Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3c049099f1 | |||
| 325b565b00 | |||
| c22ceebc17 | |||
| a6f3a3b931 | |||
| 8aeaf1eb7e | |||
| dbc31efb6f | |||
| ee63b3494b | |||
| beb6932f20 | |||
| 71839404f4 | |||
| 8a98c09527 |
Generated
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="AndroidProjectSystem">
|
||||||
|
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
BIN
Binary file not shown.
Generated
+1749
File diff suppressed because it is too large
Load Diff
Generated
BIN
Binary file not shown.
Generated
-116
@@ -1,116 +0,0 @@
|
|||||||
<component name="ProjectCodeStyleConfiguration">
|
|
||||||
<code_scheme name="Project" version="173">
|
|
||||||
<codeStyleSettings language="XML">
|
|
||||||
<indentOptions>
|
|
||||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
|
||||||
</indentOptions>
|
|
||||||
<arrangement>
|
|
||||||
<rules>
|
|
||||||
<section>
|
|
||||||
<rule>
|
|
||||||
<match>
|
|
||||||
<AND>
|
|
||||||
<NAME>xmlns:android</NAME>
|
|
||||||
<XML_ATTRIBUTE />
|
|
||||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
|
||||||
</AND>
|
|
||||||
</match>
|
|
||||||
</rule>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<rule>
|
|
||||||
<match>
|
|
||||||
<AND>
|
|
||||||
<NAME>xmlns:.*</NAME>
|
|
||||||
<XML_ATTRIBUTE />
|
|
||||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
|
||||||
</AND>
|
|
||||||
</match>
|
|
||||||
<order>BY_NAME</order>
|
|
||||||
</rule>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<rule>
|
|
||||||
<match>
|
|
||||||
<AND>
|
|
||||||
<NAME>.*:id</NAME>
|
|
||||||
<XML_ATTRIBUTE />
|
|
||||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
|
||||||
</AND>
|
|
||||||
</match>
|
|
||||||
</rule>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<rule>
|
|
||||||
<match>
|
|
||||||
<AND>
|
|
||||||
<NAME>.*:name</NAME>
|
|
||||||
<XML_ATTRIBUTE />
|
|
||||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
|
||||||
</AND>
|
|
||||||
</match>
|
|
||||||
</rule>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<rule>
|
|
||||||
<match>
|
|
||||||
<AND>
|
|
||||||
<NAME>name</NAME>
|
|
||||||
<XML_ATTRIBUTE />
|
|
||||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
|
||||||
</AND>
|
|
||||||
</match>
|
|
||||||
</rule>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<rule>
|
|
||||||
<match>
|
|
||||||
<AND>
|
|
||||||
<NAME>style</NAME>
|
|
||||||
<XML_ATTRIBUTE />
|
|
||||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
|
||||||
</AND>
|
|
||||||
</match>
|
|
||||||
</rule>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<rule>
|
|
||||||
<match>
|
|
||||||
<AND>
|
|
||||||
<NAME>.*</NAME>
|
|
||||||
<XML_ATTRIBUTE />
|
|
||||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
|
||||||
</AND>
|
|
||||||
</match>
|
|
||||||
<order>BY_NAME</order>
|
|
||||||
</rule>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<rule>
|
|
||||||
<match>
|
|
||||||
<AND>
|
|
||||||
<NAME>.*</NAME>
|
|
||||||
<XML_ATTRIBUTE />
|
|
||||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
|
||||||
</AND>
|
|
||||||
</match>
|
|
||||||
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
|
||||||
</rule>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<rule>
|
|
||||||
<match>
|
|
||||||
<AND>
|
|
||||||
<NAME>.*</NAME>
|
|
||||||
<XML_ATTRIBUTE />
|
|
||||||
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
|
||||||
</AND>
|
|
||||||
</match>
|
|
||||||
<order>BY_NAME</order>
|
|
||||||
</rule>
|
|
||||||
</section>
|
|
||||||
</rules>
|
|
||||||
</arrangement>
|
|
||||||
</codeStyleSettings>
|
|
||||||
</code_scheme>
|
|
||||||
</component>
|
|
||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="CompilerConfiguration">
|
<component name="CompilerConfiguration">
|
||||||
<bytecodeTargetLevel target="1.8" />
|
<bytecodeTargetLevel target="17" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
Generated
+10
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="deploymentTargetDropDown">
|
||||||
|
<value>
|
||||||
|
<entry key="GSKMTOrange">
|
||||||
|
<State />
|
||||||
|
</entry>
|
||||||
|
</value>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+10
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="deploymentTargetSelector">
|
||||||
|
<selectionStates>
|
||||||
|
<SelectionState runConfigName="GSKMTOrange">
|
||||||
|
<option name="selectionMode" value="DROPDOWN" />
|
||||||
|
</SelectionState>
|
||||||
|
</selectionStates>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+13
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DeviceTable">
|
||||||
|
<option name="columnSorters">
|
||||||
|
<list>
|
||||||
|
<ColumnSorterState>
|
||||||
|
<option name="column" value="Name" />
|
||||||
|
<option name="order" value="ASCENDING" />
|
||||||
|
</ColumnSorterState>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
-4
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
|
|
||||||
</project>
|
|
||||||
Generated
+2
-5
@@ -4,10 +4,9 @@
|
|||||||
<component name="GradleSettings">
|
<component name="GradleSettings">
|
||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
<option name="delegatedBuild" value="false" />
|
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||||
<option name="testRunner" value="PLATFORM" />
|
|
||||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="gradleJvm" value="jbr-21" />
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
<set>
|
<set>
|
||||||
<option value="$PROJECT_DIR$" />
|
<option value="$PROJECT_DIR$" />
|
||||||
@@ -15,8 +14,6 @@
|
|||||||
<option value="$PROJECT_DIR$/library" />
|
<option value="$PROJECT_DIR$/library" />
|
||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
<option name="resolveModulePerSourceSet" value="false" />
|
|
||||||
<option name="useQualifiedModuleNames" value="true" />
|
|
||||||
</GradleProjectSettings>
|
</GradleProjectSettings>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
Generated
+5
-10
@@ -11,25 +11,20 @@
|
|||||||
<option name="name" value="JBoss Community repository" />
|
<option name="name" value="JBoss Community repository" />
|
||||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||||
</remote-repository>
|
</remote-repository>
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="maven" />
|
|
||||||
<option name="name" value="maven" />
|
|
||||||
<option name="url" value="https://maven.google.com/" />
|
|
||||||
</remote-repository>
|
|
||||||
<remote-repository>
|
<remote-repository>
|
||||||
<option name="id" value="BintrayJCenter" />
|
<option name="id" value="BintrayJCenter" />
|
||||||
<option name="name" value="BintrayJCenter" />
|
<option name="name" value="BintrayJCenter" />
|
||||||
<option name="url" value="https://jcenter.bintray.com/" />
|
<option name="url" value="https://jcenter.bintray.com/" />
|
||||||
</remote-repository>
|
</remote-repository>
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="Google" />
|
|
||||||
<option name="name" value="Google" />
|
|
||||||
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
|
||||||
</remote-repository>
|
|
||||||
<remote-repository>
|
<remote-repository>
|
||||||
<option name="id" value="maven" />
|
<option name="id" value="maven" />
|
||||||
<option name="name" value="maven" />
|
<option name="name" value="maven" />
|
||||||
<option name="url" value="https://jitpack.io" />
|
<option name="url" value="https://jitpack.io" />
|
||||||
</remote-repository>
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="Google" />
|
||||||
|
<option name="name" value="Google" />
|
||||||
|
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
||||||
|
</remote-repository>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
Generated
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="Kotlin2JsCompilerArguments">
|
<component name="KotlinJpsPluginSettings">
|
||||||
<option name="sourceMapEmbedSources" />
|
<option name="version" value="1.9.22" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
Generated
+10
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectMigrations">
|
||||||
|
<option name="MigrateToGradleLocalJavaHome">
|
||||||
|
<set>
|
||||||
|
<option value="$PROJECT_DIR$" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+43
-46
@@ -1,52 +1,49 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="MavenImportPreferences">
|
<component name="DesignSurface">
|
||||||
<option name="generalSettings">
|
<option name="filePathToZoomLevelMap">
|
||||||
<MavenGeneralSettings>
|
<map>
|
||||||
<option name="mavenHome" value="Bundled (Maven 3)" />
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_daily_data_menu.xml" value="0.11277173913043478" />
|
||||||
</MavenGeneralSettings>
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_login.xml" value="0.25" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_msl__availability.xml" value="0.115625" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_msl__availability_stock_facing.xml" value="0.11197916666666667" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_order_confirm.xml" value="0.2" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_order_status_detail.xml" value="0.22" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_order_taking.xml" value="0.2" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_visit_type_status.xml" value="0.11875" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_daily_main_menu.xml" value="0.13697916666666668" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_msl__availability_stock_facing.xml" value="0.11197916666666667" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_order_status_detail.xml" value="0.17" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_order_taking.xml" value="0.11197916666666667" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_store_wise_performance.xml" value="0.11302083333333333" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/contentcatgoryadpterlayout.xml" value="0.10833333333333334" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/contentorderstatus.xml" value="0.16302083333333334" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/daily_main_menu_row.xml" value="0.15416666666666667" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_category_wise_performance.xml" value="0.1390625" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_msl_availability_stock_facing_child.xml" value="0.16" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_msl_availability_stock_facing_header.xml" value="0.2" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_order_received_status_child.xml" value="0.2" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_order_status_child.xml" value="0.17" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_order_taking.xml" value="0.128125" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/item_order_taking_child.xml" value="0.2" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/order_status_item_layout.xml" value="0.33" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/storelist.xml" value="0.11875" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/storelist_child.xml" value="0.159375" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/storelistfablayout.xml" value="0.11875" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/visitstatuslist.xml" value="0.11875" />
|
||||||
|
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/visittypelist_child.xml" value="0.159375" />
|
||||||
|
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_audit.xml" value="0.14990942028985507" />
|
||||||
|
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_main.xml" value="0.20416666666666666" />
|
||||||
|
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/audit_question_list_item.xml" value="0.30676552363299353" />
|
||||||
|
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_audit.xml" value="0.14990942028985507" />
|
||||||
|
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/content_t2_pcompliance.xml" value="0.20416666666666666" />
|
||||||
|
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/t2p_sku_dialog_layout.xml" value="0.20416666666666666" />
|
||||||
|
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/t2pbranddialoglayout.xml" value="0.20416666666666666" />
|
||||||
|
<entry key="..\:/Upendra-Projects/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/menu/activity_main_drawer.xml" value="0.20416666666666666" />
|
||||||
|
</map>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="NullableNotNullManager">
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||||
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
|
||||||
<option name="myNullables">
|
|
||||||
<value>
|
|
||||||
<list size="12">
|
|
||||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
|
||||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
|
||||||
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
|
||||||
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
|
|
||||||
<item index="4" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
|
|
||||||
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
|
|
||||||
<item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
|
|
||||||
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
|
|
||||||
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
|
|
||||||
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
|
|
||||||
<item index="10" class="java.lang.String" itemvalue="android.annotation.Nullable" />
|
|
||||||
<item index="11" class="java.lang.String" itemvalue="com.android.annotations.Nullable" />
|
|
||||||
</list>
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
<option name="myNotNulls">
|
|
||||||
<value>
|
|
||||||
<list size="11">
|
|
||||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
|
|
||||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
|
|
||||||
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
|
|
||||||
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
|
|
||||||
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
|
|
||||||
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
|
|
||||||
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
|
|
||||||
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
|
|
||||||
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
|
|
||||||
<item index="9" class="java.lang.String" itemvalue="android.annotation.NonNull" />
|
|
||||||
<item index="10" class="java.lang.String" itemvalue="com.android.annotations.NonNull" />
|
|
||||||
</list>
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|||||||
Generated
+6
-3
@@ -2,9 +2,12 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectModuleManager">
|
<component name="ProjectModuleManager">
|
||||||
<modules>
|
<modules>
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/GSKORANGEV2-TURKEY.iml" filepath="$PROJECT_DIR$/.idea/modules/GSKORANGEV2-TURKEY.iml" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/modules/GSKMTOrange/GSKORANGEV2-JORDAN.GSKMTOrange.iml" filepath="$PROJECT_DIR$/.idea/modules/GSKMTOrange/GSKORANGEV2-JORDAN.GSKMTOrange.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/GSKMTOrange/GSKORANGEV2-TURKEY.GSKMTOrange.iml" filepath="$PROJECT_DIR$/.idea/modules/GSKMTOrange/GSKORANGEV2-TURKEY.GSKMTOrange.iml" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/modules/GSKMTOrange/GSKORANGEV2-JORDAN.GSKMTOrange.main.iml" filepath="$PROJECT_DIR$/.idea/modules/GSKMTOrange/GSKORANGEV2-JORDAN.GSKMTOrange.main.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/library/GSKORANGEV2-TURKEY.library.iml" filepath="$PROJECT_DIR$/.idea/modules/library/GSKORANGEV2-TURKEY.library.iml" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/modules/GSKMTOrange/GSKORANGEV2-JORDAN.GSKMTOrange.unitTest.iml" filepath="$PROJECT_DIR$/.idea/modules/GSKMTOrange/GSKORANGEV2-JORDAN.GSKMTOrange.unitTest.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/modules/library/GSKORANGEV2-JORDAN.library.iml" filepath="$PROJECT_DIR$/.idea/modules/library/GSKORANGEV2-JORDAN.library.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/modules/library/GSKORANGEV2-JORDAN.library.main.iml" filepath="$PROJECT_DIR$/.idea/modules/library/GSKORANGEV2-JORDAN.library.main.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/modules/library/GSKORANGEV2-JORDAN.library.unitTest.iml" filepath="$PROJECT_DIR$/.idea/modules/library/GSKORANGEV2-JORDAN.library.unitTest.iml" />
|
||||||
</modules>
|
</modules>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
Generated
+758
@@ -0,0 +1,758 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="direct_access_persist.xml">
|
||||||
|
<option name="deviceSelectionList">
|
||||||
|
<list>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="Sony" />
|
||||||
|
<option name="codename" value="A402SO" />
|
||||||
|
<option name="id" value="A402SO" />
|
||||||
|
<option name="manufacturer" value="Sony" />
|
||||||
|
<option name="name" value="Xperia 10" />
|
||||||
|
<option name="screenDensity" value="450" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2520" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="27" />
|
||||||
|
<option name="brand" value="DOCOMO" />
|
||||||
|
<option name="codename" value="F01L" />
|
||||||
|
<option name="id" value="F01L" />
|
||||||
|
<option name="manufacturer" value="FUJITSU" />
|
||||||
|
<option name="name" value="F-01L" />
|
||||||
|
<option name="screenDensity" value="360" />
|
||||||
|
<option name="screenX" value="720" />
|
||||||
|
<option name="screenY" value="1280" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="OnePlus" />
|
||||||
|
<option name="codename" value="OP535DL1" />
|
||||||
|
<option name="id" value="OP535DL1" />
|
||||||
|
<option name="manufacturer" value="OnePlus" />
|
||||||
|
<option name="name" value="CPH2409" />
|
||||||
|
<option name="screenDensity" value="401" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2412" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="OnePlus" />
|
||||||
|
<option name="codename" value="OP5552L1" />
|
||||||
|
<option name="id" value="OP5552L1" />
|
||||||
|
<option name="manufacturer" value="OnePlus" />
|
||||||
|
<option name="name" value="CPH2415" />
|
||||||
|
<option name="screenDensity" value="480" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2412" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="OPPO" />
|
||||||
|
<option name="codename" value="OP573DL1" />
|
||||||
|
<option name="id" value="OP573DL1" />
|
||||||
|
<option name="manufacturer" value="OPPO" />
|
||||||
|
<option name="name" value="CPH2557" />
|
||||||
|
<option name="screenDensity" value="480" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="28" />
|
||||||
|
<option name="brand" value="DOCOMO" />
|
||||||
|
<option name="codename" value="SH-01L" />
|
||||||
|
<option name="id" value="SH-01L" />
|
||||||
|
<option name="manufacturer" value="SHARP" />
|
||||||
|
<option name="name" value="AQUOS sense2 SH-01L" />
|
||||||
|
<option name="screenDensity" value="480" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2160" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="a14m" />
|
||||||
|
<option name="id" value="a14m" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="SM-A145R" />
|
||||||
|
<option name="screenDensity" value="450" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2408" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="a15" />
|
||||||
|
<option name="id" value="a15" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="A15" />
|
||||||
|
<option name="screenDensity" value="450" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2340" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="a15x" />
|
||||||
|
<option name="id" value="a15x" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="A15 5G" />
|
||||||
|
<option name="screenDensity" value="450" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2340" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="a16x" />
|
||||||
|
<option name="id" value="a16x" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="A16 5G" />
|
||||||
|
<option name="screenDensity" value="450" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2340" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="a35x" />
|
||||||
|
<option name="id" value="a35x" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="A35" />
|
||||||
|
<option name="screenDensity" value="450" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2340" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="akita" />
|
||||||
|
<option name="id" value="akita" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 8a" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="35" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="akita" />
|
||||||
|
<option name="id" value="akita" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 8a" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="motorola" />
|
||||||
|
<option name="codename" value="arcfox" />
|
||||||
|
<option name="id" value="arcfox" />
|
||||||
|
<option name="manufacturer" value="Motorola" />
|
||||||
|
<option name="name" value="razr plus 2024" />
|
||||||
|
<option name="screenDensity" value="360" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="1272" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="33" />
|
||||||
|
<option name="brand" value="motorola" />
|
||||||
|
<option name="codename" value="austin" />
|
||||||
|
<option name="id" value="austin" />
|
||||||
|
<option name="manufacturer" value="Motorola" />
|
||||||
|
<option name="name" value="moto g 5G (2022)" />
|
||||||
|
<option name="screenDensity" value="280" />
|
||||||
|
<option name="screenX" value="720" />
|
||||||
|
<option name="screenY" value="1600" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="33" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="b0q" />
|
||||||
|
<option name="id" value="b0q" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy S22 Ultra" />
|
||||||
|
<option name="screenDensity" value="600" />
|
||||||
|
<option name="screenX" value="1440" />
|
||||||
|
<option name="screenY" value="3088" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="b6q" />
|
||||||
|
<option name="id" value="b6q" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Flip 6" />
|
||||||
|
<option name="screenDensity" value="340" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2640" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="32" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="bluejay" />
|
||||||
|
<option name="id" value="bluejay" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 6a" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="caiman" />
|
||||||
|
<option name="id" value="caiman" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 9 Pro" />
|
||||||
|
<option name="screenDensity" value="360" />
|
||||||
|
<option name="screenX" value="960" />
|
||||||
|
<option name="screenY" value="2142" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="35" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="caiman" />
|
||||||
|
<option name="id" value="caiman" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 9 Pro" />
|
||||||
|
<option name="screenDensity" value="360" />
|
||||||
|
<option name="screenX" value="960" />
|
||||||
|
<option name="screenY" value="2142" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="comet" />
|
||||||
|
<option name="id" value="comet" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 9 Pro Fold" />
|
||||||
|
<option name="screenDensity" value="390" />
|
||||||
|
<option name="screenX" value="2076" />
|
||||||
|
<option name="screenY" value="2152" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="35" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="comet" />
|
||||||
|
<option name="id" value="comet" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 9 Pro Fold" />
|
||||||
|
<option name="screenDensity" value="390" />
|
||||||
|
<option name="screenX" value="2076" />
|
||||||
|
<option name="screenY" value="2152" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="29" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="crownqlteue" />
|
||||||
|
<option name="id" value="crownqlteue" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy Note9" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="2220" />
|
||||||
|
<option name="screenY" value="1080" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="dm2q" />
|
||||||
|
<option name="id" value="dm2q" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="S23 Plus" />
|
||||||
|
<option name="screenDensity" value="450" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2340" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="dm3q" />
|
||||||
|
<option name="id" value="dm3q" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy S23 Ultra" />
|
||||||
|
<option name="screenDensity" value="600" />
|
||||||
|
<option name="screenX" value="1440" />
|
||||||
|
<option name="screenY" value="3088" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="motorola" />
|
||||||
|
<option name="codename" value="dubai" />
|
||||||
|
<option name="id" value="dubai" />
|
||||||
|
<option name="manufacturer" value="Motorola" />
|
||||||
|
<option name="name" value="edge 30" />
|
||||||
|
<option name="screenDensity" value="405" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="e1q" />
|
||||||
|
<option name="id" value="e1q" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy S24" />
|
||||||
|
<option name="screenDensity" value="480" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2340" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="e3q" />
|
||||||
|
<option name="id" value="e3q" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy S24 Ultra" />
|
||||||
|
<option name="screenDensity" value="450" />
|
||||||
|
<option name="screenX" value="1440" />
|
||||||
|
<option name="screenY" value="3120" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="33" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="eos" />
|
||||||
|
<option name="id" value="eos" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Eos" />
|
||||||
|
<option name="screenDensity" value="320" />
|
||||||
|
<option name="screenX" value="384" />
|
||||||
|
<option name="screenY" value="384" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="35" />
|
||||||
|
<option name="brand" value="motorola" />
|
||||||
|
<option name="codename" value="eqe" />
|
||||||
|
<option name="id" value="eqe" />
|
||||||
|
<option name="manufacturer" value="Motorola" />
|
||||||
|
<option name="name" value="edge 50 pro" />
|
||||||
|
<option name="screenDensity" value="450" />
|
||||||
|
<option name="screenX" value="1220" />
|
||||||
|
<option name="screenY" value="2712" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="33" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="felix" />
|
||||||
|
<option name="id" value="felix" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel Fold" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="2208" />
|
||||||
|
<option name="screenY" value="1840" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="felix" />
|
||||||
|
<option name="id" value="felix" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel Fold" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="2208" />
|
||||||
|
<option name="screenY" value="1840" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="33" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="felix_camera" />
|
||||||
|
<option name="id" value="felix_camera" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel Fold (Camera-enabled)" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="2208" />
|
||||||
|
<option name="screenY" value="1840" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="motorola" />
|
||||||
|
<option name="codename" value="fogona" />
|
||||||
|
<option name="id" value="fogona" />
|
||||||
|
<option name="manufacturer" value="Motorola" />
|
||||||
|
<option name="name" value="moto g play - 2024" />
|
||||||
|
<option name="screenDensity" value="280" />
|
||||||
|
<option name="screenX" value="720" />
|
||||||
|
<option name="screenY" value="1600" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="motorola" />
|
||||||
|
<option name="codename" value="fogos" />
|
||||||
|
<option name="id" value="fogos" />
|
||||||
|
<option name="manufacturer" value="Motorola" />
|
||||||
|
<option name="name" value="moto g34 5G" />
|
||||||
|
<option name="screenDensity" value="280" />
|
||||||
|
<option name="screenX" value="720" />
|
||||||
|
<option name="screenY" value="1600" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="g0q" />
|
||||||
|
<option name="id" value="g0q" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="SM-S906U1" />
|
||||||
|
<option name="screenDensity" value="450" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2340" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="gta9pwifi" />
|
||||||
|
<option name="id" value="gta9pwifi" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="SM-X210" />
|
||||||
|
<option name="screenDensity" value="240" />
|
||||||
|
<option name="screenX" value="1200" />
|
||||||
|
<option name="screenY" value="1920" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="33" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="gts7lwifi" />
|
||||||
|
<option name="id" value="gts7lwifi" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="SM-T870" />
|
||||||
|
<option name="screenDensity" value="340" />
|
||||||
|
<option name="screenX" value="1600" />
|
||||||
|
<option name="screenY" value="2560" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="gts7xllite" />
|
||||||
|
<option name="id" value="gts7xllite" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="SM-T738U" />
|
||||||
|
<option name="screenDensity" value="340" />
|
||||||
|
<option name="screenX" value="1600" />
|
||||||
|
<option name="screenY" value="2560" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="33" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="gts8uwifi" />
|
||||||
|
<option name="id" value="gts8uwifi" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy Tab S8 Ultra" />
|
||||||
|
<option name="screenDensity" value="320" />
|
||||||
|
<option name="screenX" value="1848" />
|
||||||
|
<option name="screenY" value="2960" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="gts8wifi" />
|
||||||
|
<option name="id" value="gts8wifi" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy Tab S8" />
|
||||||
|
<option name="screenDensity" value="274" />
|
||||||
|
<option name="screenX" value="1600" />
|
||||||
|
<option name="screenY" value="2560" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="gts9fe" />
|
||||||
|
<option name="id" value="gts9fe" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy Tab S9 FE 5G" />
|
||||||
|
<option name="screenDensity" value="280" />
|
||||||
|
<option name="screenX" value="1440" />
|
||||||
|
<option name="screenY" value="2304" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="gts9wifi" />
|
||||||
|
<option name="id" value="gts9wifi" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="SM-X710" />
|
||||||
|
<option name="screenDensity" value="340" />
|
||||||
|
<option name="screenX" value="1600" />
|
||||||
|
<option name="screenY" value="2560" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="husky" />
|
||||||
|
<option name="id" value="husky" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 8 Pro" />
|
||||||
|
<option name="screenDensity" value="390" />
|
||||||
|
<option name="screenX" value="1008" />
|
||||||
|
<option name="screenY" value="2244" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="30" />
|
||||||
|
<option name="brand" value="motorola" />
|
||||||
|
<option name="codename" value="java" />
|
||||||
|
<option name="id" value="java" />
|
||||||
|
<option name="manufacturer" value="Motorola" />
|
||||||
|
<option name="name" value="G20" />
|
||||||
|
<option name="screenDensity" value="280" />
|
||||||
|
<option name="screenX" value="720" />
|
||||||
|
<option name="screenY" value="1600" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="komodo" />
|
||||||
|
<option name="id" value="komodo" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 9 Pro XL" />
|
||||||
|
<option name="screenDensity" value="360" />
|
||||||
|
<option name="screenX" value="1008" />
|
||||||
|
<option name="screenY" value="2244" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="35" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="komodo" />
|
||||||
|
<option name="id" value="komodo" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 9 Pro XL" />
|
||||||
|
<option name="screenDensity" value="360" />
|
||||||
|
<option name="screenX" value="1008" />
|
||||||
|
<option name="screenY" value="2244" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="motorola" />
|
||||||
|
<option name="codename" value="lion" />
|
||||||
|
<option name="id" value="lion" />
|
||||||
|
<option name="manufacturer" value="Motorola" />
|
||||||
|
<option name="name" value="moto g04" />
|
||||||
|
<option name="screenDensity" value="280" />
|
||||||
|
<option name="screenX" value="720" />
|
||||||
|
<option name="screenY" value="1612" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="33" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="lynx" />
|
||||||
|
<option name="id" value="lynx" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 7a" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="motorola" />
|
||||||
|
<option name="codename" value="lyriq" />
|
||||||
|
<option name="id" value="lyriq" />
|
||||||
|
<option name="manufacturer" value="Motorola" />
|
||||||
|
<option name="name" value="edge 40" />
|
||||||
|
<option name="screenDensity" value="400" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="motorola" />
|
||||||
|
<option name="codename" value="manaus" />
|
||||||
|
<option name="id" value="manaus" />
|
||||||
|
<option name="manufacturer" value="Motorola" />
|
||||||
|
<option name="name" value="edge 40 neo" />
|
||||||
|
<option name="screenDensity" value="400" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="33" />
|
||||||
|
<option name="brand" value="motorola" />
|
||||||
|
<option name="codename" value="maui" />
|
||||||
|
<option name="id" value="maui" />
|
||||||
|
<option name="manufacturer" value="Motorola" />
|
||||||
|
<option name="name" value="moto g play - 2023" />
|
||||||
|
<option name="screenDensity" value="280" />
|
||||||
|
<option name="screenX" value="720" />
|
||||||
|
<option name="screenY" value="1600" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="o1q" />
|
||||||
|
<option name="id" value="o1q" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy S21" />
|
||||||
|
<option name="screenDensity" value="421" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="31" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="oriole" />
|
||||||
|
<option name="id" value="oriole" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 6" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="35" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="pa3q" />
|
||||||
|
<option name="id" value="pa3q" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy S25 Ultra" />
|
||||||
|
<option name="screenDensity" value="600" />
|
||||||
|
<option name="screenX" value="1440" />
|
||||||
|
<option name="screenY" value="3120" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="33" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="panther" />
|
||||||
|
<option name="id" value="panther" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 7" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="q5q" />
|
||||||
|
<option name="id" value="q5q" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy Z Fold5" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1812" />
|
||||||
|
<option name="screenY" value="2176" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="q6q" />
|
||||||
|
<option name="id" value="q6q" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy Z Fold6" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1856" />
|
||||||
|
<option name="screenY" value="2160" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="30" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="r11" />
|
||||||
|
<option name="id" value="r11" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel Watch" />
|
||||||
|
<option name="screenDensity" value="320" />
|
||||||
|
<option name="screenX" value="384" />
|
||||||
|
<option name="screenY" value="384" />
|
||||||
|
<option name="type" value="WEAR_OS" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="r11q" />
|
||||||
|
<option name="id" value="r11q" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="SM-S711U" />
|
||||||
|
<option name="screenDensity" value="450" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2340" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="30" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="redfin" />
|
||||||
|
<option name="id" value="redfin" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 5" />
|
||||||
|
<option name="screenDensity" value="440" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2340" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="shiba" />
|
||||||
|
<option name="id" value="shiba" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 8" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="t2q" />
|
||||||
|
<option name="id" value="t2q" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy S21 Plus" />
|
||||||
|
<option name="screenDensity" value="394" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="33" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="tangorpro" />
|
||||||
|
<option name="id" value="tangorpro" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel Tablet" />
|
||||||
|
<option name="screenDensity" value="320" />
|
||||||
|
<option name="screenX" value="1600" />
|
||||||
|
<option name="screenY" value="2560" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="35" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="tegu" />
|
||||||
|
<option name="id" value="tegu" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 9a" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2424" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="tokay" />
|
||||||
|
<option name="id" value="tokay" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 9" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2424" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="35" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="tokay" />
|
||||||
|
<option name="id" value="tokay" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 9" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2424" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="xcover7" />
|
||||||
|
<option name="id" value="xcover7" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="SM-G556B" />
|
||||||
|
<option name="screenDensity" value="450" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2408" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+8
-3
@@ -3,9 +3,14 @@
|
|||||||
<component name="RunConfigurationProducerService">
|
<component name="RunConfigurationProducerService">
|
||||||
<option name="ignoredProducers">
|
<option name="ignoredProducers">
|
||||||
<set>
|
<set>
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||||
|
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||||
|
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||||
|
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||||
|
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||||
|
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="VcsDirectoryMappings">
|
<component name="VcsDirectoryMappings">
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
<mapping directory="" vcs="Git" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
+104
-53
@@ -2,71 +2,121 @@ apply plugin: 'com.android.application'
|
|||||||
//apply plugin: 'io.fabric'
|
//apply plugin: 'io.fabric'
|
||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
apply plugin: 'com.google.firebase.crashlytics'
|
apply plugin: 'com.google.firebase.crashlytics'
|
||||||
|
apply plugin: 'org.jetbrains.kotlin.android'
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 30
|
compileSdk(35)
|
||||||
buildToolsVersion '29.0.3'
|
|
||||||
useLibrary 'org.apache.http.legacy'
|
useLibrary 'org.apache.http.legacy'
|
||||||
|
namespace "cpm.com.gskmtorange"
|
||||||
lintOptions {
|
lintOptions {
|
||||||
|
checkReleaseBuilds false
|
||||||
disable 'MissingTranslation'
|
disable 'MissingTranslation'
|
||||||
|
abortOnError false
|
||||||
}
|
}
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
all*.exclude module: 'okio'
|
// all*.exclude module: 'okio'
|
||||||
all*.exclude group: 'com.squareup.okhttp3', module: 'okhttp'
|
// all*.exclude group: 'com.squareup.okhttp3', module: 'okhttp'
|
||||||
all*.exclude module: 'support-v4' // This removes all other versions of `support-v4` if gets duplicated from all the artifacts.
|
all*.exclude module: 'support-v4' // This removes all other versions of `support-v4` if gets duplicated from all the artifacts.
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "cpm.com.gskmtorange"
|
applicationId "cpm.com.gskmtorange"
|
||||||
minSdkVersion 20
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdk(34)
|
||||||
|
|
||||||
/*//For Egypt
|
// For Lebanon
|
||||||
versionCode 31
|
/* versionCode 1
|
||||||
versionName "4.3"*/
|
versionName "1.0"*/
|
||||||
|
|
||||||
|
//For Egypt
|
||||||
|
/*versionCode 35
|
||||||
|
versionName "4.6"*/
|
||||||
|
|
||||||
//For UAE
|
//For UAE
|
||||||
/* versionCode 29
|
/* versionCode 30
|
||||||
versionName "4.1"*/
|
versionName "4.2"*/
|
||||||
|
|
||||||
//For Turkey
|
//For Turkey
|
||||||
versionCode 27
|
/* versionCode 34
|
||||||
versionName "3.9"
|
versionName "4.6"*/
|
||||||
|
|
||||||
|
//For Turkey
|
||||||
|
/*versionCode 32
|
||||||
|
versionName "4.4"*/
|
||||||
|
|
||||||
//For KSA
|
//For KSA
|
||||||
/* versionCode 28
|
/* versionCode 31
|
||||||
versionName "4.0"*/
|
versionName "4.3"*/
|
||||||
|
|
||||||
// aading price facing
|
// aading price facing
|
||||||
/* versionCode 27
|
/* versionCode 27
|
||||||
versionName "3.8"*/
|
versionName "3.8"*/
|
||||||
|
|
||||||
|
|
||||||
//sa
|
//sa
|
||||||
|
|
||||||
|
|
||||||
/* versionCode 28
|
/* versionCode 28
|
||||||
versionName "3.9"*/
|
versionName "3.9"*/
|
||||||
|
|
||||||
//Kenya
|
//Kenya
|
||||||
/* versionCode 2
|
/* versionCode 2
|
||||||
versionName "1.1"*/
|
versionName "1.1"*/
|
||||||
//nigeria
|
|
||||||
/* versionCode 1
|
|
||||||
versionName "1.0"*/
|
|
||||||
multiDexEnabled true
|
|
||||||
|
|
||||||
|
//kenya-lite
|
||||||
|
/* versionCode 2
|
||||||
|
versionName "1.1"*/
|
||||||
|
|
||||||
|
//nigeria
|
||||||
|
/*versionCode 1
|
||||||
|
versionName "1.0"*/
|
||||||
|
|
||||||
|
//For jordan
|
||||||
|
/* versionCode 8
|
||||||
|
versionName "1.7"*/
|
||||||
|
|
||||||
|
//For Kuwait
|
||||||
|
/*versionCode 1
|
||||||
|
versionName "1.0"*/
|
||||||
|
|
||||||
|
//For Bahrain
|
||||||
|
/*versionCode 1
|
||||||
|
versionName "1.0"*/
|
||||||
|
|
||||||
|
//For QATAR
|
||||||
|
/*versionCode 1
|
||||||
|
versionName "1.0"*/
|
||||||
|
|
||||||
|
//For Libya
|
||||||
|
versionCode 3
|
||||||
|
versionName "1.2"
|
||||||
|
|
||||||
|
//For Oman
|
||||||
|
/*versionCode 1
|
||||||
|
versionName "1.0"*/
|
||||||
|
|
||||||
|
multiDexEnabled true
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
signingConfigs {
|
||||||
|
config {
|
||||||
|
keyAlias 'hp'
|
||||||
|
keyPassword 'android'
|
||||||
|
storeFile file('D:\\jeevanp_cpm_projects\\keystore\\hp.dat')
|
||||||
|
storePassword 'android'
|
||||||
|
}
|
||||||
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
|
debuggable true
|
||||||
|
signingConfig signingConfigs.config
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_17
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
|
kotlin {
|
||||||
|
jvmToolchain(17)
|
||||||
}
|
}
|
||||||
firebaseCrashlytics {
|
firebaseCrashlytics {
|
||||||
nativeSymbolUploadEnabled true
|
nativeSymbolUploadEnabled true
|
||||||
@@ -75,40 +125,41 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
implementation files('libs/ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar')
|
||||||
|
// implementation files('libs/ksoap2-android-assembly-3.6.2-jar-with-dependencies.jar')
|
||||||
implementation 'androidx.cardview:cardview:1.0.0'
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
implementation 'com.google.android.material:material:1.2.1'
|
implementation 'com.google.android.material:material:1.12.0'
|
||||||
implementation project(path: ':library')
|
implementation project(path: ':library')
|
||||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation 'com.google.firebase:firebase-auth:20.0.3'
|
implementation 'androidx.activity:activity:1.10.1'
|
||||||
testImplementation 'junit:junit:4.13.1'
|
implementation 'androidx.appcompat:appcompat:1.7.1'
|
||||||
implementation 'android.arch.navigation:navigation-fragment:1.0.0'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
implementation "androidx.navigation:navigation-fragment-ktx:2.9.0"
|
||||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
androidTestImplementation "androidx.test:core:1.6.1"
|
||||||
implementation 'com.google.code.gson:gson:2.8.6'
|
androidTestImplementation "androidx.test:espresso:espresso-core:3.5.1"
|
||||||
implementation 'com.github.bumptech.glide:glide:4.11.0'
|
androidTestImplementation "androidx.test.ext:junit:1.2.1"
|
||||||
|
androidTestImplementation "androidx.test:annotation:1.0.1"
|
||||||
implementation platform('com.google.firebase:firebase-bom:26.7.0')
|
implementation 'com.google.code.gson:gson:2.11.0'
|
||||||
// implementation 'com.google.firebase:firebase-analytics'
|
implementation 'com.github.bumptech.glide:glide:4.16.0'
|
||||||
implementation 'com.google.firebase:firebase-crashlytics-ndk'
|
implementation platform('com.google.firebase:firebase-bom:33.14.0')
|
||||||
|
implementation 'com.google.firebase:firebase-crashlytics'
|
||||||
implementation 'com.google.firebase:firebase-messaging'
|
implementation 'com.google.firebase:firebase-messaging'
|
||||||
|
implementation 'com.google.android.gms:play-services-location:21.3.0'
|
||||||
implementation 'com.google.android.gms:play-services-location:17.1.0'
|
implementation 'com.google.android.gms:play-services-maps:19.2.0'
|
||||||
implementation 'com.google.android.gms:play-services-maps:17.0.0'
|
implementation 'com.google.firebase:firebase-analytics:22.4.0'
|
||||||
|
implementation 'com.google.firebase:firebase-appindexing:20.0.0'
|
||||||
implementation 'com.kyanogen.signatureview:signature-view:1.0'
|
// implementation 'com.google.firebase:firebase-crashlytics:19.4.3'
|
||||||
implementation 'com.android.support:multidex:1.0.3'
|
implementation 'com.google.firebase:firebase-auth:23.2.1'
|
||||||
implementation files('libs/ksoap2-android-assembly-3.6.2-jar-with-dependencies.jar')
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.0.2'
|
|
||||||
implementation 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
|
implementation 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
implementation 'com.google.android.gms:play-services-appindexing:8.3.0'
|
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
|
||||||
// Add the Firebase Crashlytics SDK.
|
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.22"))
|
||||||
implementation 'com.google.firebase:firebase-crashlytics:17.3.0'
|
implementation 'androidx.multidex:multidex:2.0.1'
|
||||||
// Recommended: Add the Google Analytics SDK.
|
implementation "androidx.core:core-splashscreen:1.0.1"
|
||||||
implementation 'com.google.firebase:firebase-analytics:18.0.0'
|
|
||||||
}
|
}
|
||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
|
apply plugin: 'org.jetbrains.kotlin.android'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"artifactType": {
|
||||||
|
"type": "APK",
|
||||||
|
"kind": "Directory"
|
||||||
|
},
|
||||||
|
"applicationId": "cpm.com.gskmtorange",
|
||||||
|
"variantName": "release",
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"type": "SINGLE",
|
||||||
|
"filters": [],
|
||||||
|
"attributes": [],
|
||||||
|
"versionCode": 31,
|
||||||
|
"versionName": "4.3",
|
||||||
|
"outputFile": "GSKMTOrange-release.apk"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"elementType": "File",
|
||||||
|
"minSdkVersionForDexing": 24
|
||||||
|
}
|
||||||
@@ -20,5 +20,7 @@
|
|||||||
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
|
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
|
||||||
string in this file.
|
string in this file.
|
||||||
-->
|
-->
|
||||||
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyDdgvyAY0_pb-k7PLPJoG6wR-KN0xnhkRE</string>
|
<!--<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyDdgvyAY0_pb-k7PLPJoG6wR-KN0xnhkRE</string>-->
|
||||||
|
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyCs2VZqLl4OgStAraUHr8012cUc7vf3Uo8</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="cpm.com.gskmtorange">
|
package="cpm.com.gskmtorange">
|
||||||
<!-- To auto-complete the email text field in the login form with the user's emails -->
|
<!-- To auto-complete the email text field in the login form with the user's emails -->
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.camera"
|
||||||
|
android:required="false" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||||
<uses-permission android:name="android.permission.READ_PROFILE" />
|
<uses-permission android:name="android.permission.READ_PROFILE" />
|
||||||
@@ -12,27 +18,60 @@
|
|||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||||
|
android:maxSdkVersion="32" />
|
||||||
|
<uses-permission
|
||||||
|
android:name="android.permission.READ_EXTERNAL_STORAGE"
|
||||||
|
android:maxSdkVersion="32" />
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
<uses-permission android:name="an[droid.permission.REQUEST_INSTALL_PACKAGES" />
|
||||||
|
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||||
<meta-data
|
|
||||||
android:name="firebase_crashlytics_collection_enabled"
|
|
||||||
android:value="false" />
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:largeHeap="true"
|
android:largeHeap="true"
|
||||||
android:supportsRtl="true"
|
|
||||||
android:requestLegacyExternalStorage="true"
|
android:requestLegacyExternalStorage="true"
|
||||||
|
android:supportsRtl="false"
|
||||||
|
android:theme="@style/AppTheme"
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true"
|
||||||
|
tools:replace="android:supportsRtl">
|
||||||
|
|
||||||
android:theme="@style/AppTheme">
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.StockEntryActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.VisitTypeStatusActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:label="Ad hoc - Visit Type"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.OrderStatusDetailActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.OrderConfirmActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.OrderTakingActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.NewStockDataActivity"
|
android:name=".dailyentry.NewStockDataActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_new_stock_data"
|
android:label="@string/title_activity_new_stock_data"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
<activity
|
<activity
|
||||||
@@ -42,6 +81,7 @@
|
|||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.StockPricingActivity"
|
android:name=".dailyentry.StockPricingActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_stock_pricing"
|
android:label="@string/title_activity_stock_pricing"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
<activity
|
<activity
|
||||||
@@ -77,6 +117,8 @@
|
|||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".SplashScreenActivity"
|
android:name=".SplashScreenActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:exported="true"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
@@ -88,11 +130,13 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".LoginActivity"
|
android:name=".LoginActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_login"
|
android:label="@string/title_activity_login"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/main_menu_activity_name"
|
android:label="@string/main_menu_activity_name"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
@@ -101,6 +145,7 @@
|
|||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".SelectLanguageActivity"
|
android:name=".SelectLanguageActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_select_language"
|
android:label="@string/title_activity_select_language"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
@@ -110,11 +155,13 @@
|
|||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".GeoTag.GeoTagStoreList"
|
android:name=".GeoTag.GeoTagStoreList"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_store_list"
|
android:label="@string/title_activity_store_list"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.StoreListActivity"
|
android:name=".dailyentry.StoreListActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_store_list"
|
android:label="@string/title_activity_store_list"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
@@ -126,6 +173,7 @@
|
|||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".GeoTag.GeoTagActivity"
|
android:name=".GeoTag.GeoTagActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_store_geotag"
|
android:label="@string/title_activity_store_geotag"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
@@ -140,9 +188,9 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.T2PComplianceActivity"
|
android:name=".dailyentry.T2PComplianceActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" /> <!-- Gagan Start Declaration -->
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan" /> <!-- Gagan Start Declaration -->
|
||||||
<activity
|
<activity
|
||||||
android:name=".gsk_dailyentry.CategoryListActivity"
|
android:name=".gsk_dailyentry.CategoryListActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
@@ -205,6 +253,7 @@
|
|||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.SettingsActivity"
|
android:name=".dailyentry.SettingsActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_settings"
|
android:label="@string/title_activity_settings"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
@@ -225,7 +274,9 @@
|
|||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.T2pBrand_Avaibility"
|
android:name=".dailyentry.T2pBrand_Avaibility"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_t2p_brand__avaibility"
|
android:label="@string/title_activity_t2p_brand__avaibility"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gsk_dailyentry.StockFacing_PlanogramTrackerActivity"
|
android:name=".gsk_dailyentry.StockFacing_PlanogramTrackerActivity"
|
||||||
@@ -285,7 +336,8 @@
|
|||||||
android:name=".dailyentry.AuditActivity"
|
android:name=".dailyentry.AuditActivity"
|
||||||
android:label="@string/audit"
|
android:label="@string/audit"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".service.FCMNotificationService"
|
android:name=".service.FCMNotificationService"
|
||||||
@@ -311,6 +363,11 @@
|
|||||||
sign the APK for publishing.
|
sign the APK for publishing.
|
||||||
You can define the keys for the debug and release targets in src/debug/ and src/release/.
|
You can define the keys for the debug and release targets in src/debug/ and src/release/.
|
||||||
-->
|
-->
|
||||||
|
<!--
|
||||||
|
<meta-data
|
||||||
|
android:name="com.google.android.geo.API_KEY"
|
||||||
|
android:value="@string/google_maps_key" />
|
||||||
|
-->
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.google.android.geo.API_KEY"
|
android:name="com.google.android.geo.API_KEY"
|
||||||
android:value="@string/google_maps_key" />
|
android:value="@string/google_maps_key" />
|
||||||
@@ -352,6 +409,11 @@
|
|||||||
android:label="@string/title_activity_coaching_visit"
|
android:label="@string/title_activity_coaching_visit"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.CoachingVisitStoreActivity"
|
||||||
|
android:label="@string/title_activity_coaching_visit_store"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.DeliveryCallActivity"
|
android:name=".dailyentry.DeliveryCallActivity"
|
||||||
android:label="@string/delivery_call"
|
android:label="@string/delivery_call"
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package cpm.com.gskmtorange;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class AppUtils {
|
||||||
|
public static File getInternalDirectory(Context context, String folderName) {
|
||||||
|
File dir = context.getExternalFilesDir("");
|
||||||
|
File file = new File(dir, folderName);
|
||||||
|
if (!file.exists()) {
|
||||||
|
file.mkdirs();
|
||||||
|
}
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static File getFile(Context context, String fileName, String folderName) {
|
||||||
|
File dir = getInternalDirectory(context, folderName);
|
||||||
|
if (fileName == null || fileName.isEmpty()) {
|
||||||
|
return dir;
|
||||||
|
} else {
|
||||||
|
return new File(dir, fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void saveByteArrayToFile(byte[] byteArray, String fileName) throws IOException {
|
||||||
|
try (FileOutputStream fileOutputStream = new FileOutputStream(fileName)) {
|
||||||
|
fileOutputStream.write(byteArray);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static void clearMyFiles(Context activity, String folderName) {
|
||||||
|
File[] files = getInternalDirectory(activity, folderName).listFiles();
|
||||||
|
if (files != null) {
|
||||||
|
for (File file : files) {
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static File getExterDir(Context context) {
|
||||||
|
return context.getExternalFilesDir("");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,7 @@
|
|||||||
package cpm.com.gskmtorange.GeoTag;
|
package cpm.com.gskmtorange.GeoTag;
|
||||||
|
|
||||||
|
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@@ -19,6 +21,7 @@ import android.net.Uri;
|
|||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Looper;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
@@ -38,14 +41,19 @@ import androidx.core.app.ActivityCompat;
|
|||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
|
import com.google.android.gms.appindexing.Action;
|
||||||
import com.google.android.gms.appindexing.AppIndex;
|
import com.google.android.gms.appindexing.AppIndex;
|
||||||
import com.google.android.gms.appindexing.Thing;
|
import com.google.android.gms.appindexing.Thing;
|
||||||
import com.google.android.gms.common.ConnectionResult;
|
import com.google.android.gms.common.ConnectionResult;
|
||||||
import com.google.android.gms.common.GooglePlayServicesUtil;
|
import com.google.android.gms.common.GooglePlayServicesUtil;
|
||||||
import com.google.android.gms.common.api.GoogleApiClient;
|
import com.google.android.gms.common.api.GoogleApiClient;
|
||||||
|
import com.google.android.gms.location.FusedLocationProviderClient;
|
||||||
|
import com.google.android.gms.location.LocationCallback;
|
||||||
import com.google.android.gms.location.LocationListener;
|
import com.google.android.gms.location.LocationListener;
|
||||||
import com.google.android.gms.location.LocationRequest;
|
import com.google.android.gms.location.LocationRequest;
|
||||||
|
import com.google.android.gms.location.LocationResult;
|
||||||
import com.google.android.gms.location.LocationServices;
|
import com.google.android.gms.location.LocationServices;
|
||||||
|
import com.google.android.gms.location.Priority;
|
||||||
import com.google.android.gms.maps.CameraUpdateFactory;
|
import com.google.android.gms.maps.CameraUpdateFactory;
|
||||||
import com.google.android.gms.maps.GoogleMap;
|
import com.google.android.gms.maps.GoogleMap;
|
||||||
import com.google.android.gms.maps.OnMapReadyCallback;
|
import com.google.android.gms.maps.OnMapReadyCallback;
|
||||||
@@ -81,16 +89,12 @@ import cpm.com.gskmtorange.R;
|
|||||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.dailyentry.StoreimageActivity;
|
import cpm.com.gskmtorange.dailyentry.StoreimageActivity;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.VisitTypeStatusActivity;
|
||||||
import cpm.com.gskmtorange.messgae.AlertMessage;
|
import cpm.com.gskmtorange.messgae.AlertMessage;
|
||||||
import cpm.com.gskmtorange.upload.Base64;
|
import cpm.com.gskmtorange.upload.Base64;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by ashishc on 27-12-2016.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
||||||
private Context context;
|
private Context context;
|
||||||
String result, errormsg = "";
|
String result, errormsg = "";
|
||||||
@@ -98,6 +102,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
private GoogleMap mMap;
|
private GoogleMap mMap;
|
||||||
double latitude = 0.0;
|
double latitude = 0.0;
|
||||||
double longitude = 0.0;
|
double longitude = 0.0;
|
||||||
|
String country_id;
|
||||||
protected String diskpath = "", _path, _pathforcheck, img_str = "", status;
|
protected String diskpath = "", _path, _pathforcheck, img_str = "", status;
|
||||||
private Location mLastLocation;
|
private Location mLastLocation;
|
||||||
private LocationManager locmanager = null;
|
private LocationManager locmanager = null;
|
||||||
@@ -123,15 +128,14 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
Uri outputFileUri;
|
Uri outputFileUri;
|
||||||
private int factor, k;
|
private int factor, k;
|
||||||
ArrayList<GeotaggingBeans> geotaglist = new ArrayList<GeotaggingBeans>();
|
ArrayList<GeotaggingBeans> geotaglist = new ArrayList<GeotaggingBeans>();
|
||||||
|
|
||||||
ArrayList<GeotaggingBeans> geotaglistImage = new ArrayList<GeotaggingBeans>();
|
ArrayList<GeotaggingBeans> geotaglistImage = new ArrayList<GeotaggingBeans>();
|
||||||
Boolean markerflag = true;
|
Boolean markerflag = true;
|
||||||
private TextView percentage, message;
|
private TextView percentage, message;
|
||||||
private FailureGetterSetter failureGetterSetter = null;
|
private FailureGetterSetter failureGetterSetter = null;
|
||||||
/**
|
|
||||||
* ATTENTION: This was auto-generated to implement the App Indexing API.
|
private FusedLocationProviderClient fusedLocationProviderClient;
|
||||||
* See https://g.co/AppIndexing/AndroidStudio for more information.
|
LocationRequest locationRequest;
|
||||||
*/
|
|
||||||
private GoogleApiClient client;
|
private GoogleApiClient client;
|
||||||
|
|
||||||
Toolbar toolbar;
|
Toolbar toolbar;
|
||||||
@@ -142,15 +146,16 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
context = this;
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);
|
||||||
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
//storeid = preferences.getString(CommonString.KEY_STORE_ID, null);
|
//storeid = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||||
//storename = preferences.getString(CommonString.KEY_STORE_NAME, null);
|
//storename = preferences.getString(CommonString.KEY_STORE_NAME, null);
|
||||||
visitData = preferences.getString(CommonString.KEY_DATE, null);
|
visitData = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
||||||
storeid = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
storeid = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||||
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||||
|
|
||||||
|
|
||||||
final PackageManager packageManager = getPackageManager();
|
final PackageManager packageManager = getPackageManager();
|
||||||
@@ -161,9 +166,9 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
|
|
||||||
db = new GSKOrangeDB(GeoTagActivity.this);
|
db = new GSKOrangeDB(GeoTagActivity.this);
|
||||||
db.open();
|
db.open();
|
||||||
context = this;
|
|
||||||
//storeid = getIntent().getStringExtra("Storeid");
|
//storeid = getIntent().getStringExtra("Storeid");
|
||||||
str = CommonString.FILE_PATH;
|
str = CommonString.getImagesFolder(context);
|
||||||
|
|
||||||
mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
|
mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
|
||||||
|
|
||||||
@@ -221,7 +226,6 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
// Write your code here to invoke NO event
|
// Write your code here to invoke NO event
|
||||||
|
|
||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
@@ -266,31 +270,15 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
fabcarmabtn.setOnClickListener(new View.OnClickListener() {
|
fabcarmabtn.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
/* List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
|
||||||
for (int n = 0; n < list.size(); n++) {
|
|
||||||
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
|
||||||
Log.d("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
|
||||||
Log.d("TAG", "package name : " + list.get(n).packageName);
|
|
||||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
|
||||||
defaultCameraPackage = list.get(n).packageName;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
_pathforcheck = storeid + "GeoTag" + visitData.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck = storeid + "GeoTag" + visitData.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
|
||||||
|
|
||||||
|
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// ATTENTION: This was auto-generated to implement the App Indexing API.
|
// ATTENTION: This was auto-generated to implement the App Indexing API.
|
||||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
||||||
client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
|
// client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkPlayServices() {
|
private boolean checkPlayServices() {
|
||||||
@@ -317,8 +305,6 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
.addOnConnectionFailedListener(this)
|
.addOnConnectionFailedListener(this)
|
||||||
.addApi(LocationServices.API).build();
|
.addApi(LocationServices.API).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void createLocationRequest() {
|
protected void createLocationRequest() {
|
||||||
mLocationRequest = new LocationRequest();
|
mLocationRequest = new LocationRequest();
|
||||||
mLocationRequest.setInterval(UPDATE_INTERVAL);
|
mLocationRequest.setInterval(UPDATE_INTERVAL);
|
||||||
@@ -328,11 +314,8 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void startLocationUpdates() {
|
protected void startLocationUpdates() {
|
||||||
|
|
||||||
|
|
||||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
||||||
|| ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
|| ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
||||||
|
|
||||||
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
|
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -349,7 +332,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
@Override
|
@Override
|
||||||
public void onConnected(Bundle bundle) {
|
public void onConnected(Bundle bundle) {
|
||||||
|
|
||||||
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
/* if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
// TODO: Consider calling
|
// TODO: Consider calling
|
||||||
// ActivityCompat#requestPermissions
|
// ActivityCompat#requestPermissions
|
||||||
// here to request the missing permissions, and then overriding
|
// here to request the missing permissions, and then overriding
|
||||||
@@ -385,10 +368,8 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
|
|
||||||
|
|
||||||
// if (mRequestingLocationUpdates) {
|
// if (mRequestingLocationUpdates) {
|
||||||
startLocationUpdates();
|
startLocationUpdates();*/
|
||||||
// }
|
|
||||||
|
|
||||||
// startLocationUpdates();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -414,7 +395,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
protected void onStart() {
|
protected void onStart() {
|
||||||
super.onStart();// ATTENTION: This was auto-generated to implement the App Indexing API.
|
super.onStart();// ATTENTION: This was auto-generated to implement the App Indexing API.
|
||||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
||||||
client.connect();
|
// client.connect();
|
||||||
if (mGoogleApiClient != null) {
|
if (mGoogleApiClient != null) {
|
||||||
mGoogleApiClient.connect();
|
mGoogleApiClient.connect();
|
||||||
}
|
}
|
||||||
@@ -429,12 +410,49 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
|
|
||||||
CommonFunctions.updateLangResources(context,preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context,preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
toolbar.setTitle(getResources().getString(R.string.title_activity_store_geotag));
|
toolbar.setTitle(getResources().getString(R.string.title_activity_store_geotag));
|
||||||
/* checkPlayServices();
|
locationRequest = new LocationRequest.Builder(Priority.PRIORITY_HIGH_ACCURACY, 100000)
|
||||||
|
.setWaitForAccurateLocation(false)
|
||||||
|
.setMinUpdateIntervalMillis(IMPLICIT_MIN_UPDATE_INTERVAL)
|
||||||
|
.setMaxUpdateDelayMillis(1000)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
|
||||||
|
LocationCallback locationCallback = new LocationCallback() {
|
||||||
|
@Override
|
||||||
|
public void onLocationResult(LocationResult locationResult) {
|
||||||
|
if (locationResult != null) {
|
||||||
|
if (locationResult == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//Showing the latitude, longitude and accuracy on the home screen.
|
||||||
|
for (Location location : locationResult.getLocations()) {
|
||||||
|
latitude = location.getLatitude();
|
||||||
|
longitude = location.getLongitude();
|
||||||
|
// Log.e("latitude_inside",location.getLatitude() + "," +location.getLongitude());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ActivityCompat.checkSelfPermission(context, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
|
||||||
|
&& ActivityCompat.checkSelfPermission(context, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
ActivityCompat.requestPermissions(GeoTagActivity.this, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, 1);
|
||||||
|
ActivityCompat.requestPermissions(GeoTagActivity.this, new String[]{android.Manifest.permission.ACCESS_COARSE_LOCATION}, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
mMap.setMyLocationEnabled(true);
|
||||||
|
|
||||||
|
if(markerflag)
|
||||||
|
{
|
||||||
|
// Add a marker of latest location and move the camera
|
||||||
|
LatLng latLng = new LatLng(latitude, longitude);
|
||||||
|
mMap.addMarker(new MarkerOptions().position(latLng));
|
||||||
|
mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
|
||||||
|
mMap.animateCamera(CameraUpdateFactory.zoomTo(15));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, Looper.getMainLooper());
|
||||||
|
|
||||||
// Resuming the periodic location updates
|
|
||||||
if (mGoogleApiClient.isConnected() && mRequestingLocationUpdates) {
|
|
||||||
startLocationUpdates();
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -443,17 +461,12 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
||||||
|
|
||||||
|
|
||||||
//usk comment
|
// AppIndex.AppIndexApi.end(client, getIndexApiAction());
|
||||||
/* if(client!=null && mGoogleApiClient!=null){
|
|
||||||
AppIndex.AppIndexApi.end(client, getIndexApiAction());
|
|
||||||
if (mGoogleApiClient.isConnected()) {
|
if (mGoogleApiClient.isConnected()) {
|
||||||
mGoogleApiClient.disconnect();
|
mGoogleApiClient.disconnect();
|
||||||
}
|
}
|
||||||
// ATTENTION: This was auto-generated to implement the App Indexing API.
|
|
||||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
|
||||||
client.disconnect();
|
|
||||||
|
|
||||||
}*/
|
// client.disconnect();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -501,8 +514,23 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
cdate = arabicToenglish(cdate);
|
cdate = arabicToenglish(cdate);
|
||||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
||||||
cdate = arabicToenglish(cdate);
|
cdate = arabicToenglish(cdate);
|
||||||
|
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KUWAIT)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_BAHRAIN)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_OMAN)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_QATAR)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}
|
||||||
|
else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LEBANON)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}
|
||||||
|
else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LIBIYA)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cdate;
|
return cdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -614,19 +642,6 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//usk comment
|
|
||||||
/* public com.google.android.gms.appindexing.Action getIndexApiAction() {
|
|
||||||
Thing object = new Thing.Builder()
|
|
||||||
.setName("GeoTag Page") // TODO: Define a title for the content shown.
|
|
||||||
// TODO: Make sure this auto-generated URL is correct.
|
|
||||||
.setUrl(Uri.parse("http://[ENTER-YOUR-URL-HERE]"))
|
|
||||||
.build();
|
|
||||||
return new Action.Builder(Action.TYPE_VIEW)
|
|
||||||
.setObject(object)
|
|
||||||
.setActionStatus(Action.STATUS_TYPE_COMPLETED)
|
|
||||||
.build();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
public class GeoTagUpload extends AsyncTask<Void, Void, String> {
|
public class GeoTagUpload extends AsyncTask<Void, Void, String> {
|
||||||
|
|
||||||
@@ -779,29 +794,51 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
|
|
||||||
} catch (SocketException ex) {
|
} catch (SocketException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
|
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION) && country_id.equals("2")){
|
||||||
|
Intent intent = new Intent(
|
||||||
|
GeoTagActivity.this,
|
||||||
|
VisitTypeStatusActivity.class);
|
||||||
|
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
|
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
else{
|
||||||
Intent intent = new Intent(
|
Intent intent = new Intent(
|
||||||
GeoTagActivity.this,
|
GeoTagActivity.this,
|
||||||
StoreimageActivity.class);
|
StoreimageActivity.class);
|
||||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||||
|
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
}
|
||||||
GeoTagActivity.this.finish();
|
GeoTagActivity.this.finish();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
||||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||||
// Crashlytics.logException(e.getCause());
|
// Crashlytics.logException(e.getCause());
|
||||||
// Crashlytics.logException(new Exception(e.getCause()));
|
// Crashlytics.logException(new Exception(e.getCause()));
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION) && country_id.equals("2")){
|
||||||
|
Intent intent = new Intent(
|
||||||
|
GeoTagActivity.this,
|
||||||
|
VisitTypeStatusActivity.class);
|
||||||
|
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
|
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
else{
|
||||||
Intent intent = new Intent(
|
Intent intent = new Intent(
|
||||||
GeoTagActivity.this,
|
GeoTagActivity.this,
|
||||||
StoreimageActivity.class);
|
StoreimageActivity.class);
|
||||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||||
|
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
/* Intent intent = new Intent(
|
||||||
|
GeoTagActivity.this,
|
||||||
|
StoreimageActivity.class);
|
||||||
|
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
|
intent.putExtra(CommonString.KEY_STORE_ID, storeid);*/
|
||||||
|
|
||||||
|
// startActivity(intent);
|
||||||
|
|
||||||
GeoTagActivity.this.finish();
|
GeoTagActivity.this.finish();
|
||||||
}
|
}
|
||||||
@@ -912,17 +949,14 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
&& !geotaglistImage.get(i).getUrl1()
|
&& !geotaglistImage.get(i).getUrl1()
|
||||||
.equalsIgnoreCase("")) {
|
.equalsIgnoreCase("")) {
|
||||||
|
|
||||||
if (new File(CommonString.FILE_PATH
|
if (new File(CommonString.getImagesFolder(context)
|
||||||
+ geotaglistImage.get(i).getUrl1()).exists()) {
|
+ geotaglistImage.get(i).getUrl1()).exists()) {
|
||||||
result = UploadGeoImage(geotaglistImage.get(i).getUrl1(), "GeotagImages");
|
result = UploadGeoImage(geotaglistImage.get(i).getUrl1(), "GeotagImages");
|
||||||
|
|
||||||
|
|
||||||
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
|
|
||||||
return "GeotagImages";
|
return "GeotagImages";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (result.toString().equalsIgnoreCase(CommonString.KEY_FALSE)) {
|
if (result.toString().equalsIgnoreCase(CommonString.KEY_FALSE)) {
|
||||||
|
|
||||||
return CommonString.METHOD_Get_DR_STORE_IMAGES_GEO;
|
return CommonString.METHOD_Get_DR_STORE_IMAGES_GEO;
|
||||||
@@ -931,7 +965,6 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
|
|
||||||
return CommonString.METHOD_Get_DR_STORE_IMAGES_GEO + "," + errormsg;
|
return CommonString.METHOD_Get_DR_STORE_IMAGES_GEO + "," + errormsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -964,13 +997,29 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||||
// Crashlytics.logException(e.getCause());
|
// Crashlytics.logException(e.getCause());
|
||||||
//Crashlytics.logException(new Exception(e.getCause()));
|
//Crashlytics.logException(new Exception(e.getCause()));
|
||||||
|
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION) && country_id.equals("2")){
|
||||||
|
Intent intent = new Intent(
|
||||||
|
GeoTagActivity.this,
|
||||||
|
VisitTypeStatusActivity.class);
|
||||||
|
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
|
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
else{
|
||||||
Intent intent = new Intent(
|
Intent intent = new Intent(
|
||||||
GeoTagActivity.this,
|
GeoTagActivity.this,
|
||||||
StoreimageActivity.class);
|
StoreimageActivity.class);
|
||||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||||
|
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
/* Intent intent = new Intent(
|
||||||
|
GeoTagActivity.this,
|
||||||
|
StoreimageActivity.class);
|
||||||
|
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
|
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||||
|
|
||||||
|
startActivity(intent);*/
|
||||||
|
|
||||||
GeoTagActivity.this.finish();
|
GeoTagActivity.this.finish();
|
||||||
|
|
||||||
@@ -991,7 +1040,9 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
String Statustag = "U";
|
//usk
|
||||||
|
//String Statustag = "U";
|
||||||
|
String Statustag = "Y";
|
||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
for (int i = 0; i < geotaglistImage.size(); i++) {
|
for (int i = 0; i < geotaglistImage.size(); i++) {
|
||||||
@@ -1021,13 +1072,29 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
+ result, getResources().getString(R.string.success), null);
|
+ result, getResources().getString(R.string.success), null);
|
||||||
message.showMessage();*/
|
message.showMessage();*/
|
||||||
|
|
||||||
|
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION) && country_id.equals("2")){
|
||||||
|
Intent intent = new Intent(
|
||||||
|
GeoTagActivity.this,
|
||||||
|
VisitTypeStatusActivity.class);
|
||||||
|
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
|
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
else{
|
||||||
Intent intent = new Intent(
|
Intent intent = new Intent(
|
||||||
GeoTagActivity.this,
|
GeoTagActivity.this,
|
||||||
StoreimageActivity.class);
|
StoreimageActivity.class);
|
||||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||||
|
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
/* Intent intent = new Intent(
|
||||||
|
GeoTagActivity.this,
|
||||||
|
StoreimageActivity.class);
|
||||||
|
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
|
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||||
|
|
||||||
|
startActivity(intent);*/
|
||||||
|
|
||||||
GeoTagActivity.this.finish();
|
GeoTagActivity.this.finish();
|
||||||
|
|
||||||
@@ -1042,13 +1109,30 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
+ result, getResources().getString(R.string.failure), null);
|
+ result, getResources().getString(R.string.failure), null);
|
||||||
message.showMessage();*/
|
message.showMessage();*/
|
||||||
Toast.makeText(context,getResources().getString(R.string.failure),Toast.LENGTH_LONG).show();
|
Toast.makeText(context,getResources().getString(R.string.failure),Toast.LENGTH_LONG).show();
|
||||||
|
|
||||||
|
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION) && country_id.equals("2")){
|
||||||
|
Intent intent = new Intent(
|
||||||
|
GeoTagActivity.this,
|
||||||
|
VisitTypeStatusActivity.class);
|
||||||
|
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
|
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
else{
|
||||||
Intent intent = new Intent(
|
Intent intent = new Intent(
|
||||||
GeoTagActivity.this,
|
GeoTagActivity.this,
|
||||||
StoreimageActivity.class);
|
StoreimageActivity.class);
|
||||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||||
|
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
/* Intent intent = new Intent(
|
||||||
|
GeoTagActivity.this,
|
||||||
|
StoreimageActivity.class);
|
||||||
|
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
|
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||||
|
|
||||||
|
startActivity(intent);*/
|
||||||
|
|
||||||
GeoTagActivity.this.finish();
|
GeoTagActivity.this.finish();
|
||||||
}
|
}
|
||||||
@@ -1068,7 +1152,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
errormsg = "";
|
errormsg = "";
|
||||||
BitmapFactory.Options o = new BitmapFactory.Options();
|
BitmapFactory.Options o = new BitmapFactory.Options();
|
||||||
o.inJustDecodeBounds = true;
|
o.inJustDecodeBounds = true;
|
||||||
BitmapFactory.decodeFile(CommonString.FILE_PATH + path, o);
|
BitmapFactory.decodeFile(CommonString.getImagesFolder(context) + path, o);
|
||||||
|
|
||||||
// The new size we want to scale to
|
// The new size we want to scale to
|
||||||
final int REQUIRED_SIZE = 1024;
|
final int REQUIRED_SIZE = 1024;
|
||||||
@@ -1088,7 +1172,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
// Decode with inSampleSize
|
// Decode with inSampleSize
|
||||||
BitmapFactory.Options o2 = new BitmapFactory.Options();
|
BitmapFactory.Options o2 = new BitmapFactory.Options();
|
||||||
o2.inSampleSize = scale;
|
o2.inSampleSize = scale;
|
||||||
Bitmap bitmap = BitmapFactory.decodeFile(CommonString.FILE_PATH + path, o2);
|
Bitmap bitmap = BitmapFactory.decodeFile(CommonString.getImagesFolder(context) + path, o2);
|
||||||
|
|
||||||
ByteArrayOutputStream bao = new ByteArrayOutputStream();
|
ByteArrayOutputStream bao = new ByteArrayOutputStream();
|
||||||
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, bao);
|
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, bao);
|
||||||
@@ -1114,31 +1198,10 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
|
|
||||||
if (result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
if (result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
|
|
||||||
new File(CommonString.FILE_PATH + path).delete();
|
new File(CommonString.getImagesFolder(context) + path).delete();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*SAXParserFactory saxPF = SAXParserFactory.newInstance();
|
|
||||||
SAXParser saxP = saxPF.newSAXParser();
|
|
||||||
XMLReader xmlR = saxP.getXMLReader();
|
|
||||||
|
|
||||||
// for failure
|
|
||||||
FailureXMLHandler failureXMLHandler = new FailureXMLHandler();
|
|
||||||
xmlR.setContentHandler(failureXMLHandler);
|
|
||||||
|
|
||||||
InputSource is = new InputSource();
|
|
||||||
is.setCharacterStream(new StringReader(result.toString()));
|
|
||||||
xmlR.parse(is);
|
|
||||||
|
|
||||||
failureGetterSetter = failureXMLHandler
|
|
||||||
.getFailureGetterSetter();
|
|
||||||
|
|
||||||
if (failureGetterSetter.getStatus().equalsIgnoreCase(
|
|
||||||
CommonString.KEY_FAILURE)) {
|
|
||||||
errormsg = failureGetterSetter.getErrorMsg();
|
|
||||||
return CommonString.KEY_FAILURE;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
} else if (result.toString().equalsIgnoreCase(CommonString.KEY_FALSE)) {
|
} else if (result.toString().equalsIgnoreCase(CommonString.KEY_FALSE)) {
|
||||||
return CommonString.KEY_FALSE;
|
return CommonString.KEY_FALSE;
|
||||||
} else {
|
} else {
|
||||||
@@ -1148,4 +1211,17 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
return result.toString();
|
return result.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Action getIndexApiAction() {
|
||||||
|
Thing object = new Thing.Builder()
|
||||||
|
.setName("GeoTag Page") // TODO: Define a title for the content shown.
|
||||||
|
// TODO: Make sure this auto-generated URL is correct.
|
||||||
|
.setUrl(Uri.parse("http://[ENTER-YOUR-URL-HERE]"))
|
||||||
|
.build();
|
||||||
|
return new Action.Builder(Action.TYPE_VIEW)
|
||||||
|
.setObject(object)
|
||||||
|
.setActionStatus(Action.STATUS_TYPE_COMPLETED)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class OrderReceivedStatus implements Serializable {
|
||||||
|
//TextView sys_gen_poTV,storepoTV,podateTV,lineItemTV,statusTV;
|
||||||
|
String sys_gen_po="";
|
||||||
|
String storepo="";
|
||||||
|
String podate="";
|
||||||
|
String lineItem="";
|
||||||
|
String status="";
|
||||||
|
int SKU_ID;
|
||||||
|
int ORDERQTY;
|
||||||
|
int CATEGORY_ID;
|
||||||
|
int POID;
|
||||||
|
|
||||||
|
public int getPOID() {
|
||||||
|
return POID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPOID(int POID) {
|
||||||
|
this.POID = POID;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getStoreid() {
|
||||||
|
return Storeid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStoreid(int storeid) {
|
||||||
|
Storeid = storeid;
|
||||||
|
}
|
||||||
|
|
||||||
|
int Storeid;
|
||||||
|
|
||||||
|
public int getSKU_ID() {
|
||||||
|
return SKU_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSKU_ID(int SKU_ID) {
|
||||||
|
this.SKU_ID = SKU_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getORDERQTY() {
|
||||||
|
return ORDERQTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setORDERQTY(int ORDERQTY) {
|
||||||
|
this.ORDERQTY = ORDERQTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCATEGORY_ID() {
|
||||||
|
return CATEGORY_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCATEGORY_ID(int CATEGORY_ID) {
|
||||||
|
this.CATEGORY_ID = CATEGORY_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getSys_gen_po() {
|
||||||
|
return sys_gen_po;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSys_gen_po(String sys_gen_po) {
|
||||||
|
this.sys_gen_po = sys_gen_po;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStorepo() {
|
||||||
|
return storepo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStorepo(String storepo) {
|
||||||
|
this.storepo = storepo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPodate() {
|
||||||
|
return podate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPodate(String podate) {
|
||||||
|
this.podate = podate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLineItem() {
|
||||||
|
return lineItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLineItem(String lineItem) {
|
||||||
|
this.lineItem = lineItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,8 +19,10 @@ import android.os.AsyncTask;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
import android.os.Looper;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
@@ -36,6 +38,7 @@ import android.widget.Toast;
|
|||||||
//import com.crashlytics.android.Crashlytics;
|
//import com.crashlytics.android.Crashlytics;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.cardview.widget.CardView;
|
||||||
import androidx.core.app.ActivityCompat;
|
import androidx.core.app.ActivityCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
@@ -45,12 +48,16 @@ import com.google.android.gms.common.api.GoogleApiClient;
|
|||||||
import com.google.android.gms.common.api.PendingResult;
|
import com.google.android.gms.common.api.PendingResult;
|
||||||
import com.google.android.gms.common.api.ResultCallback;
|
import com.google.android.gms.common.api.ResultCallback;
|
||||||
import com.google.android.gms.common.api.Status;
|
import com.google.android.gms.common.api.Status;
|
||||||
|
import com.google.android.gms.location.FusedLocationProviderClient;
|
||||||
|
import com.google.android.gms.location.LocationCallback;
|
||||||
import com.google.android.gms.location.LocationListener;
|
import com.google.android.gms.location.LocationListener;
|
||||||
import com.google.android.gms.location.LocationRequest;
|
import com.google.android.gms.location.LocationRequest;
|
||||||
|
import com.google.android.gms.location.LocationResult;
|
||||||
import com.google.android.gms.location.LocationServices;
|
import com.google.android.gms.location.LocationServices;
|
||||||
import com.google.android.gms.location.LocationSettingsRequest;
|
import com.google.android.gms.location.LocationSettingsRequest;
|
||||||
import com.google.android.gms.location.LocationSettingsResult;
|
import com.google.android.gms.location.LocationSettingsResult;
|
||||||
import com.google.android.gms.location.LocationSettingsStatusCodes;
|
import com.google.android.gms.location.LocationSettingsStatusCodes;
|
||||||
|
import com.google.android.gms.location.Priority;
|
||||||
import com.google.android.gms.maps.model.LatLng;
|
import com.google.android.gms.maps.model.LatLng;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||||
@@ -77,8 +84,10 @@ import java.text.SimpleDateFormat;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.autoupdate.AutoUpdateActivity;
|
import cpm.com.gskmtorange.autoupdate.AutoUpdateActivity;
|
||||||
@@ -92,60 +101,48 @@ import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
|||||||
//import io.fabric.sdk.android.Fabric;
|
//import io.fabric.sdk.android.Fabric;
|
||||||
|
|
||||||
import static android.Manifest.permission.READ_CONTACTS;
|
import static android.Manifest.permission.READ_CONTACTS;
|
||||||
|
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
||||||
|
|
||||||
/**
|
|
||||||
* A login screen that offers login via userid/password.
|
|
||||||
*/
|
|
||||||
public class LoginActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
|
||||||
|
|
||||||
|
public class LoginActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks,
|
||||||
|
GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
||||||
private static final int MY_PERMISSIONS_REQUEST_CAMERA = 10;
|
private static final int MY_PERMISSIONS_REQUEST_CAMERA = 10;
|
||||||
private static final int MY_PERMISSIONS_REQUEST_LOCATION = 11;
|
private static final int MY_PERMISSIONS_REQUEST_LOCATION = 11;
|
||||||
private static final int MY_PERMISSIONS_REQUEST_STORAGE_READ = 12;
|
private static final int MY_PERMISSIONS_REQUEST_STORAGE_READ = 12;
|
||||||
private static final int MY_PERMISSIONS_REQUEST_STORAGE_WRITE = 14;
|
private static final int MY_PERMISSIONS_REQUEST_STORAGE_WRITE = 14;
|
||||||
|
|
||||||
private FirebaseAnalytics mFirebaseAnalytics;
|
private FirebaseAnalytics mFirebaseAnalytics;
|
||||||
|
|
||||||
TextView tv_version;
|
private static final int PERMISSION_ALL = 99;
|
||||||
|
|
||||||
String app_ver;
|
String app_ver;
|
||||||
|
|
||||||
LoginGetterSetter lgs = null;
|
LoginGetterSetter lgs = null;
|
||||||
|
|
||||||
static int counter = 1;
|
static int counter = 1;
|
||||||
|
|
||||||
private SharedPreferences preferences = null;
|
private SharedPreferences preferences = null;
|
||||||
private SharedPreferences.Editor editor = null;
|
private SharedPreferences.Editor editor = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Id to identity READ_CONTACTS permission request.
|
* Id to identity READ_CONTACTS permission request.
|
||||||
*/
|
*/
|
||||||
private static final int REQUEST_READ_CONTACTS = 0;
|
private static final int REQUEST_READ_CONTACTS = 0;
|
||||||
|
|
||||||
|
//New Location Changes
|
||||||
|
private FusedLocationProviderClient fusedLocationProviderClient;
|
||||||
|
LocationRequest locationRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A dummy authentication store containing known user names and passwords.
|
* A dummy authentication store containing known user names and passwords.
|
||||||
* TODO: remove after connecting to a real authentication system.
|
* TODO: remove after connecting to a real authentication system.
|
||||||
*/
|
*/
|
||||||
private static final String[] DUMMY_CREDENTIALS = new String[]{
|
|
||||||
"foo@example.com:hello", "bar@example.com:world"
|
|
||||||
};
|
|
||||||
|
|
||||||
double lat = 0.0;
|
double lat = 0.0;
|
||||||
double lon = 0.0;
|
double lon = 0.0;
|
||||||
|
|
||||||
// UI references.
|
// UI references.
|
||||||
private AutoCompleteTextView museridView;
|
private AutoCompleteTextView museridView;
|
||||||
private EditText mPasswordView;
|
private EditText mPasswordView;
|
||||||
private View mProgressView;
|
private View mProgressView;
|
||||||
private View mLoginFormView;
|
private View mLoginFormView;
|
||||||
|
private String userid, password;
|
||||||
private String userid, password, p_username, p_password;
|
|
||||||
|
|
||||||
private int versionCode;
|
private int versionCode;
|
||||||
|
|
||||||
int eventType;
|
int eventType;
|
||||||
|
CardView museridSignInButton;
|
||||||
Button museridSignInButton;
|
|
||||||
|
|
||||||
// Trace myTrace;
|
|
||||||
|
|
||||||
GoogleApiClient mGoogleApiClient;
|
GoogleApiClient mGoogleApiClient;
|
||||||
private static int UPDATE_INTERVAL = 200; // 5 sec
|
private static int UPDATE_INTERVAL = 200; // 5 sec
|
||||||
@@ -160,9 +157,9 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
setContentView(R.layout.activity_login);
|
setContentView(R.layout.activity_login);
|
||||||
context = this;
|
context = this;
|
||||||
|
|
||||||
TextView tv_version = (TextView) findViewById(R.id.tv_version_code);
|
TextView tv_version = (TextView) findViewById(R.id.tv_version_code);
|
||||||
try {
|
try {
|
||||||
app_ver = String.valueOf(getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
|
app_ver = String.valueOf(getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
|
||||||
@@ -172,20 +169,24 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
tv_version.setText("Version/Versiyon - " + app_ver);
|
tv_version.setText("Version/Versiyon - " + app_ver +"-T4");
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
|
||||||
editor = preferences.edit();
|
editor = preferences.edit();
|
||||||
|
|
||||||
// Set up the login form.
|
// Set up the login form.
|
||||||
museridView = (AutoCompleteTextView) findViewById(R.id.userid);
|
museridView = (AutoCompleteTextView) findViewById(R.id.userid);
|
||||||
//populateAutoComplete();
|
//populateAutoComplete();
|
||||||
mPasswordView = (EditText) findViewById(R.id.password);
|
mPasswordView = (EditText) findViewById(R.id.password);
|
||||||
|
fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);
|
||||||
|
|
||||||
/* museridView.setText("test.egypt");
|
//for lebanon
|
||||||
mPasswordView.setText("cpm123");*/
|
// museridView.setText("test.lebanon1");
|
||||||
/* museridView.setText("egypt.1");
|
// mPasswordView.setText("cpm@123");
|
||||||
|
// for EGYPT
|
||||||
|
// museridView.setText("test.egypt");
|
||||||
|
// mPasswordView.setText("cpm123");
|
||||||
|
/*museridView.setText("egypt.1");
|
||||||
mPasswordView.setText("cpm123");*/
|
mPasswordView.setText("cpm123");*/
|
||||||
|
|
||||||
/* museridView.setText("DSR_Alex_61");
|
/* museridView.setText("DSR_Alex_61");
|
||||||
mPasswordView.setText("cpm123");*/
|
mPasswordView.setText("cpm123");*/
|
||||||
|
|
||||||
@@ -211,14 +212,18 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
/* museridView.setText("testksa");
|
/* museridView.setText("testksa");
|
||||||
mPasswordView.setText("cpm123");*/
|
mPasswordView.setText("cpm123");*/
|
||||||
|
|
||||||
|
/* //turkey
|
||||||
//turkey
|
museridView.setText("testmer");
|
||||||
/* museridView.setText("testmer");
|
mPasswordView.setText("cpm123");
|
||||||
mPasswordView.setText("cpm123");*/
|
*/
|
||||||
//sa
|
//sa
|
||||||
/* museridView.setText("testsa");
|
/* museridView.setText("testsa");
|
||||||
mPasswordView.setText("cpm123");*/
|
mPasswordView.setText("cpm123");*/
|
||||||
|
|
||||||
|
//Qatar
|
||||||
|
/* museridView.setText("test.qatar1");
|
||||||
|
mPasswordView.setText("cpm123");*/
|
||||||
|
|
||||||
//Kenya
|
//Kenya
|
||||||
// museridView.setText("test.Kenya");
|
// museridView.setText("test.Kenya");
|
||||||
// museridView.setText("testkenya");
|
// museridView.setText("testkenya");
|
||||||
@@ -233,6 +238,19 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
// museridView.setText("test.nig");
|
// museridView.setText("test.nig");
|
||||||
/* museridView.setText("test.nigeria");
|
/* museridView.setText("test.nigeria");
|
||||||
mPasswordView.setText("cpm@123");*/
|
mPasswordView.setText("cpm@123");*/
|
||||||
|
|
||||||
|
/* museridView.setText("test.jordan");
|
||||||
|
mPasswordView.setText("cpm@123");*/
|
||||||
|
|
||||||
|
// museridView.setText("test.kuwait");
|
||||||
|
// mPasswordView.setText("cpm@123");
|
||||||
|
|
||||||
|
// museridView.setText("test.oman");
|
||||||
|
|
||||||
|
/* museridView.setText("test.bahrain");
|
||||||
|
mPasswordView.setText("cpm@123");
|
||||||
|
*/
|
||||||
|
|
||||||
mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
|
public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
|
||||||
@@ -246,7 +264,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
app_ver = String.valueOf(getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
|
app_ver = String.valueOf(getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
|
||||||
|
|
||||||
// tv_version.setText("Version " + app_ver);
|
// tv_version.setText("Version " + app_ver);
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
@@ -254,9 +271,10 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
FirebaseCrashlytics.getInstance().recordException(e);
|
FirebaseCrashlytics.getInstance().recordException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkAndRequestPermissions();
|
||||||
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
|
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
|
||||||
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
|
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
|
||||||
museridSignInButton = (Button) findViewById(R.id.user_login_button);
|
museridSignInButton = (CardView) findViewById(R.id.user_login_button);
|
||||||
museridSignInButton.setOnClickListener(new OnClickListener() {
|
museridSignInButton.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
@@ -280,10 +298,137 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
file_planogram.mkdir();
|
file_planogram.mkdir();
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
checkAppPermission(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA);
|
//checkAppPermission(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkAndRequestPermissions() {
|
||||||
|
//int permissionwrite_storage = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||||
|
int CAMERA = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA);
|
||||||
|
int ACCESS_NETWORK_STATE = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_NETWORK_STATE);
|
||||||
|
int ACCESS_COARSE_LOCATION = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION);
|
||||||
|
int locationPermission = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);
|
||||||
|
//int READ_EXTERNAL_STORAGE = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);
|
||||||
|
int READ_PHONE_STATE = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE);
|
||||||
|
List<String> listPermissionsNeeded = new ArrayList<>();
|
||||||
|
|
||||||
|
if (CAMERA != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
listPermissionsNeeded.add(Manifest.permission.CAMERA);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ACCESS_NETWORK_STATE != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
listPermissionsNeeded.add(Manifest.permission.ACCESS_NETWORK_STATE);
|
||||||
|
}
|
||||||
|
if (ACCESS_COARSE_LOCATION != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
listPermissionsNeeded.add(Manifest.permission.ACCESS_COARSE_LOCATION);
|
||||||
|
}
|
||||||
|
if (locationPermission != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
listPermissionsNeeded.add(Manifest.permission.ACCESS_FINE_LOCATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (READ_PHONE_STATE != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
listPermissionsNeeded.add(Manifest.permission.READ_PHONE_STATE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!listPermissionsNeeded.isEmpty()) {
|
||||||
|
ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]), PERMISSION_ALL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (checkPlayServices()) {
|
||||||
|
// Building the GoogleApi client
|
||||||
|
buildGoogleApiClient();
|
||||||
|
createLocationRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create an instance of GoogleAPIClient.
|
||||||
|
if (mGoogleApiClient == null) {
|
||||||
|
mGoogleApiClient = new GoogleApiClient.Builder(context)
|
||||||
|
.addConnectionCallbacks(this)
|
||||||
|
.addOnConnectionFailedListener(this)
|
||||||
|
.addApi(LocationServices.API)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[], @NonNull int[] grantResults) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
|
Log.d("", "Permission callback called-------");
|
||||||
|
|
||||||
|
if (checkPlayServices()) {
|
||||||
|
// Building the GoogleApi client
|
||||||
|
buildGoogleApiClient();
|
||||||
|
createLocationRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create an instance of GoogleAPIClient.
|
||||||
|
if (mGoogleApiClient == null) {
|
||||||
|
mGoogleApiClient = new GoogleApiClient.Builder(this)
|
||||||
|
.addConnectionCallbacks(this)
|
||||||
|
.addOnConnectionFailedListener(this)
|
||||||
|
.addApi(LocationServices.API)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
if (requestCode == PERMISSION_ALL) {
|
||||||
|
Map<String, Integer> perms = new HashMap<>();
|
||||||
|
// Initialize the map with both permissions
|
||||||
|
perms.put(Manifest.permission.CAMERA, PackageManager.PERMISSION_GRANTED);
|
||||||
|
perms.put(Manifest.permission.ACCESS_NETWORK_STATE, PackageManager.PERMISSION_GRANTED);
|
||||||
|
perms.put(Manifest.permission.ACCESS_COARSE_LOCATION, PackageManager.PERMISSION_GRANTED);
|
||||||
|
perms.put(Manifest.permission.ACCESS_FINE_LOCATION, PackageManager.PERMISSION_GRANTED);
|
||||||
|
perms.put(Manifest.permission.READ_PHONE_STATE, PackageManager.PERMISSION_GRANTED);
|
||||||
|
// Fill with actual results from user
|
||||||
|
if (grantResults.length > 0) {
|
||||||
|
for (int i = 0; i < permissions.length; i++)
|
||||||
|
perms.put(permissions[i], grantResults[i]);
|
||||||
|
// Check for both permissions//
|
||||||
|
if (perms.get(Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED
|
||||||
|
&& perms.get(Manifest.permission.ACCESS_NETWORK_STATE) == PackageManager.PERMISSION_GRANTED
|
||||||
|
&& perms.get(Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
||||||
|
&& perms.get(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
||||||
|
&& perms.get(Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) {
|
||||||
|
// imeiNumbers = imei.getDeviceImei();
|
||||||
|
Log.d("", "sms & location services permission granted");
|
||||||
|
// process the normal flow
|
||||||
|
//else any one or both the permissions are not granted
|
||||||
|
} else {
|
||||||
|
Log.d("", "Some permissions are not granted ask again ");
|
||||||
|
//permission is denied (this is the first time, when "never ask again" is not checked) so ask again explaining the usage of permission
|
||||||
|
// // shouldShowRequestPermissionRationale will return true
|
||||||
|
//show the dialog or snackbar saying its necessary and try again otherwise proceed with setup.
|
||||||
|
if (
|
||||||
|
ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CAMERA) ||
|
||||||
|
ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_NETWORK_STATE) ||
|
||||||
|
ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_COARSE_LOCATION) ||
|
||||||
|
ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION) ||
|
||||||
|
ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.READ_EXTERNAL_STORAGE) ||
|
||||||
|
ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.READ_PHONE_STATE)) {
|
||||||
|
showDialogOK("Location,Photos,media,file,manage phone calls and Camera Services Permission required for this app",
|
||||||
|
(dialog, which) -> {
|
||||||
|
switch (which) {
|
||||||
|
case DialogInterface.BUTTON_POSITIVE:
|
||||||
|
checkAndRequestPermissions();
|
||||||
|
break;
|
||||||
|
case DialogInterface.BUTTON_NEGATIVE:
|
||||||
|
// proceed with logic by disabling the related features or quit the app.
|
||||||
|
Intent startMain = new Intent(Intent.ACTION_MAIN);
|
||||||
|
startMain.addCategory(Intent.CATEGORY_HOME);
|
||||||
|
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
startActivity(startMain);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showDialogOK(String message, DialogInterface.OnClickListener okListener) {
|
||||||
|
new androidx.appcompat.app.AlertDialog.Builder(this).setMessage(message).setPositiveButton("OK", okListener).setNegativeButton("Cancel", okListener).create().show();
|
||||||
|
}
|
||||||
|
|
||||||
/* private void populateAutoComplete() {
|
/* private void populateAutoComplete() {
|
||||||
if (!mayRequestContacts()) {
|
if (!mayRequestContacts()) {
|
||||||
return;
|
return;
|
||||||
@@ -505,9 +650,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPreExecute() {
|
protected void onPreExecute() {
|
||||||
|
|
||||||
super.onPreExecute();
|
super.onPreExecute();
|
||||||
|
|
||||||
dialog = new ProgressDialog(LoginActivity.this);
|
dialog = new ProgressDialog(LoginActivity.this);
|
||||||
dialog.setTitle("Login");
|
dialog.setTitle("Login");
|
||||||
dialog.setMessage("Authenticating....");
|
dialog.setMessage("Authenticating....");
|
||||||
@@ -517,17 +660,15 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String doInBackground(Void... params) {
|
protected String doInBackground(Void... params) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Log.e("latitudedata",lat + ","+ lon);
|
||||||
versionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
|
versionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
|
||||||
|
|
||||||
String userauth_xml = "[DATA]" + "[USER_DATA][USER_ID]"
|
String userauth_xml = "[DATA]" + "[USER_DATA][USER_ID]"
|
||||||
+ userid + "[/USER_ID]" + "[PASSWORD]" + password
|
+ userid + "[/USER_ID]" + "[PASSWORD]" + password
|
||||||
+ "[/PASSWORD]" + "[IN_TIME]" + CommonFunctions.getCurrentTimeWithLanguage(context)
|
+ "[/PASSWORD]" + "[IN_TIME]" + CommonFunctions.getCurrentTimeWithLanguage(context)
|
||||||
+ "[/IN_TIME]" + "[LATITUDE]" + lat
|
+ "[/IN_TIME]" + "[LATITUDE]" + lat
|
||||||
+ "[/LATITUDE]" + "[LONGITUDE]" + lon
|
+ "[/LATITUDE]" + "[LONGITUDE]" + lon
|
||||||
+ "[/LONGITUDE]" + "[APP_VERSION]" + app_ver
|
+ "[/LONGITUDE]" + "[APP_VERSION]" + app_ver +"-T4"
|
||||||
+ "[/APP_VERSION]" + "[ATT_MODE]OnLine[/ATT_MODE]"
|
+ "[/APP_VERSION]" + "[ATT_MODE]OnLine[/ATT_MODE]"
|
||||||
+ "[NETWORK_STATUS]" + "LoginStatus"
|
+ "[NETWORK_STATUS]" + "LoginStatus"
|
||||||
+ "[/NETWORK_STATUS]" + "[/USER_DATA][/DATA]";
|
+ "[/NETWORK_STATUS]" + "[/USER_DATA][/DATA]";
|
||||||
@@ -535,17 +676,24 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
SoapObject request = new SoapObject(CommonString.NAMESPACE,
|
SoapObject request = new SoapObject(CommonString.NAMESPACE,
|
||||||
CommonString.METHOD_LOGIN);
|
CommonString.METHOD_LOGIN);
|
||||||
request.addProperty("onXML", userauth_xml);
|
request.addProperty("onXML", userauth_xml);
|
||||||
|
Log.d("loginrequest", String.valueOf(request));
|
||||||
|
|
||||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
|
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
|
||||||
SoapEnvelope.VER11);
|
SoapEnvelope.VER11);
|
||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
try {
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(
|
HttpTransportSE androidHttpTransport = new HttpTransportSE(
|
||||||
CommonString.URL);
|
CommonString.URL);
|
||||||
|
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_LOGIN,
|
androidHttpTransport.call(CommonString.SOAP_ACTION_LOGIN,
|
||||||
envelope);
|
envelope);
|
||||||
|
} catch (Exception e){
|
||||||
|
Log.e("httpexception",e.getMessage());
|
||||||
|
}
|
||||||
|
/*HttpTransportSE androidHttpTransport = new HttpTransportSE(
|
||||||
|
CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION_LOGIN,
|
||||||
|
envelope);*/
|
||||||
|
|
||||||
Object result = (Object) envelope.getResponse();
|
Object result = (Object) envelope.getResponse();
|
||||||
|
|
||||||
@@ -563,24 +711,18 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
|
|
||||||
} else if (result.toString().equalsIgnoreCase(
|
} else if (result.toString().equalsIgnoreCase(
|
||||||
CommonString.KEY_FALSE)) {
|
CommonString.KEY_FALSE)) {
|
||||||
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
showAlert(CommonString.MESSAGE_FALSE);
|
showAlert(CommonString.MESSAGE_FALSE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
} else if (result.toString().equalsIgnoreCase(
|
} else if (result.toString().equalsIgnoreCase(
|
||||||
CommonString.KEY_CHANGED)) {
|
CommonString.KEY_CHANGED)) {
|
||||||
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
showAlert(CommonString.MESSAGE_CHANGED);
|
showAlert(CommonString.MESSAGE_CHANGED);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -628,15 +770,16 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
// PUT IN PREFERENCES
|
// PUT IN PREFERENCES
|
||||||
editor.putString(CommonString.KEY_USERNAME, userid);
|
editor.putString(CommonString.KEY_USERNAME, userid);
|
||||||
editor.putString(CommonString.KEY_PASSWORD, password);
|
editor.putString(CommonString.KEY_PASSWORD, password);
|
||||||
editor.putString(CommonString.KEY_VERSION, lgs.getAPP_VERSION());
|
editor.putString(CommonString.KEY_VERSION, lgs.getAPP_VERSION());
|
||||||
editor.putString(CommonString.KEY_PATH, lgs.getAPP_PATH());
|
editor.putString(CommonString.KEY_PATH, lgs.getAPP_PATH());
|
||||||
|
//editor.putString(CommonString.KEY_DATE, "12/05/2022");
|
||||||
editor.putString(CommonString.KEY_DATE, lgs.getCURRENTDATE());
|
editor.putString(CommonString.KEY_DATE, lgs.getCURRENTDATE());
|
||||||
//editor.putString(CommonString.KEY_DATE, "01/25/2019");
|
//editor.putString(CommonString.KEY_DATE, "01/25/2019");
|
||||||
editor.putString(CommonString.KEY_COUNTRY_ID, lgs.getCOUNTRY_ID());
|
editor.putString(CommonString.KEY_COUNTRY_ID, lgs.getCOUNTRY_ID());
|
||||||
|
Log.e("countryid",lgs.getCOUNTRY_ID());
|
||||||
editor.commit();
|
editor.commit();
|
||||||
setDataFromSharedPreferences(lgs);
|
setDataFromSharedPreferences(lgs);
|
||||||
|
|
||||||
@@ -686,12 +829,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
FirebaseCrashlytics.getInstance().recordException(e);
|
FirebaseCrashlytics.getInstance().recordException(e);
|
||||||
/* final AlertMessage message = new AlertMessage(
|
|
||||||
LoginActivity.this, AlertMessage.MESSAGE_EXCEPTION,
|
|
||||||
"acra_login", e);*/
|
|
||||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
|
||||||
// Crashlytics.logException(e.getCause());
|
|
||||||
// Crashlytics.logException(new Exception("My custom login Exception"));
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -700,7 +837,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -712,7 +848,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
if (result.equals(CommonString.KEY_SUCCESS)) {
|
if (result.equals(CommonString.KEY_SUCCESS)) {
|
||||||
// manually set true for South Africa
|
// manually set true for South Africa
|
||||||
boolean forSA = false;
|
boolean forSA = false;
|
||||||
// database.open();
|
// database.open();
|
||||||
if (forSA) {
|
if (forSA) {
|
||||||
//For SA Only
|
//For SA Only
|
||||||
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equals("")) {
|
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equals("")) {
|
||||||
@@ -745,7 +881,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
finish();
|
finish();
|
||||||
//uploadPreviousImages();
|
//uploadPreviousImages();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Intent intent = new Intent(getBaseContext(), AutoUpdateActivity.class);
|
Intent intent = new Intent(getBaseContext(), AutoUpdateActivity.class);
|
||||||
intent.putExtra(CommonString.KEY_PATH, preferences.getString(CommonString.KEY_PATH, ""));
|
intent.putExtra(CommonString.KEY_PATH, preferences.getString(CommonString.KEY_PATH, ""));
|
||||||
@@ -753,11 +888,9 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showAlert(String str) {
|
public void showAlert(String str) {
|
||||||
@@ -778,15 +911,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public String getCurrentTimeNotUsed() {
|
|
||||||
|
|
||||||
Calendar m_cal = Calendar.getInstance();
|
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
|
|
||||||
String intime = formatter.format(m_cal.getTime());
|
|
||||||
|
|
||||||
return intime;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
private static String arabicToenglish(String number) {
|
private static String arabicToenglish(String number) {
|
||||||
char[] chars = new char[number.length()];
|
char[] chars = new char[number.length()];
|
||||||
@@ -811,85 +935,27 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
cdate = arabicToenglish(cdate);
|
cdate = arabicToenglish(cdate);
|
||||||
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
||||||
cdate = arabicToenglish(cdate);
|
cdate = arabicToenglish(cdate);
|
||||||
|
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KUWAIT)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_BAHRAIN)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_OMAN)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_QATAR)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}
|
||||||
|
else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LEBANON)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}
|
||||||
|
else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LIBIYA)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cdate;
|
return cdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void uploadPreviousImages() {
|
|
||||||
try {
|
|
||||||
File f = new File(CommonString.FILE_PATH);
|
|
||||||
if (f != null) {
|
|
||||||
File file[] = f.listFiles();
|
|
||||||
if (file != null && file.length > 0) {
|
|
||||||
String newPattern = "EEE MMM dd HH:mm:ss Z yyyy";
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat(newPattern, Locale.ENGLISH);
|
|
||||||
|
|
||||||
Date c = Calendar.getInstance().getTime();
|
|
||||||
System.out.println("Current time => " + c);
|
|
||||||
|
|
||||||
//SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy");
|
|
||||||
String formattedDate = sdf.format(c);
|
|
||||||
|
|
||||||
Date visitdate = sdf.parse(formattedDate);
|
|
||||||
|
|
||||||
for (int i = 0; i < file.length; i++) {
|
|
||||||
Date lastModDate = new Date(file[i].lastModified());
|
|
||||||
String day = lastModDate.toString();
|
|
||||||
//String day = "Sun Apr 01 22:20:48 GMT+05:30 2018";
|
|
||||||
Date file_date = sdf.parse(day);
|
|
||||||
|
|
||||||
|
|
||||||
long diff = visitdate.getTime() - file_date.getTime();
|
|
||||||
System.out.println("Days: " + TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS));
|
|
||||||
long difference = TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS);
|
|
||||||
if (difference > 12) {
|
|
||||||
file[i].delete();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*SimpleDateFormat spf= new SimpleDateFormat("MM/dd/yyyy");
|
|
||||||
date = spf.format(newDate);
|
|
||||||
System.out.println(date);*/
|
|
||||||
}
|
|
||||||
if (file.length > 0) {
|
|
||||||
UploadImageWithRetrofit.uploadedFiles = 0;
|
|
||||||
UploadImageWithRetrofit.totalFiles = file.length;
|
|
||||||
UploadImageWithRetrofit uploadImg = new UploadImageWithRetrofit("", userid, LoginActivity.this);
|
|
||||||
//uploadImg.UploadImageRecursive(LoginActivity.this);
|
|
||||||
} else {
|
|
||||||
sendToMain();
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
sendToMain();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
sendToMain();
|
|
||||||
}
|
|
||||||
} catch (ParseException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
sendToMain();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void sendToMain() {
|
|
||||||
// Check if no view has focus:
|
|
||||||
View view = this.getCurrentFocus();
|
|
||||||
if (view != null) {
|
|
||||||
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
||||||
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
Intent intent = new Intent(getBaseContext(),
|
|
||||||
MainActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
|
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
@@ -937,14 +1003,14 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
|
|
||||||
// Create a Folder for Images
|
// Create a Folder for Images
|
||||||
|
|
||||||
File file = new File(Environment.getExternalStorageDirectory(), ".GSK_MT_ORANGE_IMAGES");
|
/* File file = new File(Environment.getExternalStorageDirectory(), ".GSK_MT_ORANGE_IMAGES");
|
||||||
if (!file.isDirectory()) {
|
if (!file.isDirectory()) {
|
||||||
file.mkdir();
|
file.mkdir();
|
||||||
}
|
}
|
||||||
File file_planogram = new File(Environment.getExternalStorageDirectory(), "GSK_MT_ORANGE_Planogram_Images");
|
File file_planogram = new File(Environment.getExternalStorageDirectory(), "GSK_MT_ORANGE_Planogram_Images");
|
||||||
if (!file_planogram.isDirectory()) {
|
if (!file_planogram.isDirectory()) {
|
||||||
file_planogram.mkdir();
|
file_planogram.mkdir();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if (checkPlayServices()) {
|
if (checkPlayServices()) {
|
||||||
// Building the GoogleApi client
|
// Building the GoogleApi client
|
||||||
@@ -961,7 +1027,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
.addApi(LocationServices.API)
|
.addApi(LocationServices.API)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
//attemptLogin();
|
attemptLogin();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1004,32 +1070,44 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
|
|
||||||
}
|
}
|
||||||
checkgpsEnableDevice();
|
checkgpsEnableDevice();
|
||||||
|
locationRequest= new LocationRequest.Builder(Priority.PRIORITY_HIGH_ACCURACY, 100000)
|
||||||
|
.setWaitForAccurateLocation(false)
|
||||||
|
.setMinUpdateIntervalMillis(IMPLICIT_MIN_UPDATE_INTERVAL)
|
||||||
|
.setMaxUpdateDelayMillis(1000)
|
||||||
|
.build();
|
||||||
|
LocationCallback locationCallback = new LocationCallback() {
|
||||||
|
@Override
|
||||||
|
public void onLocationResult(LocationResult locationResult) {
|
||||||
|
if (locationResult != null) {
|
||||||
|
if (locationResult == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//Showing the latitude, longitude and accuracy on the home screen.
|
||||||
|
for (Location location : locationResult.getLocations()) {
|
||||||
|
lat = location.getLatitude();
|
||||||
|
lon = location.getLongitude();
|
||||||
|
// Log.e("latitude_inside",location.getLatitude() + "," +location.getLongitude());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
|
||||||
|
&& ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
ActivityCompat.requestPermissions(LoginActivity.this, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, 1);
|
||||||
|
ActivityCompat.requestPermissions(LoginActivity.this, new String[]{android.Manifest.permission.ACCESS_COARSE_LOCATION}, 2);
|
||||||
|
}
|
||||||
|
fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, Looper.getMainLooper());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/*@Override
|
||||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||||
|
|
||||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
checkAppPermission(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA);
|
checkAppPermission(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA);
|
||||||
|
|
||||||
/*if (requestCode == PERMISSIONS_REQUEST_READ_PHONE_STATE
|
|
||||||
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
imeiNumbers = imei.getDeviceImei();
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* if (Build.VERSION.SDK_INT >= 23 && ContextCompat.checkSelfPermission(getApplicationContext(),
|
|
||||||
android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&
|
|
||||||
ContextCompat.checkSelfPermission(getApplicationContext(),
|
|
||||||
android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
return;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if (checkPlayServices()) {
|
if (checkPlayServices()) {
|
||||||
// Building the GoogleApi client
|
// Building the GoogleApi client
|
||||||
buildGoogleApiClient();
|
buildGoogleApiClient();
|
||||||
|
|
||||||
createLocationRequest();
|
createLocationRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1043,7 +1121,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
private boolean checkPlayServices() {
|
private boolean checkPlayServices() {
|
||||||
int resultCode = GooglePlayServicesUtil
|
int resultCode = GooglePlayServicesUtil
|
||||||
.isGooglePlayServicesAvailable(this);
|
.isGooglePlayServicesAvailable(this);
|
||||||
@@ -1123,7 +1201,8 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConnected(Bundle bundle) {
|
public void onConnected(Bundle bundle) {
|
||||||
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
Log.e("onConnectdata","true" + ","+mGoogleApiClient);
|
||||||
|
/*if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
// TODO: Consider calling
|
// TODO: Consider calling
|
||||||
// ActivityCompat#requestPermissions
|
// ActivityCompat#requestPermissions
|
||||||
// here to request the missing permissions, and then overriding
|
// here to request the missing permissions, and then overriding
|
||||||
@@ -1142,7 +1221,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
// Toast.makeText(getApplicationContext(), "onconnected lat-" + lat + " Long-" + lon, Toast.LENGTH_SHORT).show();
|
// Toast.makeText(getApplicationContext(), "onconnected lat-" + lat + " Long-" + lon, Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
startLocationUpdates();
|
startLocationUpdates();
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -70,15 +70,10 @@ public class MainActivity extends AppCompatActivity
|
|||||||
String user_name, country_id, user_type;
|
String user_name, country_id, user_type;
|
||||||
ArrayList<StoreBean> storelist = new ArrayList<StoreBean>();
|
ArrayList<StoreBean> storelist = new ArrayList<StoreBean>();
|
||||||
View headerView;
|
View headerView;
|
||||||
|
|
||||||
ArrayList<CoverageBean> coverageList;
|
ArrayList<CoverageBean> coverageList;
|
||||||
|
|
||||||
String error_msg;
|
String error_msg;
|
||||||
|
|
||||||
Toolbar toolbar;
|
Toolbar toolbar;
|
||||||
|
|
||||||
NavigationView navigationView;
|
NavigationView navigationView;
|
||||||
|
|
||||||
private static final int MY_PERMISSIONS_REQUEST_CAMERA = 10;
|
private static final int MY_PERMISSIONS_REQUEST_CAMERA = 10;
|
||||||
private static final int MY_PERMISSIONS_REQUEST_LOCATION = 11;
|
private static final int MY_PERMISSIONS_REQUEST_LOCATION = 11;
|
||||||
private static final int MY_PERMISSIONS_REQUEST_STORAGE_READ = 12;
|
private static final int MY_PERMISSIONS_REQUEST_STORAGE_READ = 12;
|
||||||
@@ -101,6 +96,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
webView = (WebView) findViewById(R.id.webview);
|
webView = (WebView) findViewById(R.id.webview);
|
||||||
|
|
||||||
String url = preferences.getString(CommonString.KEY_NOTICE_BOARD_LINK, "");
|
String url = preferences.getString(CommonString.KEY_NOTICE_BOARD_LINK, "");
|
||||||
|
// String url = "https://dle.parinaam.in/OneApp/Dabur/brand-spiels/dabur-brand-spiels.html";
|
||||||
user_name = preferences.getString(CommonString.KEY_USERNAME, null);
|
user_name = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||||
|
|
||||||
@@ -111,9 +107,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
webView.getSettings().setJavaScriptEnabled(true);
|
webView.getSettings().setJavaScriptEnabled(true);
|
||||||
|
|
||||||
if (!url.equals("")) {
|
if (!url.equals("")) {
|
||||||
|
|
||||||
webView.loadUrl(url);
|
webView.loadUrl(url);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
@@ -158,6 +152,60 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
|
//usk
|
||||||
|
navigationView = (NavigationView) findViewById(R.id.nav_view);
|
||||||
|
// get menu from navigationView
|
||||||
|
Menu menu = navigationView.getMenu();
|
||||||
|
// find MenuItem you want to change
|
||||||
|
MenuItem nav_route_plan = menu.findItem(R.id.nav_route_plan);
|
||||||
|
nav_route_plan.setTitle(getResources().getString(R.string.menu_daily_route_plan));
|
||||||
|
|
||||||
|
MenuItem nav_route_plan1 = menu.findItem(R.id.nav_download);
|
||||||
|
nav_route_plan1.setTitle(getResources().getString(R.string.menu_daily_download));
|
||||||
|
|
||||||
|
MenuItem nav_route_plan2 = menu.findItem(R.id.nav_upload);
|
||||||
|
nav_route_plan2.setTitle(getResources().getString(R.string.menu_upload_data));
|
||||||
|
|
||||||
|
MenuItem nav_route_plan3 = menu.findItem(R.id.nav_geotag);
|
||||||
|
nav_route_plan3.setTitle(getResources().getString(R.string.menu_geotag));
|
||||||
|
|
||||||
|
MenuItem nav_route_plan4 = menu.findItem(R.id.nav_deviation);
|
||||||
|
nav_route_plan4.setTitle(getResources().getString(R.string.menu_deviation_data));
|
||||||
|
|
||||||
|
MenuItem nav_route_plan5 = menu.findItem(R.id.nav_delivery_call);
|
||||||
|
nav_route_plan5.setTitle(getResources().getString(R.string.delivery_call));
|
||||||
|
|
||||||
|
MenuItem nav_route_plan6 = menu.findItem(R.id.nav_future_jcp);
|
||||||
|
nav_route_plan6.setTitle(getResources().getString(R.string.future_route_plan));
|
||||||
|
|
||||||
|
MenuItem nav_route_plan7 = menu.findItem(R.id.nav_planogram);
|
||||||
|
nav_route_plan7.setTitle(getResources().getString(R.string.category_performance_PLANOGRAM));
|
||||||
|
|
||||||
|
MenuItem nav_route_plan8 = menu.findItem(R.id.nav_pharmacy_stores);
|
||||||
|
nav_route_plan8.setTitle(getResources().getString(R.string.pharma_stores));
|
||||||
|
|
||||||
|
MenuItem nav_route_plan9 = menu.findItem(R.id.nav_additional_stores);
|
||||||
|
nav_route_plan9.setTitle(getResources().getString(R.string.additional_stores));
|
||||||
|
|
||||||
|
MenuItem nav_route_plan10 = menu.findItem(R.id.nav_additional_adhoc_stores);
|
||||||
|
nav_route_plan10.setTitle(getResources().getString(R.string.additional_adhoc_stores));
|
||||||
|
|
||||||
|
MenuItem nav_route_plan11 = menu.findItem(R.id.nav_counterfeit_indicator);
|
||||||
|
nav_route_plan11.setTitle(getResources().getString(R.string.title_activity_counterfeit_indicator_web));
|
||||||
|
|
||||||
|
MenuItem nav_route_plan12 = menu.findItem(R.id.nav_exit);
|
||||||
|
nav_route_plan12.setTitle(getResources().getString(R.string.menu_exit));
|
||||||
|
|
||||||
|
MenuItem nav_route_plan13 = menu.findItem(R.id.nav_setting);
|
||||||
|
nav_route_plan13.setTitle(getResources().getString(R.string.menu_setting));
|
||||||
|
|
||||||
|
MenuItem nav_route_plan14 = menu.findItem(R.id.nav_services);
|
||||||
|
nav_route_plan14.setTitle(getResources().getString(R.string.menu_services));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*//Deviation - Ad hoc Stores - enable
|
/*//Deviation - Ad hoc Stores - enable
|
||||||
ArrayList<ConfigurationContrywiseGetterSetter> configuration_data = db.getConfigurationData(country_id);
|
ArrayList<ConfigurationContrywiseGetterSetter> configuration_data = db.getConfigurationData(country_id);
|
||||||
@@ -168,7 +216,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(configuration_data.get(0).getPDF_ALLOW().get(0).equals("1")){
|
if(configuration_data.get(0).getPDF_ALLOW().get(0).equals("1")){
|
||||||
Menu nav_Menu = navigationView.getMenu();
|
Menu nav_Menu = navigatsyncStateionView.getMenu();
|
||||||
nav_Menu.findItem(R.id.nav_planogram).setVisible(true);
|
nav_Menu.findItem(R.id.nav_planogram).setVisible(true);
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
@@ -229,6 +277,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
|
super.onBackPressed();
|
||||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
if (drawer.isDrawerOpen(GravityCompat.START)) {
|
if (drawer.isDrawerOpen(GravityCompat.START)) {
|
||||||
drawer.closeDrawer(GravityCompat.START);
|
drawer.closeDrawer(GravityCompat.START);
|
||||||
@@ -237,27 +286,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
|
||||||
getMenuInflater().inflate(R.menu.main, menu);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
// Handle action bar item clicks here. The action bar will
|
|
||||||
// automatically handle clicks on the Home/Up button, so long
|
|
||||||
// as you specify a parent activity in AndroidManifest.xml.
|
|
||||||
int id = item.getItemId();
|
|
||||||
|
|
||||||
//noinspection SimplifiableIfStatement
|
|
||||||
if (id == R.id.action_settings) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
@SuppressWarnings("StatementWithEmptyBody")
|
@SuppressWarnings("StatementWithEmptyBody")
|
||||||
@Override
|
@Override
|
||||||
@@ -266,7 +295,6 @@ public class MainActivity extends AppCompatActivity
|
|||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
if (id == R.id.nav_route_plan) {
|
if (id == R.id.nav_route_plan) {
|
||||||
|
|
||||||
Intent in_jcp = new Intent(this, StoreListActivity.class);
|
Intent in_jcp = new Intent(this, StoreListActivity.class);
|
||||||
in_jcp.putExtra(CommonString.KEY_STORE_FLAG, CommonString.FROM_JCP);
|
in_jcp.putExtra(CommonString.KEY_STORE_FLAG, CommonString.FROM_JCP);
|
||||||
startActivity(in_jcp);
|
startActivity(in_jcp);
|
||||||
@@ -274,8 +302,8 @@ public class MainActivity extends AppCompatActivity
|
|||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
|
||||||
} else if (id == R.id.nav_download) {
|
} else if (id == R.id.nav_download) {
|
||||||
|
downloadMethod();
|
||||||
checkAppPermission(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA);
|
//checkAppPermission(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA);
|
||||||
|
|
||||||
} else if (id == R.id.nav_upload) {
|
} else if (id == R.id.nav_upload) {
|
||||||
|
|
||||||
@@ -296,13 +324,10 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
Snackbar.make(webView, R.string.title_store_list_download_data, Snackbar.LENGTH_SHORT)
|
Snackbar.make(webView, R.string.title_store_list_download_data, Snackbar.LENGTH_SHORT)
|
||||||
.setAction("Action", null).show();
|
.setAction("Action", null).show();
|
||||||
|
|
||||||
// Toast.makeText(getBaseContext(), "Please Download Data First", Toast.LENGTH_LONG).show();
|
// Toast.makeText(getBaseContext(), "Please Download Data First", Toast.LENGTH_LONG).show();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (coverageList.size() == 0) {
|
if (coverageList.size() == 0) {
|
||||||
Snackbar.make(webView, R.string.no_data_for_upload, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
Snackbar.make(webView, R.string.no_data_for_upload, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (isStoreCheckedIn() && isValid()) {
|
if (isStoreCheckedIn() && isValid()) {
|
||||||
|
|
||||||
@@ -397,7 +422,6 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
} else if (id == R.id.nav_planogram) {
|
} else if (id == R.id.nav_planogram) {
|
||||||
|
|
||||||
if (checkNetIsAvailable()) {
|
if (checkNetIsAvailable()) {
|
||||||
Intent planogram_pdf = new Intent(this, PlanogramPDFActivity.class);
|
Intent planogram_pdf = new Intent(this, PlanogramPDFActivity.class);
|
||||||
startActivity(planogram_pdf);
|
startActivity(planogram_pdf);
|
||||||
@@ -420,13 +444,11 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
// Toast.makeText(getBaseContext(), "Please Download Data First", Toast.LENGTH_LONG).show();
|
// Toast.makeText(getBaseContext(), "Please Download Data First", Toast.LENGTH_LONG).show();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Intent in = new Intent(this, StoreListActivity.class);
|
Intent in = new Intent(this, StoreListActivity.class);
|
||||||
in.putExtra(CommonString.KEY_STORE_FLAG, CommonString.FROM_DEVIATION);
|
in.putExtra(CommonString.KEY_STORE_FLAG, CommonString.FROM_DEVIATION);
|
||||||
|
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
|
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
// overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (id == R.id.nav_delivery_call) {
|
} else if (id == R.id.nav_delivery_call) {
|
||||||
@@ -462,7 +484,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
}
|
}
|
||||||
}else if (id == R.id.nav_additional_adhoc_stores) {
|
} else if (id == R.id.nav_additional_adhoc_stores) {
|
||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
if (db.getSKUMasterData(null).size() == 0) {
|
if (db.getSKUMasterData(null).size() == 0) {
|
||||||
@@ -480,7 +502,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
}
|
}
|
||||||
}else if (id == R.id.nav_counterfeit_indicator) {
|
} else if (id == R.id.nav_counterfeit_indicator) {
|
||||||
|
|
||||||
Intent intent = new Intent(this, CounterfeitIndicatorWebActivity.class);
|
Intent intent = new Intent(this, CounterfeitIndicatorWebActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
@@ -548,7 +570,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
String storestatus="";
|
String storestatus = "";
|
||||||
for (int i = 0; i < coverageList.size(); i++) {
|
for (int i = 0; i < coverageList.size(); i++) {
|
||||||
|
|
||||||
StoreBean store_data = db.getSpecificStoreData(date, coverageList.get(i).getStoreId(), coverageList.get(i).getFlag_from());
|
StoreBean store_data = db.getSpecificStoreData(date, coverageList.get(i).getStoreId(), coverageList.get(i).getFlag_from());
|
||||||
@@ -657,14 +679,14 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
// Create a Folder for Images
|
// Create a Folder for Images
|
||||||
|
|
||||||
File file = new File(Environment.getExternalStorageDirectory(), ".GSK_MT_ORANGE_IMAGES");
|
/*File file = new File(Environment.getExternalStorageDirectory(), ".GSK_MT_ORANGE_IMAGES");
|
||||||
if (!file.isDirectory()) {
|
if (!file.isDirectory()) {
|
||||||
file.mkdir();
|
file.mkdir();
|
||||||
}
|
}
|
||||||
File file_planogram = new File(Environment.getExternalStorageDirectory(), "GSK_MT_ORANGE_Planogram_Images");
|
File file_planogram = new File(Environment.getExternalStorageDirectory(), "GSK_MT_ORANGE_Planogram_Images");
|
||||||
if (!file_planogram.isDirectory()) {
|
if (!file_planogram.isDirectory()) {
|
||||||
file_planogram.mkdir();
|
file_planogram.mkdir();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
downloadMethod();
|
downloadMethod();
|
||||||
}
|
}
|
||||||
@@ -837,7 +859,5 @@ public class MainActivity extends AppCompatActivity
|
|||||||
});
|
});
|
||||||
AlertDialog alert = builder.create();
|
AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package cpm.com.gskmtorange;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
|
|
||||||
|
public class MovableFloatingActionButton extends FloatingActionButton implements View.OnTouchListener {
|
||||||
|
|
||||||
|
private final static float CLICK_DRAG_TOLERANCE = 10; // Often, there will be a slight, unintentional, drag when the user taps the FAB, so we need to account for this.
|
||||||
|
|
||||||
|
private float downRawX, downRawY;
|
||||||
|
private float dX, dY;
|
||||||
|
|
||||||
|
public MovableFloatingActionButton(Context context) {
|
||||||
|
super(context);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MovableFloatingActionButton(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MovableFloatingActionButton(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||||
|
super(context, attrs, defStyleAttr);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
setOnTouchListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onTouch(View view, MotionEvent motionEvent){
|
||||||
|
|
||||||
|
int action = motionEvent.getAction();
|
||||||
|
if (action == MotionEvent.ACTION_DOWN) {
|
||||||
|
|
||||||
|
downRawX = motionEvent.getRawX();
|
||||||
|
downRawY = motionEvent.getRawY();
|
||||||
|
dX = view.getX() - downRawX;
|
||||||
|
dY = view.getY() - downRawY;
|
||||||
|
|
||||||
|
return true; // Consumed
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (action == MotionEvent.ACTION_MOVE) {
|
||||||
|
|
||||||
|
int viewWidth = view.getWidth();
|
||||||
|
int viewHeight = view.getHeight();
|
||||||
|
|
||||||
|
View viewParent = (View)view.getParent();
|
||||||
|
int parentWidth = viewParent.getWidth();
|
||||||
|
int parentHeight = viewParent.getHeight();
|
||||||
|
|
||||||
|
float newX = motionEvent.getRawX() + dX;
|
||||||
|
newX = Math.max(0, newX); // Don't allow the FAB past the left hand side of the parent
|
||||||
|
newX = Math.min(parentWidth - viewWidth, newX); // Don't allow the FAB past the right hand side of the parent
|
||||||
|
|
||||||
|
float newY = motionEvent.getRawY() + dY;
|
||||||
|
newY = Math.max(0, newY); // Don't allow the FAB past the top of the parent
|
||||||
|
newY = Math.min(parentHeight - viewHeight, newY); // Don't allow the FAB past the bottom of the parent
|
||||||
|
|
||||||
|
view.animate()
|
||||||
|
.x(newX)
|
||||||
|
.y(newY)
|
||||||
|
.setDuration(0)
|
||||||
|
.start();
|
||||||
|
|
||||||
|
return true; // Consumed
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (action == MotionEvent.ACTION_UP) {
|
||||||
|
|
||||||
|
float upRawX = motionEvent.getRawX();
|
||||||
|
float upRawY = motionEvent.getRawY();
|
||||||
|
|
||||||
|
float upDX = upRawX - downRawX;
|
||||||
|
float upDY = upRawY - downRawY;
|
||||||
|
|
||||||
|
if (Math.abs(upDX) < CLICK_DRAG_TOLERANCE && Math.abs(upDY) < CLICK_DRAG_TOLERANCE) { // A click
|
||||||
|
return performClick();
|
||||||
|
}
|
||||||
|
else { // A drag
|
||||||
|
return true; // Consumed
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return super.onTouchEvent(motionEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -27,15 +27,12 @@ import cpm.com.gskmtorange.password.MPinActivity;
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
||||||
|
|
||||||
public class SelectLanguageActivity extends AppCompatActivity implements View.OnClickListener {
|
public class SelectLanguageActivity extends AppCompatActivity implements View.OnClickListener {
|
||||||
|
|
||||||
Button btn_lang_1, btn_lang_2;
|
Button btn_lang_1, btn_lang_2;
|
||||||
private Context context;
|
private Context context;
|
||||||
private SharedPreferences preferences = null;
|
private SharedPreferences preferences = null;
|
||||||
private SharedPreferences.Editor editor = null;
|
private SharedPreferences.Editor editor = null;
|
||||||
|
|
||||||
LoginGetterSetter login_data;
|
LoginGetterSetter login_data;
|
||||||
ArrayList<String> language, culture_id;
|
ArrayList<String> language, culture_id;
|
||||||
|
|
||||||
boolean selected_flag = false;
|
boolean selected_flag = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -47,36 +44,26 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
|||||||
context = this;
|
context = this;
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
editor = preferences.edit();
|
editor = preferences.edit();
|
||||||
|
|
||||||
btn_lang_1 = (Button) findViewById(R.id.btn_language_one);
|
btn_lang_1 = (Button) findViewById(R.id.btn_language_one);
|
||||||
btn_lang_2 = (Button) findViewById(R.id.btn_language_two);
|
btn_lang_2 = (Button) findViewById(R.id.btn_language_two);
|
||||||
|
|
||||||
|
|
||||||
login_data = (LoginGetterSetter) getIntent().getSerializableExtra(CommonString.KEY_LOGIN_DATA);
|
login_data = (LoginGetterSetter) getIntent().getSerializableExtra(CommonString.KEY_LOGIN_DATA);
|
||||||
language = login_data.getCULTURE_NAME();
|
language = login_data.getCULTURE_NAME();
|
||||||
culture_id = login_data.getCULTURE_ID();
|
culture_id = login_data.getCULTURE_ID();
|
||||||
|
|
||||||
setDataFromSharedPreferences(login_data);
|
setDataFromSharedPreferences(login_data);
|
||||||
|
|
||||||
if (language.size() > 1) {
|
if (language.size() > 1) {
|
||||||
|
|
||||||
btn_lang_1.setText(language.get(0));
|
btn_lang_1.setText(language.get(0));
|
||||||
btn_lang_2.setText(language.get(1));
|
btn_lang_2.setText(language.get(1));
|
||||||
|
|
||||||
btn_lang_1.setOnClickListener(this);
|
btn_lang_1.setOnClickListener(this);
|
||||||
btn_lang_2.setOnClickListener(this);
|
btn_lang_2.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
fab.setOnClickListener(new View.OnClickListener() {
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
if (selected_flag) {
|
if (selected_flag) {
|
||||||
/* Intent intent = new Intent(getBaseContext(),
|
/* Intent intent = new Intent(getBaseContext(),
|
||||||
MainActivity.class);
|
MainActivity.class);
|
||||||
|
|
||||||
intent.putExtra(CommonString.KEY_LOGIN_DATA, login_data);
|
intent.putExtra(CommonString.KEY_LOGIN_DATA, login_data);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
finish();*/
|
finish();*/
|
||||||
@@ -98,43 +85,37 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
|||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
int id = view.getId();
|
int id = view.getId();
|
||||||
|
|
||||||
switch (id) {
|
if (id == R.id.btn_language_one) {
|
||||||
case R.id.btn_language_one:
|
|
||||||
selected_flag = true;
|
selected_flag = true;
|
||||||
CommonFunctions.updateLangResources(context, language.get(0));
|
CommonFunctions.updateLangResources(context, language.get(0));
|
||||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
|
btn_lang_1.setTextColor(getResources().getColor(R.color.white));
|
||||||
|
btn_lang_2.setTextColor(getResources().getColor(R.color.black));
|
||||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
editor.putString(CommonString.KEY_LANGUAGE, language.get(0));
|
editor.putString(CommonString.KEY_LANGUAGE, language.get(0));
|
||||||
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(0));
|
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(0));
|
||||||
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(0));
|
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(0));
|
||||||
editor.commit();
|
editor.commit();
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.btn_language_two) {
|
||||||
|
|
||||||
case R.id.btn_language_two:
|
|
||||||
|
|
||||||
selected_flag = true;
|
selected_flag = true;
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(context, language.get(1));
|
CommonFunctions.updateLangResources(context, language.get(1));
|
||||||
|
|
||||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
|
btn_lang_1.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
btn_lang_2.setTextColor(getResources().getColor(R.color.white));
|
||||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
|
|
||||||
editor.putString(CommonString.KEY_LANGUAGE, language.get(1));
|
editor.putString(CommonString.KEY_LANGUAGE, language.get(1));
|
||||||
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(1));
|
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(1));
|
||||||
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(1));
|
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(1));
|
||||||
editor.commit();
|
editor.commit();
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
|
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
String jsonCurProduct = gson.toJson(lgs);
|
String jsonCurProduct = gson.toJson(lgs);
|
||||||
SharedPreferences.Editor editor = preferences.edit();
|
SharedPreferences.Editor editor = preferences.edit();
|
||||||
|
|
||||||
editor.putString(CommonString.KEY_LOOGIN_PREF, jsonCurProduct);
|
editor.putString(CommonString.KEY_LOOGIN_PREF, jsonCurProduct);
|
||||||
editor.commit();
|
editor.commit();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,18 @@
|
|||||||
package cpm.com.gskmtorange;
|
package cpm.com.gskmtorange;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.PixelFormat;
|
import android.graphics.PixelFormat;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
|
import android.view.WindowManager;
|
||||||
import android.view.animation.Animation;
|
import android.view.animation.Animation;
|
||||||
import android.view.animation.AnimationUtils;
|
import android.view.animation.AnimationUtils;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
@@ -36,21 +40,25 @@ public class SplashScreenActivity extends AppCompatActivity {
|
|||||||
Window window = getWindow();
|
Window window = getWindow();
|
||||||
window.setFormat(PixelFormat.RGBA_8888);
|
window.setFormat(PixelFormat.RGBA_8888);
|
||||||
}
|
}
|
||||||
/** Called when the activity is first created. */
|
|
||||||
|
/**
|
||||||
|
* Called when the activity is first created.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||||
setContentView(R.layout.activity_splash_main_layout);
|
setContentView(R.layout.activity_splash_main_layout);
|
||||||
|
|
||||||
linearLayout = findViewById(R.id.lin_lay);
|
linearLayout = findViewById(R.id.lin_lay);
|
||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
context = this;
|
context = this;
|
||||||
StartAnimations();
|
//StartAnimations();
|
||||||
|
|
||||||
sendToLogin();
|
sendToLogin();
|
||||||
|
|
||||||
/* File f = new File(CommonString.FILE_PATH_OLD);
|
/* File f = new File(CommonString.getImagesFolder(context)_OLD);
|
||||||
if(f!=null){
|
if(f!=null){
|
||||||
File file[] = f.listFiles();
|
File file[] = f.listFiles();
|
||||||
if(file!=null){
|
if(file!=null){
|
||||||
@@ -83,7 +91,7 @@ public class SplashScreenActivity extends AppCompatActivity {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
private void StartAnimations() {
|
/* private void StartAnimations() {
|
||||||
Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);
|
Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);
|
||||||
anim.reset();
|
anim.reset();
|
||||||
LinearLayout l=(LinearLayout) findViewById(R.id.lin_lay);
|
LinearLayout l=(LinearLayout) findViewById(R.id.lin_lay);
|
||||||
@@ -96,9 +104,9 @@ public class SplashScreenActivity extends AppCompatActivity {
|
|||||||
iv.clearAnimation();
|
iv.clearAnimation();
|
||||||
iv.startAnimation(anim);
|
iv.startAnimation(anim);
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
|
||||||
public void sendToLogin(){
|
public void sendToLogin() {
|
||||||
new Handler().postDelayed(new Runnable() {
|
new Handler().postDelayed(new Runnable() {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -108,43 +116,14 @@ public class SplashScreenActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
// This method will be executed once the timer is over
|
|
||||||
// Start your app main activity
|
|
||||||
|
|
||||||
/* SharedPreferences sharedpreferences = getSharedPreferences("MyPref", Context.MODE_PRIVATE);
|
|
||||||
|
|
||||||
boolean isLoggedIn = sharedpreferences.getBoolean("isLoggedIn", false);
|
|
||||||
|
|
||||||
if (isLoggedIn) {
|
|
||||||
|
|
||||||
Intent i = new Intent(SplashScreenActivity.this, LoginActivity.class);
|
|
||||||
startActivity(i);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
Intent i = new Intent(SplashScreenActivity.this, LoginActivity.class);
|
|
||||||
startActivity(i);
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// close this activity
|
|
||||||
//before MPin
|
|
||||||
/* Intent i = new Intent(SplashScreenActivity.this, LoginActivity.class);
|
|
||||||
startActivity(i);
|
|
||||||
|
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
|
||||||
|
|
||||||
finish();*/
|
|
||||||
|
|
||||||
//after Mpin
|
//after Mpin
|
||||||
String mpin = preferences.getString(CommonString.MPIN, null);
|
String mpin = preferences.getString(CommonString.MPIN, null);
|
||||||
if(mpin!=null){
|
if (mpin != null) {
|
||||||
Intent in = new Intent(context, MPinActivity.class);
|
Intent in = new Intent(context, MPinActivity.class);
|
||||||
in.putExtra(CommonString.IS_PASSWORD_CHECK, true);
|
in.putExtra(CommonString.IS_PASSWORD_CHECK, true);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Intent i = new Intent(context, LoginActivity.class);
|
Intent i = new Intent(context, LoginActivity.class);
|
||||||
startActivity(i);
|
startActivity(i);
|
||||||
finish();
|
finish();
|
||||||
@@ -156,7 +135,7 @@ public class SplashScreenActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
public static String getCalculatedDate(String date, String dateFormat, int days) {
|
public static String getCalculatedDate(String date, String dateFormat, int days) {
|
||||||
Calendar cal = Calendar.getInstance();
|
Calendar cal = Calendar.getInstance();
|
||||||
SimpleDateFormat s = new SimpleDateFormat(dateFormat);
|
@SuppressLint("SimpleDateFormat") SimpleDateFormat s = new SimpleDateFormat(dateFormat);
|
||||||
cal.add(Calendar.DAY_OF_YEAR, days);
|
cal.add(Calendar.DAY_OF_YEAR, days);
|
||||||
try {
|
try {
|
||||||
return s.format(new Date(s.parse(date).getTime()));
|
return s.format(new Date(s.parse(date).getTime()));
|
||||||
@@ -167,14 +146,4 @@ public class SplashScreenActivity extends AppCompatActivity {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* public boolean isValidDateForUpload(String dateImg){
|
|
||||||
boolean flag=false;
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
|
|
||||||
Date strDate = sdf.parse(valid_until);
|
|
||||||
if (System.currentTimeMillis() > strDate.getTime()) {
|
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return flag;
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import android.os.Build;
|
|||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@@ -44,12 +45,9 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
|||||||
private ProgressBar pb;
|
private ProgressBar pb;
|
||||||
private TextView percentage, message;
|
private TextView percentage, message;
|
||||||
private Data data;
|
private Data data;
|
||||||
|
|
||||||
String path = "", p, s;
|
String path = "", p, s;
|
||||||
|
|
||||||
ProgressBar progressBar;
|
ProgressBar progressBar;
|
||||||
private boolean status;
|
private boolean status;
|
||||||
|
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -144,11 +142,13 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
|||||||
String size = new DecimalFormat("##.##")
|
String size = new DecimalFormat("##.##")
|
||||||
.format((double) ((double) length / 1024) / 1024)
|
.format((double) ((double) length / 1024) / 1024)
|
||||||
+ " MB";
|
+ " MB";
|
||||||
|
Log.e("appsize",size);
|
||||||
|
|
||||||
String PATH = Environment.getExternalStorageDirectory()
|
/*String PATH = Environment.getExternalStorageDirectory()
|
||||||
+ "/download/";
|
+ "/download/";*/
|
||||||
|
String PATH = CommonString.getApkFolder(context);
|
||||||
File file = new File(PATH);
|
File file = new File(PATH);
|
||||||
file.mkdirs();
|
// file.mkdirs();
|
||||||
File outputFile = new File(file, "app.apk");
|
File outputFile = new File(file, "app.apk");
|
||||||
FileOutputStream fos = new FileOutputStream(outputFile);
|
FileOutputStream fos = new FileOutputStream(outputFile);
|
||||||
|
|
||||||
@@ -187,7 +187,6 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
|||||||
AutoUpdateActivity.this,
|
AutoUpdateActivity.this,
|
||||||
AlertMessage.MESSAGE_EXCEPTION, "download", e);*/
|
AlertMessage.MESSAGE_EXCEPTION, "download", e);*/
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
@@ -196,9 +195,6 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
|
|
||||||
/* final AlertMessage message = new AlertMessage(
|
|
||||||
AutoUpdateActivity.this,
|
|
||||||
AlertMessage.MESSAGE_EXCEPTION, "download", e);*/
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -209,9 +205,6 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
/* final AlertMessage message = new AlertMessage(
|
|
||||||
AutoUpdateActivity.this,
|
|
||||||
AlertMessage.MESSAGE_SOCKETEXCEPTION, "update", e);*/
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -221,9 +214,6 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
/* final AlertMessage message = new AlertMessage(
|
|
||||||
AutoUpdateActivity.this,
|
|
||||||
AlertMessage.MESSAGE_EXCEPTION, "download", e);*/
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -255,9 +245,7 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (result.equals(CommonString.KEY_SUCCESS)) {
|
if (result.equals(CommonString.KEY_SUCCESS)) {
|
||||||
|
|
||||||
File toInstall = new File(Environment.getExternalStorageDirectory()
|
File toInstall = new File(CommonString.getApkFolder(context) + "app.apk");
|
||||||
+ "/download/"
|
|
||||||
+ "app.apk");
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
Uri apkUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", toInstall);
|
Uri apkUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", toInstall);
|
||||||
@@ -292,17 +280,10 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
|||||||
builder.setMessage(str).setCancelable(false)
|
builder.setMessage(str).setCancelable(false)
|
||||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
/* Intent i = new Intent(activity, StorelistActivity.class);
|
|
||||||
activity.startActivity(i);
|
|
||||||
activity.finish();*/
|
|
||||||
finish();
|
finish();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
AlertDialog alert = builder.create();
|
AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,9 +12,11 @@ import android.preference.PreferenceManager;
|
|||||||
import android.view.ViewTreeObserver;
|
import android.view.ViewTreeObserver;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
@@ -25,9 +27,7 @@ import cpm.com.gskmtorange.interfaces.DialogCallbackListener;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public class CommonFunctions {
|
public class CommonFunctions {
|
||||||
|
|
||||||
public static boolean updateLangResources(Context context, String language) {
|
public static boolean updateLangResources(Context context, String language) {
|
||||||
|
|
||||||
String lang;
|
String lang;
|
||||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
||||||
@@ -37,40 +37,60 @@ public class CommonFunctions {
|
|||||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
lang = CommonString.KEY_RETURE_LANGUAGE_UAE_ARABIC;
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
||||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_EGYPT)) {
|
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_EGYPT)) {
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_EGYPT;
|
lang = CommonString.KEY_RETURN_LANGUAGE_EGYPT;
|
||||||
}else{
|
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||||
|
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
||||||
|
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KUWAIT)) {
|
||||||
|
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
||||||
|
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_BAHRAIN)) {
|
||||||
|
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
||||||
|
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_OMAN)) {
|
||||||
|
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
||||||
|
}
|
||||||
|
else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_QATAR)) {
|
||||||
|
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
||||||
|
}
|
||||||
|
else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LIBIYA)) {
|
||||||
|
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
||||||
|
}
|
||||||
|
else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LEBANON)) {
|
||||||
|
lang = CommonString.KEY_RETURE_LANGUAGE_ARABIC_KSA;
|
||||||
|
}
|
||||||
|
else {
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
Locale locale = new Locale(lang);
|
Locale locale = new Locale(lang);
|
||||||
Locale.setDefault(locale);
|
Locale.setDefault(locale);
|
||||||
|
|
||||||
Resources resources = context.getResources();
|
Resources resources = context.getResources();
|
||||||
|
|
||||||
Configuration configuration = resources.getConfiguration();
|
Configuration configuration = resources.getConfiguration();
|
||||||
configuration.locale = locale;
|
configuration.locale = locale;
|
||||||
|
|
||||||
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
|
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getCurrentTimeWithLanguage(Context context) {
|
public static String getCurrentTimeWithLanguage(Context context) {
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
String cdate = formatter.format(m_cal.getTime());
|
String cdate = formatter.format(m_cal.getTime());
|
||||||
SharedPreferences preferences = preferences = PreferenceManager.getDefaultSharedPreferences(context);;
|
//SharedPreferences preferences = preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)
|
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)
|
||||||
|
////aDDED NEW COUNTRY FOR TIME BY JP
|
||||||
|
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KUWAIT)
|
||||||
|
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_BAHRAIN)
|
||||||
|
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_OMAN)
|
||||||
|
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_QATAR)
|
||||||
|
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LEBANON)
|
||||||
|
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LIBIYA)
|
||||||
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)
|
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)
|
||||||
|
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)
|
||||||
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_EGYPT)) {
|
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_EGYPT)) {
|
||||||
cdate = arabicToenglish(cdate);
|
cdate = arabicToenglish(cdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cdate;
|
return cdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,6 +107,25 @@ public class CommonFunctions {
|
|||||||
return new String(chars);
|
return new String(chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* private static String arabicToenglish(String number) {
|
||||||
|
String abc ="";
|
||||||
|
try {
|
||||||
|
abc = new String(number.getBytes("UTF-8"), "UTF-8");
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
char[] chars = new char[abc.length()];
|
||||||
|
for (int i = 0; i < abc.length(); i++) {
|
||||||
|
char ch = abc.charAt(i);
|
||||||
|
if (ch >= 0x0660 && ch <= 0x0669)
|
||||||
|
ch -= 0x0660 - '0';
|
||||||
|
else if (ch >= 0x06f0 && ch <= 0x06F9)
|
||||||
|
ch -= 0x06f0 - '0';
|
||||||
|
chars[i] = ch;
|
||||||
|
}
|
||||||
|
return new String(chars);
|
||||||
|
}*/
|
||||||
|
|
||||||
public static void setScaledImage(ImageView imageView, final String path) {
|
public static void setScaledImage(ImageView imageView, final String path) {
|
||||||
final ImageView iv = imageView;
|
final ImageView iv = imageView;
|
||||||
ViewTreeObserver viewTreeObserver = iv.getViewTreeObserver();
|
ViewTreeObserver viewTreeObserver = iv.getViewTreeObserver();
|
||||||
@@ -101,8 +140,7 @@ public class CommonFunctions {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Bitmap decodeSampledBitmapFromPath(String path,
|
private static Bitmap decodeSampledBitmapFromPath(String path, int reqWidth, int reqHeight) {
|
||||||
int reqWidth, int reqHeight) {
|
|
||||||
// First decode with inJustDecodeBounds = true to check dimensions
|
// First decode with inJustDecodeBounds = true to check dimensions
|
||||||
final BitmapFactory.Options options = new BitmapFactory.Options();
|
final BitmapFactory.Options options = new BitmapFactory.Options();
|
||||||
options.inJustDecodeBounds = true;
|
options.inJustDecodeBounds = true;
|
||||||
@@ -136,7 +174,7 @@ public class CommonFunctions {
|
|||||||
return inSampleSize;
|
return inSampleSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showAlertDialog(final Context context, String msg){
|
public static void showAlertDialog(final Context context, String msg) {
|
||||||
|
|
||||||
final DialogCallbackListener[] mListener = new DialogCallbackListener[1];
|
final DialogCallbackListener[] mListener = new DialogCallbackListener[1];
|
||||||
|
|
||||||
@@ -171,12 +209,9 @@ public class CommonFunctions {
|
|||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// create alert dialog
|
// create alert dialog
|
||||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||||
|
|
||||||
// show it
|
// show it
|
||||||
alertDialog.show();
|
alertDialog.show();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,18 @@
|
|||||||
package cpm.com.gskmtorange.constant;
|
package cpm.com.gskmtorange.constant;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.AppUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by yadavendras on 19-12-2016.
|
* Created by yadavendras on 19-12-2016.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class CommonString {
|
public class CommonString {
|
||||||
|
public static final String BACKUP_PATH = Environment.getExternalStorageDirectory().getPath() + "/gsk_orange_backup";
|
||||||
public static final String BACKUP_PATH = Environment.getExternalStorageDirectory().getPath()+ "/gsk_orange_backup";
|
|
||||||
// String path = Environment.getExternalStorageDirectory().getPath()+ "/gsk_orange_backup";
|
|
||||||
|
|
||||||
// webservice constants
|
// webservice constants
|
||||||
|
|
||||||
// preferenec keys
|
// preferenec keys
|
||||||
|
public static final String PD_PROJECT_iD = "4f57635b-6b07-45bf-bfba-c61c2826b6db";
|
||||||
public static final String KEY_USERNAME = "username";
|
public static final String KEY_USERNAME = "username";
|
||||||
public static final String KEY_PASSWORD = "password";
|
public static final String KEY_PASSWORD = "password";
|
||||||
public static final String KEY_DATE = "date";
|
public static final String KEY_DATE = "date";
|
||||||
@@ -69,6 +68,7 @@ public class CommonString {
|
|||||||
|
|
||||||
public static final String KEY_LOGIN_DONE = "IS_LOGGED_IN";
|
public static final String KEY_LOGIN_DONE = "IS_LOGGED_IN";
|
||||||
public static final String KEY_DOWNLOAD_DONE = "IS_DOWNLOAD_DONE";
|
public static final String KEY_DOWNLOAD_DONE = "IS_DOWNLOAD_DONE";
|
||||||
|
public static final String KEY_STOCK_MAPPING = "STOCK_MAPPING";
|
||||||
|
|
||||||
//KEYS RELATED TO T2P COMPLIANCE
|
//KEYS RELATED TO T2P COMPLIANCE
|
||||||
|
|
||||||
@@ -111,7 +111,6 @@ public class CommonString {
|
|||||||
public static final String FROM_ADDITIONAL_ADHOC = "ADDITIONAL_ADHOC";
|
public static final String FROM_ADDITIONAL_ADHOC = "ADDITIONAL_ADHOC";
|
||||||
public static final String TABLE_INSERT_STOCK_DIALOG = "STOCK_DIALOG";
|
public static final String TABLE_INSERT_STOCK_DIALOG = "STOCK_DIALOG";
|
||||||
|
|
||||||
|
|
||||||
public static final String KEY_P = "P";
|
public static final String KEY_P = "P";
|
||||||
public static final String KEY_D = "D";
|
public static final String KEY_D = "D";
|
||||||
public static final String KEY_U = "U";
|
public static final String KEY_U = "U";
|
||||||
@@ -136,8 +135,8 @@ public class CommonString {
|
|||||||
public static final String KEY_SUB_CATEGORY = "SUB_CATEGORY";
|
public static final String KEY_SUB_CATEGORY = "SUB_CATEGORY";
|
||||||
public static final String KEY_SUB_CATEGORY_ID = "SUB_CATEGORY_ID";
|
public static final String KEY_SUB_CATEGORY_ID = "SUB_CATEGORY_ID";
|
||||||
public static final String KEY_FROM = "FROM";
|
public static final String KEY_FROM = "FROM";
|
||||||
public static final String KEY_CHAT_ID= "CHAT_ID";
|
public static final String KEY_CHAT_ID = "CHAT_ID";
|
||||||
public static final String KEY_MESSAGE= "MESSAGE";
|
public static final String KEY_MESSAGE = "MESSAGE";
|
||||||
|
|
||||||
public static final String KEY_NO_DATA = "NODATA";
|
public static final String KEY_NO_DATA = "NODATA";
|
||||||
|
|
||||||
@@ -146,11 +145,15 @@ public class CommonString {
|
|||||||
public static final int UNIT_VERTICAL = 50;
|
public static final int UNIT_VERTICAL = 50;
|
||||||
public static final int UNIT_HORIZONTAL = 200;
|
public static final int UNIT_HORIZONTAL = 200;
|
||||||
|
|
||||||
public static String URL = "http://gskme.parinaam.in/Gskwebservice.asmx";
|
// public static String URL = "http://gskme.parinaam.in/Gskwebservice.asmx";
|
||||||
|
public static String URL = "https://haleonme.parinaam.in/Gskwebservice.asmx";
|
||||||
//temp remove
|
// public static String URL = "https://gskme1.parinaam.in/Gskwebservice.asmx";
|
||||||
//public static String URL = "http://gskmetest.parinaam.in/Gskwebservice.asmx";
|
//Added new Test url for Turkey
|
||||||
|
// public static String URL = "http://gskmetest.parinaam.in/Gskwebservice.asmx";
|
||||||
|
|
||||||
|
// public static String URL = "https://haleonme.parinaam.in/Gskwebservice.asmx";
|
||||||
|
//public static String URL = " https://gskme1.parinaam.in/Gskwebservice.asmx";
|
||||||
|
//public static String URL = "https://gskme-test.parinaam.in/Gskwebservice.asmx";
|
||||||
|
|
||||||
public static final String NAMESPACE = "http://tempuri.org/";
|
public static final String NAMESPACE = "http://tempuri.org/";
|
||||||
public static final String METHOD_LOGIN = "UserLoginDetail";
|
public static final String METHOD_LOGIN = "UserLoginDetail";
|
||||||
@@ -200,6 +203,7 @@ public class CommonString {
|
|||||||
public static final String METHOD_UPLOAD_COVERAGE_STATUS_PHARMA = "UploadCoverage_Status_Pharma";
|
public static final String METHOD_UPLOAD_COVERAGE_STATUS_PHARMA = "UploadCoverage_Status_Pharma";
|
||||||
|
|
||||||
public static final String SOAP_ACTION = "http://tempuri.org/";
|
public static final String SOAP_ACTION = "http://tempuri.org/";
|
||||||
|
public static final String TABLE_INSERT_STOCK = "Stock_Data";
|
||||||
|
|
||||||
public static final String SOAP_ACTION_UPLOAD_STORE_COVERAGE = "http://tempuri.org/"
|
public static final String SOAP_ACTION_UPLOAD_STORE_COVERAGE = "http://tempuri.org/"
|
||||||
+ METHOD_UPLOAD_COVERAGE;
|
+ METHOD_UPLOAD_COVERAGE;
|
||||||
@@ -246,7 +250,11 @@ public class CommonString {
|
|||||||
+ KEY_COVERAGE_REMARK + " VARCHAR,"
|
+ KEY_COVERAGE_REMARK + " VARCHAR,"
|
||||||
+ KEY_CHECKOUT_IMAGE + " VARCHAR,"
|
+ KEY_CHECKOUT_IMAGE + " VARCHAR,"
|
||||||
+ KEY_STORE_FLAG + " VARCHAR,"
|
+ KEY_STORE_FLAG + " VARCHAR,"
|
||||||
+ KEY_REASON + " VARCHAR)";
|
+ KEY_KEYACCOUNT_ID + " INTEGER,"
|
||||||
|
+ KEY_STORETYPE_ID + " INTEGER,"
|
||||||
|
+ KEY_CLASS_ID + " INTEGER,"
|
||||||
|
+ KEY_REASON + " VARCHAR,"
|
||||||
|
+ KEY_STOCK_MAPPING + " VARCHAR)";
|
||||||
|
|
||||||
|
|
||||||
public static final String TABLE_COACHING_VISIT = "COACHING_VISIT";
|
public static final String TABLE_COACHING_VISIT = "COACHING_VISIT";
|
||||||
@@ -266,10 +274,10 @@ public class CommonString {
|
|||||||
|
|
||||||
public static final String KEY_ADDRESS = "ADDRESS";
|
public static final String KEY_ADDRESS = "ADDRESS";
|
||||||
|
|
||||||
public static final String CREATE_TABLE_DELIVERY_CALLS= "CREATE TABLE IF NOT EXISTS " + TABLE_DELIVERY_CALLS
|
public static final String CREATE_TABLE_DELIVERY_CALLS = "CREATE TABLE IF NOT EXISTS " + TABLE_DELIVERY_CALLS
|
||||||
+ " ("
|
+ " ("
|
||||||
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||||
+ KEY_STORE_NAME+ " NVARCHAR,"
|
+ KEY_STORE_NAME + " NVARCHAR,"
|
||||||
+ KEY_ADDRESS + " VARCHAR,"
|
+ KEY_ADDRESS + " VARCHAR,"
|
||||||
+ KEY_IMAGE + " VARCHAR,"
|
+ KEY_IMAGE + " VARCHAR,"
|
||||||
+ KEY_IMAGE1 + " VARCHAR,"
|
+ KEY_IMAGE1 + " VARCHAR,"
|
||||||
@@ -933,16 +941,27 @@ public class CommonString {
|
|||||||
|
|
||||||
public static final String KEY_LANGUAGE_TURKISH = "TURKISH";
|
public static final String KEY_LANGUAGE_TURKISH = "TURKISH";
|
||||||
public static final String KEY_RETURE_LANGUAGE_TURKISH = "TR";
|
public static final String KEY_RETURE_LANGUAGE_TURKISH = "TR";
|
||||||
|
public static final String KEY_LANGUAGE_ARABIC_KUWAIT = "ARABIC-KUWAIT";
|
||||||
|
public static final String KEY_LANGUAGE_ARABIC_BAHRAIN = "ARABIC-BAHRAIN";
|
||||||
|
public static final String KEY_LANGUAGE_ARABIC_OMAN = "ARABIC-OMAN";
|
||||||
|
public static final String KEY_LANGUAGE_ARABIC_QATAR = "ARABIC-QATAR";
|
||||||
|
public static final String KEY_LANGUAGE_ARABIC_LEBANON = "ARABIC-LEBANON";
|
||||||
|
public static final String KEY_LANGUAGE_ARABIC_LIBIYA = "ARABIC-LIBYA";
|
||||||
public static final String KEY_LANGUAGE_OMAN = "English";
|
public static final String KEY_LANGUAGE_OMAN = "English";
|
||||||
public static final String KEY_RETURE_LANGUAGE_OMAN = "EN";
|
public static final String KEY_RETURE_LANGUAGE_OMAN = "EN";
|
||||||
|
|
||||||
public static final String KEY_RETURN_LANGUAGE_EGYPT = "AR";
|
public static final String KEY_RETURN_LANGUAGE_EGYPT = "AR";
|
||||||
public static final String KEY_LANGUAGE_ARABIC_UAE = "ARABIC-UAE";
|
public static final String KEY_LANGUAGE_ARABIC_UAE = "ARABIC-UAE";
|
||||||
public static final String KEY_LANGUAGE_ARABIC_EGYPT = "ARABIC-EGYPT";
|
public static final String KEY_LANGUAGE_ARABIC_EGYPT = "ARABIC-EGYPT";
|
||||||
|
public static final String KEY_LANGUAGE_ARABIC_JORDAN = "ARABIC-JORDAN";
|
||||||
public static final String KEY_RETURE_LANGUAGE_UAE_ARABIC = "AR";
|
public static final String KEY_RETURE_LANGUAGE_UAE_ARABIC = "AR";
|
||||||
|
|
||||||
public static final String TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING = "Msl_Availability_Stock_Facing_Data";
|
public static final String TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING = "Msl_Availability_Stock_Facing_Data";
|
||||||
|
public static final String TABLE_INSERT_STOCK_ENTRY = "STOCK_ENTRY";
|
||||||
|
public static final String TABLE_INSERT_ORDER_TAKING_DATA = "ORDER_TAKING_DATA";
|
||||||
|
public static final String TABLE_INSERT_ORDER_RECEIVED_DATA = "ORDER_RECEIVED_STATUS_DATA";
|
||||||
|
public static final String POSM_STOCK = "POSM_STOCK";
|
||||||
|
public static final String WAREHOUSE_STOCK = "WAREHOUSE_STOCK";
|
||||||
|
|
||||||
public static final String TABLE_INSERT_NO_CAMERA_FACING_DATA = "NO_CAMERA_FACING_DATA";
|
public static final String TABLE_INSERT_NO_CAMERA_FACING_DATA = "NO_CAMERA_FACING_DATA";
|
||||||
|
|
||||||
@@ -952,48 +971,78 @@ public class CommonString {
|
|||||||
+ "KEY_ID"
|
+ "KEY_ID"
|
||||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||||
|
|
||||||
|
+ KEY_VISIT_DATE
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
+ "Store_Id"
|
+ "Store_Id"
|
||||||
+ " INTEGER,"
|
+ " INTEGER,"
|
||||||
|
|
||||||
+ "Category_Id"
|
+ "Category_Id"
|
||||||
+ " INTEGER,"
|
+ " INTEGER,"
|
||||||
|
|
||||||
+ "Brand_Id"
|
+ "Brand_Id"
|
||||||
+ " VARCHAR,"
|
+ " VARCHAR,"
|
||||||
|
|
||||||
+ "SKU_ID"
|
+ "SKU_ID"
|
||||||
+ " INTEGER,"
|
+ " INTEGER,"
|
||||||
|
|
||||||
+ "SKU"
|
+ "SKU"
|
||||||
+ " VARCHAR,"
|
+ " VARCHAR,"
|
||||||
|
|
||||||
+ "SKU_SEQUENCE"
|
+ "SKU_SEQUENCE"
|
||||||
+ " VARCHAR,"
|
+ " VARCHAR,"
|
||||||
|
|
||||||
+ "MBQ"
|
+ "MBQ"
|
||||||
+ " VARCHAR,"
|
+ " VARCHAR,"
|
||||||
|
|
||||||
+ "COMPANY_ID"
|
+ "COMPANY_ID"
|
||||||
+ " INTEGER,"
|
+ " INTEGER,"
|
||||||
|
|
||||||
+ "FACING"
|
+ "FACING"
|
||||||
+ " REAL,"
|
+ " REAL,"
|
||||||
|
|
||||||
+ "STOCK"
|
+ "STOCK"
|
||||||
+ " INTEGER,"
|
+ " INTEGER,"
|
||||||
|
|
||||||
+ "PRICING"
|
+ "PRICING"
|
||||||
+ " INTEGER,"
|
+ " INTEGER,"
|
||||||
|
|
||||||
+ "PRICING_DEFAULT"
|
+ "PRICING_DEFAULT"
|
||||||
+ " VARCHAR,"
|
+ " VARCHAR,"
|
||||||
|
|
||||||
+ "TOGGLE_VALUE"
|
+ "TOGGLE_VALUE"
|
||||||
+ " VARCHAR,"
|
+ " VARCHAR,"
|
||||||
|
|
||||||
+ "MUST_HAVE"
|
+ "MUST_HAVE"
|
||||||
+ " VARCHAR"
|
+ " VARCHAR"
|
||||||
|
+ ")";
|
||||||
|
|
||||||
|
public static final String CREATE_TABLE_INSERT_STOCK = "CREATE TABLE IF NOT EXISTS "
|
||||||
|
+ TABLE_INSERT_STOCK
|
||||||
|
+ "("
|
||||||
|
+ "KEY_ID"
|
||||||
|
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||||
|
|
||||||
|
+ KEY_VISIT_DATE
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "Store_Id"
|
||||||
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ "Category_Id"
|
||||||
|
+ " INTEGER,"
|
||||||
|
+ "Brand_Id"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ "SKU_ID"
|
||||||
|
+ " INTEGER,"
|
||||||
|
+ "SKU"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ "SKU_SEQUENCE"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ "MBQ"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ "COMPANY_ID"
|
||||||
|
+ " INTEGER,"
|
||||||
|
+ "FACING"
|
||||||
|
+ " REAL,"
|
||||||
|
+ "STOCK"
|
||||||
|
+ " INTEGER,"
|
||||||
|
+ "PRICING"
|
||||||
|
+ " INTEGER,"
|
||||||
|
+ "PRICING_DEFAULT"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ "TOGGLE_VALUE"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ "MUST_HAVE"
|
||||||
|
+ " VARCHAR"
|
||||||
+ ")";
|
+ ")";
|
||||||
|
|
||||||
public static final String KEY_ROW_NO = "ROW_NO";
|
public static final String KEY_ROW_NO = "ROW_NO";
|
||||||
@@ -1057,7 +1106,10 @@ public class CommonString {
|
|||||||
+ " VARCHAR,"
|
+ " VARCHAR,"
|
||||||
|
|
||||||
+ "REMARK"
|
+ "REMARK"
|
||||||
+ " VARCHAR"
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "MAX_LENGHT"
|
||||||
|
+ " INTEGER"
|
||||||
|
|
||||||
+ ")";
|
+ ")";
|
||||||
|
|
||||||
@@ -1186,14 +1238,17 @@ public class CommonString {
|
|||||||
|
|
||||||
+ ")";
|
+ ")";
|
||||||
|
|
||||||
public static final String TABLE_INSERT_STOCK = "Stock_Data";
|
|
||||||
|
|
||||||
public static final String CREATE_TABLE_INSERT_STOCK = "CREATE TABLE IF NOT EXISTS "
|
|
||||||
+ TABLE_INSERT_STOCK
|
public static final String CREATE_TABLE_INSERT_STOCK_ENTRY = "CREATE TABLE IF NOT EXISTS "
|
||||||
|
+ TABLE_INSERT_STOCK_ENTRY
|
||||||
+ "("
|
+ "("
|
||||||
+ "KEY_ID"
|
+ "KEY_ID"
|
||||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||||
|
|
||||||
|
+ KEY_VISIT_DATE
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
+ "Store_Id"
|
+ "Store_Id"
|
||||||
+ " INTEGER,"
|
+ " INTEGER,"
|
||||||
|
|
||||||
@@ -1218,15 +1273,29 @@ public class CommonString {
|
|||||||
+ "COMPANY_ID"
|
+ "COMPANY_ID"
|
||||||
+ " INTEGER,"
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ "FACING"
|
||||||
|
+ " REAL,"
|
||||||
|
|
||||||
+ "STOCK"
|
+ "STOCK"
|
||||||
+ " INTEGER,"
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ "PRICING"
|
||||||
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ "PRICING_DEFAULT"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ POSM_STOCK
|
||||||
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ WAREHOUSE_STOCK
|
||||||
|
+ " INTEGER,"
|
||||||
|
|
||||||
+ "TOGGLE_VALUE"
|
+ "TOGGLE_VALUE"
|
||||||
+ " VARCHAR,"
|
+ " VARCHAR,"
|
||||||
|
|
||||||
+ "MUST_HAVE"
|
+ "MUST_HAVE"
|
||||||
+ " VARCHAR"
|
+ " VARCHAR"
|
||||||
|
|
||||||
+ ")";
|
+ ")";
|
||||||
|
|
||||||
public static final String TABLE_INSERT_STORE_PROFILE_DATA = "Store_Profile_Data";
|
public static final String TABLE_INSERT_STORE_PROFILE_DATA = "Store_Profile_Data";
|
||||||
@@ -1258,7 +1327,7 @@ public class CommonString {
|
|||||||
+ KEY_IMAGE4 + " INTEGER)";
|
+ KEY_IMAGE4 + " INTEGER)";
|
||||||
|
|
||||||
public static final String TABLE_INSERT_SOS_PHARMA_DATA = "SOS_PHARMA_DATA";
|
public static final String TABLE_INSERT_SOS_PHARMA_DATA = "SOS_PHARMA_DATA";
|
||||||
public static final String KEY_GSK_FACING= "GSK_FACING";
|
public static final String KEY_GSK_FACING = "GSK_FACING";
|
||||||
public static final String KEY_COMPETITION_FACING = "COMPETITION_FACING";
|
public static final String KEY_COMPETITION_FACING = "COMPETITION_FACING";
|
||||||
|
|
||||||
public static final String CREATE_TABLE_INSERT_SOS_PHARMA_DATA = "CREATE TABLE IF NOT EXISTS " + TABLE_INSERT_SOS_PHARMA_DATA
|
public static final String CREATE_TABLE_INSERT_SOS_PHARMA_DATA = "CREATE TABLE IF NOT EXISTS " + TABLE_INSERT_SOS_PHARMA_DATA
|
||||||
@@ -1352,4 +1421,139 @@ public class CommonString {
|
|||||||
|
|
||||||
+ ")";
|
+ ")";
|
||||||
|
|
||||||
|
public static final String TABLE_COACHING_VISIT_STORE = "COACHING_VISIT_STORE";
|
||||||
|
|
||||||
|
public static final String CREATE_TABLE_COACHING_VISIT_STORE = "CREATE TABLE IF NOT EXISTS " + TABLE_COACHING_VISIT_STORE
|
||||||
|
+ " ("
|
||||||
|
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||||
|
+ KEY_STORE_ID + " INTEGER,USER_ID VARCHAR, "
|
||||||
|
+ KEY_EMP_ID + " VARCHAR,"
|
||||||
|
+ KEY_IMAGE + " VARCHAR,"
|
||||||
|
+ KEY_EXIST + " INTEGER)";
|
||||||
|
|
||||||
|
public static final String CREATE_TABLE_INSERT_ORDER_TAKING_DATA = "CREATE TABLE IF NOT EXISTS "
|
||||||
|
+ TABLE_INSERT_ORDER_TAKING_DATA
|
||||||
|
+ " ("
|
||||||
|
|
||||||
|
+ "KEY_ID"
|
||||||
|
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||||
|
|
||||||
|
+ "IsExist"
|
||||||
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ "Sys_PO_No"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "Store_PO_No"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "PO_Date"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "PO_IMAGE"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "Store_Id"
|
||||||
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ "Category_Id"
|
||||||
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ "BRAND_ID"
|
||||||
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ "SKU_ID"
|
||||||
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ "SKU"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "SKU_SEQUENCE"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "Order_Qty"
|
||||||
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ "COMPANY_ID"
|
||||||
|
+ " INTEGER)";
|
||||||
|
|
||||||
|
public static final String CREATE_TABLE_INSERT_ORDER_RECEIVED_DATA = "CREATE TABLE IF NOT EXISTS "
|
||||||
|
+ TABLE_INSERT_ORDER_RECEIVED_DATA
|
||||||
|
+ " ("
|
||||||
|
|
||||||
|
+ "KEY_ID"
|
||||||
|
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||||
|
|
||||||
|
+ "Sys_PO_No"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "Store_PO_No"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "PO_Date"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "Store_Id"
|
||||||
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ "Category_Id"
|
||||||
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ "BRAND_ID"
|
||||||
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ "SKU_ID"
|
||||||
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ "SKU"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "SKU_SEQUENCE"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "PO_Qty"
|
||||||
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ "ACTUAL_Qty"
|
||||||
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ "COMPANY_ID"
|
||||||
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ "POID"
|
||||||
|
+ " INTEGER)";
|
||||||
|
|
||||||
|
public static final String TABLE_VISIT_TYPE = "VISIT_TYPE";
|
||||||
|
public static final String KEY_VISIT_ID = "VISIT_TYPE_ID";
|
||||||
|
|
||||||
|
public static final String CREATE_TABLE_VISIT_TYPE = "CREATE TABLE IF NOT EXISTS " + TABLE_VISIT_TYPE
|
||||||
|
+ " ("
|
||||||
|
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||||
|
+ KEY_STORE_ID + " INTEGER,"
|
||||||
|
+ KEY_VISIT_DATE + " VARCHAR,"
|
||||||
|
+ KEY_VISIT_ID + " INTEGER)";
|
||||||
|
|
||||||
|
|
||||||
|
public static final String BACKUP_FOLDER_NAME = "HaleonMT_Backup";
|
||||||
|
public static final String IMAGE_FOLDER_NAME = "HaleonMT_Images";
|
||||||
|
public static final String Download_IMAGE_FOLDER = "Downloaded_HaleonMT_Images";
|
||||||
|
public static final String ApkFolder = "HaleonMT_ApkFolder";
|
||||||
|
|
||||||
|
public static String getApkFolder(Context context) {
|
||||||
|
return AppUtils.getInternalDirectory(context, ApkFolder).getAbsolutePath() + "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getImagesFolder(Context context) {
|
||||||
|
return AppUtils.getInternalDirectory(context, IMAGE_FOLDER_NAME).getAbsolutePath() + "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getDownloadedImageFolder(Context context) {
|
||||||
|
return AppUtils.getInternalDirectory(context, Download_IMAGE_FOLDER).getAbsolutePath() + "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getBackupFolder(Context context) {
|
||||||
|
return AppUtils.getInternalDirectory(context, BACKUP_FOLDER_NAME).getAbsolutePath() + "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+90
-252
@@ -1,5 +1,6 @@
|
|||||||
package cpm.com.gskmtorange.dailyentry;
|
package cpm.com.gskmtorange.dailyentry;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
@@ -14,6 +15,7 @@ import android.os.Build;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
|
import android.text.method.DigitsKeyListener;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
@@ -41,6 +43,7 @@ import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
|||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -56,18 +59,18 @@ import cpm.com.gskmtorange.xmlGetterSetter.SelectGetterSetter;
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
|
||||||
|
|
||||||
public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener, View.OnClickListener{
|
public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener, View.OnClickListener {
|
||||||
|
|
||||||
private Context context;
|
private Context context;
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
String store_id, visit_date, username, intime, date;
|
String store_id, visit_date, username, intime, date;
|
||||||
String categoryName, categoryId;
|
String categoryName, categoryId;
|
||||||
String sub_category="", sub_category_id="0", brand="", brand_id="0", sku="", sku_id="0", discount="", price="", _pathforcheck = "", _path = "", img_str="", country_id;
|
String sub_category = "", sub_category_id = "0", brand = "", brand_id = "0", sku = "", sku_id = "0", discount = "", price = "", _pathforcheck = "", _path = "", img_str = "", country_id;
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
Spinner spinner_sub_category_list, spinner_brand_list, spinner_sku_list, sp_flasher;
|
Spinner spinner_sub_category_list, spinner_brand_list, spinner_sku_list, sp_flasher;
|
||||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list;
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list;
|
||||||
ArrayList<BrandMasterGetterSetter> brand_list = new ArrayList<>();
|
ArrayList<BrandMasterGetterSetter> brand_list = new ArrayList<>();
|
||||||
ArrayList<SkuMasterGetterSetter> sku_list= new ArrayList<>();
|
ArrayList<SkuMasterGetterSetter> sku_list = new ArrayList<>();
|
||||||
Toolbar toolbar;
|
Toolbar toolbar;
|
||||||
FloatingActionButton fab_save, fab_add;
|
FloatingActionButton fab_save, fab_add;
|
||||||
|
|
||||||
@@ -108,6 +111,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
img_cam = (ImageView) findViewById(R.id.img_promotion_add);
|
img_cam = (ImageView) findViewById(R.id.img_promotion_add);
|
||||||
lin_parent = (LinearLayout) findViewById(R.id.lin_parent_promo);
|
lin_parent = (LinearLayout) findViewById(R.id.lin_parent_promo);
|
||||||
btntoggle = (ToggleButton) findViewById(R.id.btntoggle);
|
btntoggle = (ToggleButton) findViewById(R.id.btntoggle);
|
||||||
|
|
||||||
context = this;
|
context = this;
|
||||||
//preference data
|
//preference data
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
@@ -115,6 +119,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||||
|
et_price.setKeyListener(DigitsKeyListener.getInstance(false, true));
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
@@ -127,32 +132,30 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
//Enable camera compulsory According to Configuration
|
//Enable camera compulsory According to Configuration
|
||||||
ArrayList<ConfigurationMasterGetterSetter> configurationData = db.getConfigurationMasterData(country_id);
|
ArrayList<ConfigurationMasterGetterSetter> configurationData = db.getConfigurationMasterData(country_id);
|
||||||
if(configurationData.size()>0){
|
if (configurationData.size() > 0) {
|
||||||
for(int i=0; i<configurationData.size();i++){
|
for (int i = 0; i < configurationData.size(); i++) {
|
||||||
|
|
||||||
if(configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("ADDITIONAL_PROMO_SKUWISE_IMAGE_MANDATORY") &&
|
if (configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("ADDITIONAL_PROMO_SKUWISE_IMAGE_MANDATORY") && configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")) {
|
||||||
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")){
|
|
||||||
is_camera_compulsory = true;
|
is_camera_compulsory = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_camera_compulsory){
|
if (is_camera_compulsory) {
|
||||||
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Promo SKU List
|
//Promo SKU List
|
||||||
exists_data = db.getPromoComplianceSkuwiseExistsAfterData(store_id, categoryId);
|
exists_data = db.getPromoComplianceSkuwiseExistsAfterData(store_id, categoryId);
|
||||||
|
|
||||||
if(exists_data.size()>0){
|
if (exists_data.size() > 0) {
|
||||||
isExists = exists_data.get(0).isExists();
|
isExists = exists_data.get(0).isExists();
|
||||||
if(exists_data.get(0).isExists()){
|
if (exists_data.get(0).isExists()) {
|
||||||
added_promo_list = db.getPromoComplianceSkuwiseAfterData(store_id, categoryId);
|
added_promo_list = db.getPromoComplianceSkuwiseAfterData(store_id, categoryId);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
fab_add.hide();//.setVisibility(View.GONE);
|
fab_add.hide();//.setVisibility(View.GONE);
|
||||||
added_promo_list.clear();
|
added_promo_list.clear();
|
||||||
if(promoAdapter!=null){
|
if (promoAdapter != null) {
|
||||||
promoAdapter.list.clear();
|
promoAdapter.list.clear();
|
||||||
promoAdapter.notifyDataSetChanged();
|
promoAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
@@ -163,7 +166,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
btntoggle.setChecked(isExists);
|
btntoggle.setChecked(isExists);
|
||||||
|
|
||||||
if(added_promo_list.size()>0){
|
if (added_promo_list.size() > 0) {
|
||||||
rec_added_promo.setLayoutManager(new LinearLayoutManager(context));
|
rec_added_promo.setLayoutManager(new LinearLayoutManager(context));
|
||||||
promoAdapter = new PromoAdapter(added_promo_list);
|
promoAdapter = new PromoAdapter(added_promo_list);
|
||||||
rec_added_promo.setAdapter(promoAdapter);
|
rec_added_promo.setAdapter(promoAdapter);
|
||||||
@@ -211,17 +214,15 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
toolbar.setTitle(getResources().getString(R.string.title_activity_promo_compliance));
|
toolbar.setTitle(getResources().getString(R.string.title_activity_promo_compliance));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
|
||||||
switch (parent.getId()) {
|
if (parent.getId() == R.id.sp_sub_category) {
|
||||||
case R.id.sp_sub_category:
|
|
||||||
|
|
||||||
if(position!=0){
|
if (position != 0) {
|
||||||
sub_category = sub_category_list.get(position).getSub_category();
|
sub_category = sub_category_list.get(position).getSub_category();
|
||||||
sub_category_id = sub_category_list.get(position).getSub_category_id();
|
sub_category_id = sub_category_list.get(position).getSub_category_id();
|
||||||
|
|
||||||
@@ -232,21 +233,17 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
brand_select.setBRAND(str);
|
brand_select.setBRAND(str);
|
||||||
brand_select.setBRAND_ID("0");
|
brand_select.setBRAND_ID("0");
|
||||||
brand_list.add(0, brand_select);
|
brand_list.add(0, brand_select);
|
||||||
CustomBrandAdapter adapter = new CustomBrandAdapter(AdditionalPromoSKUwiseActivity.this, R.layout.custom_spinner_item, brand_list);
|
|
||||||
|
|
||||||
|
CustomBrandAdapter adapter = new CustomBrandAdapter(AdditionalPromoSKUwiseActivity.this, R.layout.custom_spinner_item, brand_list);
|
||||||
spinner_brand_list.setAdapter(adapter);
|
spinner_brand_list.setAdapter(adapter);
|
||||||
spinner_brand_list.setOnItemSelectedListener(this);
|
spinner_brand_list.setOnItemSelectedListener(this);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
|
|
||||||
clearBrandSpinner();
|
clearBrandSpinner();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (parent.getId() == R.id.sp_brand) {
|
||||||
|
|
||||||
case R.id.sp_brand:
|
if (position != 0) {
|
||||||
|
|
||||||
if(position!=0){
|
|
||||||
brand = brand_list.get(position).getBRAND().get(0);
|
brand = brand_list.get(position).getBRAND().get(0);
|
||||||
brand_id = brand_list.get(position).getBRAND_ID().get(0);
|
brand_id = brand_list.get(position).getBRAND_ID().get(0);
|
||||||
|
|
||||||
@@ -257,47 +254,32 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
sku_select.setSKU(str);
|
sku_select.setSKU(str);
|
||||||
sku_select.setSKU_ID("0");
|
sku_select.setSKU_ID("0");
|
||||||
sku_list.add(0, sku_select);
|
sku_list.add(0, sku_select);
|
||||||
CustomSkuAdapter adapter = new CustomSkuAdapter(AdditionalPromoSKUwiseActivity.this, R.layout.custom_spinner_item, sku_list);
|
|
||||||
|
|
||||||
|
CustomSkuAdapter adapter = new CustomSkuAdapter(AdditionalPromoSKUwiseActivity.this, R.layout.custom_spinner_item, sku_list);
|
||||||
spinner_sku_list.setAdapter(adapter);
|
spinner_sku_list.setAdapter(adapter);
|
||||||
spinner_sku_list.setOnItemSelectedListener(this);
|
spinner_sku_list.setOnItemSelectedListener(this);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
|
|
||||||
clearSkuSpinner();
|
clearSkuSpinner();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (parent.getId() == R.id.sp_sku) {
|
||||||
|
|
||||||
case R.id.sp_sku:
|
if (position != 0) {
|
||||||
|
|
||||||
if(position!=0) {
|
|
||||||
sku = sku_list.get(position).getSKU().get(0);
|
sku = sku_list.get(position).getSKU().get(0);
|
||||||
sku_id = sku_list.get(position).getSKU_ID().get(0);
|
sku_id = sku_list.get(position).getSKU_ID().get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (parent.getId() == R.id.sp_flasher) {
|
||||||
|
|
||||||
case R.id.sp_flasher:
|
|
||||||
|
|
||||||
switch (position){
|
|
||||||
|
|
||||||
case 0:
|
|
||||||
|
|
||||||
|
if (position == 0) {
|
||||||
price_flasher_available = -1;
|
price_flasher_available = -1;
|
||||||
break;
|
} else if (position == 1) {
|
||||||
|
|
||||||
case 1:
|
|
||||||
price_flasher_available = 1;
|
price_flasher_available = 1;
|
||||||
break;
|
} else if (position == 2) {
|
||||||
|
|
||||||
case 2:
|
|
||||||
price_flasher_available = 0;
|
price_flasher_available = 0;
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -305,7 +287,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearBrandSpinner(){
|
void clearBrandSpinner() {
|
||||||
brand_list.clear();
|
brand_list.clear();
|
||||||
|
|
||||||
BrandMasterGetterSetter brand_select = new BrandMasterGetterSetter();
|
BrandMasterGetterSetter brand_select = new BrandMasterGetterSetter();
|
||||||
@@ -319,7 +301,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
spinner_brand_list.setOnItemSelectedListener(this);
|
spinner_brand_list.setOnItemSelectedListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearSkuSpinner(){
|
void clearSkuSpinner() {
|
||||||
sku_list.clear();
|
sku_list.clear();
|
||||||
|
|
||||||
SkuMasterGetterSetter sku_select = new SkuMasterGetterSetter();
|
SkuMasterGetterSetter sku_select = new SkuMasterGetterSetter();
|
||||||
@@ -337,82 +319,46 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
|
|
||||||
switch (id){
|
if (id == R.id.fab) {
|
||||||
|
|
||||||
case R.id.fab:
|
|
||||||
|
|
||||||
boolean valid_flag = true;
|
boolean valid_flag = true;
|
||||||
|
|
||||||
if(isExists){
|
if (isExists) {
|
||||||
if(added_promo_list.size()==0){
|
if (added_promo_list.size() == 0) {
|
||||||
valid_flag = false;
|
valid_flag = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!valid_flag){
|
if (!valid_flag) {
|
||||||
Snackbar.make(rec_added_promo, R.string.title_activity_Want_add,Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(rec_added_promo, R.string.title_activity_Want_add, Snackbar.LENGTH_SHORT).show();
|
||||||
}
|
} else if (isdata_added) {
|
||||||
else if(isdata_added){
|
|
||||||
|
|
||||||
db.InsertPromoSKUwiseData(added_promo_list, categoryId, store_id, isExists);
|
db.InsertPromoSKUwiseData(added_promo_list, categoryId, store_id, isExists);
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
} else {
|
||||||
/*AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
|
||||||
AdditionalPromoSKUwiseActivity.this);
|
|
||||||
// set title
|
|
||||||
alertDialogBuilder.setTitle(getResources().getString(R.string.dialog_title));
|
|
||||||
// set dialog message
|
|
||||||
alertDialogBuilder
|
|
||||||
.setMessage(getResources().getString(R.string.title_activity_Want_save))
|
|
||||||
.setCancelable(false)
|
|
||||||
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
// if this button is clicked, just close
|
|
||||||
// the dialog box and do nothing
|
|
||||||
dialog.cancel();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// create alert dialog
|
|
||||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
|
||||||
|
|
||||||
// show it
|
|
||||||
alertDialog.show();*/
|
|
||||||
|
|
||||||
}else {
|
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.fab_add) {
|
||||||
|
|
||||||
case R.id.fab_add:
|
|
||||||
|
|
||||||
discount = et_discount.getText().toString();
|
discount = et_discount.getText().toString();
|
||||||
price = et_price.getText().toString();
|
price = et_price.getText().toString();
|
||||||
|
|
||||||
if(sub_category.equals("")){
|
if (sub_category.equals("")) {
|
||||||
Snackbar.make(rec_added_promo, R.string.pls_select_sub_category,Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(rec_added_promo, R.string.pls_select_sub_category, Snackbar.LENGTH_SHORT).show();
|
||||||
}
|
} else if (brand.equals("")) {
|
||||||
else if(brand.equals("")){
|
Snackbar.make(rec_added_promo, R.string.pls_select_brand, Snackbar.LENGTH_SHORT).show();
|
||||||
Snackbar.make(rec_added_promo, R.string.pls_select_brand,Snackbar.LENGTH_SHORT).show();
|
} else if (sku.equals("")) {
|
||||||
}else if(sku.equals("")){
|
Snackbar.make(rec_added_promo, R.string.pls_select_sku, Snackbar.LENGTH_SHORT).show();
|
||||||
Snackbar.make(rec_added_promo, R.string.pls_select_sku,Snackbar.LENGTH_SHORT).show();
|
} else if (price.equals("")) {
|
||||||
}/*else if(discount.equals("")){
|
Snackbar.make(rec_added_promo, R.string.pls_enter_price, Snackbar.LENGTH_SHORT).show();
|
||||||
Snackbar.make(rec_added_promo, R.string.pls_enter_discount,Snackbar.LENGTH_SHORT).show();
|
} else if (!price.equals("") && price.substring(0, 1).equals(".")) {
|
||||||
}*/else if(price.equals("")){
|
Snackbar.make(rec_added_promo, R.string.incorrect_price, Snackbar.LENGTH_SHORT).show();
|
||||||
Snackbar.make(rec_added_promo, R.string.pls_enter_price,Snackbar.LENGTH_SHORT).show();
|
} else if (is_camera_compulsory && img_str.equals("")) {
|
||||||
}else if(is_camera_compulsory && img_str.equals("")){
|
Snackbar.make(rec_added_promo, R.string.click_image, Snackbar.LENGTH_SHORT).show();
|
||||||
Snackbar.make(rec_added_promo, R.string.click_image,Snackbar.LENGTH_SHORT).show();
|
} else if (price_flasher_available == -1) {
|
||||||
}else if(price_flasher_available==-1){
|
Snackbar.make(rec_added_promo, R.string.pls_select_price, Snackbar.LENGTH_SHORT).show();
|
||||||
Snackbar.make(rec_added_promo, R.string.pls_select_price,Snackbar.LENGTH_SHORT).show();
|
} else {
|
||||||
}else {
|
|
||||||
PromoComplianceSkuwiseGetterSetter promo = new PromoComplianceSkuwiseGetterSetter();
|
PromoComplianceSkuwiseGetterSetter promo = new PromoComplianceSkuwiseGetterSetter();
|
||||||
promo.setBrand(brand);
|
promo.setBrand(brand);
|
||||||
promo.setBrand_id(brand_id);
|
promo.setBrand_id(brand_id);
|
||||||
@@ -424,7 +370,6 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
promo.setDiscount_value(discount);
|
promo.setDiscount_value(discount);
|
||||||
promo.setPrice(price);
|
promo.setPrice(price);
|
||||||
promo.setPrice_flasher(price_flasher_available);
|
promo.setPrice_flasher(price_flasher_available);
|
||||||
|
|
||||||
added_promo_list.add(promo);
|
added_promo_list.add(promo);
|
||||||
|
|
||||||
rec_added_promo.setLayoutManager(new LinearLayoutManager(context));
|
rec_added_promo.setLayoutManager(new LinearLayoutManager(context));
|
||||||
@@ -433,7 +378,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
sub_category = "";
|
sub_category = "";
|
||||||
sub_category_id = "0";
|
sub_category_id = "0";
|
||||||
brand= "";
|
brand = "";
|
||||||
brand_id = "0";
|
brand_id = "0";
|
||||||
sku = "";
|
sku = "";
|
||||||
sku_id = "0";
|
sku_id = "0";
|
||||||
@@ -449,58 +394,47 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
clearSkuSpinner();
|
clearSkuSpinner();
|
||||||
sp_flasher.setSelection(0);
|
sp_flasher.setSelection(0);
|
||||||
|
|
||||||
if(is_camera_compulsory){
|
if (is_camera_compulsory) {
|
||||||
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
}
|
}
|
||||||
|
|
||||||
isdata_added = true;
|
isdata_added = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.img_promotion_add) {
|
||||||
|
|
||||||
case R.id.img_promotion_add:
|
_pathforcheck = "Additional_Promo_Skuwise_Image" + store_id + categoryId + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
_pathforcheck = "Additional_Promo_Skuwise_Image" + store_id + categoryId + visit_date.replace("/", "") + "_" +
|
|
||||||
CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
|
||||||
|
|
||||||
startCameraActivity(1);
|
startCameraActivity(1);
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.btntoggle:
|
} else if (id == R.id.btntoggle) {
|
||||||
|
|
||||||
isExists = btntoggle.isChecked();
|
isExists = btntoggle.isChecked();
|
||||||
|
|
||||||
if(isExists){
|
if (isExists) {
|
||||||
lin_parent.setVisibility(View.VISIBLE);
|
lin_parent.setVisibility(View.VISIBLE);
|
||||||
fab_add.show();//.setVisibility(View.VISIBLE);
|
fab_add.show();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AdditionalPromoSKUwiseActivity.this);
|
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AdditionalPromoSKUwiseActivity.this);
|
||||||
builder.setTitle("Parinaam");
|
builder.setTitle("Parinaam");
|
||||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||||
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
fab_add.hide();
|
||||||
fab_add.hide();//.setVisibility(View.GONE);
|
|
||||||
added_promo_list.clear();
|
added_promo_list.clear();
|
||||||
|
|
||||||
rec_added_promo.setLayoutManager(new LinearLayoutManager(context));
|
rec_added_promo.setLayoutManager(new LinearLayoutManager(context));
|
||||||
promoAdapter = new PromoAdapter(added_promo_list);
|
promoAdapter = new PromoAdapter(added_promo_list);
|
||||||
rec_added_promo.setAdapter(promoAdapter);
|
rec_added_promo.setAdapter(promoAdapter);
|
||||||
|
|
||||||
/* if(promoAdapter!=null){
|
|
||||||
promoAdapter.list.clear();
|
|
||||||
promoAdapter.notifyDataSetChanged();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
lin_parent.setVisibility(View.GONE);
|
lin_parent.setVisibility(View.GONE);
|
||||||
|
|
||||||
sub_category = "";
|
sub_category = "";
|
||||||
sub_category_id = "0";
|
sub_category_id = "0";
|
||||||
brand= "";
|
brand = "";
|
||||||
brand_id = "0";
|
brand_id = "0";
|
||||||
sku = "";
|
sku = "";
|
||||||
sku_id = "0";
|
sku_id = "0";
|
||||||
@@ -513,27 +447,26 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
spinner_sub_category_list.setSelection(0);
|
spinner_sub_category_list.setSelection(0);
|
||||||
clearBrandSpinner();
|
clearBrandSpinner();
|
||||||
clearSkuSpinner();
|
clearSkuSpinner();
|
||||||
if(is_camera_compulsory){
|
|
||||||
|
if (is_camera_compulsory) {
|
||||||
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
}
|
}
|
||||||
isdata_added = true;
|
|
||||||
|
|
||||||
|
isdata_added = true;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
//checkBox.setChecked(true);
|
|
||||||
btntoggle.setChecked(true);
|
btntoggle.setChecked(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
android.app.AlertDialog alert = builder.create();
|
android.app.AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -607,7 +540,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
case -1:
|
case -1:
|
||||||
|
|
||||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + _pathforcheck).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + _pathforcheck).exists()) {
|
||||||
|
|
||||||
img_cam.setBackgroundResource(R.mipmap.camera_green);
|
img_cam.setBackgroundResource(R.mipmap.camera_green);
|
||||||
|
|
||||||
@@ -632,10 +565,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
/*************
|
/*************
|
||||||
* CustomBrandAdapter Constructor
|
* CustomBrandAdapter Constructor
|
||||||
*****************/
|
*****************/
|
||||||
public CustomBrandAdapter(
|
public CustomBrandAdapter(AdditionalPromoSKUwiseActivity activitySpinner, int textViewResourceId, ArrayList objects
|
||||||
AdditionalPromoSKUwiseActivity activitySpinner,
|
|
||||||
int textViewResourceId,
|
|
||||||
ArrayList objects
|
|
||||||
|
|
||||||
) {
|
) {
|
||||||
super(activitySpinner, textViewResourceId, objects);
|
super(activitySpinner, textViewResourceId, objects);
|
||||||
@@ -694,10 +624,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
/*************
|
/*************
|
||||||
* CustomSkuAdapter Constructor
|
* CustomSkuAdapter Constructor
|
||||||
*****************/
|
*****************/
|
||||||
public CustomSkuAdapter(
|
public CustomSkuAdapter(AdditionalPromoSKUwiseActivity activitySpinner, int textViewResourceId, ArrayList objects
|
||||||
AdditionalPromoSKUwiseActivity activitySpinner,
|
|
||||||
int textViewResourceId,
|
|
||||||
ArrayList objects
|
|
||||||
|
|
||||||
) {
|
) {
|
||||||
super(activitySpinner, textViewResourceId, objects);
|
super(activitySpinner, textViewResourceId, objects);
|
||||||
@@ -756,10 +683,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
/*************
|
/*************
|
||||||
* CustomSubCategoryAdapter Constructor
|
* CustomSubCategoryAdapter Constructor
|
||||||
*****************/
|
*****************/
|
||||||
public CustomSubCategoryAdapter(
|
public CustomSubCategoryAdapter(AdditionalPromoSKUwiseActivity activitySpinner, int textViewResourceId, ArrayList objects
|
||||||
AdditionalPromoSKUwiseActivity activitySpinner,
|
|
||||||
int textViewResourceId,
|
|
||||||
ArrayList objects
|
|
||||||
|
|
||||||
) {
|
) {
|
||||||
super(activitySpinner, textViewResourceId, objects);
|
super(activitySpinner, textViewResourceId, objects);
|
||||||
@@ -818,8 +742,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
View view = LayoutInflater.from(parent.getContext())
|
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_added_promo, parent, false);
|
||||||
.inflate(R.layout.item_added_promo, parent, false);
|
|
||||||
return new ViewHolder(view);
|
return new ViewHolder(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -833,10 +756,9 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
holder.tv_discount_val.setText(getString(R.string.discount_value) + " - " + mItem.getDiscount_value());
|
holder.tv_discount_val.setText(getString(R.string.discount_value) + " - " + mItem.getDiscount_value());
|
||||||
holder.tv_price.setText(getString(R.string.price) + " - " + mItem.getPrice());
|
holder.tv_price.setText(getString(R.string.price) + " - " + mItem.getPrice());
|
||||||
String exists = "";
|
String exists = "";
|
||||||
if(mItem.getPrice_flasher()==1){
|
if (mItem.getPrice_flasher() == 1) {
|
||||||
exists = getString(R.string.yes);
|
exists = getString(R.string.yes);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
exists = getString(R.string.no);
|
exists = getString(R.string.no);
|
||||||
}
|
}
|
||||||
holder.tv_promo_flasher_exists.setText(" - " + exists);
|
holder.tv_promo_flasher_exists.setText(" - " + exists);
|
||||||
@@ -870,90 +792,12 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("MissingSuperCall")
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
ischanged();
|
ischanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
|
||||||
getMenuInflater().inflate(R.menu.menu_promo_skuwise, menu);
|
|
||||||
|
|
||||||
final CheckBox checkBox = (CheckBox) menu.findItem(R.id.menuShowDue).getActionView();
|
|
||||||
checkBox.setText(R.string.exists);
|
|
||||||
checkBox.setChecked(isExists);
|
|
||||||
|
|
||||||
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
||||||
@Override
|
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
|
||||||
isExists = isChecked;
|
|
||||||
|
|
||||||
if(isExists){
|
|
||||||
lin_parent.setVisibility(View.VISIBLE);
|
|
||||||
fab_add.show();//.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AdditionalPromoSKUwiseActivity.this);
|
|
||||||
builder.setTitle("Parinaam");
|
|
||||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
|
||||||
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
|
|
||||||
fab_add.hide();//.setVisibility(View.GONE);
|
|
||||||
added_promo_list.clear();
|
|
||||||
|
|
||||||
rec_added_promo.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
|
|
||||||
promoAdapter = new PromoAdapter(added_promo_list);
|
|
||||||
rec_added_promo.setAdapter(promoAdapter);
|
|
||||||
|
|
||||||
*//* if(promoAdapter!=null){
|
|
||||||
promoAdapter.list.clear();
|
|
||||||
promoAdapter.notifyDataSetChanged();
|
|
||||||
}*//*
|
|
||||||
|
|
||||||
lin_parent.setVisibility(View.GONE);
|
|
||||||
|
|
||||||
sub_category = "";
|
|
||||||
sub_category_id = "0";
|
|
||||||
brand= "";
|
|
||||||
brand_id = "0";
|
|
||||||
sku = "";
|
|
||||||
sku_id = "0";
|
|
||||||
discount = "";
|
|
||||||
price = "";
|
|
||||||
img_str = "";
|
|
||||||
|
|
||||||
et_discount.setText("");
|
|
||||||
et_price.setText("");
|
|
||||||
spinner_sub_category_list.setSelection(0);
|
|
||||||
clearBrandSpinner();
|
|
||||||
clearSkuSpinner();
|
|
||||||
if(is_camera_compulsory){
|
|
||||||
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
|
||||||
}
|
|
||||||
isdata_added = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
|
||||||
checkBox.setChecked(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
android.app.AlertDialog alert = builder.create();
|
|
||||||
alert.show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
// Handle action bar item clicks here. The action bar will
|
// Handle action bar item clicks here. The action bar will
|
||||||
@@ -973,19 +817,17 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ischanged(){
|
void ischanged() {
|
||||||
if(isdata_added){
|
if (isdata_added) {
|
||||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AdditionalPromoSKUwiseActivity.this);
|
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AdditionalPromoSKUwiseActivity.this);
|
||||||
builder.setTitle("Parinaam");
|
builder.setTitle("Parinaam");
|
||||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false).setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
})
|
}).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
|
||||||
@@ -993,8 +835,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
});
|
});
|
||||||
android.app.AlertDialog alert = builder.create();
|
android.app.AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
@@ -1010,10 +851,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
/*************
|
/*************
|
||||||
* CustomAdapter Constructor
|
* CustomAdapter Constructor
|
||||||
*****************/
|
*****************/
|
||||||
public CustomSpinnerAdapter(
|
public CustomSpinnerAdapter(AdditionalPromoSKUwiseActivity activitySpinner, int textViewResourceId, ArrayList objects
|
||||||
AdditionalPromoSKUwiseActivity activitySpinner,
|
|
||||||
int textViewResourceId,
|
|
||||||
ArrayList objects
|
|
||||||
|
|
||||||
) {
|
) {
|
||||||
super(activitySpinner, textViewResourceId, objects);
|
super(activitySpinner, textViewResourceId, objects);
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
btntoggle.setChecked(true);
|
btntoggle.setChecked(true);
|
||||||
|
|
||||||
str = CommonString.FILE_PATH;
|
str = CommonString.getImagesFolder(context);
|
||||||
|
|
||||||
///band List
|
///band List
|
||||||
|
|
||||||
@@ -194,13 +194,10 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
brand.setBRAND(str);
|
brand.setBRAND(str);
|
||||||
brand_list.add(0, brand);
|
brand_list.add(0, brand);
|
||||||
CustomAdapter adapter = new CustomAdapter(AdditionalVisibility.this, R.layout.custom_spinner_item, brand_list);
|
CustomAdapter adapter = new CustomAdapter(AdditionalVisibility.this, R.layout.custom_spinner_item, brand_list);
|
||||||
|
|
||||||
spinner_brand_list.setAdapter(adapter);
|
spinner_brand_list.setAdapter(adapter);
|
||||||
|
|
||||||
///Display List
|
///Display List
|
||||||
|
|
||||||
DisplayMaster_list = db.getADDITIONAL_DISPLAYData(categoryId);
|
DisplayMaster_list = db.getADDITIONAL_DISPLAYData(categoryId);
|
||||||
|
|
||||||
ADDITIONAL_DISPLAY_MASTERGetterSetter select = new ADDITIONAL_DISPLAY_MASTERGetterSetter();
|
ADDITIONAL_DISPLAY_MASTERGetterSetter select = new ADDITIONAL_DISPLAY_MASTERGetterSetter();
|
||||||
select.setDISPLAY_ID(str);
|
select.setDISPLAY_ID(str);
|
||||||
DisplayMaster_list.add(0, select);
|
DisplayMaster_list.add(0, select);
|
||||||
@@ -210,9 +207,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
spinner_brand_list.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
spinner_brand_list.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
|
|
||||||
brand_list_name = brand_list.get(position).getBRAND().get(0);
|
brand_list_name = brand_list.get(position).getBRAND().get(0);
|
||||||
brand_list_id = brand_list.get(position).getBRAND_ID().get(0);
|
brand_list_id = brand_list.get(position).getBRAND_ID().get(0);
|
||||||
|
|
||||||
@@ -799,7 +794,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
_pathforcheck1 = store_id + categoryId + "AdditionalImage1" + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck1 = store_id + categoryId + "AdditionalImage1" + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck1;
|
_path = CommonString.getImagesFolder(context)+ _pathforcheck1;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
@@ -811,7 +806,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
_pathforcheck2 = store_id + categoryId + "AdditionalImage2" + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck2 = store_id + categoryId + "AdditionalImage2" + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck2;
|
_path = CommonString.getImagesFolder(context)+ _pathforcheck2;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
@@ -823,14 +818,13 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
_pathforcheck3 = store_id + categoryId + "AdditionalImage3" + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck3 = store_id + categoryId + "AdditionalImage3" + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck3;
|
_path = CommonString.getImagesFolder(context)+ _pathforcheck3;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
btnimage.setBackgroundResource(R.mipmap.camera_grey);
|
btnimage.setBackgroundResource(R.mipmap.camera_grey);
|
||||||
btnimage1.setBackgroundResource(R.mipmap.camera_grey);
|
btnimage1.setBackgroundResource(R.mipmap.camera_grey);
|
||||||
@@ -929,13 +923,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
webView.getSettings().setJavaScriptEnabled(true);
|
webView.getSettings().setJavaScriptEnabled(true);
|
||||||
webView.getSettings().setBuiltInZoomControls(true);
|
webView.getSettings().setBuiltInZoomControls(true);
|
||||||
|
|
||||||
//String planogram_image = mp.get(0).getPLANOGRAM_IMAGE();
|
|
||||||
/* if (new File(CommonString.FILE_PATH_PLANOGRAM + planogram_image).exists()) {
|
|
||||||
|
|
||||||
String imagePath = "file://" + CommonString.FILE_PATH_PLANOGRAM + planogram_image;
|
|
||||||
//String imagePath = "file://" + CommonString.FILE_PATH + "/" + "image_ref.png";
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
String html = "<html><head></head><body><img src=\"" + planogram_image + "\"></body></html>";
|
String html = "<html><head></head><body><img src=\"" + planogram_image + "\"></body></html>";
|
||||||
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
||||||
@@ -1313,14 +1300,14 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
public void showSkuDialog() {
|
public void showSkuDialog() {
|
||||||
|
|
||||||
final ArrayList<BrandMasterGetterSetter> brandList;
|
final ArrayList<BrandMasterGetterSetter> brandList;
|
||||||
/* if(country_id.equals("7")){
|
/* if(country_id.equals("]")){
|
||||||
brandList = db.getBrandT2PData(null, null, null, categoryId, store_id);
|
brandList = db.getBrandT2PData(null, null, null, categoryId, store_id);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
brandList = db.getBrandT2PData(store_type_id, class_id, key_account_id, categoryId, store_id);
|
brandList = db.getBrandT2PData(store_type_id, class_id, key_account_id, categoryId, store_id);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if (country_id.equals("7")||country_id.equals("8")) {
|
if (country_id.equals("7")||country_id.equals("8") ||country_id.equals("11") || country_id.equals("17")) {
|
||||||
brandList = db.getBrandT2PData(null, null, null, categoryId, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
brandList = db.getBrandT2PData(null, null, null, categoryId, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
brandList = db.getBrandT2PData(store_type_id, class_id, key_account_id, categoryId, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
brandList = db.getBrandT2PData(store_type_id, class_id, key_account_id, categoryId, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
@@ -1438,7 +1425,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Create custom adapter object ( see below CustomAdapter.java )
|
// Create custom adapter object ( see below CustomAdapter.java )
|
||||||
CustomAdapter adapter = new CustomAdapter(AdditionalVisibility.this, R.layout.custom_spinner_item, brandList);
|
CustomAdapter adapter = new CustomAdapter(AdditionalVisibility.this, R.layout.custom_spinner_item, brandList);
|
||||||
// Set adapter to spinner
|
// Set adapter to spinner
|
||||||
@@ -1460,7 +1446,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
brand_id = brandList.get(position).getBRAND_ID().get(0);
|
brand_id = brandList.get(position).getBRAND_ID().get(0);
|
||||||
brand_name = brandList.get(position).getBRAND().get(0);
|
brand_name = brandList.get(position).getBRAND().get(0);
|
||||||
|
|
||||||
if(country_id.equals("7")||country_id.equals("8")){
|
if(country_id.equals("7")||country_id.equals("8")||country_id.equals("11") ||country_id.equals("17")){
|
||||||
sku_list = db.getSkuT2PData(null, null, null, brand_id, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
sku_list = db.getSkuT2PData(null, null, null, brand_id, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||||
}
|
}
|
||||||
else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||||
@@ -1872,9 +1858,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
toolbar.setTitle(getResources().getString(R.string.title_activity_Additional_visibility));
|
toolbar.setTitle(categoryName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package cpm.com.gskmtorange.dailyentry;
|
package cpm.com.gskmtorange.dailyentry;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
@@ -14,6 +15,9 @@ import android.os.Build;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
|
import android.text.InputFilter;
|
||||||
|
import android.text.InputType;
|
||||||
|
import android.text.Spanned;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
@@ -35,7 +39,6 @@ import androidx.cardview.widget.CardView;
|
|||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
|
||||||
@@ -44,6 +47,8 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
||||||
@@ -61,7 +66,7 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
boolean checkflag = true;
|
boolean checkflag = true;
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
String categoryName, categoryId, Error_Message = "", pathforcheck = "", _path = "", str, img_str = "", img_str2 = "";
|
String categoryName, categoryId, Error_Message = "", pathforcheck = "", _path = "", str, img_str = "", img_str2 = "";
|
||||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, store_flag_str, country_id="";
|
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, store_flag_str, country_id = "";
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
ArrayList<AuditDataGetterSetter> question_list = new ArrayList<>(), childListData;
|
ArrayList<AuditDataGetterSetter> question_list = new ArrayList<>(), childListData;
|
||||||
HashMap<AuditDataGetterSetter, ArrayList<AuditDataGetterSetter>> hashMapAnsListChildData;
|
HashMap<AuditDataGetterSetter, ArrayList<AuditDataGetterSetter>> hashMapAnsListChildData;
|
||||||
@@ -96,11 +101,8 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||||
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
||||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||||
|
|
||||||
toolbar.setTitle(getResources().getString(R.string.audit));
|
toolbar.setTitle(getResources().getString(R.string.audit));
|
||||||
|
str = CommonString.getImagesFolder(context);
|
||||||
str = CommonString.FILE_PATH;
|
|
||||||
|
|
||||||
recyclerView = (RecyclerView) findViewById(R.id.list);
|
recyclerView = (RecyclerView) findViewById(R.id.list);
|
||||||
|
|
||||||
db = new GSKOrangeDB(this);
|
db = new GSKOrangeDB(this);
|
||||||
@@ -113,9 +115,7 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
//Header
|
//Header
|
||||||
question_list = db.getAfterSaveAuditQuestionAnswerData(store_id, categoryId);
|
question_list = db.getAfterSaveAuditQuestionAnswerData(store_id, categoryId);
|
||||||
if (question_list.size() == 0) {
|
if (question_list.size() == 0) {
|
||||||
|
|
||||||
question_list = getAuditQnsRemoved();
|
question_list = getAuditQnsRemoved();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hashMapAnsListChildData = new HashMap<>();
|
hashMapAnsListChildData = new HashMap<>();
|
||||||
@@ -143,15 +143,39 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
recyclerView.setVisibility(View.GONE);
|
recyclerView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void onScrolled(RecyclerView recyclerView, int dx, int dy)
|
||||||
|
{
|
||||||
|
if (dy > 0 && fab.isShown())
|
||||||
|
{
|
||||||
|
fab.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dy < 0 && !fab.isShown())
|
||||||
|
{
|
||||||
|
fab.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @Override
|
||||||
|
public void onScrollStateChanged(RecyclerView recyclerView, int newState)
|
||||||
|
{
|
||||||
|
if (newState == RecyclerView.SCROLL_STATE_IDLE)
|
||||||
|
{
|
||||||
|
fab.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
super.onScrollStateChanged(recyclerView, newState);
|
||||||
|
}*/
|
||||||
|
});
|
||||||
|
|
||||||
fab.setOnClickListener(new View.OnClickListener() {
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
if (question_list.size() > 0) {
|
if (question_list.size() > 0) {
|
||||||
|
|
||||||
recyclerView.clearFocus();
|
recyclerView.clearFocus();
|
||||||
|
|
||||||
if (validateData(question_list)) {
|
if (validateData(question_list)) {
|
||||||
db.saveAuditQuestionAnswerData(question_list, store_id, categoryId);
|
db.saveAuditQuestionAnswerData(question_list, store_id, categoryId);
|
||||||
finish();
|
finish();
|
||||||
@@ -163,7 +187,6 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
Snackbar.make(recyclerView, getString(R.string.NodataAvailable), Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(recyclerView, getString(R.string.NodataAvailable), Snackbar.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -173,11 +196,10 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
boolean t2p_flag = false;
|
boolean t2p_flag = false;
|
||||||
|
|
||||||
boolean flag_t2p_mapping;
|
boolean flag_t2p_mapping;
|
||||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId,CommonString.TABLE_MAPPING_T2P_ADHOC);
|
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||||
}
|
} else {
|
||||||
else {
|
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P);
|
||||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId,CommonString.TABLE_MAPPING_T2P);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag_t2p_mapping) {
|
if (flag_t2p_mapping) {
|
||||||
@@ -196,7 +218,6 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
if (!t2p_flag) {
|
if (!t2p_flag) {
|
||||||
if (db.additionalVisibilitydata(store_id, categoryId)) {
|
if (db.additionalVisibilitydata(store_id, categoryId)) {
|
||||||
ArrayList<AddittionalGetterSetter> additionalList = db.getAdditionalMainStock(store_id, categoryId);
|
ArrayList<AddittionalGetterSetter> additionalList = db.getAdditionalMainStock(store_id, categoryId);
|
||||||
|
|
||||||
for (int i = 0; i < additionalList.size(); i++) {
|
for (int i = 0; i < additionalList.size(); i++) {
|
||||||
if (additionalList.get(i).getBtn_toogle().equals("1")) {
|
if (additionalList.get(i).getBtn_toogle().equals("1")) {
|
||||||
t2p_flag = true;
|
t2p_flag = true;
|
||||||
@@ -207,7 +228,6 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(categoryId, storeType_id);
|
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(categoryId, storeType_id);
|
||||||
|
|
||||||
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
AuditDataGetterSetter item = iterator.next(); // must be called before you can call iterator.remove()
|
AuditDataGetterSetter item = iterator.next(); // must be called before you can call iterator.remove()
|
||||||
@@ -219,7 +239,6 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
if (!t2p_flag) {
|
if (!t2p_flag) {
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,9 +258,7 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
// automatically handle clicks on the Home/Up button, so long
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
// as you specify a parent activity in AndroidManifest.xml.
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
if (id == android.R.id.home) {
|
if (id == android.R.id.home) {
|
||||||
|
|
||||||
if (question_list.size() > 0) {
|
if (question_list.size() > 0) {
|
||||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AuditActivity.this);
|
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AuditActivity.this);
|
||||||
builder.setTitle("Parinaam");
|
builder.setTitle("Parinaam");
|
||||||
@@ -250,10 +267,8 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
}).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
|
||||||
@@ -272,15 +287,13 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
//super.onBackPressed();
|
super.onBackPressed();
|
||||||
|
|
||||||
if (question_list.size() > 0) {
|
if (question_list.size() > 0) {
|
||||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AuditActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(AuditActivity.this);
|
||||||
builder.setTitle("Parinaam");
|
builder.setTitle("Parinaam");
|
||||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||||
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
@@ -291,7 +304,7 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
android.app.AlertDialog alert = builder.create();
|
AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
} else {
|
} else {
|
||||||
finish();
|
finish();
|
||||||
@@ -299,6 +312,26 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class DecimalDigitsInputFilter implements InputFilter {
|
||||||
|
|
||||||
|
Pattern mPattern;
|
||||||
|
|
||||||
|
public DecimalDigitsInputFilter(int digitsBeforeZero, int digitsAfterZero) {
|
||||||
|
mPattern = Pattern.compile("[0-9]{0," + (digitsBeforeZero - 1) + "}+((\\.[0-9]{0," + (digitsAfterZero - 1) + "})?)||(\\.)?");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
|
||||||
|
|
||||||
|
Matcher matcher = mPattern.matcher(dest);
|
||||||
|
if (!matcher.matches())
|
||||||
|
return "";
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
class AnswerAdapter extends RecyclerView.Adapter<AnswerAdapter.ViewHolder> {
|
class AnswerAdapter extends RecyclerView.Adapter<AnswerAdapter.ViewHolder> {
|
||||||
ArrayList<AuditDataGetterSetter> questionList;
|
ArrayList<AuditDataGetterSetter> questionList;
|
||||||
HashMap<AuditDataGetterSetter, ArrayList<AuditDataGetterSetter>> answerHashMap;
|
HashMap<AuditDataGetterSetter, ArrayList<AuditDataGetterSetter>> answerHashMap;
|
||||||
@@ -314,44 +347,92 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
return new ViewHolder(view);
|
return new ViewHolder(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onBindViewHolder(final AnswerAdapter.ViewHolder holder, final int position) {
|
public void onBindViewHolder(final AnswerAdapter.ViewHolder holder, @SuppressLint("RecyclerView") final int position) {
|
||||||
holder.data = questionList.get(position);
|
holder.data = questionList.get(position);
|
||||||
|
|
||||||
holder.txt_question.setText(holder.data.getQUESTION());
|
holder.txt_question.setText(holder.data.getQUESTION());
|
||||||
|
holder.txt_question.setId(position);
|
||||||
|
|
||||||
|
// Log.e("mandate_data",holder.data.getCAMERA_ALLOW()+","+holder.data.getCAMERA_MANDATORY() + "," + holder.data.getQUESTION_ID());
|
||||||
|
|
||||||
ArrayList<AuditDataGetterSetter> ans_list = answerHashMap.get(holder.data);
|
ArrayList<AuditDataGetterSetter> ans_list = answerHashMap.get(holder.data);
|
||||||
|
|
||||||
if (holder.data.getANSWER_TYPE().equalsIgnoreCase("Dropdown")) {
|
if (holder.data.getANSWER_TYPE().equalsIgnoreCase("Dropdown")) {
|
||||||
holder.sp_auditAnswer.setVisibility(View.VISIBLE);
|
holder.sp_auditAnswer.setVisibility(View.VISIBLE);
|
||||||
|
holder.sp_auditAnswer.setId(position);
|
||||||
holder.edt_answer.setVisibility(View.GONE);
|
holder.edt_answer.setVisibility(View.GONE);
|
||||||
} else if(holder.data.getANSWER_TYPE().equalsIgnoreCase("TEXTBOX")){
|
holder.edt_answer.setId(position);
|
||||||
|
}
|
||||||
|
else if (holder.data.getANSWER_TYPE().equalsIgnoreCase("TEXTBOX")) {
|
||||||
|
int maxLength = Integer.parseInt(holder.data.getMaxlength());
|
||||||
|
InputFilter[] fArray = new InputFilter[1];
|
||||||
|
fArray[0] = new InputFilter.LengthFilter(maxLength);
|
||||||
|
holder.edt_answer.setFilters(fArray);
|
||||||
|
holder.edt_answer.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||||
holder.edt_answer.setVisibility(View.VISIBLE);
|
holder.edt_answer.setVisibility(View.VISIBLE);
|
||||||
if(country_id.equals("4")){
|
holder.edt_answer.setId(position);
|
||||||
|
if (country_id.equals("4")) {
|
||||||
|
holder.edt_answer.setHint(R.string.pls_fill_stock_count);
|
||||||
|
holder.edt_answer.setId(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.sp_auditAnswer.setVisibility(View.GONE);
|
||||||
|
holder.sp_auditAnswer.setId(position);
|
||||||
|
|
||||||
|
} else if (holder.data.getANSWER_TYPE().equalsIgnoreCase("DECIMAL")) {
|
||||||
|
int maxLength = Integer.parseInt(holder.data.getMaxlength());
|
||||||
|
holder.edt_answer.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL | InputType.TYPE_NUMBER_FLAG_SIGNED);
|
||||||
|
holder.edt_answer.setFilters(new InputFilter[]{new DecimalDigitsInputFilter(maxLength, 2)});
|
||||||
|
|
||||||
|
holder.edt_answer.setVisibility(View.VISIBLE);
|
||||||
|
holder.edt_answer.setId(position);
|
||||||
|
|
||||||
|
if (country_id.equals("4")) {
|
||||||
holder.edt_answer.setHint(R.string.pls_fill_stock_count);
|
holder.edt_answer.setHint(R.string.pls_fill_stock_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.sp_auditAnswer.setVisibility(View.GONE);
|
holder.sp_auditAnswer.setVisibility(View.GONE);
|
||||||
|
holder.sp_auditAnswer.setId(position);
|
||||||
|
|
||||||
|
} else if (holder.data.getANSWER_TYPE().equalsIgnoreCase("NUMBER")) {
|
||||||
|
int maxLength = Integer.parseInt(holder.data.getMaxlength());
|
||||||
|
InputFilter[] fArray = new InputFilter[1];
|
||||||
|
fArray[0] = new InputFilter.LengthFilter(maxLength);
|
||||||
|
holder.edt_answer.setFilters(fArray);
|
||||||
|
holder.edt_answer.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||||
|
|
||||||
|
holder.edt_answer.setVisibility(View.VISIBLE);
|
||||||
|
holder.edt_answer.setId(position);
|
||||||
|
|
||||||
|
if (country_id.equals("4")) {
|
||||||
|
holder.edt_answer.setHint(R.string.pls_fill_stock_count);
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.sp_auditAnswer.setVisibility(View.GONE);
|
||||||
|
holder.sp_auditAnswer.setId(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (holder.data.getCAMERA_ALLOW().equals("1")) {
|
if (holder.data.getCAMERA_ALLOW().equals("1")) {
|
||||||
holder.parent_cam_layout.setVisibility(View.VISIBLE);
|
holder.parent_cam_layout.setVisibility(View.VISIBLE);
|
||||||
}
|
holder.parent_cam_layout.setId(position);
|
||||||
else {
|
} else {
|
||||||
holder.parent_cam_layout.setVisibility(View.GONE);
|
holder.parent_cam_layout.setVisibility(View.GONE);
|
||||||
|
holder.parent_cam_layout.setId(position);
|
||||||
}
|
}
|
||||||
//text
|
//text
|
||||||
if (holder.data.getREMARK_ALLOW().equals("1")) {
|
if (holder.data.getREMARK_ALLOW().equals("1")) {
|
||||||
holder.edt_text.setVisibility(View.VISIBLE);
|
holder.edt_text.setVisibility(View.VISIBLE);
|
||||||
|
holder.edt_text.setId(position);
|
||||||
|
|
||||||
holder.txt_leval.setVisibility(View.VISIBLE);
|
holder.txt_leval.setVisibility(View.VISIBLE);
|
||||||
holder.txt_leval.setText(holder.data.getREMARK_LEVEL());
|
holder.txt_leval.setText(holder.data.getREMARK_LEVEL());
|
||||||
|
holder.txt_leval.setId(position);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
holder.edt_text.setVisibility(View.GONE);
|
holder.edt_text.setVisibility(View.GONE);
|
||||||
|
holder.edt_text.setId(position);
|
||||||
holder.txt_leval.setVisibility(View.GONE);
|
holder.txt_leval.setVisibility(View.GONE);
|
||||||
|
holder.txt_leval.setId(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
holder.sp_auditAnswer.setAdapter(new AnswerSpinnerAdapter(AuditActivity.this, R.layout.custom_spinner_item, ans_list));
|
holder.sp_auditAnswer.setAdapter(new AnswerSpinnerAdapter(AuditActivity.this, R.layout.custom_spinner_item, ans_list));
|
||||||
|
|
||||||
final ArrayList<AuditDataGetterSetter> finalAns_list = ans_list;
|
final ArrayList<AuditDataGetterSetter> finalAns_list = ans_list;
|
||||||
@@ -364,13 +445,16 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
holder.data.setCAMERA_ALLOW(ans.getCAMERA_ALLOW());
|
holder.data.setCAMERA_ALLOW(ans.getCAMERA_ALLOW());
|
||||||
holder.data.setREMARK_ALLOW(ans.getREMARK_ALLOW());
|
holder.data.setREMARK_ALLOW(ans.getREMARK_ALLOW());
|
||||||
holder.data.setREMARK_LEVEL(ans.getREMARK_LEVEL());
|
holder.data.setREMARK_LEVEL(ans.getREMARK_LEVEL());
|
||||||
|
holder.data.setCAMERA_MANDATORY(ans.getCAMERA_MANDATORY());
|
||||||
|
|
||||||
|
Log.e("mandate_data",holder.data.getCAMERA_ALLOW() + ","+ holder.data.getCAMERA_MANDATORY());
|
||||||
|
|
||||||
//text
|
//text
|
||||||
if (holder.data.getREMARK_ALLOW().equals("1")) {
|
if (holder.data.getREMARK_ALLOW().equals("1")) {
|
||||||
holder.edt_text.setVisibility(View.VISIBLE);
|
holder.edt_text.setVisibility(View.VISIBLE);
|
||||||
holder.txt_leval.setVisibility(View.VISIBLE);
|
holder.txt_leval.setVisibility(View.VISIBLE);
|
||||||
holder.txt_leval.setText(holder.data.getREMARK_LEVEL());
|
holder.txt_leval.setText(holder.data.getREMARK_LEVEL());
|
||||||
}else {
|
} else {
|
||||||
holder.edt_text.setVisibility(View.GONE);
|
holder.edt_text.setVisibility(View.GONE);
|
||||||
holder.txt_leval.setVisibility(View.GONE);
|
holder.txt_leval.setVisibility(View.GONE);
|
||||||
holder.data.setTXT_REMARK("");
|
holder.data.setTXT_REMARK("");
|
||||||
@@ -401,7 +485,6 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
holder.img_cam2.setBackgroundResource(R.mipmap.camera_orange);
|
holder.img_cam2.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNothingSelected(AdapterView<?> parent) {
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
|
|
||||||
@@ -412,8 +495,7 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
pathforcheck = store_id + "AuditAnsPic" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
pathforcheck = store_id + "AuditAnsPic" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
_path = CommonString.getImagesFolder(context)+ pathforcheck;
|
||||||
_path = CommonString.FILE_PATH + pathforcheck;
|
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
child_position = position;
|
child_position = position;
|
||||||
startCameraActivity(0);
|
startCameraActivity(0);
|
||||||
@@ -425,7 +507,7 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
pathforcheck = store_id + "AuditAnsPic2" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
pathforcheck = store_id + "AuditAnsPic2" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + pathforcheck;
|
_path = CommonString.getImagesFolder(context)+ pathforcheck;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
child_position = position;
|
child_position = position;
|
||||||
startCameraActivity(1);
|
startCameraActivity(1);
|
||||||
@@ -436,9 +518,15 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onFocusChange(View v, boolean hasFocus) {
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
if (!hasFocus) {
|
if (!hasFocus) {
|
||||||
|
if (holder.data.getANSWER_TYPE().equalsIgnoreCase("NUMBER")) {
|
||||||
|
holder.data.setANSWER_ID("0");
|
||||||
|
holder.data.setANSWER(((EditText) v).getText().toString().replaceFirst("^0+.(?!$)", ""));
|
||||||
|
} else {
|
||||||
holder.data.setANSWER_ID("0");
|
holder.data.setANSWER_ID("0");
|
||||||
holder.data.setANSWER(((EditText) v).getText().toString().replaceAll("[&^<>{}'$]", ""));
|
holder.data.setANSWER(((EditText) v).getText().toString().replaceAll("[&^<>{}'$]", ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -447,26 +535,30 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onFocusChange(View v, boolean hasFocus) {
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
if (!hasFocus) {
|
if (!hasFocus) {
|
||||||
// holder.data.setANSWER_ID("0");
|
|
||||||
holder.data.setTXT_REMARK(((EditText) v).getText().toString().replaceAll("[&^<>{}'$]", ""));
|
holder.data.setTXT_REMARK(((EditText) v).getText().toString().replaceAll("[&^<>{}'$]", ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
for (int i = 0; i < ans_list.size(); i++) {
|
for (int i = 0; i < ans_list.size(); i++) {
|
||||||
if (holder.data.getANSWER_TYPE().equalsIgnoreCase("Dropdown") && ans_list.get(i).getANSWER_ID().equals(holder.data.getANSWER_ID())) {
|
if (holder.data.getANSWER_TYPE().equalsIgnoreCase("Dropdown")
|
||||||
|
&& ans_list.get(i).getANSWER_ID().equals(holder.data.getANSWER_ID())) {
|
||||||
holder.sp_auditAnswer.setSelection(i);
|
holder.sp_auditAnswer.setSelection(i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(holder.data.getANSWER_TYPE().equalsIgnoreCase("TEXTBOX")){
|
if (holder.data.getANSWER_TYPE().equalsIgnoreCase("TEXTBOX")
|
||||||
|
|| holder.data.getANSWER_TYPE().equalsIgnoreCase("DECIMAL")
|
||||||
|
|| holder.data.getANSWER_TYPE().equalsIgnoreCase("NUMBER")) {
|
||||||
holder.edt_answer.setText(holder.data.getANSWER());
|
holder.edt_answer.setText(holder.data.getANSWER());
|
||||||
|
holder.edt_answer.setId(position);
|
||||||
}
|
}
|
||||||
//set text
|
|
||||||
|
|
||||||
if(holder.data.getREMARK_ALLOW().equalsIgnoreCase("1")){
|
//set text
|
||||||
|
if (holder.data.getREMARK_ALLOW().equalsIgnoreCase("1")) {
|
||||||
holder.edt_text.setText(holder.data.getTXT_REMARK());
|
holder.edt_text.setText(holder.data.getTXT_REMARK());
|
||||||
|
holder.edt_text.setId(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!img_str.equals("")) {
|
if (!img_str.equals("")) {
|
||||||
@@ -487,22 +579,29 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (holder.data.getCAM_IMAGE().equals("")) {
|
if (holder.data.getCAM_IMAGE().equals("")) {
|
||||||
holder.img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
holder.img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
|
holder.img_cam.setId(position);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
holder.img_cam.setBackgroundResource(R.mipmap.camera_green);
|
holder.img_cam.setBackgroundResource(R.mipmap.camera_green);
|
||||||
|
holder.img_cam.setId(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (holder.data.getCAM_IMAGE2().equals("")) {
|
if (holder.data.getCAM_IMAGE2().equals("")) {
|
||||||
holder.img_cam2.setBackgroundResource(R.mipmap.camera_orange);
|
holder.img_cam2.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
|
holder.img_cam2.setId(position);
|
||||||
} else {
|
} else {
|
||||||
holder.img_cam2.setBackgroundResource(R.mipmap.camera_green);
|
holder.img_cam2.setBackgroundResource(R.mipmap.camera_green);
|
||||||
|
holder.img_cam2.setId(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!checkflag) {
|
if (!checkflag) {
|
||||||
if (checkHeaderArray.contains(position)) {
|
if (checkHeaderArray.contains(position)) {
|
||||||
holder.card_view.setBackgroundColor(getResources().getColor(R.color.red));
|
holder.card_view.setBackgroundColor(getResources().getColor(R.color.red));
|
||||||
|
holder.card_view.setId(position);
|
||||||
} else {
|
} else {
|
||||||
holder.card_view.setBackgroundColor(getResources().getColor(R.color.white));
|
holder.card_view.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
holder.card_view.setId(position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -514,9 +613,9 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
public final View mView;
|
public final View mView;
|
||||||
public final TextView txt_question,txt_leval;
|
public final TextView txt_question, txt_leval;
|
||||||
public final Spinner sp_auditAnswer;
|
public final Spinner sp_auditAnswer;
|
||||||
public final EditText edt_answer,edt_text;
|
public final EditText edt_answer, edt_text;
|
||||||
public final ImageView img_cam, img_cam2;
|
public final ImageView img_cam, img_cam2;
|
||||||
public final RelativeLayout parent_cam_layout;
|
public final RelativeLayout parent_cam_layout;
|
||||||
CardView card_view;
|
CardView card_view;
|
||||||
@@ -585,23 +684,26 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
checkHeaderArray.clear();
|
checkHeaderArray.clear();
|
||||||
|
|
||||||
for (int i = 0; i < data.size(); i++) {
|
for (int i = 0; i < data.size(); i++) {
|
||||||
if(data.get(i).getANSWER_TYPE().equalsIgnoreCase("TEXTBOX") && data.get(i).getANSWER().equalsIgnoreCase("")){
|
if (data.get(i).getANSWER_TYPE().equalsIgnoreCase("TEXTBOX") && data.get(i).getANSWER().equalsIgnoreCase("")
|
||||||
|
|| data.get(i).getANSWER_TYPE().equalsIgnoreCase("DECIMAL") && data.get(i).getANSWER().equalsIgnoreCase("")
|
||||||
|
|| data.get(i).getANSWER_TYPE().equalsIgnoreCase("NUMBER") && data.get(i).getANSWER().equalsIgnoreCase("")) {
|
||||||
error_msg = getString(R.string.pls_answer_all_qns);
|
error_msg = getString(R.string.pls_answer_all_qns);
|
||||||
checkflag = false;
|
checkflag = false;
|
||||||
}else if (data.get(i).getANSWER_TYPE().equalsIgnoreCase("DROPDOWN") && data.get(i).getANSWER_ID().equalsIgnoreCase("0")) {
|
} else if (data.get(i).getANSWER_TYPE().equalsIgnoreCase("DROPDOWN") && data.get(i).getANSWER_ID().equalsIgnoreCase("0")) {
|
||||||
error_msg = getString(R.string.pls_answer_all_qns);
|
error_msg = getString(R.string.pls_answer_all_qns);
|
||||||
checkflag = false;
|
checkflag = false;
|
||||||
} else if (data.get(i).getCAMERA_ALLOW().equals("1") && data.get(i).getCAM_IMAGE().equals("")) {
|
} else if (data.get(i).getCAMERA_ALLOW().equals("1") && data.get(i).getCAMERA_MANDATORY().equals("1") && data.get(i).getCAM_IMAGE().equals("")) {
|
||||||
error_msg = getString(R.string.click_image);
|
error_msg = getString(R.string.click_image);
|
||||||
checkflag = false;
|
checkflag = false;
|
||||||
} else if (data.get(i).getCAMERA_ALLOW().equals("1") && data.get(i).getNO_OF_CAMERA().equals("2") && data.get(i).getCAM_IMAGE2().equals("")) {
|
} else if (data.get(i).getCAMERA_ALLOW().equals("1") && data.get(i).getCAMERA_MANDATORY().equals("1")
|
||||||
|
&& data.get(i).getNO_OF_CAMERA().equals("2") && data.get(i).getCAM_IMAGE2().equals("")) {
|
||||||
error_msg = getString(R.string.click_image);
|
error_msg = getString(R.string.click_image);
|
||||||
checkflag = false;
|
checkflag = false;
|
||||||
//text
|
//text
|
||||||
} else if (data.get(i).getREMARK_ALLOW().equals("1") && data.get(i).getTXT_REMARK().equals("")) {
|
} else if (data.get(i).getREMARK_ALLOW().equals("1") && data.get(i).getTXT_REMARK().equals("")) {
|
||||||
error_msg = getString(R.string.pleaseenterRemarks);
|
error_msg = getString(R.string.pleaseenterRemarks);
|
||||||
checkflag = false;
|
checkflag = false;
|
||||||
}else {
|
} else {
|
||||||
checkflag = true;
|
checkflag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import java.text.SimpleDateFormat;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
||||||
@@ -86,25 +87,20 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
categoryName = getIntent().getStringExtra("categoryName");
|
categoryName = getIntent().getStringExtra("categoryName");
|
||||||
categoryId = getIntent().getStringExtra("categoryId");
|
categoryId = getIntent().getStringExtra("categoryId");
|
||||||
|
|
||||||
//store_id = "2";
|
|
||||||
date = preferences.getString(CommonString.KEY_DATE, null);
|
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
||||||
str = CommonString.FILE_PATH;
|
str = CommonString.getImagesFolder(context);
|
||||||
db = new GSKOrangeDB(CategoryPicture.this);
|
db = new GSKOrangeDB(CategoryPicture.this);
|
||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
im1 = (ImageView) findViewById(R.id.image1);
|
im1 = (ImageView) findViewById(R.id.image1);
|
||||||
im2 = (ImageView) findViewById(R.id.image2);
|
im2 = (ImageView) findViewById(R.id.image2);
|
||||||
im3 = (ImageView) findViewById(R.id.image3);
|
im3 = (ImageView) findViewById(R.id.image3);
|
||||||
im4 = (ImageView) findViewById(R.id.image4);
|
im4 = (ImageView) findViewById(R.id.image4);
|
||||||
listview = (ListView) findViewById(R.id.listview);
|
listview = (ListView) findViewById(R.id.listview);
|
||||||
|
|
||||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
|
|
||||||
|
|
||||||
adddata = db.getCategoryPictureData(store_id, categoryId);
|
adddata = db.getCategoryPictureData(store_id, categoryId);
|
||||||
categoryImagesAllowed = db.getCategoryPictureAllowedData(categoryId);
|
categoryImagesAllowed = db.getCategoryPictureAllowedData(categoryId);
|
||||||
|
|
||||||
if (categoryImagesAllowed.size() > 0) {
|
if (categoryImagesAllowed.size() > 0) {
|
||||||
setCamAllowImage(categoryImagesAllowed.get(0).isImg_cam1(), im1);
|
setCamAllowImage(categoryImagesAllowed.get(0).isImg_cam1(), im1);
|
||||||
setCamAllowImage(categoryImagesAllowed.get(0).isImg_cam2(), im2);
|
setCamAllowImage(categoryImagesAllowed.get(0).isImg_cam2(), im2);
|
||||||
@@ -124,36 +120,34 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
String image4 = adddata.get(0).getCategoryImage4();
|
String image4 = adddata.get(0).getCategoryImage4();
|
||||||
|
|
||||||
if (image1 != null && !image1.equals("")) {
|
if (image1 != null && !image1.equals("")) {
|
||||||
im1.setBackgroundResource(R.mipmap.camera_green);
|
im1.setImageResource(R.mipmap.camera_green);
|
||||||
img_str1 = image1;
|
img_str1 = image1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (image2 != null && !image2.equals("")) {
|
if (image2 != null && !image2.equals("")) {
|
||||||
im2.setBackgroundResource(R.mipmap.camera_green);
|
im2.setImageResource(R.mipmap.camera_green);
|
||||||
img_str2 = image2;
|
img_str2 = image2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (image3 != null && !image3.equals("")) {
|
if (image3 != null && !image3.equals("")) {
|
||||||
im3.setBackgroundResource(R.mipmap.camera_green);
|
im3.setImageResource(R.mipmap.camera_green);
|
||||||
img_str3 = image3;
|
img_str3 = image3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (image4 != null && !image4.equals("")) {
|
if (image4 != null && !image4.equals("")) {
|
||||||
im4.setBackgroundResource(R.mipmap.camera_green);
|
im4.setImageResource(R.mipmap.camera_green);
|
||||||
img_str4 = image4;
|
img_str4 = image4;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (country_id.equals("7")||country_id.equals("8")) {
|
if (country_id.equals("7")||country_id.equals("8") ||country_id.equals("11")|| country_id.equals("17")) {
|
||||||
listdat = db.getCategoryPicturedata(categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
listdat = db.getCategoryPicturedata(categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
listdat = db.getCategoryPicturedata(categoryId, key_account_id, store_type_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
listdat = db.getCategoryPicturedata(categoryId, key_account_id, store_type_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
} else {
|
} else {
|
||||||
listdat = db.getCategoryPicturedata(categoryId, key_account_id, store_type_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK);
|
listdat = db.getCategoryPicturedata(categoryId, key_account_id, store_type_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
adapteradditional = new CategoryPicture.CategoryAdapter(CategoryPicture.this, listdat);
|
adapteradditional = new CategoryPicture.CategoryAdapter(CategoryPicture.this, listdat);
|
||||||
listview.setAdapter(adapteradditional);
|
listview.setAdapter(adapteradditional);
|
||||||
|
|
||||||
@@ -161,9 +155,7 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
fab.setOnClickListener(new View.OnClickListener() {
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(final View view) {
|
public void onClick(final View view) {
|
||||||
|
|
||||||
final CategoryPictureGetterSetter CP = new CategoryPictureGetterSetter();
|
final CategoryPictureGetterSetter CP = new CategoryPictureGetterSetter();
|
||||||
|
|
||||||
CP.setCategoryImage1(img_str1);
|
CP.setCategoryImage1(img_str1);
|
||||||
CP.setCategoryImage2(img_str2);
|
CP.setCategoryImage2(img_str2);
|
||||||
CP.setCategoryImage3(img_str3);
|
CP.setCategoryImage3(img_str3);
|
||||||
@@ -172,55 +164,23 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
CP.setCamera_allow(camera_allow);
|
CP.setCamera_allow(camera_allow);
|
||||||
|
|
||||||
if (validateData(CP, listdat)) {
|
if (validateData(CP, listdat)) {
|
||||||
|
|
||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
db.InsertCategoryPictureData(CP, listdat, categoryId);
|
db.InsertCategoryPictureData(CP, listdat, categoryId);
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
|
||||||
/* AlertDialog.Builder builder = new AlertDialog.Builder(CategoryPicture.this);
|
|
||||||
builder.setMessage(getResources().getString(R.string.check_save_message))
|
|
||||||
.setCancelable(false)
|
|
||||||
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
db.open();
|
|
||||||
|
|
||||||
db.InsertCategoryPictureData(CP, listdat, categoryId);
|
|
||||||
finish();
|
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
dialog.cancel();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
AlertDialog alert = builder.create();
|
|
||||||
alert.show();*/
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(view, R.string.title_activity_take_image, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(view, R.string.title_activity_take_image, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
im1.setOnClickListener(new View.OnClickListener() {
|
im1.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
|
|
||||||
_pathforcheck1 = store_id + "CategoryPicture1" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck1 = store_id + "CategoryPicture1" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
_path = CommonString.getImagesFolder(context)+ _pathforcheck1;
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck1;
|
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -230,11 +190,9 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
|
|
||||||
_pathforcheck2 = store_id + "CategoryPicture2" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck2 = store_id + "CategoryPicture2" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck2;
|
_path = CommonString.getImagesFolder(context)+ _pathforcheck2;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
im3.setOnClickListener(new View.OnClickListener() {
|
im3.setOnClickListener(new View.OnClickListener() {
|
||||||
@@ -243,7 +201,7 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
|
|
||||||
_pathforcheck3 = store_id + "CategoryPicture3" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck3 = store_id + "CategoryPicture3" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck3;
|
_path = CommonString.getImagesFolder(context)+ _pathforcheck3;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
@@ -256,7 +214,7 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
|
|
||||||
_pathforcheck4 = store_id + "CategoryPicture4" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck4 = store_id + "CategoryPicture4" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck4;
|
_path = CommonString.getImagesFolder(context)+ _pathforcheck4;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
@@ -288,9 +246,9 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
cdate = arabicToenglish(cdate);
|
cdate = arabicToenglish(cdate);
|
||||||
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
||||||
cdate = arabicToenglish(cdate);
|
cdate = arabicToenglish(cdate);
|
||||||
|
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return cdate;
|
return cdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,7 +326,7 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
if (_pathforcheck1 != null && !_pathforcheck1.equals("")) {
|
if (_pathforcheck1 != null && !_pathforcheck1.equals("")) {
|
||||||
if (new File(str + _pathforcheck1).exists()) {
|
if (new File(str + _pathforcheck1).exists()) {
|
||||||
|
|
||||||
im1.setBackgroundResource(R.mipmap.camera_green);
|
im1.setImageResource(R.mipmap.camera_green);
|
||||||
|
|
||||||
img_str1 = _pathforcheck1;
|
img_str1 = _pathforcheck1;
|
||||||
_pathforcheck1 = "";
|
_pathforcheck1 = "";
|
||||||
@@ -377,7 +335,7 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
if (_pathforcheck2 != null && !_pathforcheck2.equals("")) {
|
if (_pathforcheck2 != null && !_pathforcheck2.equals("")) {
|
||||||
if (new File(str + _pathforcheck2).exists()) {
|
if (new File(str + _pathforcheck2).exists()) {
|
||||||
|
|
||||||
im2.setBackgroundResource(R.mipmap.camera_green);
|
im2.setImageResource(R.mipmap.camera_green);
|
||||||
|
|
||||||
img_str2 = _pathforcheck2;
|
img_str2 = _pathforcheck2;
|
||||||
_pathforcheck2 = "";
|
_pathforcheck2 = "";
|
||||||
@@ -387,7 +345,7 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
if (_pathforcheck3 != null && !_pathforcheck3.equals("")) {
|
if (_pathforcheck3 != null && !_pathforcheck3.equals("")) {
|
||||||
if (new File(str + _pathforcheck3).exists()) {
|
if (new File(str + _pathforcheck3).exists()) {
|
||||||
|
|
||||||
im3.setBackgroundResource(R.mipmap.camera_green);
|
im3.setImageResource(R.mipmap.camera_green);
|
||||||
|
|
||||||
img_str3 = _pathforcheck3;
|
img_str3 = _pathforcheck3;
|
||||||
_pathforcheck3 = "";
|
_pathforcheck3 = "";
|
||||||
@@ -397,7 +355,7 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
if (_pathforcheck4 != null && !_pathforcheck4.equals("")) {
|
if (_pathforcheck4 != null && !_pathforcheck4.equals("")) {
|
||||||
if (new File(str + _pathforcheck4).exists()) {
|
if (new File(str + _pathforcheck4).exists()) {
|
||||||
|
|
||||||
im4.setBackgroundResource(R.mipmap.camera_green);
|
im4.setImageResource(R.mipmap.camera_green);
|
||||||
|
|
||||||
img_str4 = _pathforcheck4;
|
img_str4 = _pathforcheck4;
|
||||||
_pathforcheck4 = "";
|
_pathforcheck4 = "";
|
||||||
@@ -479,9 +437,7 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
convertView = mInflater
|
convertView = mInflater
|
||||||
.inflate(R.layout.contentcatgoryadpterlayout, null);
|
.inflate(R.layout.contentcatgoryadpterlayout, null);
|
||||||
holder = new CategoryPicture.CategoryAdapter.ViewHolder();
|
holder = new CategoryPicture.CategoryAdapter.ViewHolder();
|
||||||
|
|
||||||
holder.brand = (TextView) convertView.findViewById(R.id.textviewname);
|
holder.brand = (TextView) convertView.findViewById(R.id.textviewname);
|
||||||
|
|
||||||
holder.camera1 = (Button) convertView.findViewById(R.id.button3);
|
holder.camera1 = (Button) convertView.findViewById(R.id.button3);
|
||||||
holder.camera2 = (Button) convertView.findViewById(R.id.cameranew);
|
holder.camera2 = (Button) convertView.findViewById(R.id.cameranew);
|
||||||
convertView.setTag(holder);
|
convertView.setTag(holder);
|
||||||
@@ -490,26 +446,29 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
holder.camera1.setOnClickListener(new View.OnClickListener() {
|
holder.camera1.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
Camerapath1 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID().toString() + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
//Camerapath1 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID()+ date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
Adapterposition = position1;
|
/* if(CommonFunctions.getCurrentTimeWithLanguage(mcontext).replace(":", "").contains("????")){
|
||||||
|
Camerapath1 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID()+ date.replace("/", "") + new Random().nextInt(999999) + ".jpg";
|
||||||
_path = CommonString.FILE_PATH + Camerapath1;
|
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
|
||||||
startCameraActivity();
|
|
||||||
|
|
||||||
listview.invalidateViews();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
Camerapath1 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID()+ date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(mcontext).replace(":", "") + ".jpg";
|
||||||
|
}*/
|
||||||
|
|
||||||
|
Camerapath1 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID()+ date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(mcontext).replace(":", "") + ".jpg";
|
||||||
|
Adapterposition = position1;
|
||||||
|
// Log.e("Camimage",Camerapath1);
|
||||||
|
_path = CommonString.getImagesFolder(context)+ Camerapath1;
|
||||||
|
// intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
|
intime = CommonFunctions.getCurrentTimeWithLanguage(mcontext);
|
||||||
|
startCameraActivity();
|
||||||
|
listview.invalidateViews();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
holder.camera2.setOnClickListener(new View.OnClickListener() {
|
holder.camera2.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
@@ -517,15 +476,16 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
Snackbar.make(listview,R.string.first_click_compulsory_image,Snackbar.LENGTH_LONG).show();
|
Snackbar.make(listview,R.string.first_click_compulsory_image,Snackbar.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Camerapath2 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID().toString() + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
// Camerapath2 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID().toString() + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
Camerapath2 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID().toString() + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(mcontext).replace(":", "") + ".jpg";
|
||||||
Adapterposition = position1;
|
Adapterposition = position1;
|
||||||
_path = CommonString.FILE_PATH + Camerapath2;
|
_path = CommonString.getImagesFolder(context)+ Camerapath2;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(mcontext);
|
||||||
|
// intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
listview.invalidateViews();
|
listview.invalidateViews();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
holder.brand.setText(list.get(position1).getSUB_CATEGORY().toString());
|
holder.brand.setText(list.get(position1).getSUB_CATEGORY().toString());
|
||||||
@@ -551,9 +511,7 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
holder.camera2.setBackgroundResource(R.mipmap.camera_orange);
|
holder.camera2.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
holder.brand.setId(position1);
|
holder.brand.setId(position1);
|
||||||
|
|
||||||
return convertView;
|
return convertView;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -663,8 +621,7 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
//super.onBackPressed();
|
super.onBackPressed();
|
||||||
|
|
||||||
showDataLossAlert();
|
showDataLossAlert();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -678,9 +635,9 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
public void setCamAllowImage(boolean isAllowed, ImageView img_cam) {
|
public void setCamAllowImage(boolean isAllowed, ImageView img_cam) {
|
||||||
|
|
||||||
if (isAllowed) {
|
if (isAllowed) {
|
||||||
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
img_cam.setImageResource(R.drawable.camera_orange_star_green);
|
||||||
} else {
|
} else {
|
||||||
img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
img_cam.setImageResource(R.mipmap.camera_orange);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,9 +156,6 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
SoapObject request = new SoapObject(CommonString.NAMESPACE, service);
|
SoapObject request = new SoapObject(CommonString.NAMESPACE, service);
|
||||||
request.addProperty("onXML", sos_xml);
|
request.addProperty("onXML", sos_xml);
|
||||||
/*request.addProperty("KEYS", "CHECKOUT_STATUS");
|
|
||||||
request.addProperty("USERNAME", username);*/
|
|
||||||
//request.addProperty("MID", mid);
|
|
||||||
|
|
||||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
@@ -232,8 +229,6 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
showAlert(CommonString.MESSAGE_EXCEPTION);
|
showAlert(CommonString.MESSAGE_EXCEPTION);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -246,12 +241,6 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
public void run() {
|
public void run() {
|
||||||
showAlert(CommonString.MESSAGE_SOCKETEXCEPTION);
|
showAlert(CommonString.MESSAGE_SOCKETEXCEPTION);
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
/*
|
|
||||||
* if (counter < 10) { new
|
|
||||||
* BackgroundTask(CheckOutUploadActivity
|
|
||||||
* .this).execute(); } else { message.showMessage();
|
|
||||||
* counter =1; }
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -288,20 +277,11 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
showAlert(getString(R.string.checkout_successful));
|
showAlert(getString(R.string.checkout_successful));
|
||||||
|
|
||||||
//finish();
|
|
||||||
|
|
||||||
} else if (!result.equals("")) {
|
} else if (!result.equals("")) {
|
||||||
/*AlertMessage message = new AlertMessage(
|
|
||||||
CheckOutStoreActivity.this, CommonString1.ERROR + result, "success", null);
|
|
||||||
message.showMessage();*/
|
|
||||||
|
|
||||||
Toast.makeText(context, "Network Error Try Again", Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, "Network Error Try Again", Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Data {
|
class Data {
|
||||||
@@ -316,15 +296,6 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
toolbar.setTitle(getResources().getString(R.string.title_activity_checkout));
|
toolbar.setTitle(getResources().getString(R.string.title_activity_checkout));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public String getCurrentTimeNotUsed() {
|
|
||||||
Calendar m_cal = Calendar.getInstance();
|
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
|
||||||
String cdate = formatter.format(m_cal.getTime());
|
|
||||||
|
|
||||||
return cdate;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
private static String arabicToenglish(String number) {
|
private static String arabicToenglish(String number) {
|
||||||
char[] chars = new char[number.length()];
|
char[] chars = new char[number.length()];
|
||||||
for (int i = 0; i < number.length(); i++) {
|
for (int i = 0; i < number.length(); i++) {
|
||||||
@@ -335,39 +306,31 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
ch -= 0x06f0 - '0';
|
ch -= 0x06f0 - '0';
|
||||||
chars[i] = ch;
|
chars[i] = ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new String(chars);
|
return new String(chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCurrentTimeNotUsed() {
|
public String getCurrentTimeNotUsed() {
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
||||||
String cdate = formatter.format(m_cal.getTime());
|
String cdate = formatter.format(m_cal.getTime());
|
||||||
|
|
||||||
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
||||||
cdate = arabicToenglish(cdate);
|
cdate = arabicToenglish(cdate);
|
||||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
||||||
cdate = arabicToenglish(cdate);
|
cdate = arabicToenglish(cdate);
|
||||||
}
|
}
|
||||||
|
else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}
|
||||||
return cdate;
|
return cdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showAlert(String str) {
|
public void showAlert(String str) {
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(CheckoutActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(CheckoutActivity.this);
|
||||||
builder.setTitle("Parinaam");
|
builder.setTitle("Parinaam");
|
||||||
builder.setMessage(str).setCancelable(false)
|
builder.setMessage(str).setCancelable(false)
|
||||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
/* Intent i = new Intent(activity, StorelistActivity.class);
|
|
||||||
activity.startActivity(i);
|
|
||||||
activity.finish();*/
|
|
||||||
finish();
|
finish();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
AlertDialog alert = builder.create();
|
AlertDialog alert = builder.create();
|
||||||
|
|||||||
+23
-74
@@ -33,6 +33,7 @@ import com.androidbuts.multispinnerfilter.MultiSpinnerSearch;
|
|||||||
import com.androidbuts.multispinnerfilter.SpinnerListener;
|
import com.androidbuts.multispinnerfilter.SpinnerListener;
|
||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -47,7 +48,6 @@ import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;
|
||||||
|
|
||||||
public class CoachingVisitActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener, View.OnClickListener {
|
public class CoachingVisitActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener, View.OnClickListener {
|
||||||
|
|
||||||
private Context context;
|
private Context context;
|
||||||
private GSKOrangeDB database;
|
private GSKOrangeDB database;
|
||||||
ArrayList<SupervisorListGetterSetter> supervisorList;
|
ArrayList<SupervisorListGetterSetter> supervisorList;
|
||||||
@@ -67,7 +67,6 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
ArrayList<CoachingVisitGetterSetter> coachingVisitdata;
|
ArrayList<CoachingVisitGetterSetter> coachingVisitdata;
|
||||||
boolean coaching_visit_camera_flag = false;
|
boolean coaching_visit_camera_flag = false;
|
||||||
MultiSpinnerSearch multi_spinner_supervisor;
|
MultiSpinnerSearch multi_spinner_supervisor;
|
||||||
|
|
||||||
ArrayList<String> selectedSupervisorList = new ArrayList<>();
|
ArrayList<String> selectedSupervisorList = new ArrayList<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -93,7 +92,7 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
|
|
||||||
toolbar.setTitle(getResources().getString(R.string.title_activity_coaching_visit));
|
toolbar.setTitle(getResources().getString(R.string.title_activity_coaching_visit));
|
||||||
|
|
||||||
str = CommonString.FILE_PATH;
|
str = CommonString.getImagesFolder(context);
|
||||||
|
|
||||||
store_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
store_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||||
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
||||||
@@ -116,8 +115,7 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
if (configurationData.size() > 0) {
|
if (configurationData.size() > 0) {
|
||||||
|
|
||||||
for (int i = 0; i < configurationData.size(); i++) {
|
for (int i = 0; i < configurationData.size(); i++) {
|
||||||
if (configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("COACHING VISIT IMAGE") &&
|
if (configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("COACHING VISIT IMAGE") && configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")) {
|
||||||
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")) {
|
|
||||||
coaching_visit_camera_flag = true;
|
coaching_visit_camera_flag = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -133,8 +131,7 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
|
|
||||||
supervisorList = database.getSupervisorListData();
|
supervisorList = database.getSupervisorListData();
|
||||||
|
|
||||||
exist_adapter = new ArrayAdapter<>(this,
|
exist_adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item);
|
||||||
android.R.layout.simple_spinner_item);
|
|
||||||
|
|
||||||
String select_str = getResources().getString(R.string.select);
|
String select_str = getResources().getString(R.string.select);
|
||||||
|
|
||||||
@@ -144,8 +141,7 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
|
|
||||||
exist_spinner.setAdapter(exist_adapter);
|
exist_spinner.setAdapter(exist_adapter);
|
||||||
|
|
||||||
exist_adapter
|
exist_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
|
||||||
|
|
||||||
exist_spinner.setOnItemSelectedListener(this);
|
exist_spinner.setOnItemSelectedListener(this);
|
||||||
|
|
||||||
@@ -170,43 +166,19 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
|
||||||
switch (parent.getId()) {
|
if (parent.getId() == R.id.spinner_coaching_visit) {
|
||||||
case R.id.spinner_coaching_visit:
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
|
|
||||||
if (!update_flag) {
|
if (!update_flag) {
|
||||||
|
|
||||||
fab_save.show();//setVisibility(View.VISIBLE);
|
fab_save.show(); //setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
if (position == 1) {
|
if (position == 1) {
|
||||||
|
|
||||||
linear_supervisor.setVisibility(View.VISIBLE);
|
linear_supervisor.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
coaching_visit = 1;
|
coaching_visit = 1;
|
||||||
|
|
||||||
/*supervisor_adapter = new ArrayAdapter<CharSequence>(this,
|
|
||||||
android.R.layout.simple_spinner_item);
|
|
||||||
|
|
||||||
String select_str = getResources().getString(R.string.select_promo);
|
|
||||||
|
|
||||||
supervisor_adapter.add(select_str);
|
|
||||||
|
|
||||||
for (int i = 0; i < supervisorList.size(); i++) {
|
|
||||||
supervisor_adapter.add(supervisorList.get(i).getSUPERVISOR().get(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
supervisor_spinner.setAdapter(supervisor_adapter);
|
|
||||||
|
|
||||||
supervisor_adapter
|
|
||||||
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
|
||||||
|
|
||||||
supervisor_spinner.setOnItemSelectedListener(this);*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Getting array of String to Bind in Spinner
|
|
||||||
*/
|
|
||||||
//final List<String> list = Arrays.asList(getResources().getStringArray(R.array.sports_array));
|
|
||||||
|
|
||||||
final List<KeyPairBoolData> listArray0 = new ArrayList<>();
|
final List<KeyPairBoolData> listArray0 = new ArrayList<>();
|
||||||
|
|
||||||
for (int i = 0; i < supervisorList.size(); i++) {
|
for (int i = 0; i < supervisorList.size(); i++) {
|
||||||
@@ -218,7 +190,6 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
}
|
}
|
||||||
|
|
||||||
multi_spinner_supervisor.setItems(listArray0, -1, new SpinnerListener() {
|
multi_spinner_supervisor.setItems(listArray0, -1, new SpinnerListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemsSelected(List<KeyPairBoolData> items) {
|
public void onItemsSelected(List<KeyPairBoolData> items) {
|
||||||
|
|
||||||
@@ -226,7 +197,6 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
|
|
||||||
for (int i = 0; i < items.size(); i++) {
|
for (int i = 0; i < items.size(); i++) {
|
||||||
if (items.get(i).isSelected()) {
|
if (items.get(i).isSelected()) {
|
||||||
|
|
||||||
selectedSupervisorList.add(items.get(i).getName());
|
selectedSupervisorList.add(items.get(i).getName());
|
||||||
Log.i("MultiSpinner", i + " : " + items.get(i).getName() + " : " + items.get(i).isSelected());
|
Log.i("MultiSpinner", i + " : " + items.get(i).getName() + " : " + items.get(i).isSelected());
|
||||||
}
|
}
|
||||||
@@ -242,25 +212,15 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
coaching_visit = -1;
|
coaching_visit = -1;
|
||||||
linear_supervisor.setVisibility(View.GONE);
|
linear_supervisor.setVisibility(View.GONE);
|
||||||
fab_save.hide();//setVisibility(View.GONE);
|
fab_save.hide(); //setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (parent.getId() == R.id.multi_spinner_supervisor) {
|
||||||
|
// Commented-out code from original
|
||||||
case R.id.multi_spinner_supervisor:
|
|
||||||
|
|
||||||
/* if(position!=0){
|
|
||||||
emp_id = supervisorList.get(position-1).getEMP_ID().get(0);
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
emp_id = "";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -271,22 +231,18 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
switch (v.getId()) {
|
if (v.getId() == R.id.img_cam) {
|
||||||
case R.id.img_cam:
|
|
||||||
_pathforcheck = store_id + "CoachingVisit" + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck = store_id + "CoachingVisit" + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
|
||||||
|
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.fab_save:
|
} else if (v.getId() == R.id.fab_save) {
|
||||||
|
|
||||||
if (coaching_visit == 1) {
|
if (coaching_visit == 1) {
|
||||||
|
|
||||||
String error_msg = "";
|
String error_msg = "";
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
//if(emp_id.equals("")){
|
|
||||||
if (selectedSupervisorList.size() == 0) {
|
if (selectedSupervisorList.size() == 0) {
|
||||||
flag = false;
|
flag = false;
|
||||||
error_msg = getString(R.string.title_activity_select_dropdown);
|
error_msg = getString(R.string.title_activity_select_dropdown);
|
||||||
@@ -296,24 +252,21 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
|
|
||||||
for (int i = 0; i < selectedSupervisorList.size(); i++) {
|
for (int i = 0; i < selectedSupervisorList.size(); i++) {
|
||||||
CoachingVisitGetterSetter coachingVisitGetterSetter = new CoachingVisitGetterSetter();
|
CoachingVisitGetterSetter coachingVisitGetterSetter = new CoachingVisitGetterSetter();
|
||||||
coachingVisitGetterSetter.setEmp_id(getEmp_idFromName(selectedSupervisorList.get(i)));
|
coachingVisitGetterSetter.setEmp_id(getEmp_idFromName(selectedSupervisorList.get(i)));
|
||||||
coachingVisitGetterSetter.setImg_path(image_name);
|
coachingVisitGetterSetter.setImg_path(image_name);
|
||||||
coachingVisitGetterSetter.setExists(coaching_visit == 1);
|
coachingVisitGetterSetter.setExists(coaching_visit == 1);
|
||||||
|
|
||||||
database.insertCoachingVisitData(coachingVisitGetterSetter, store_id);
|
database.insertCoachingVisitData(coachingVisitGetterSetter, store_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Toast.makeText(context, getString(R.string.save_message), Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, getString(R.string.save_message), Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
saved_flag = true;
|
saved_flag = true;
|
||||||
|
fab_next.show(); // setVisibility(View.VISIBLE);
|
||||||
fab_next.show();//setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(linear_supervisor, error_msg, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(linear_supervisor, error_msg, Snackbar.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
CoachingVisitGetterSetter coachingVisitGetterSetter = new CoachingVisitGetterSetter();
|
CoachingVisitGetterSetter coachingVisitGetterSetter = new CoachingVisitGetterSetter();
|
||||||
coachingVisitGetterSetter.setEmp_id("0");
|
coachingVisitGetterSetter.setEmp_id("0");
|
||||||
@@ -324,27 +277,23 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
|
|
||||||
Toast.makeText(context, getString(R.string.save_message), Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, getString(R.string.save_message), Toast.LENGTH_SHORT).show();
|
||||||
saved_flag = true;
|
saved_flag = true;
|
||||||
fab_next.show();//setVisibility(View.VISIBLE);
|
fab_next.show(); // setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (v.getId() == R.id.fab) {
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.fab:
|
|
||||||
|
|
||||||
if (saved_flag || update_flag) {
|
if (saved_flag || update_flag) {
|
||||||
|
Intent i = new Intent(CoachingVisitActivity.this, CoachingVisitStoreActivity.class);
|
||||||
Intent i = new Intent(CoachingVisitActivity.this, StoreCheckoutImageActivity.class);
|
|
||||||
i.putExtra(CommonString.KEY_STORE_ID, store_id);
|
i.putExtra(CommonString.KEY_STORE_ID, store_id);
|
||||||
i.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
i.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
startActivity(i);
|
startActivity(i);
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(linear_supervisor, getString(R.string.please_save_data), Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(linear_supervisor, getString(R.string.please_save_data), Snackbar.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String getEmp_idFromName(String name) {
|
String getEmp_idFromName(String name) {
|
||||||
|
|||||||
+419
@@ -0,0 +1,419 @@
|
|||||||
|
package cpm.com.gskmtorange.dailyentry;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.ActivityNotFoundException;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.pm.ApplicationInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.provider.MediaStore;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.Spinner;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
|
import com.androidbuts.multispinnerfilter.KeyPairBoolData;
|
||||||
|
import com.androidbuts.multispinnerfilter.MultiSpinnerSearch;
|
||||||
|
import com.androidbuts.multispinnerfilter.SpinnerListener;
|
||||||
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.CoachingVisitGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;
|
||||||
|
|
||||||
|
public class CoachingVisitStoreActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener, View.OnClickListener {
|
||||||
|
|
||||||
|
private Context context;
|
||||||
|
private GSKOrangeDB database;
|
||||||
|
ArrayList<SupervisorListGetterSetter> supervisorList;
|
||||||
|
private Spinner exist_spinner; //supervisor_spinner;
|
||||||
|
private ArrayAdapter<CharSequence> exist_adapter, supervisor_adapter;
|
||||||
|
int coaching_visit;
|
||||||
|
LinearLayout linear_supervisor;
|
||||||
|
ImageView img_cam;
|
||||||
|
FloatingActionButton fab_next, fab_save;
|
||||||
|
String emp_id;
|
||||||
|
protected String _pathforcheck = "", _path, image_name = "", str, country_id, store_flag_str;
|
||||||
|
String visit_date, store_id, username;
|
||||||
|
private SharedPreferences preferences;
|
||||||
|
String gallery_package = "";
|
||||||
|
Uri outputFileUri;
|
||||||
|
boolean saved_flag = false, update_flag = false;
|
||||||
|
ArrayList<CoachingVisitGetterSetter> coachingVisitdata;
|
||||||
|
boolean coaching_visit_camera_flag = false;
|
||||||
|
MultiSpinnerSearch multi_spinner_supervisor;
|
||||||
|
|
||||||
|
ArrayList<String> selectedSupervisorList = new ArrayList<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_coaching_visit_store);
|
||||||
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
linear_supervisor = (LinearLayout) findViewById(R.id.linear_supervisor);
|
||||||
|
exist_spinner = (Spinner) findViewById(R.id.spinner_coaching_visit);
|
||||||
|
//supervisor_spinner = (Spinner) findViewById(R.id.spinner_supervisor);
|
||||||
|
img_cam = (ImageView) findViewById(R.id.img_cam);
|
||||||
|
|
||||||
|
multi_spinner_supervisor = (MultiSpinnerSearch) findViewById(R.id.multi_spinner_supervisor);
|
||||||
|
context = this;
|
||||||
|
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
|
toolbar.setTitle(getResources().getString(R.string.title_activity_coaching_visit_store));
|
||||||
|
|
||||||
|
str = CommonString.getImagesFolder(context);
|
||||||
|
|
||||||
|
store_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||||
|
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
||||||
|
|
||||||
|
username = preferences.getString(CommonString.KEY_USERNAME, "");
|
||||||
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
//store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||||
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||||
|
|
||||||
|
fab_next = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
|
fab_save = (FloatingActionButton) findViewById(R.id.fab_save);
|
||||||
|
|
||||||
|
database = new GSKOrangeDB(this);
|
||||||
|
database.open();
|
||||||
|
|
||||||
|
coachingVisitdata = database.getCoachingVisitStoreData(store_id);
|
||||||
|
|
||||||
|
//Enable disable According to Configuration
|
||||||
|
ArrayList<ConfigurationMasterGetterSetter> configurationData = database.getConfigurationMasterData(country_id);
|
||||||
|
if (configurationData.size() > 0) {
|
||||||
|
|
||||||
|
for (int i = 0; i < configurationData.size(); i++) {
|
||||||
|
if (configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("COACHING VISIT IMAGE") &&
|
||||||
|
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")) {
|
||||||
|
coaching_visit_camera_flag = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (coaching_visit_camera_flag) {
|
||||||
|
img_cam.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
img_cam.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
supervisorList = database.getSupervisorcheckListData();
|
||||||
|
|
||||||
|
exist_adapter = new ArrayAdapter<>(this,
|
||||||
|
android.R.layout.simple_spinner_item);
|
||||||
|
|
||||||
|
String select_str = getResources().getString(R.string.select);
|
||||||
|
|
||||||
|
exist_adapter.add(select_str);
|
||||||
|
exist_adapter.add(getResources().getString(R.string.yes));
|
||||||
|
exist_adapter.add(getResources().getString(R.string.no));
|
||||||
|
|
||||||
|
exist_spinner.setAdapter(exist_adapter);
|
||||||
|
|
||||||
|
exist_adapter
|
||||||
|
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
|
|
||||||
|
exist_spinner.setOnItemSelectedListener(this);
|
||||||
|
|
||||||
|
if (coachingVisitdata.size() != 0) {
|
||||||
|
update_flag = true;
|
||||||
|
fab_save.hide();//setVisibility(View.GONE);
|
||||||
|
fab_next.show();//setVisibility(View.VISIBLE);
|
||||||
|
if (coachingVisitdata.get(0).isExists()) {
|
||||||
|
exist_spinner.setSelection(1);
|
||||||
|
} else {
|
||||||
|
exist_spinner.setSelection(2);
|
||||||
|
}
|
||||||
|
exist_spinner.setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
fab_next.setOnClickListener(this);
|
||||||
|
fab_save.setOnClickListener(this);
|
||||||
|
img_cam.setOnClickListener(this);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
|
||||||
|
if (parent.getId() == R.id.spinner_coaching_visit) {
|
||||||
|
|
||||||
|
if (position != 0) {
|
||||||
|
|
||||||
|
if (!update_flag) {
|
||||||
|
|
||||||
|
fab_save.show(); // setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
if (position == 1) {
|
||||||
|
|
||||||
|
linear_supervisor.setVisibility(View.VISIBLE);
|
||||||
|
coaching_visit = 1;
|
||||||
|
|
||||||
|
// Creating list for multi-spinner
|
||||||
|
final List<KeyPairBoolData> listArray0 = new ArrayList<>();
|
||||||
|
|
||||||
|
for (int i = 0; i < supervisorList.size(); i++) {
|
||||||
|
KeyPairBoolData h = new KeyPairBoolData();
|
||||||
|
h.setId(i + 1);
|
||||||
|
h.setName(supervisorList.get(i).getSUPERVISOR().get(0));
|
||||||
|
h.setSelected(false);
|
||||||
|
listArray0.add(h);
|
||||||
|
}
|
||||||
|
|
||||||
|
multi_spinner_supervisor.setItems(listArray0, -1, new SpinnerListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemsSelected(List<KeyPairBoolData> items) {
|
||||||
|
selectedSupervisorList.clear();
|
||||||
|
for (int i = 0; i < items.size(); i++) {
|
||||||
|
if (items.get(i).isSelected()) {
|
||||||
|
selectedSupervisorList.add(items.get(i).getName());
|
||||||
|
Log.i("MultiSpinner", i + " : " + items.get(i).getName() + " : " + items.get(i).isSelected());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
coaching_visit = 0;
|
||||||
|
selectedSupervisorList.clear();
|
||||||
|
linear_supervisor.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
coaching_visit = -1;
|
||||||
|
linear_supervisor.setVisibility(View.GONE);
|
||||||
|
fab_save.hide(); // setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
if (v.getId() == R.id.img_cam) {
|
||||||
|
|
||||||
|
_pathforcheck = store_id + "CheckVisit" + visit_date.replace("/", "") +
|
||||||
|
CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
|
|
||||||
|
startCameraActivity();
|
||||||
|
|
||||||
|
} else if (v.getId() == R.id.fab_save) {
|
||||||
|
|
||||||
|
if (coaching_visit == 1) {
|
||||||
|
String error_msg = "";
|
||||||
|
boolean flag = true;
|
||||||
|
|
||||||
|
if (selectedSupervisorList.size() == 0) {
|
||||||
|
flag = false;
|
||||||
|
error_msg = getString(R.string.title_activity_select_dropdown);
|
||||||
|
} else if (coaching_visit_camera_flag && image_name.equals("")) {
|
||||||
|
flag = false;
|
||||||
|
error_msg = getString(R.string.clickimage);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag) {
|
||||||
|
for (int i = 0; i < selectedSupervisorList.size(); i++) {
|
||||||
|
CoachingVisitGetterSetter coachingVisitGetterSetter = new CoachingVisitGetterSetter();
|
||||||
|
coachingVisitGetterSetter.setEmp_id(getEmp_idFromName(selectedSupervisorList.get(i)));
|
||||||
|
coachingVisitGetterSetter.setImg_path(image_name);
|
||||||
|
coachingVisitGetterSetter.setExists(coaching_visit == 1);
|
||||||
|
|
||||||
|
database.insertCoachingVisitStoreData(coachingVisitGetterSetter, store_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
Toast.makeText(context, getString(R.string.save_message), Toast.LENGTH_SHORT).show();
|
||||||
|
saved_flag = true;
|
||||||
|
fab_next.show(); // setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Snackbar.make(linear_supervisor, error_msg, Snackbar.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
CoachingVisitGetterSetter coachingVisitGetterSetter = new CoachingVisitGetterSetter();
|
||||||
|
coachingVisitGetterSetter.setEmp_id("0");
|
||||||
|
coachingVisitGetterSetter.setImg_path(image_name);
|
||||||
|
coachingVisitGetterSetter.setExists(coaching_visit == 1);
|
||||||
|
|
||||||
|
database.insertCoachingVisitStoreData(coachingVisitGetterSetter, store_id);
|
||||||
|
|
||||||
|
Toast.makeText(context, getString(R.string.save_message), Toast.LENGTH_SHORT).show();
|
||||||
|
saved_flag = true;
|
||||||
|
fab_next.show(); // setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (v.getId() == R.id.fab) {
|
||||||
|
|
||||||
|
if (saved_flag || update_flag) {
|
||||||
|
|
||||||
|
Intent i = new Intent(CoachingVisitStoreActivity.this, StoreCheckoutImageActivity.class);
|
||||||
|
i.putExtra(CommonString.KEY_STORE_ID, store_id);
|
||||||
|
i.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
|
startActivity(i);
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Snackbar.make(linear_supervisor, getString(R.string.please_save_data), Snackbar.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String getEmp_idFromName(String name) {
|
||||||
|
String emp_id = "0";
|
||||||
|
|
||||||
|
for (int i = 0; i < supervisorList.size(); i++) {
|
||||||
|
if (supervisorList.get(i).getSUPERVISOR().get(0).equalsIgnoreCase(name)) {
|
||||||
|
emp_id = supervisorList.get(i).getEMP_ID().get(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return emp_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void startCameraActivity() {
|
||||||
|
try {
|
||||||
|
|
||||||
|
Log.i("MakeMachine", "startCameraActivity()");
|
||||||
|
File file = new File(_path);
|
||||||
|
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||||
|
|
||||||
|
String defaultCameraPackage = "";
|
||||||
|
final PackageManager packageManager = getPackageManager();
|
||||||
|
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||||
|
for (int n = 0; n < list.size(); n++) {
|
||||||
|
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
||||||
|
Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
||||||
|
Log.e("TAG", "package name : " + list.get(n).packageName);
|
||||||
|
|
||||||
|
//temp value in case camera is gallery app above jellybean
|
||||||
|
String packag = list.get(n).loadLabel(packageManager).toString();
|
||||||
|
if (packag.equalsIgnoreCase("Gallery") || packag.equalsIgnoreCase("Galeri") || packag.equalsIgnoreCase("الاستوديو")) {
|
||||||
|
gallery_package = list.get(n).packageName;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
|
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
||||||
|
defaultCameraPackage = list.get(n).packageName;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
||||||
|
|
||||||
|
defaultCameraPackage = list.get(n).packageName;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//com.android.gallery3d
|
||||||
|
|
||||||
|
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||||
|
intent.setPackage(defaultCameraPackage);
|
||||||
|
startActivityForResult(intent, 0);
|
||||||
|
} catch (ActivityNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
|
||||||
|
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||||
|
intent.setPackage(gallery_package);
|
||||||
|
startActivityForResult(intent, 0);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||||
|
// Crashlytics.logException(e.getCause());
|
||||||
|
//Crashlytics.logException(new Exception(e.getCause()));
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("MissingSuperCall")
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
Log.i("MakeMachine", "resultCode: " + resultCode);
|
||||||
|
switch (resultCode) {
|
||||||
|
case 0:
|
||||||
|
Log.i("MakeMachine", "User cancelled");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case -1:
|
||||||
|
|
||||||
|
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||||
|
if (new File(str + _pathforcheck).exists()) {
|
||||||
|
|
||||||
|
img_cam.setImageDrawable(getResources().getDrawable(R.mipmap.camera_green));
|
||||||
|
|
||||||
|
image_name = _pathforcheck;
|
||||||
|
|
||||||
|
_pathforcheck = "";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
if (id == android.R.id.home) {
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
+28
-46
@@ -197,15 +197,14 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
|
|
||||||
btntoggle.setChecked(isExists);
|
btntoggle.setChecked(isExists);
|
||||||
|
|
||||||
str = CommonString.FILE_PATH;
|
str = CommonString.getImagesFolder(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
|
|
||||||
switch (id) {
|
if (id == R.id.btntoggle) {
|
||||||
case R.id.btntoggle:
|
|
||||||
isExists = btntoggle.isChecked();
|
isExists = btntoggle.isChecked();
|
||||||
|
|
||||||
if (isExists) {
|
if (isExists) {
|
||||||
@@ -242,16 +241,14 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
//checkBox.setChecked(true);
|
|
||||||
btntoggle.setChecked(true);
|
btntoggle.setChecked(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
android.app.AlertDialog alert = builder.create();
|
android.app.AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.fab_add:
|
} else if (id == R.id.fab_add) {
|
||||||
|
|
||||||
skuName = et_sku_name.getText().toString().replaceAll("[&^<>{}'$]", "").replaceFirst("^0+(?!$)", "");
|
skuName = et_sku_name.getText().toString().replaceAll("[&^<>{}'$]", "").replaceFirst("^0+(?!$)", "");
|
||||||
|
|
||||||
@@ -259,13 +256,11 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_promo_type, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_promo_type, Snackbar.LENGTH_SHORT).show();
|
||||||
} else if (subcategory.equals("")) {
|
} else if (subcategory.equals("")) {
|
||||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_sub_category, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_sub_category, Snackbar.LENGTH_SHORT).show();
|
||||||
}else if (brand.equals("")) {
|
} else if (brand.equals("")) {
|
||||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_competitor, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_competitor, Snackbar.LENGTH_SHORT).show();
|
||||||
} else if (skuName.equals("")) {
|
} else if (skuName.equals("")) {
|
||||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_enter_comment, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(rec_added_counterfeit_product, R.string.pls_enter_comment, Snackbar.LENGTH_SHORT).show();
|
||||||
} /*else if (img_str.equals("") && img_str1.equals("") && img_str2.equals("")) {
|
} else {
|
||||||
Snackbar.make(rec_added_counterfeit_product, R.string.click_image, Snackbar.LENGTH_SHORT).show();
|
|
||||||
}*/ else {
|
|
||||||
CompetitonPromoGetterSetter product = new CompetitonPromoGetterSetter();
|
CompetitonPromoGetterSetter product = new CompetitonPromoGetterSetter();
|
||||||
product.setBrand(brand);
|
product.setBrand(brand);
|
||||||
product.setPromotion(promotion);
|
product.setPromotion(promotion);
|
||||||
@@ -296,7 +291,6 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
sp_subcategory.setSelection(0);
|
sp_subcategory.setSelection(0);
|
||||||
spinner_brand_list.setSelection(0);
|
spinner_brand_list.setSelection(0);
|
||||||
sp_promotion_typ.setSelection(0);
|
sp_promotion_typ.setSelection(0);
|
||||||
//clearBrandSpinner();
|
|
||||||
|
|
||||||
imgCam.setBackgroundResource(R.mipmap.camera_orange);
|
imgCam.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
imgCam1.setBackgroundResource(R.mipmap.camera_orange);
|
imgCam1.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
@@ -305,39 +299,33 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
isdata_added = true;
|
isdata_added = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.fab) {
|
||||||
|
|
||||||
case R.id.fab:
|
if (isExists && addedCounterfeitProducts.size() == 0) {
|
||||||
if(isExists && addedCounterfeitProducts.size()==0){
|
Snackbar.make(rec_added_counterfeit_product, R.string.title_activity_Want_add, Snackbar.LENGTH_SHORT).show();
|
||||||
Snackbar.make(rec_added_counterfeit_product, R.string.title_activity_Want_add,Snackbar.LENGTH_SHORT).show();
|
} else {
|
||||||
}
|
|
||||||
else {
|
|
||||||
db.InsertComptionPromotData(addedCounterfeitProducts, categoryId, store_id, isExists);
|
db.InsertComptionPromotData(addedCounterfeitProducts, categoryId, store_id, isExists);
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.img_cam) {
|
||||||
|
|
||||||
case R.id.img_cam:
|
|
||||||
_pathforcheck = store_id + "CounterfeitProductImg1" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck = store_id + "CounterfeitProductImg1" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.img_cam1:
|
} else if (id == R.id.img_cam1) {
|
||||||
_pathforcheck1 = store_id + "CounterfeitProductImg2" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck1 = store_id + "CounterfeitProductImg2" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck1;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck1;
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.img_cam2:
|
} else if (id == R.id.img_cam2) {
|
||||||
_pathforcheck2 = store_id + "CounterfeitProductImg3" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck2 = store_id + "CounterfeitProductImg3" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck2;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck2;
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearBrandSpinner() {
|
void clearBrandSpinner() {
|
||||||
@@ -355,20 +343,23 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long _po) {
|
||||||
switch (parent.getId()) {
|
int id = parent.getId();
|
||||||
case R.id.sp_subcategory:
|
|
||||||
|
if (id == R.id.sp_subcategory) {
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
subcategory = subcategory_list.get(position).getSUB_CATEGORY().get(0);
|
subcategory = subcategory_list.get(position).getSUB_CATEGORY().get(0);
|
||||||
subcategoryId = Integer.parseInt(subcategory_list.get(position).getSUB_CATEGORY_ID().get(0));
|
subcategoryId = Integer.parseInt(subcategory_list.get(position).getSUB_CATEGORY_ID().get(0));
|
||||||
|
|
||||||
brand_list = db.getCompetionData(keyAccount_id, storeType_id,class_id,categoryId,subcategoryId);
|
brand_list = db.getCompetionData(keyAccount_id, storeType_id, class_id, categoryId, subcategoryId);
|
||||||
//brand data
|
|
||||||
|
// Prepare brand data with default "Select" option
|
||||||
BrandMasterGetterSetter brand_select = new BrandMasterGetterSetter();
|
BrandMasterGetterSetter brand_select = new BrandMasterGetterSetter();
|
||||||
String select = getResources().getString(R.string.select);
|
String select = getResources().getString(R.string.select);
|
||||||
brand_select.setBRAND(select);
|
brand_select.setBRAND(select);
|
||||||
brand_select.setBRAND_ID("0");
|
brand_select.setBRAND_ID("0");
|
||||||
brand_list.add(0, brand_select);
|
brand_list.add(0, brand_select);
|
||||||
|
|
||||||
CustomBrandAdapter adapter = new CustomBrandAdapter(CompetitionPromoActivity.this, R.layout.custom_spinner_item, brand_list);
|
CustomBrandAdapter adapter = new CustomBrandAdapter(CompetitionPromoActivity.this, R.layout.custom_spinner_item, brand_list);
|
||||||
spinner_brand_list.setAdapter(adapter);
|
spinner_brand_list.setAdapter(adapter);
|
||||||
spinner_brand_list.setOnItemSelectedListener(this);
|
spinner_brand_list.setOnItemSelectedListener(this);
|
||||||
@@ -379,10 +370,7 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
subcategoryId = 0;
|
subcategoryId = 0;
|
||||||
lay_competitor_name.setVisibility(View.GONE);
|
lay_competitor_name.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
break;
|
} else if (id == R.id.sp_brand) {
|
||||||
|
|
||||||
case R.id.sp_brand:
|
|
||||||
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
brand = brand_list.get(position).getBRAND().get(0);
|
brand = brand_list.get(position).getBRAND().get(0);
|
||||||
brand_id = Integer.parseInt(brand_list.get(position).getBRAND_ID().get(0));
|
brand_id = Integer.parseInt(brand_list.get(position).getBRAND_ID().get(0));
|
||||||
@@ -390,23 +378,16 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
brand = "";
|
brand = "";
|
||||||
brand_id = 0;
|
brand_id = 0;
|
||||||
}
|
}
|
||||||
|
} else if (id == R.id.sp_promotion_typ) {
|
||||||
break;
|
|
||||||
case R.id.sp_promotion_typ:
|
|
||||||
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
promotion = promotion_list.get(position).getPROMOTION_TYPE().get(0);
|
promotion = promotion_list.get(position).getPROMOTION_TYPE().get(0);
|
||||||
promotion_id = Integer.parseInt(promotion_list.get(position).getPROMOTION_TYPE_ID().get(0));
|
promotion_id = Integer.parseInt(promotion_list.get(position).getPROMOTION_TYPE_ID().get(0));
|
||||||
} else {
|
} else {
|
||||||
promotion = "";
|
promotion = "";
|
||||||
promotion_id = 0;
|
promotion_id = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -806,6 +787,7 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
|
super.onBackPressed();
|
||||||
ischanged();
|
ischanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,17 +58,13 @@ import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
|
|||||||
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
||||||
|
|
||||||
public class ConversationActivity extends AppCompatActivity {
|
public class ConversationActivity extends AppCompatActivity {
|
||||||
|
|
||||||
String userId, culture_id, store_id, chat_id, message_main, visit_date;
|
String userId, culture_id, store_id, chat_id, message_main, visit_date;
|
||||||
private SharedPreferences preferences = null;
|
private SharedPreferences preferences = null;
|
||||||
|
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
private Context context;
|
private Context context;
|
||||||
ArrayList<ChatMessageGetterSetter> conversation_list = new ArrayList<>();
|
ArrayList<ChatMessageGetterSetter> conversation_list = new ArrayList<>();
|
||||||
|
|
||||||
MyRecyclerAdapter adapter;
|
MyRecyclerAdapter adapter;
|
||||||
RecyclerView rec;
|
RecyclerView rec;
|
||||||
|
|
||||||
EditText et_reply;
|
EditText et_reply;
|
||||||
private Dialog dialog;
|
private Dialog dialog;
|
||||||
private ProgressBar pb;
|
private ProgressBar pb;
|
||||||
|
|||||||
+22
-33
@@ -161,15 +161,14 @@ public class CounterfeitProductsActivity extends AppCompatActivity implements Ad
|
|||||||
|
|
||||||
btntoggle.setChecked(isExists);
|
btntoggle.setChecked(isExists);
|
||||||
|
|
||||||
str = CommonString.FILE_PATH;
|
str = CommonString.getImagesFolder(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
|
|
||||||
switch (id) {
|
if (id == R.id.btntoggle) {
|
||||||
case R.id.btntoggle:
|
|
||||||
isExists = btntoggle.isChecked();
|
isExists = btntoggle.isChecked();
|
||||||
|
|
||||||
if (isExists) {
|
if (isExists) {
|
||||||
@@ -211,10 +210,8 @@ public class CounterfeitProductsActivity extends AppCompatActivity implements Ad
|
|||||||
android.app.AlertDialog alert = builder.create();
|
android.app.AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.fab_add:
|
|
||||||
|
|
||||||
|
} else if (id == R.id.fab_add) {
|
||||||
skuName = et_sku_name.getText().toString().replaceAll("[&^<>{}'$]", "").replaceFirst("^0+(?!$)", "");
|
skuName = et_sku_name.getText().toString().replaceAll("[&^<>{}'$]", "").replaceFirst("^0+(?!$)", "");
|
||||||
stock = et_stock.getText().toString();
|
stock = et_stock.getText().toString();
|
||||||
|
|
||||||
@@ -254,7 +251,6 @@ public class CounterfeitProductsActivity extends AppCompatActivity implements Ad
|
|||||||
et_stock.setText("");
|
et_stock.setText("");
|
||||||
et_sku_name.setText("");
|
et_sku_name.setText("");
|
||||||
spinner_brand_list.setSelection(0);
|
spinner_brand_list.setSelection(0);
|
||||||
//clearBrandSpinner();
|
|
||||||
|
|
||||||
imgCam.setBackgroundResource(R.mipmap.camera_orange);
|
imgCam.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
imgCam1.setBackgroundResource(R.mipmap.camera_orange);
|
imgCam1.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
@@ -263,39 +259,35 @@ public class CounterfeitProductsActivity extends AppCompatActivity implements Ad
|
|||||||
isdata_added = true;
|
isdata_added = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.fab) {
|
||||||
|
if (isExists && addedCounterfeitProducts.size() == 0) {
|
||||||
case R.id.fab:
|
Snackbar.make(rec_added_counterfeit_product, R.string.title_activity_Want_add, Snackbar.LENGTH_SHORT).show();
|
||||||
if(isExists && addedCounterfeitProducts.size()==0){
|
} else {
|
||||||
Snackbar.make(rec_added_counterfeit_product, R.string.title_activity_Want_add,Snackbar.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
db.InsertCounterfeitProductData(addedCounterfeitProducts, categoryId, store_id, isExists);
|
db.InsertCounterfeitProductData(addedCounterfeitProducts, categoryId, store_id, isExists);
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.img_cam) {
|
||||||
|
_pathforcheck = store_id + "CounterfeitProductImg1" + categoryId + visit_date.replace("/", "") +
|
||||||
case R.id.img_cam:
|
CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
_pathforcheck = store_id + "CounterfeitProductImg1" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.img_cam1:
|
} else if (id == R.id.img_cam1) {
|
||||||
_pathforcheck1 = store_id + "CounterfeitProductImg2" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck1 = store_id + "CounterfeitProductImg2" + categoryId + visit_date.replace("/", "") +
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck1;
|
CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
_path = CommonString.getImagesFolder(context) + _pathforcheck1;
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.img_cam2:
|
} else if (id == R.id.img_cam2) {
|
||||||
_pathforcheck2 = store_id + "CounterfeitProductImg3" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck2 = store_id + "CounterfeitProductImg3" + categoryId + visit_date.replace("/", "") +
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck2;
|
CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
_path = CommonString.getImagesFolder(context) + _pathforcheck2;
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearBrandSpinner() {
|
void clearBrandSpinner() {
|
||||||
@@ -314,9 +306,7 @@ public class CounterfeitProductsActivity extends AppCompatActivity implements Ad
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
switch (parent.getId()) {
|
if (parent.getId() == R.id.sp_brand) {
|
||||||
case R.id.sp_brand:
|
|
||||||
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
brand = brand_list.get(position).getBRAND().get(0);
|
brand = brand_list.get(position).getBRAND().get(0);
|
||||||
brand_id = Integer.parseInt(brand_list.get(position).getBRAND_ID().get(0));
|
brand_id = Integer.parseInt(brand_list.get(position).getBRAND_ID().get(0));
|
||||||
@@ -324,10 +314,9 @@ public class CounterfeitProductsActivity extends AppCompatActivity implements Ad
|
|||||||
brand = "";
|
brand = "";
|
||||||
brand_id = 0;
|
brand_id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, store_flag_str;
|
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, store_flag_str;
|
||||||
String categoryName, categoryId,country_id;
|
String categoryName, categoryId, country_id;
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
MSL_AvailabilityStockFacingGetterSetter brand_selected;
|
MSL_AvailabilityStockFacingGetterSetter brand_selected;
|
||||||
int number_of_rows=0;
|
int number_of_rows = 0;
|
||||||
RecyclerView rec_sub_category;
|
RecyclerView rec_sub_category;
|
||||||
static int FROM_DIALOG = 0;
|
static int FROM_DIALOG = 0;
|
||||||
static int FROM_CLICK = 1;
|
static int FROM_CLICK = 1;
|
||||||
@@ -98,35 +98,28 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
number_of_rows = 0;
|
||||||
number_of_rows=0;
|
|
||||||
brand_selected = null;
|
brand_selected = null;
|
||||||
|
|
||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
added_sub_category_list = new ArrayList<>();
|
added_sub_category_list = new ArrayList<>();
|
||||||
|
|
||||||
//kenya use
|
//kenya use
|
||||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(categoryId,store_id,country_id);
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(categoryId, store_id, country_id);
|
||||||
|
|
||||||
for(int i=0; i<sub_category_list.size(); i++){
|
|
||||||
|
|
||||||
|
for (int i = 0; i < sub_category_list.size(); i++) {
|
||||||
ArrayList<NoCameraDataGetterSetter> noCameraLastVisitData;
|
ArrayList<NoCameraDataGetterSetter> noCameraLastVisitData;
|
||||||
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
noCameraLastVisitData = db.getNoCameraLastVisitCategoryData(store_id, categoryId,
|
||||||
noCameraLastVisitData = db.getNoCameraLastVisitCategoryData(store_id, categoryId, sub_category_list.get(i).getSub_category_id(), CommonString.TABLE_NO_CAMERA_LAST_VISIT_DATA_ADHOC);
|
sub_category_list.get(i).getSub_category_id(), CommonString.TABLE_NO_CAMERA_LAST_VISIT_DATA_ADHOC);
|
||||||
|
} else {
|
||||||
|
noCameraLastVisitData = db.getNoCameraLastVisitCategoryData(store_id, categoryId, sub_category_list.get(i).getSub_category_id(),
|
||||||
|
"NO_CAMERA_LAST_VISIT_DATA");
|
||||||
}
|
}
|
||||||
else {
|
if (db.getNoCameraCategoryDataInserted(store_id, categoryId, sub_category_list.get(i).getSub_category_id()).size() > 0) {
|
||||||
noCameraLastVisitData = db.getNoCameraLastVisitCategoryData(store_id, categoryId, sub_category_list.get(i).getSub_category_id(), "NO_CAMERA_LAST_VISIT_DATA");
|
|
||||||
}
|
|
||||||
if(db.getNoCameraCategoryDataInserted(store_id, categoryId, sub_category_list.get(i).getSub_category_id()).size()>0){
|
|
||||||
|
|
||||||
MSL_AvailabilityStockFacingGetterSetter subCategory = new MSL_AvailabilityStockFacingGetterSetter();
|
MSL_AvailabilityStockFacingGetterSetter subCategory = new MSL_AvailabilityStockFacingGetterSetter();
|
||||||
subCategory.setSub_category(sub_category_list.get(i).getSub_category());
|
subCategory.setSub_category(sub_category_list.get(i).getSub_category());
|
||||||
subCategory.setSub_category_id(sub_category_list.get(i).getSub_category_id());
|
subCategory.setSub_category_id(sub_category_list.get(i).getSub_category_id());
|
||||||
added_sub_category_list.add(subCategory);
|
added_sub_category_list.add(subCategory);
|
||||||
}
|
} else if (noCameraLastVisitData.size() > 0) {
|
||||||
else if(noCameraLastVisitData.size()>0){
|
|
||||||
MSL_AvailabilityStockFacingGetterSetter subCategory = new MSL_AvailabilityStockFacingGetterSetter();
|
MSL_AvailabilityStockFacingGetterSetter subCategory = new MSL_AvailabilityStockFacingGetterSetter();
|
||||||
subCategory.setSub_category(sub_category_list.get(i).getSub_category());
|
subCategory.setSub_category(sub_category_list.get(i).getSub_category());
|
||||||
subCategory.setSub_category_id(sub_category_list.get(i).getSub_category_id());
|
subCategory.setSub_category_id(sub_category_list.get(i).getSub_category_id());
|
||||||
@@ -134,7 +127,7 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(added_sub_category_list.size()>0){
|
if (added_sub_category_list.size() > 0) {
|
||||||
rec_sub_category.setLayoutManager(new GridLayoutManager(this, 3));
|
rec_sub_category.setLayoutManager(new GridLayoutManager(this, 3));
|
||||||
SubcategoryAdapter skuAdapter = new SubcategoryAdapter(added_sub_category_list);
|
SubcategoryAdapter skuAdapter = new SubcategoryAdapter(added_sub_category_list);
|
||||||
rec_sub_category.setAdapter(skuAdapter);
|
rec_sub_category.setAdapter(skuAdapter);
|
||||||
@@ -151,13 +144,11 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showSkuDialog() {
|
public void showSkuDialog() {
|
||||||
|
final ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(categoryId, store_id, country_id);
|
||||||
final ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(categoryId,store_id,country_id);
|
|
||||||
MSL_AvailabilityStockFacingGetterSetter brand = new MSL_AvailabilityStockFacingGetterSetter();
|
MSL_AvailabilityStockFacingGetterSetter brand = new MSL_AvailabilityStockFacingGetterSetter();
|
||||||
brand.setSub_category("select");
|
brand.setSub_category("select");
|
||||||
sub_category_list.add(0, brand);
|
sub_category_list.add(0, brand);
|
||||||
// ArrayList<SkuMasterGetterSetter> skuMasterGetterSetterArrayList = db.getSkuT2PData("1", "1", "1",)
|
// ArrayList<SkuMasterGetterSetter> skuMasterGetterSetterArrayList = db.getSkuT2PData("1", "1", "1",)
|
||||||
|
|
||||||
final Dialog dialog = new Dialog(CreateSelfActivity.this);
|
final Dialog dialog = new Dialog(CreateSelfActivity.this);
|
||||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
@@ -173,28 +164,25 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
if(brand_selected==null){
|
if (brand_selected == null) {
|
||||||
Snackbar.make(btn_create,"Please select Sub Category",Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(btn_create, "Please select Sub Category", Snackbar.LENGTH_SHORT).show();
|
||||||
}
|
} else if (number_of_rows == 0) {
|
||||||
else if(number_of_rows==0){
|
Snackbar.make(btn_create, "Please select number of rows", Snackbar.LENGTH_SHORT).show();
|
||||||
Snackbar.make(btn_create,"Please select number of rows",Snackbar.LENGTH_SHORT).show();
|
} else {
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
boolean sub_category_already_filled = false;
|
boolean sub_category_already_filled = false;
|
||||||
if(added_sub_category_list.size()>0){
|
if (added_sub_category_list.size() > 0) {
|
||||||
for(int k=0;k<added_sub_category_list.size();k++){
|
for (int k = 0; k < added_sub_category_list.size(); k++) {
|
||||||
if(added_sub_category_list.get(k).getSub_category_id().equals(brand_selected.getSub_category_id())){
|
if (added_sub_category_list.get(k).getSub_category_id().equals(brand_selected.getSub_category_id())) {
|
||||||
sub_category_already_filled = true;
|
sub_category_already_filled = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sub_category_already_filled){
|
if (sub_category_already_filled) {
|
||||||
Snackbar.make(btn_create,"Sub Category already added",Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(btn_create, "Sub Category already added", Snackbar.LENGTH_SHORT).show();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Intent in = new Intent(context, NoCameraActivity.class);
|
Intent in = new Intent(context, NoCameraActivity.class);
|
||||||
in.putExtra("categoryName", categoryName);
|
in.putExtra("categoryName", categoryName);
|
||||||
in.putExtra("categoryId", categoryId);
|
in.putExtra("categoryId", categoryId);
|
||||||
@@ -228,7 +216,7 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
final ArrayList<String> no_of_rows = new ArrayList<>();
|
final ArrayList<String> no_of_rows = new ArrayList<>();
|
||||||
no_of_rows.add(getString(R.string.select));
|
no_of_rows.add(getString(R.string.select));
|
||||||
for(int i=1; i<9; i++){
|
for (int i = 1; i < 9; i++) {
|
||||||
no_of_rows.add(i + "");
|
no_of_rows.add(i + "");
|
||||||
}
|
}
|
||||||
CustomSpinnerAdapter skuadapter = new CustomSpinnerAdapter(CreateSelfActivity.this, R.layout.custom_spinner_item, no_of_rows);
|
CustomSpinnerAdapter skuadapter = new CustomSpinnerAdapter(CreateSelfActivity.this, R.layout.custom_spinner_item, no_of_rows);
|
||||||
@@ -241,8 +229,7 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
brand_selected = sub_category_list.get(position);
|
brand_selected = sub_category_list.get(position);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
brand_selected = null;
|
brand_selected = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,8 +247,7 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
number_of_rows = Integer.parseInt(no_of_rows.get(position));
|
number_of_rows = Integer.parseInt(no_of_rows.get(position));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
number_of_rows = 0;
|
number_of_rows = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,7 +479,6 @@ public class CreateSelfActivity extends AppCompatActivity {
|
|||||||
super(view);
|
super(view);
|
||||||
|
|
||||||
mView = view;
|
mView = view;
|
||||||
|
|
||||||
tv_sub_category = (TextView) mView.findViewById(R.id.tv_sub_category);
|
tv_sub_category = (TextView) mView.findViewById(R.id.tv_sub_category);
|
||||||
parentLayout = (LinearLayout) mView.findViewById(R.id.linear_parent);
|
parentLayout = (LinearLayout) mView.findViewById(R.id.linear_parent);
|
||||||
|
|
||||||
|
|||||||
+25
-67
@@ -1,5 +1,6 @@
|
|||||||
package cpm.com.gskmtorange.dailyentry;
|
package cpm.com.gskmtorange.dailyentry;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -90,27 +91,18 @@ public class DeliveryCallActivity extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
|
|
||||||
switch (id) {
|
if (id == R.id.fab_upload) {
|
||||||
|
|
||||||
case R.id.fab_upload:
|
|
||||||
|
|
||||||
new UploadTask().execute();
|
new UploadTask().execute();
|
||||||
break;
|
} else if (id == R.id.fab) {
|
||||||
|
|
||||||
case R.id.fab:
|
|
||||||
|
|
||||||
if (isCheckedIn()) {
|
if (isCheckedIn()) {
|
||||||
Snackbar.make(recyclerView, getString(R.string.title_store_list_checkout_current), Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(recyclerView, getString(R.string.title_store_list_checkout_current), Snackbar.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Intent in = new Intent(context, DeliveryCallAddStoreActivity.class);
|
Intent in = new Intent(context, DeliveryCallAddStoreActivity.class);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
|
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class DeliveryAdapter extends RecyclerView.Adapter<DeliveryAdapter.MyViewHolder> {
|
class DeliveryAdapter extends RecyclerView.Adapter<DeliveryAdapter.MyViewHolder> {
|
||||||
@@ -148,7 +140,7 @@ public class DeliveryCallActivity extends AppCompatActivity implements View.OnCl
|
|||||||
holder.imageview.setVisibility(View.VISIBLE);
|
holder.imageview.setVisibility(View.VISIBLE);
|
||||||
holder.imageview.setBackgroundResource(R.mipmap.tick);
|
holder.imageview.setBackgroundResource(R.mipmap.tick);
|
||||||
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||||
}else if (current.getUPLOAD_STATUS().equals(CommonString.KEY_C)) {
|
} else if (current.getUPLOAD_STATUS().equals(CommonString.KEY_C)) {
|
||||||
holder.imageview.setVisibility(View.VISIBLE);
|
holder.imageview.setVisibility(View.VISIBLE);
|
||||||
holder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
holder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
||||||
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||||
@@ -157,22 +149,22 @@ public class DeliveryCallActivity extends AppCompatActivity implements View.OnCl
|
|||||||
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.cardView.setOnClickListener(new View.OnClickListener() {
|
holder.cardView.setOnClickListener(v -> {
|
||||||
@Override
|
switch (current.getUPLOAD_STATUS()) {
|
||||||
public void onClick(View v) {
|
case CommonString.KEY_CHECK_IN:
|
||||||
if (current.getUPLOAD_STATUS().equals(CommonString.KEY_CHECK_IN)) {
|
|
||||||
|
|
||||||
Intent in = new Intent(context, DeliveryCallAddStoreActivity.class);
|
Intent in = new Intent(context, DeliveryCallAddStoreActivity.class);
|
||||||
in.putExtra(CommonString.KEY_STORE_ID, current);
|
in.putExtra(CommonString.KEY_STORE_ID, current);
|
||||||
in.putExtra(CommonString.KEY_STORE_FLAG, false);
|
in.putExtra(CommonString.KEY_STORE_FLAG, false);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
|
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
} else if (current.getUPLOAD_STATUS().equals(CommonString.KEY_U)) {
|
break;
|
||||||
|
case CommonString.KEY_U:
|
||||||
Snackbar.make(v, R.string.title_store_list_activity_store_already_done, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(v, R.string.title_store_list_activity_store_already_done, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
} else if (current.getUPLOAD_STATUS().equals(CommonString.KEY_C)) {
|
break;
|
||||||
|
case CommonString.KEY_C:
|
||||||
Snackbar.make(v, R.string.title_store_list_activity_store_already_checkout, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(v, R.string.title_store_list_activity_store_already_checkout, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -202,18 +194,13 @@ public class DeliveryCallActivity extends AppCompatActivity implements View.OnCl
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
toolbar.setTitle(getString(R.string.delivery_call));
|
toolbar.setTitle(getString(R.string.delivery_call));
|
||||||
|
|
||||||
deliveryCallsList = database.getDeliveryCallsData(visit_date);
|
deliveryCallsList = database.getDeliveryCallsData(visit_date);
|
||||||
|
if (!deliveryCallsList.isEmpty()) {
|
||||||
if (deliveryCallsList.size() > 0) {
|
|
||||||
//list.setAdapter(new MyAdaptor());
|
|
||||||
deliveryAdapter = new DeliveryAdapter(context, deliveryCallsList);
|
deliveryAdapter = new DeliveryAdapter(context, deliveryCallsList);
|
||||||
recyclerView.setAdapter(deliveryAdapter);
|
recyclerView.setAdapter(deliveryAdapter);
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
|
||||||
if (isCheckedIn()) {
|
if (isCheckedIn()) {
|
||||||
fab_upload.hide();//setVisibility(View.GONE);
|
fab_upload.hide();//setVisibility(View.GONE);
|
||||||
} else if (isUploadAble()) {
|
} else if (isUploadAble()) {
|
||||||
@@ -249,10 +236,10 @@ public class DeliveryCallActivity extends AppCompatActivity implements View.OnCl
|
|||||||
((TextView) dialog.findViewById(R.id.tv_title)).setText(getString(R.string.uploaddata));
|
((TextView) dialog.findViewById(R.id.tv_title)).setText(getString(R.string.uploaddata));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
@Override
|
@Override
|
||||||
protected void onProgressUpdate(Data... values) {
|
protected void onProgressUpdate(Data... values) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
pb.setProgress(values[0].value);
|
pb.setProgress(values[0].value);
|
||||||
percentage.setText(values[0].value + "%");
|
percentage.setText(values[0].value + "%");
|
||||||
message.setText(values[0].name);
|
message.setText(values[0].name);
|
||||||
@@ -264,16 +251,12 @@ public class DeliveryCallActivity extends AppCompatActivity implements View.OnCl
|
|||||||
Data data = new Data();
|
Data data = new Data();
|
||||||
ArrayList<DeliveryCallsGetterSetter> _deliveryCallsList = database.getDeliveryCallsData(null);
|
ArrayList<DeliveryCallsGetterSetter> _deliveryCallsList = database.getDeliveryCallsData(null);
|
||||||
for (int i = 0; i < _deliveryCallsList.size(); i++) {
|
for (int i = 0; i < _deliveryCallsList.size(); i++) {
|
||||||
|
|
||||||
if (_deliveryCallsList.get(i).getUPLOAD_STATUS().equals(CommonString.KEY_C)) {
|
if (_deliveryCallsList.get(i).getUPLOAD_STATUS().equals(CommonString.KEY_C)) {
|
||||||
|
|
||||||
data.value = 50;
|
data.value = 50;
|
||||||
data.name = getString(R.string.delivery_call);
|
data.name = getString(R.string.delivery_call);
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
String store_name = URLEncoder.encode(_deliveryCallsList.get(i).getSTORE_NAME(), "utf-8");
|
String store_name = URLEncoder.encode(_deliveryCallsList.get(i).getSTORE_NAME(), "utf-8");
|
||||||
String store_address = URLEncoder.encode(_deliveryCallsList.get(i).getADDRESS(), "utf-8");
|
String store_address = URLEncoder.encode(_deliveryCallsList.get(i).getADDRESS(), "utf-8");
|
||||||
|
|
||||||
String onXML = "[DELIVERY_CALLS_DATA]"
|
String onXML = "[DELIVERY_CALLS_DATA]"
|
||||||
+ "[USER_ID]" + userId + "[/USER_ID]"
|
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||||
+ "[VISIT_DATE]" + _deliveryCallsList.get(i).getVISIT_DATE() + "[/VISIT_DATE]"
|
+ "[VISIT_DATE]" + _deliveryCallsList.get(i).getVISIT_DATE() + "[/VISIT_DATE]"
|
||||||
@@ -282,9 +265,9 @@ public class DeliveryCallActivity extends AppCompatActivity implements View.OnCl
|
|||||||
+ "[IN_TIME]" + _deliveryCallsList.get(i).getIn_time() + "[/IN_TIME]"
|
+ "[IN_TIME]" + _deliveryCallsList.get(i).getIn_time() + "[/IN_TIME]"
|
||||||
+ "[OUT_TIME]" + _deliveryCallsList.get(i).getOut_time() + "[/OUT_TIME]"
|
+ "[OUT_TIME]" + _deliveryCallsList.get(i).getOut_time() + "[/OUT_TIME]"
|
||||||
+ "[IN_TIME_IMAGE]" + _deliveryCallsList.get(i).getIN_TIME_IMAGE() + "[/IN_TIME_IMAGE]"
|
+ "[IN_TIME_IMAGE]" + _deliveryCallsList.get(i).getIN_TIME_IMAGE() + "[/IN_TIME_IMAGE]"
|
||||||
+ "[OUT_TIME_IMAGE]" + _deliveryCallsList.get(i).getOUT_TIME_IMAGE()+ "[/OUT_TIME_IMAGE]"
|
+ "[OUT_TIME_IMAGE]" + _deliveryCallsList.get(i).getOUT_TIME_IMAGE() + "[/OUT_TIME_IMAGE]"
|
||||||
+ "[LATITUDE]" + _deliveryCallsList.get(i).getLATITUDE()+ "[/LATITUDE]"
|
+ "[LATITUDE]" + _deliveryCallsList.get(i).getLATITUDE() + "[/LATITUDE]"
|
||||||
+ "[LONGITUDE]" + _deliveryCallsList.get(i).getLONGITUDE()+ "[/LONGITUDE]"
|
+ "[LONGITUDE]" + _deliveryCallsList.get(i).getLONGITUDE() + "[/LONGITUDE]"
|
||||||
+ "[/DELIVERY_CALLS_DATA]";
|
+ "[/DELIVERY_CALLS_DATA]";
|
||||||
|
|
||||||
final String delivery_xml = "[DATA]" + onXML + "[/DATA]";
|
final String delivery_xml = "[DATA]" + onXML + "[/DATA]";
|
||||||
@@ -294,18 +277,15 @@ public class DeliveryCallActivity extends AppCompatActivity implements View.OnCl
|
|||||||
request.addProperty("KEYS", "DELIVERY_CALLS");
|
request.addProperty("KEYS", "DELIVERY_CALLS");
|
||||||
request.addProperty("USERNAME", userId);
|
request.addProperty("USERNAME", userId);
|
||||||
request.addProperty("MID", 0);
|
request.addProperty("MID", 0);
|
||||||
|
|
||||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
database.open();
|
database.open();
|
||||||
database.updateDeliveryCallsUploadStatus(_deliveryCallsList.get(i).getId());
|
database.updateDeliveryCallsUploadStatus(_deliveryCallsList.get(i).getId());
|
||||||
}
|
}
|
||||||
@@ -314,50 +294,36 @@ public class DeliveryCallActivity extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
return result.toString();
|
return result.toString();
|
||||||
|
|
||||||
} catch (MalformedURLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
//Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
e.fillInStackTrace();
|
||||||
//Crashlytics.logException(e.getCause());
|
|
||||||
// Crashlytics.logException(new Exception(e.getCause()));
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (XmlPullParserException e) {
|
} catch (XmlPullParserException e) {
|
||||||
e.printStackTrace();
|
e.fillInStackTrace();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
e.fillInStackTrace();
|
||||||
// Crashlytics.logException(e.getCause());
|
|
||||||
// Crashlytics.logException(new Exception(e.getCause()));
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(String result) {
|
protected void onPostExecute(String result) {
|
||||||
super.onPostExecute(result);
|
super.onPostExecute(result);
|
||||||
|
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
if (result.contains(CommonString.KEY_SUCCESS)) {
|
if (result.contains(CommonString.KEY_SUCCESS)) {
|
||||||
//db.deleteAllTables();
|
//db.deleteAllTables();
|
||||||
|
File f = new File(CommonString.getImagesFolder(context));
|
||||||
File f = new File(CommonString.FILE_PATH);
|
|
||||||
File fileAll[] = f.listFiles();
|
File fileAll[] = f.listFiles();
|
||||||
ArrayList<String> file_list = new ArrayList<>();
|
ArrayList<String> file_list = new ArrayList<>();
|
||||||
|
|
||||||
for (int i = 0; i < fileAll.length; i++) {
|
for (int i = 0; i < fileAll.length; i++) {
|
||||||
String name = fileAll[i].getName();
|
String name = fileAll[i].getName();
|
||||||
if(name.contains("DeliveryCalls")){
|
if (name.contains("DeliveryCalls")) {
|
||||||
file_list.add(name);
|
file_list.add(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UploadImageWithRetrofit.uploadedFiles = 0;
|
UploadImageWithRetrofit.uploadedFiles = 0;
|
||||||
UploadImageWithRetrofit.totalFiles = file_list.size();
|
UploadImageWithRetrofit.totalFiles = file_list.size();
|
||||||
UploadImageWithRetrofit uploadImg = new UploadImageWithRetrofit(visit_date, userId, DeliveryCallActivity.this);
|
UploadImageWithRetrofit uploadImg = new UploadImageWithRetrofit(visit_date, userId, DeliveryCallActivity.this);
|
||||||
uploadImg.UploadDeliveryImageRecursive(DeliveryCallActivity.this, file_list, 0);
|
uploadImg.UploadDeliveryImageRecursive(DeliveryCallActivity.this, file_list, 0);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
showAlert(getString(R.string.error) + result.toString());
|
showAlert(getString(R.string.error) + result.toString());
|
||||||
}
|
}
|
||||||
@@ -365,19 +331,11 @@ public class DeliveryCallActivity extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showAlert(String str) {
|
public void showAlert(String str) {
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(DeliveryCallActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(DeliveryCallActivity.this);
|
||||||
builder.setTitle("Parinaam");
|
builder.setTitle("Parinaam");
|
||||||
builder.setMessage(str).setCancelable(false)
|
builder.setMessage(str).setCancelable(false)
|
||||||
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
.setPositiveButton(R.string.ok, (dialog, id) -> {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
|
|
||||||
/* Intent i = new Intent(activity, StorelistActivity.class);
|
|
||||||
activity.startActivity(i);
|
|
||||||
activity.finish();*/
|
|
||||||
finish();
|
finish();
|
||||||
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
AlertDialog alert = builder.create();
|
AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
|
|||||||
+9
-8
@@ -160,7 +160,7 @@ public class DeliveryCallAddStoreActivity extends AppCompatActivity implements V
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
str = CommonString.FILE_PATH;
|
str = CommonString.getImagesFolder(context);
|
||||||
|
|
||||||
if (checkPlayServices()) {
|
if (checkPlayServices()) {
|
||||||
|
|
||||||
@@ -315,29 +315,30 @@ public class DeliveryCallAddStoreActivity extends AppCompatActivity implements V
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
int viewId = v.getId();
|
||||||
case R.id.img_checkin:
|
|
||||||
|
if (viewId == R.id.img_checkin) {
|
||||||
|
|
||||||
in_time = CommonFunctions.getCurrentTimeWithLanguage(context);
|
in_time = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
|
|
||||||
_pathforcheck = "DeliveryCalls" + visit_date.replace("/", "") + "InTime" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck = "DeliveryCalls" + visit_date.replace("/", "") + "InTime" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(0);
|
startCameraActivity(0);
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.img_checkout:
|
} else if (viewId == R.id.img_checkout) {
|
||||||
|
|
||||||
out_time = CommonFunctions.getCurrentTimeWithLanguage(context);
|
out_time = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
|
|
||||||
_pathforcheck = "DeliveryCalls" + visit_date.replace("/", "") + "OutTime" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck = "DeliveryCalls" + visit_date.replace("/", "") + "OutTime" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(1);
|
startCameraActivity(1);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void startCameraActivity(int request_code) {
|
protected void startCameraActivity(int request_code) {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import android.content.res.Resources;
|
|||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
@@ -79,25 +80,24 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
int viewId = v.getId();
|
||||||
case R.id.iconCalender:
|
|
||||||
|
if (viewId == R.id.iconCalender) {
|
||||||
c = Calendar.getInstance();
|
c = Calendar.getInstance();
|
||||||
year = c.get(Calendar.YEAR);
|
year = c.get(Calendar.YEAR);
|
||||||
month = c.get(Calendar.MONTH);
|
month = c.get(Calendar.MONTH);
|
||||||
day = c.get(Calendar.DAY_OF_MONTH);
|
day = c.get(Calendar.DAY_OF_MONTH);
|
||||||
showDatePickerDialog(year, month, day);
|
showDatePickerDialog(year, month, day);
|
||||||
break;
|
|
||||||
case R.id.fab:
|
} else if (viewId == R.id.fab) {
|
||||||
Snackbar.make(v, "Replace with your own action", Snackbar.LENGTH_LONG)
|
Snackbar.make(v, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||||
.setAction("Action", null).show();
|
.setAction("Action", null).show();
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showDatePickerDialog(int year, int month, int day) {
|
protected void showDatePickerDialog(int year, int month, int day) {
|
||||||
|
|
||||||
DatePickerDialog datePickerDialog = new DatePickerDialog(this, pickerListener, year, month, day);
|
DatePickerDialog datePickerDialog = new DatePickerDialog(this, pickerListener, year, month, day);
|
||||||
// ((ViewGroup) datePickerDialog.getDatePicker()).findViewById(Resources.getSystem().getIdentifier("year", "id", "android")).setVisibility(View.GONE);
|
// ((ViewGroup) datePickerDialog.getDatePicker()).findViewById(Resources.getSystem().getIdentifier("year", "id", "android")).setVisibility(View.GONE);
|
||||||
//datePickerDialog.findViewById(Resources.getSystem().getIdentifier("year", "id", "android")).setVisibility(View.GONE);
|
//datePickerDialog.findViewById(Resources.getSystem().getIdentifier("year", "id", "android")).setVisibility(View.GONE);
|
||||||
@@ -195,19 +195,17 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
Log.d("requestdata",request.toString());
|
||||||
|
|
||||||
androidHttpTransport.call(
|
androidHttpTransport.call(
|
||||||
CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
Object resultFuturedata = (Object) envelope.getResponse();
|
Object resultFuturedata = (Object) envelope.getResponse();
|
||||||
|
|
||||||
if (resultFuturedata.toString() != null) {
|
if (resultFuturedata.toString() != null) {
|
||||||
|
|
||||||
xpp.setInput(new StringReader(resultFuturedata.toString()));
|
xpp.setInput(new StringReader(resultFuturedata.toString()));
|
||||||
xpp.next();
|
xpp.next();
|
||||||
eventType = xpp.getEventType();
|
eventType = xpp.getEventType();
|
||||||
|
|
||||||
journeyPlanPreviousGetterSetter = XMLHandlers.JCPXMLHandler(xpp, eventType);
|
journeyPlanPreviousGetterSetter = XMLHandlers.JCPXMLHandler(xpp, eventType);
|
||||||
|
|
||||||
}
|
}
|
||||||
return "Success";
|
return "Success";
|
||||||
} catch (XmlPullParserException e) {
|
} catch (XmlPullParserException e) {
|
||||||
@@ -236,7 +234,6 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
|||||||
MyListAdapter adapter = new MyListAdapter(context, journeyPlanPreviousGetterSetter);
|
MyListAdapter adapter = new MyListAdapter(context, journeyPlanPreviousGetterSetter);
|
||||||
futureJcpList.setLayoutManager(new LinearLayoutManager(context));
|
futureJcpList.setLayoutManager(new LinearLayoutManager(context));
|
||||||
futureJcpList.setAdapter(adapter);
|
futureJcpList.setAdapter(adapter);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Snackbar.make(futureJcpList,R.string.no_route_plan_for_day,Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(futureJcpList,R.string.no_route_plan_for_day,Snackbar.LENGTH_SHORT).show();
|
||||||
@@ -275,11 +272,8 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
|||||||
|
|
||||||
// NavUtils.navigateUpFromSameTask(this);
|
// NavUtils.navigateUpFromSameTask(this);
|
||||||
finish();
|
finish();
|
||||||
|
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -302,7 +296,6 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(ViewHolder holder, int position) {
|
public void onBindViewHolder(ViewHolder holder, int position) {
|
||||||
|
|
||||||
if (holder != null) {
|
if (holder != null) {
|
||||||
holder.txt_store_cd.setText(journeyPlanPreviousGetterSetter.getSTORE_ID().get(position));
|
holder.txt_store_cd.setText(journeyPlanPreviousGetterSetter.getSTORE_ID().get(position));
|
||||||
holder.txt_keyacct.setText(journeyPlanPreviousGetterSetter.getKEYACCOUNT().get(position));
|
holder.txt_keyacct.setText(journeyPlanPreviousGetterSetter.getKEYACCOUNT().get(position));
|
||||||
@@ -313,10 +306,8 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemCount() {
|
public int getItemCount() {
|
||||||
|
|
||||||
return journeyPlanPreviousGetterSetter.getSTORE_ID().size();
|
return journeyPlanPreviousGetterSetter.getSTORE_ID().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
|||||||
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
||||||
|
|
||||||
public class MessageActivity extends AppCompatActivity {
|
public class MessageActivity extends AppCompatActivity {
|
||||||
|
|
||||||
//ArrayList<MessageGetterSetter> messages;
|
//ArrayList<MessageGetterSetter> messages;
|
||||||
private Context context;
|
private Context context;
|
||||||
String categoryName = "", categoryId;
|
String categoryName = "", categoryId;
|
||||||
@@ -121,10 +120,8 @@ public class MessageActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
toolbar.setTitle(getString(R.string.title_activity_message));
|
toolbar.setTitle(getString(R.string.title_activity_message));
|
||||||
|
|
||||||
new DowloadAsync(MessageActivity.this).execute();
|
new DowloadAsync(MessageActivity.this).execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+49
-83
@@ -1,5 +1,4 @@
|
|||||||
package cpm.com.gskmtorange.dailyentry;
|
package cpm.com.gskmtorange.dailyentry;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@@ -67,9 +66,7 @@ import cpm.com.gskmtorange.interfaces.DialogCallbackListener;
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_DataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_DataGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
|
||||||
|
public class NewStockDataActivity extends AppCompatActivity implements DialogCallbackListener {
|
||||||
public class NewStockDataActivity extends AppCompatActivity implements DialogCallbackListener{
|
|
||||||
|
|
||||||
private Context context;
|
private Context context;
|
||||||
ExpandableListView expandableListView;
|
ExpandableListView expandableListView;
|
||||||
TextView txt_mslAvailabilityName;
|
TextView txt_mslAvailabilityName;
|
||||||
@@ -84,7 +81,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
|||||||
LinearLayout lin_camera1, lin_camera2, lin_camera3, lin_camera4;
|
LinearLayout lin_camera1, lin_camera2, lin_camera3, lin_camera4;
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
String categoryName, categoryId, storeId, Error_Message = "";
|
String categoryName, categoryId, storeId, Error_Message = "";
|
||||||
String store_id,store_flag_hide, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str;
|
String store_id, store_flag_hide, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str;
|
||||||
boolean isDialogOpen = true;
|
boolean isDialogOpen = true;
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
int scrollPosition = 0;
|
int scrollPosition = 0;
|
||||||
@@ -95,7 +92,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
|||||||
boolean editFlag = false;
|
boolean editFlag = false;
|
||||||
|
|
||||||
//temp
|
//temp
|
||||||
public static final String FILE_PATH = Environment.getExternalStorageDirectory() + "/";
|
// public static final String FILE_PATH = Environment.getExternalStorageDirectory() + "/";
|
||||||
//ImageView bmImage;
|
//ImageView bmImage;
|
||||||
RelativeLayout view;
|
RelativeLayout view;
|
||||||
|
|
||||||
@@ -150,7 +147,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
|||||||
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
str_planogram = CommonString.FILE_PATH_PLANOGRAM;
|
str_planogram = CommonString.getDownloadedImageFolder(context);
|
||||||
|
|
||||||
prepareList();
|
prepareList();
|
||||||
|
|
||||||
@@ -171,12 +168,19 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
|||||||
|
|
||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
if (db.checkMsl_Availability_StockFacingData(store_id, categoryId)) {
|
/*if (db.checkMsl_Availability_StockFacingData(store_id, categoryId)) {
|
||||||
db.updateMSL_Availability_StockFacing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
db.updateMSL_Availability_StockFacing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
Snackbar.make(view, getResources().getString(R.string.update_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(view, getResources().getString(R.string.update_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
} else {
|
} else {
|
||||||
db.InsertMSL_Availability_StockFacing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
db.InsertMSL_Availability_StockFacing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
Snackbar.make(view, getResources().getString(R.string.save_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(view, getResources().getString(R.string.save_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
}*/
|
||||||
|
if (db.checkMsl_Availability_StockFacingDataNew(store_id, categoryId, visit_date)) {
|
||||||
|
db.updateMSL_Availability_StockFacingNew(visit_date, store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
|
Snackbar.make(view, getResources().getString(R.string.update_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
} else {
|
||||||
|
db.InsertMSL_Availability_StockFacingNew(visit_date, store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
|
Snackbar.make(view, getResources().getString(R.string.save_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
}
|
}
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
@@ -303,50 +307,6 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* view = (RelativeLayout)findViewById(R.id.content_msl__availability);
|
|
||||||
//bmImage = (ImageView)findViewById(R.id.image);
|
|
||||||
|
|
||||||
view.setDrawingCacheEnabled(true);
|
|
||||||
// this is the important code :)
|
|
||||||
// Without it the view will have a dimension of 0,0 and the bitmap will be null
|
|
||||||
|
|
||||||
view.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
|
|
||||||
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
|
|
||||||
|
|
||||||
view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight());
|
|
||||||
|
|
||||||
view.buildDrawingCache(true);
|
|
||||||
final Bitmap b = Bitmap.createBitmap(view.getDrawingCache());
|
|
||||||
view.setDrawingCacheEnabled(false); // clear drawing cache
|
|
||||||
|
|
||||||
//bmImage.setImageBitmap(b);
|
|
||||||
|
|
||||||
try{
|
|
||||||
|
|
||||||
|
|
||||||
File yourFile = new File(FILE_PATH+"imgForTxt.png");
|
|
||||||
yourFile.createNewFile(); // if file already exists will do nothing
|
|
||||||
final FileOutputStream stream = new FileOutputStream(yourFile, false); //create your FileOutputStream here
|
|
||||||
|
|
||||||
new Thread(new Runnable() {
|
|
||||||
public void run(){
|
|
||||||
b.compress(Bitmap.CompressFormat.PNG, 85, stream);
|
|
||||||
b.recycle();
|
|
||||||
try {
|
|
||||||
stream.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (FileNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -438,7 +398,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
|||||||
//img_planogram.setImageBitmap(bmp);
|
//img_planogram.setImageBitmap(bmp);
|
||||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||||
|
|
||||||
String imagePath = "file://" + CommonString.FILE_PATH_PLANOGRAM + "/" + planogram_image;
|
String imagePath = "file://" + CommonString.getDownloadedImageFolder(context) + "/" + planogram_image;
|
||||||
String html = "<html><head></head><body><img src=\"" + imagePath + "\"></body></html>";
|
String html = "<html><head></head><body><img src=\"" + imagePath + "\"></body></html>";
|
||||||
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
||||||
|
|
||||||
@@ -670,28 +630,37 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
|||||||
|
|
||||||
//Header
|
//Header
|
||||||
if (country_id.equals("7")) {
|
if (country_id.equals("7")) {
|
||||||
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE, CommonString.TABLE_MAPPING_SOS_TARGET,store_flag_hide);
|
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide);
|
||||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC, CommonString.TABLE_MAPPING_SOS_TARGET_ADHOC,store_flag_hide);
|
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC, CommonString.TABLE_MAPPING_SOS_TARGET_ADHOC, store_flag_hide);
|
||||||
} else {
|
} else {
|
||||||
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET,store_flag_hide);
|
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (headerDataList.size() > 0) {
|
if (headerDataList.size() > 0) {
|
||||||
for (int i = 0; i < headerDataList.size(); i++) {
|
for (int i = 0; i < headerDataList.size(); i++) {
|
||||||
hashMapListHeaderData.add(headerDataList.get(i));
|
hashMapListHeaderData.add(headerDataList.get(i));
|
||||||
|
|
||||||
//childDataList = new ArrayList<>();
|
//childDataList = new ArrayList<>();
|
||||||
childDataList = db.getMSL_Availability_StockFacingSKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
//childDataList = db.getMSL_Availability_StockFacingSKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||||
if (!(childDataList.size() > 0)) {
|
|
||||||
if (country_id.equals("7")) {
|
if (country_id.equals("7")) {
|
||||||
childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE,store_flag_hide);
|
childDataList = db.getMSL_Availability_StockFacingSKUDataNewUpdate(headerDataList.get(i).getSub_category_id(),
|
||||||
|
categoryId, headerDataList.get(i).getBrand_id(), null, null, null, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_STOREWISE, store_flag_hide, visit_date, false);
|
||||||
|
updateCoverage(CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||||
|
// childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE,store_flag_hide);
|
||||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC,store_flag_hide);
|
// childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC,store_flag_hide);
|
||||||
|
childDataList = db.getMSL_Availability_StockFacingSKUDataNewUpdate(headerDataList.get(i).getSub_category_id(),
|
||||||
|
categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADHOC, store_flag_hide, visit_date, false);
|
||||||
|
updateCoverage(CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
} else {
|
} else {
|
||||||
childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK,store_flag_hide);
|
// childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK,store_flag_hide);
|
||||||
}
|
childDataList = db.getMSL_Availability_StockFacingSKUDataNewUpdate(headerDataList.get(i).getSub_category_id(), categoryId,
|
||||||
|
headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK, store_flag_hide, visit_date, false);
|
||||||
|
updateCoverage(CommonString.TABLE_MAPPING_STOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
||||||
@@ -938,7 +907,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
|||||||
txt_categoryHeader.setTypeface(null, Typeface.BOLD);
|
txt_categoryHeader.setTypeface(null, Typeface.BOLD);
|
||||||
|
|
||||||
if (headerTitle.getCompany_id().equals("1")) {
|
if (headerTitle.getCompany_id().equals("1")) {
|
||||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
txt_categoryHeader.setTextColor(getResources().getColor(R.color.header_text_color));
|
||||||
} else {
|
} else {
|
||||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.black));
|
txt_categoryHeader.setTextColor(getResources().getColor(R.color.black));
|
||||||
}
|
}
|
||||||
@@ -948,6 +917,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
|||||||
if (!checkflag) {
|
if (!checkflag) {
|
||||||
if (checkHeaderArray.contains(groupPosition)) {
|
if (checkHeaderArray.contains(groupPosition)) {
|
||||||
card_view.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
card_view.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
txt_categoryHeader.setTextColor(getResources().getColor(R.color.white));
|
||||||
} else {
|
} else {
|
||||||
card_view.setCardBackgroundColor(getResources().getColor(R.color.grey_background));
|
card_view.setCardBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
}
|
}
|
||||||
@@ -1001,7 +971,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
|||||||
|
|
||||||
if (convertView == null) {
|
if (convertView == null) {
|
||||||
LayoutInflater infalInflater = (LayoutInflater) this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
LayoutInflater infalInflater = (LayoutInflater) this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
convertView = infalInflater.inflate(R.layout.item_msl_availability_stock_facing_child, null, false);
|
convertView = infalInflater.inflate(R.layout.item_msl_availability_stock_facing_child_data, null, false);
|
||||||
|
|
||||||
holder = new NewStockDataActivity.ViewHolder();
|
holder = new NewStockDataActivity.ViewHolder();
|
||||||
holder.cardView = (CardView) convertView.findViewById(R.id.card_view);
|
holder.cardView = (CardView) convertView.findViewById(R.id.card_view);
|
||||||
@@ -1014,7 +984,6 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
|||||||
holder.facing = (EditText) convertView.findViewById(R.id.ed_facing);
|
holder.facing = (EditText) convertView.findViewById(R.id.ed_facing);
|
||||||
holder.facing.setFilters(new InputFilter[]{new NewStockDataActivity.DecimalDigitsInputFilter(3, 1)});
|
holder.facing.setFilters(new InputFilter[]{new NewStockDataActivity.DecimalDigitsInputFilter(3, 1)});
|
||||||
holder.stock = (EditText) convertView.findViewById(R.id.ed_stock);
|
holder.stock = (EditText) convertView.findViewById(R.id.ed_stock);
|
||||||
|
|
||||||
holder.stock_view = convertView.findViewById(R.id.stock_view);
|
holder.stock_view = convertView.findViewById(R.id.stock_view);
|
||||||
convertView.setTag(holder);
|
convertView.setTag(holder);
|
||||||
} else {
|
} else {
|
||||||
@@ -1025,12 +994,13 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
|||||||
holder.txt_mbq.setText(childData.getMbq());
|
holder.txt_mbq.setText(childData.getMbq());
|
||||||
|
|
||||||
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.light_green_background));
|
||||||
|
|
||||||
holder.txt_mbq.setVisibility(View.VISIBLE);
|
holder.txt_mbq.setVisibility(View.VISIBLE);
|
||||||
holder.toggle_available.setVisibility(View.VISIBLE);
|
holder.toggle_available.setVisibility(View.VISIBLE);
|
||||||
holder.facing.setVisibility(View.VISIBLE);
|
holder.facing.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
|
||||||
if (country_id.equals("6")) {
|
if (country_id.equals("6")) {
|
||||||
holder.stock.setVisibility(View.VISIBLE);
|
holder.stock.setVisibility(View.VISIBLE);
|
||||||
holder.stock_view.setVisibility(View.VISIBLE);
|
holder.stock_view.setVisibility(View.VISIBLE);
|
||||||
@@ -1115,18 +1085,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
|||||||
childData.setFacing("");
|
childData.setFacing("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* else {
|
|
||||||
if (finalHolder.facing.getText().toString() != null && !finalHolder.facing.getText().toString().equals("")) {
|
|
||||||
if (Integer.parseInt(finalHolder.facing.getText().toString()) >= 0
|
|
||||||
&& Integer.parseInt(finalHolder.facing.getText().toString()) >= Integer.parseInt(childData.getMbq())) {
|
|
||||||
childData.setFacing("");
|
|
||||||
finalHolder.facing.setText("");
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
expandableListView.clearFocus();
|
expandableListView.clearFocus();
|
||||||
expandableListView.invalidateViews();
|
expandableListView.invalidateViews();
|
||||||
}
|
}
|
||||||
@@ -1523,11 +1482,13 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
|||||||
|
|
||||||
if (tempflag) {
|
if (tempflag) {
|
||||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
// holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
// holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
holder.lin_category.setBackgroundResource(R.drawable.cardview_error_border);
|
||||||
} else {
|
} else {
|
||||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||||
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.light_green_background));
|
||||||
} else {
|
} else {
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
}
|
}
|
||||||
@@ -1543,11 +1504,12 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
|||||||
|
|
||||||
if (tempflag) {
|
if (tempflag) {
|
||||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
//holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
holder.lin_category.setBackgroundResource(R.drawable.cardview_error_border);
|
||||||
} else {
|
} else {
|
||||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||||
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.light_green_background));
|
||||||
} else {
|
} else {
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
}
|
}
|
||||||
@@ -1575,6 +1537,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
|||||||
ToggleButton toggle_available;
|
ToggleButton toggle_available;
|
||||||
LinearLayout lin_category;
|
LinearLayout lin_category;
|
||||||
EditText facing, stock;
|
EditText facing, stock;
|
||||||
|
|
||||||
View stock_view;
|
View stock_view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1641,6 +1604,9 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
|||||||
return "";
|
return "";
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
private void updateCoverage(String table) {
|
||||||
|
long l = db.updateStockMapping(store_id, visit_date, table);
|
||||||
|
if (l > 0) Log.e("CoverageUpdate", "" + l);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
|||||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||||
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
||||||
|
|
||||||
str = CommonString.FILE_PATH;
|
str = CommonString.getImagesFolder(context);
|
||||||
|
|
||||||
//Intent data
|
//Intent data
|
||||||
categoryName = getIntent().getStringExtra("categoryName");
|
categoryName = getIntent().getStringExtra("categoryName");
|
||||||
@@ -321,7 +321,6 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onLongClick(View tvView) {
|
public boolean onLongClick(View tvView) {
|
||||||
showDeleteDialog(tvView);
|
showDeleteDialog(tvView);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1063,7 +1062,7 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
|||||||
ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> mappingPlanogramList;
|
ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> mappingPlanogramList;
|
||||||
|
|
||||||
|
|
||||||
if (country_id.equals("7")) {
|
if (country_id.equals("7")||country_id.equals("8")||country_id.equals("11")) {
|
||||||
mappingPlanogramList= db.getMappingPlanogramData(categoryId, null, null, store_id, CommonString.TABLE_MAPPING_PLANOGRAM_STORE_WISE);
|
mappingPlanogramList= db.getMappingPlanogramData(categoryId, null, null, store_id, CommonString.TABLE_MAPPING_PLANOGRAM_STORE_WISE);
|
||||||
} else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
} else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
mappingPlanogramList= db.getMappingPlanogramData(categoryId, storeType_id, class_id, null, CommonString.TABLE_MAPPING_PLANOGRAM_ADHOC);
|
mappingPlanogramList= db.getMappingPlanogramData(categoryId, storeType_id, class_id, null, CommonString.TABLE_MAPPING_PLANOGRAM_ADHOC);
|
||||||
@@ -1085,13 +1084,13 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
|||||||
planogram_image = mappingPlanogramList.get(0).getPLANOGRAM_IMAGE();
|
planogram_image = mappingPlanogramList.get(0).getPLANOGRAM_IMAGE();
|
||||||
}
|
}
|
||||||
if (!planogram_image.equals("")) {
|
if (!planogram_image.equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH_PLANOGRAM + planogram_image).exists()) {
|
if (new File(CommonString.getDownloadedImageFolder(context) + planogram_image).exists()) {
|
||||||
Bitmap bmp = BitmapFactory.decodeFile(CommonString.FILE_PATH_PLANOGRAM + planogram_image);
|
Bitmap bmp = BitmapFactory.decodeFile(CommonString.getDownloadedImageFolder(context) + planogram_image);
|
||||||
// img_planogram.setRotation(90);
|
// img_planogram.setRotation(90);
|
||||||
//img_planogram.setImageBitmap(bmp);
|
//img_planogram.setImageBitmap(bmp);
|
||||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||||
|
|
||||||
String imagePath = "file://" + CommonString.FILE_PATH_PLANOGRAM + "/" + planogram_image;
|
String imagePath = "file://" + CommonString.getDownloadedImageFolder(context) + "/" + planogram_image;
|
||||||
String html = "<html><head></head><body><img src=\"" + imagePath + "\"></body></html>";
|
String html = "<html><head></head><body><img src=\"" + imagePath + "\"></body></html>";
|
||||||
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
||||||
|
|
||||||
@@ -1147,7 +1146,7 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
// super.onBackPressed();
|
super.onBackPressed();
|
||||||
|
|
||||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(NoCameraActivity.this);
|
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(NoCameraActivity.this);
|
||||||
builder.setTitle("Parinaam");
|
builder.setTitle("Parinaam");
|
||||||
@@ -1202,12 +1201,10 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
|||||||
|
|
||||||
void addRow(){
|
void addRow(){
|
||||||
DynamycIdsGetterSetter dynamic_ids = new DynamycIdsGetterSetter();
|
DynamycIdsGetterSetter dynamic_ids = new DynamycIdsGetterSetter();
|
||||||
|
|
||||||
// first Button
|
// first Button
|
||||||
RelativeLayout rLayout = new RelativeLayout(context);
|
RelativeLayout rLayout = new RelativeLayout(context);
|
||||||
RelativeLayout.LayoutParams lprams = new RelativeLayout.LayoutParams(
|
RelativeLayout.LayoutParams lprams = new RelativeLayout.LayoutParams(
|
||||||
RelativeLayout.LayoutParams.MATCH_PARENT,
|
RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||||
RelativeLayout.LayoutParams.WRAP_CONTENT);
|
|
||||||
TextView tv = new TextView(context);
|
TextView tv = new TextView(context);
|
||||||
//tv.setHeight(60);
|
//tv.setHeight(60);
|
||||||
tv.setTextSize(20);
|
tv.setTextSize(20);
|
||||||
@@ -1217,21 +1214,15 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
|||||||
tv.setLayoutParams(lprams);
|
tv.setLayoutParams(lprams);
|
||||||
int tv_id = View.generateViewId();
|
int tv_id = View.generateViewId();
|
||||||
tv.setId(tv_id);
|
tv.setId(tv_id);
|
||||||
|
|
||||||
//set dynamic textview id to object
|
//set dynamic textview id to object
|
||||||
dynamic_ids.setTextview_id(tv_id);
|
dynamic_ids.setTextview_id(tv_id);
|
||||||
|
|
||||||
RecyclerView rec_bottom = new RecyclerView(context);
|
RecyclerView rec_bottom = new RecyclerView(context);
|
||||||
int rec_id = View.generateViewId();
|
int rec_id = View.generateViewId();
|
||||||
|
|
||||||
//set dynamic recycler id to object
|
//set dynamic recycler id to object
|
||||||
dynamic_ids.setRecycler_id(rec_id);
|
dynamic_ids.setRecycler_id(rec_id);
|
||||||
|
|
||||||
rec_bottom.setLayoutParams(lprams);
|
rec_bottom.setLayoutParams(lprams);
|
||||||
rec_bottom.setPadding(0, 0, 0, 0);
|
rec_bottom.setPadding(0, 0, 0, 0);
|
||||||
|
|
||||||
rec_bottom.setVisibility(View.GONE);
|
rec_bottom.setVisibility(View.GONE);
|
||||||
|
|
||||||
rec_bottom.setId(rec_id);
|
rec_bottom.setId(rec_id);
|
||||||
rec_bottom.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
rec_bottom.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
private ProgressBar pb;
|
private ProgressBar pb;
|
||||||
private FailureGetterSetter failureGetterSetter = null;
|
private FailureGetterSetter failureGetterSetter = null;
|
||||||
boolean nonflag=true;
|
boolean nonflag=true;
|
||||||
String store_flag_str;
|
String store_flag_str,country_id, keyAccount_id, class_id, storeType_id;
|
||||||
|
|
||||||
TextView tv_remark;
|
TextView tv_remark;
|
||||||
|
|
||||||
@@ -117,7 +117,6 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.nonworkingmainlayout);
|
setContentView(R.layout.nonworkingmainlayout);
|
||||||
|
|
||||||
reasonspinner = (Spinner) findViewById(R.id.spinner_reason);
|
reasonspinner = (Spinner) findViewById(R.id.spinner_reason);
|
||||||
camera = (ImageButton) findViewById(R.id.imgcam);
|
camera = (ImageButton) findViewById(R.id.imgcam);
|
||||||
save = (Button) findViewById(R.id.save);
|
save = (Button) findViewById(R.id.save);
|
||||||
@@ -126,28 +125,25 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
reason_lay = (RelativeLayout) findViewById(R.id.layout_reason);
|
reason_lay = (RelativeLayout) findViewById(R.id.layout_reason);
|
||||||
rel_cam = (RelativeLayout) findViewById(R.id.relimgcam);
|
rel_cam = (RelativeLayout) findViewById(R.id.relimgcam);
|
||||||
subreason_spinner = (Spinner) findViewById(R.id.spinner_sub_reason);
|
subreason_spinner = (Spinner) findViewById(R.id.spinner_sub_reason);
|
||||||
|
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
context = this;
|
context = this;
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
||||||
|
|
||||||
_UserId = preferences.getString(CommonString.KEY_USERNAME, "");
|
_UserId = preferences.getString(CommonString.KEY_USERNAME, "");
|
||||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||||
|
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||||
|
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||||
|
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||||
store_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
store_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||||
//store_id = preferences.getString(CommonString.KEY_STORE_ID, "");
|
|
||||||
|
|
||||||
database = new GSKOrangeDB(this);
|
database = new GSKOrangeDB(this);
|
||||||
database.open();
|
database.open();
|
||||||
str = CommonString.FILE_PATH;
|
str = CommonString.getImagesFolder(context);
|
||||||
|
|
||||||
//storelist = database.getStoreData(visit_date,CommonString.KEY_JOURNEY_PLAN );
|
//storelist = database.getStoreData(visit_date,CommonString.KEY_JOURNEY_PLAN );
|
||||||
|
|
||||||
@@ -215,9 +211,8 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
super.onBackPressed();
|
||||||
finish();
|
finish();
|
||||||
|
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,8 +221,9 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
long arg3) {
|
long arg3) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
switch (arg0.getId()) {
|
int id = arg0.getId();
|
||||||
case R.id.spinner_reason:
|
|
||||||
|
if (id == R.id.spinner_reason) {
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
reasonname = reasondata.get(position - 1).getREASON().get(0);
|
reasonname = reasondata.get(position - 1).getREASON().get(0);
|
||||||
reasonid = reasondata.get(position - 1).getREASON_ID().get(0);
|
reasonid = reasondata.get(position - 1).getREASON_ID().get(0);
|
||||||
@@ -244,14 +240,13 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
rel_cam.setVisibility(View.GONE);
|
rel_cam.setVisibility(View.GONE);
|
||||||
image = "false";
|
image = "false";
|
||||||
}
|
}
|
||||||
//reason_reamrk = "true";
|
|
||||||
if (remark_allow.equalsIgnoreCase("1")) {
|
if (remark_allow.equalsIgnoreCase("1")) {
|
||||||
reason_lay.setVisibility(View.VISIBLE);
|
reason_lay.setVisibility(View.VISIBLE);
|
||||||
if(remark_type.equalsIgnoreCase("Text")){
|
if (remark_type.equalsIgnoreCase("Text")) {
|
||||||
text.setVisibility(View.VISIBLE);
|
text.setVisibility(View.VISIBLE);
|
||||||
subreason_spinner.setVisibility(View.GONE);
|
subreason_spinner.setVisibility(View.GONE);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
text.setVisibility(View.GONE);
|
text.setVisibility(View.GONE);
|
||||||
subreason_spinner.setVisibility(View.VISIBLE);
|
subreason_spinner.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
@@ -260,7 +255,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
sub_reason_adapter = new ArrayAdapter<CharSequence>(this,
|
sub_reason_adapter = new ArrayAdapter<CharSequence>(this,
|
||||||
android.R.layout.simple_spinner_item);
|
android.R.layout.simple_spinner_item);
|
||||||
|
|
||||||
String select_str = getResources().getString(R.string.select_promo) + " " +reasondata.get(position - 1).getREMARK_LABEL().get(0);
|
String select_str = getResources().getString(R.string.select_promo) + " " + reasondata.get(position - 1).getREMARK_LABEL().get(0);
|
||||||
|
|
||||||
sub_reason_adapter.add(select_str);
|
sub_reason_adapter.add(select_str);
|
||||||
|
|
||||||
@@ -270,8 +265,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
|
|
||||||
subreason_spinner.setAdapter(sub_reason_adapter);
|
subreason_spinner.setAdapter(sub_reason_adapter);
|
||||||
|
|
||||||
sub_reason_adapter
|
sub_reason_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
|
||||||
|
|
||||||
subreason_spinner.setOnItemSelectedListener(this);
|
subreason_spinner.setOnItemSelectedListener(this);
|
||||||
}
|
}
|
||||||
@@ -284,19 +278,15 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
reasonid = "";
|
reasonid = "";
|
||||||
reason_lay.setVisibility(View.GONE);
|
reason_lay.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
break;
|
} else if (id == R.id.spinner_sub_reason) {
|
||||||
|
|
||||||
case R.id.spinner_sub_reason:
|
|
||||||
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
sub_reason_id = sub_reasondata.get(position-1).getSUB_REASON_ID().get(0);
|
sub_reason_id = sub_reasondata.get(position - 1).getSUB_REASON_ID().get(0);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
sub_reason_id = "";
|
sub_reason_id = "";
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -430,7 +420,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
|
|
||||||
_pathforcheck = store_id + "NonWorking" + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck = store_id + "NonWorking" + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
}
|
}
|
||||||
@@ -496,13 +486,22 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
cdata.setLongitude("0.0");
|
cdata.setLongitude("0.0");
|
||||||
cdata.setImage(image1);
|
cdata.setImage(image1);
|
||||||
cdata.setSub_reasonId(sub_reason_id);
|
cdata.setSub_reasonId(sub_reason_id);
|
||||||
|
|
||||||
cdata.setRemark(text.getText().toString().replaceAll("[&^<>{}'$]", " "));
|
cdata.setRemark(text.getText().toString().replaceAll("[&^<>{}'$]", " "));
|
||||||
cdata.setStatus(CommonString.STORE_STATUS_LEAVE);
|
cdata.setStatus(CommonString.STORE_STATUS_LEAVE);
|
||||||
cdata.setFlag_from(store_flag_str);
|
cdata.setFlag_from(store_flag_str);
|
||||||
|
|
||||||
database.InsertCoverageData(cdata);
|
if (country_id.equals("7") || country_id.equals("8")) {
|
||||||
|
cdata.setKeyAccountId("0");
|
||||||
|
cdata.setStoreTypeId("0");
|
||||||
|
cdata.setClassId("0");
|
||||||
|
} else {
|
||||||
|
cdata.setKeyAccountId(keyAccount_id);
|
||||||
|
cdata.setStoreTypeId(storeType_id);
|
||||||
|
cdata.setClassId(class_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
database.open();
|
||||||
|
database.InsertCoverageData(cdata);
|
||||||
database.updateStoreStatusOnLeave(store_id, visit_date, CommonString.STORE_STATUS_LEAVE, store_flag_str);
|
database.updateStoreStatusOnLeave(store_id, visit_date, CommonString.STORE_STATUS_LEAVE, store_flag_str);
|
||||||
|
|
||||||
|
|
||||||
@@ -541,34 +540,27 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
cdata.setStatus(CommonString.STORE_STATUS_LEAVE);
|
cdata.setStatus(CommonString.STORE_STATUS_LEAVE);
|
||||||
cdata.setFlag_from(store_flag_str);
|
cdata.setFlag_from(store_flag_str);
|
||||||
|
|
||||||
database.InsertCoverageData(cdata);
|
if (country_id.equals("7") || country_id.equals("8")) {
|
||||||
|
cdata.setKeyAccountId("0");
|
||||||
//database.updateStoreStatusOnLeave(store_id, visit_date, CommonString.STORE_STATUS_LEAVE, CommonString.FROM_JCP);
|
cdata.setStoreTypeId("0");
|
||||||
database.updateStoreStatusOnLeave(store_id, visit_date, CommonString.STORE_STATUS_LEAVE, store_flag_str);
|
cdata.setClassId("0");
|
||||||
|
} else {
|
||||||
SharedPreferences.Editor editor = preferences
|
cdata.setKeyAccountId(keyAccount_id);
|
||||||
.edit();
|
cdata.setStoreTypeId(storeType_id);
|
||||||
|
cdata.setClassId(class_id);
|
||||||
editor.putString(CommonString.KEY_STOREVISITED_STATUS + store_id, "No");
|
}
|
||||||
editor.putString(
|
database.open();
|
||||||
CommonString.KEY_STOREVISITED_STATUS,
|
database.InsertCoverageData(cdata);
|
||||||
"");
|
database.updateStoreStatusOnLeave(store_id, visit_date, CommonString.STORE_STATUS_LEAVE, store_flag_str);
|
||||||
editor.putString(
|
SharedPreferences.Editor editor = preferences.edit();
|
||||||
CommonString.KEY_STORE_IN_TIME,
|
editor.putString(CommonString.KEY_STOREVISITED_STATUS + store_id, "No");
|
||||||
"");
|
editor.putString(CommonString.KEY_STOREVISITED_STATUS, "");
|
||||||
editor.putString(
|
editor.putString(CommonString.KEY_STORE_IN_TIME, "");
|
||||||
CommonString.KEY_LATITUDE,
|
editor.putString(CommonString.KEY_LATITUDE, "");
|
||||||
"");
|
editor.putString(CommonString.KEY_LONGITUDE, "");
|
||||||
editor.putString(
|
editor.commit();
|
||||||
CommonString.KEY_LONGITUDE,
|
|
||||||
"");
|
|
||||||
editor.commit();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
new NonWorkingReason.GeoTagUpload(NonWorkingReason.this).execute();
|
new NonWorkingReason.GeoTagUpload(NonWorkingReason.this).execute();
|
||||||
|
|
||||||
// finish();
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(R.string.closed,
|
.setNegativeButton(R.string.closed,
|
||||||
@@ -643,6 +635,8 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
cdate = arabicToenglish(cdate);
|
cdate = arabicToenglish(cdate);
|
||||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
||||||
cdate = arabicToenglish(cdate);
|
cdate = arabicToenglish(cdate);
|
||||||
|
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -59,6 +59,8 @@ public class POGQuestionsActivity extends AppCompatActivity {
|
|||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
int scrollPosition = 0;
|
int scrollPosition = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
|
|
||||||
List<MSL_AvailabilityStockFacingGetterSetter> headerDataList = new ArrayList<>();
|
List<MSL_AvailabilityStockFacingGetterSetter> headerDataList = new ArrayList<>();
|
||||||
@@ -146,13 +148,12 @@ public class POGQuestionsActivity extends AppCompatActivity {
|
|||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
expandableListView.invalidateViews();
|
expandableListView.invalidateViews();
|
||||||
}
|
}
|
||||||
|
|
||||||
Snackbar.make(expandableListView, error_msg, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(expandableListView, error_msg, Snackbar.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (country_id.equals("2") && (storeType_id.equals("9") || storeType_id.equals("15")||storeType_id.equals("47"))) {
|
if (country_id.equals("2") && (storeType_id.equals("9") || storeType_id.equals("15")||storeType_id.equals("47")||storeType_id.equals("123"))) {
|
||||||
linPlanogramType.setVisibility(View.VISIBLE);
|
linPlanogramType.setVisibility(View.VISIBLE);
|
||||||
final ArrayAdapter planogramTypeAdapter = new ArrayAdapter<CharSequence>(this,
|
final ArrayAdapter planogramTypeAdapter = new ArrayAdapter<CharSequence>(this,
|
||||||
android.R.layout.simple_spinner_item);
|
android.R.layout.simple_spinner_item);
|
||||||
|
|||||||
@@ -28,16 +28,14 @@ import cpm.com.gskmtorange.fragment.SelectLanguageFragment;
|
|||||||
import cpm.com.gskmtorange.fragment.SettingsActivityFragment;
|
import cpm.com.gskmtorange.fragment.SettingsActivityFragment;
|
||||||
|
|
||||||
public class SettingsActivity extends AppCompatActivity implements SelectLanguageFragment.OnFragmentInteractionListener {
|
public class SettingsActivity extends AppCompatActivity implements SelectLanguageFragment.OnFragmentInteractionListener {
|
||||||
|
|
||||||
String selected_lang = "", culture_id, notice_url;
|
String selected_lang = "", culture_id, notice_url;
|
||||||
private Context context;
|
private Context context;
|
||||||
FloatingActionButton fab;
|
FloatingActionButton fab;
|
||||||
|
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
|
|
||||||
private SharedPreferences.Editor editor = null;
|
private SharedPreferences.Editor editor = null;
|
||||||
|
|
||||||
Toolbar toolbar;
|
Toolbar toolbar;
|
||||||
|
private static final String SELECTED_ITEM_POSITION = "ItemPosition";
|
||||||
|
private int mPosition;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -47,11 +45,9 @@ public class SettingsActivity extends AppCompatActivity implements SelectLanguag
|
|||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
context = this;
|
context = this;
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
//preference data
|
//preference data
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
editor = preferences.edit();
|
editor = preferences.edit();
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(context,preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context,preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
/* SettingsActivityFragment fragment = new SettingsActivityFragment();
|
/* SettingsActivityFragment fragment = new SettingsActivityFragment();
|
||||||
@@ -61,37 +57,27 @@ public class SettingsActivity extends AppCompatActivity implements SelectLanguag
|
|||||||
fab.setOnClickListener(new View.OnClickListener() {
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
if (selected_lang.equals("")) {
|
if (selected_lang.equals("")) {
|
||||||
|
Snackbar.make(view, getString(R.string.select_language), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
Snackbar.make(view, getString(R.string.select_language), Snackbar.LENGTH_LONG)
|
|
||||||
.setAction("Action", null).show();
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(context,selected_lang);
|
CommonFunctions.updateLangResources(context,selected_lang);
|
||||||
|
|
||||||
editor.putString(CommonString.KEY_LANGUAGE, selected_lang);
|
editor.putString(CommonString.KEY_LANGUAGE, selected_lang);
|
||||||
editor.putString(CommonString.KEY_CULTURE_ID, culture_id);
|
editor.putString(CommonString.KEY_CULTURE_ID, culture_id);
|
||||||
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, notice_url);
|
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, notice_url);
|
||||||
editor.commit();
|
editor.commit();
|
||||||
|
|
||||||
Intent startDownload = new Intent(context, MainActivity.class);
|
Intent startDownload = new Intent(context, MainActivity.class);
|
||||||
startActivity(startDownload);
|
startActivity(startDownload);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFragmentInteraction(String selected_lang, String culture_id, String notice_url) {
|
public void onFragmentInteraction(String selected_lang, String culture_id, String notice_url) {
|
||||||
|
|
||||||
this.selected_lang = selected_lang;
|
this.selected_lang = selected_lang;
|
||||||
this.culture_id = culture_id;
|
this.culture_id = culture_id;
|
||||||
this.notice_url = notice_url;
|
this.notice_url = notice_url;
|
||||||
|
|
||||||
if (!selected_lang.equals("")) {
|
if (!selected_lang.equals("")) {
|
||||||
fab.show();
|
fab.show();
|
||||||
}
|
}
|
||||||
@@ -110,7 +96,7 @@ public class SettingsActivity extends AppCompatActivity implements SelectLanguag
|
|||||||
startActivity(startDownload);
|
startActivity(startDownload);
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
// overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
//noinspection SimplifiableIfStatement
|
//noinspection SimplifiableIfStatement
|
||||||
@@ -129,7 +115,7 @@ public class SettingsActivity extends AppCompatActivity implements SelectLanguag
|
|||||||
|
|
||||||
finish();
|
finish();
|
||||||
|
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
// overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -139,5 +125,18 @@ public class SettingsActivity extends AppCompatActivity implements SelectLanguag
|
|||||||
toolbar.setTitle(R.string.title_activity_settings);
|
toolbar.setTitle(R.string.title_activity_settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onSaveInstanceState(final Bundle outState) {
|
||||||
|
super.onSaveInstanceState(outState);
|
||||||
|
// Save the state of item position
|
||||||
|
outState.putInt(SELECTED_ITEM_POSITION, mPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onRestoreInstanceState(final Bundle savedInstanceState) {
|
||||||
|
super.onRestoreInstanceState(savedInstanceState);
|
||||||
|
// Read the state of item position
|
||||||
|
mPosition = savedInstanceState.getInt(SELECTED_ITEM_POSITION);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,12 +121,11 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
|||||||
alert.show();*/
|
alert.show();*/
|
||||||
|
|
||||||
db.open();
|
db.open();
|
||||||
|
if (db.checkStockData(store_id, categoryId, visit_date)) {
|
||||||
if (db.checkStockData(store_id, categoryId)) {
|
db.updateStockData(store_id, categoryId, visit_date, hashMapListHeaderData, hashMapListChildData);
|
||||||
db.updateStockData(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
|
||||||
Snackbar.make(expandableListView, getResources().getString(R.string.update_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(expandableListView, getResources().getString(R.string.update_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
} else {
|
} else {
|
||||||
db.InsertStockData(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
db.InsertStockData(store_id, categoryId, visit_date, hashMapListHeaderData, hashMapListChildData);
|
||||||
Snackbar.make(expandableListView, getResources().getString(R.string.save_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(expandableListView, getResources().getString(R.string.save_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
}
|
}
|
||||||
finish();
|
finish();
|
||||||
@@ -234,45 +233,45 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
db.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void prepareList() {
|
private void prepareList() {
|
||||||
try {
|
try {
|
||||||
hashMapListHeaderData = new ArrayList<>();
|
hashMapListHeaderData = new ArrayList<>();
|
||||||
hashMapListChildData = new HashMap<>();
|
hashMapListChildData = new HashMap<>();
|
||||||
|
|
||||||
//Header
|
//Header
|
||||||
if(country_id.equals("7")){
|
if (country_id.equals("7")) {
|
||||||
headerDataList = db.getStockFacingHeaderData(categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE, CommonString.TABLE_MAPPING_SOS_TARGET);
|
headerDataList = db.getStockFacingHeaderData(categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE, CommonString.TABLE_MAPPING_SOS_TARGET);
|
||||||
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
headerDataList = db.getStockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC, CommonString.TABLE_MAPPING_SOS_TARGET_ADHOC);
|
||||||
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
||||||
|
headerDataList = db.getStockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADDITIONAL, CommonString.TABLE_MAPPING_SOS_TARGET);
|
||||||
|
} else {
|
||||||
|
headerDataList = db.getStockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET);
|
||||||
}
|
}
|
||||||
else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
|
||||||
headerDataList = db.getStockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id,CommonString.TABLE_MAPPING_STOCK_ADHOC, CommonString.TABLE_MAPPING_SOS_TARGET_ADHOC);
|
|
||||||
}
|
|
||||||
else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
|
||||||
headerDataList = db.getStockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id,CommonString.TABLE_MAPPING_STOCK_ADDITIONAL, CommonString.TABLE_MAPPING_SOS_TARGET);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
headerDataList = db.getStockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id,CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (headerDataList.size() > 0) {
|
if (headerDataList.size() > 0) {
|
||||||
for (int i = 0; i < headerDataList.size(); i++) {
|
for (int i = 0; i < headerDataList.size(); i++) {
|
||||||
hashMapListHeaderData.add(headerDataList.get(i));
|
hashMapListHeaderData.add(headerDataList.get(i));
|
||||||
|
|
||||||
//childDataList = new ArrayList<>();
|
//childDataList = new ArrayList<>();
|
||||||
childDataList = db.getStockAfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
//childDataList = db.getStockAfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||||
if (!(childDataList.size() > 0)) {
|
|
||||||
if (country_id.equals("7")) {
|
if (country_id.equals("7")) {
|
||||||
childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE,"0");
|
// childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE,"0");
|
||||||
|
childDataList = db.getMSL_Availability_StockFacingSKUDataNewUpdate(headerDataList.get(i).getSub_category_id(),
|
||||||
|
categoryId, headerDataList.get(i).getBrand_id(), null, null, null, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_STOREWISE, "0", visit_date, true);
|
||||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC,"0");
|
childDataList = db.getMSL_Availability_StockFacingSKUDataNewUpdate(headerDataList.get(i).getSub_category_id(),
|
||||||
|
categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADHOC, "0", visit_date, true);
|
||||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
||||||
childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADDITIONAL,"0");
|
childDataList = db.getMSL_Availability_StockFacingSKUDataNewUpdate(headerDataList.get(i).getSub_category_id(), categoryId,
|
||||||
|
headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADDITIONAL, "0", visit_date, true);
|
||||||
} else {
|
} else {
|
||||||
childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK,"0");
|
childDataList = db.getMSL_Availability_StockFacingSKUDataNewUpdate(headerDataList.get(i).getSub_category_id(),
|
||||||
}
|
categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK, "0", visit_date, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
||||||
@@ -330,7 +329,7 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
|||||||
txt_categoryHeader.setTypeface(null, Typeface.BOLD);
|
txt_categoryHeader.setTypeface(null, Typeface.BOLD);
|
||||||
|
|
||||||
if (headerTitle.getCompany_id().equals("1")) {
|
if (headerTitle.getCompany_id().equals("1")) {
|
||||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
txt_categoryHeader.setTextColor(getResources().getColor(R.color.header_text_color));
|
||||||
} else {
|
} else {
|
||||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.black));
|
txt_categoryHeader.setTextColor(getResources().getColor(R.color.black));
|
||||||
}
|
}
|
||||||
@@ -339,7 +338,10 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
|||||||
|
|
||||||
if (!checkflag) {
|
if (!checkflag) {
|
||||||
if (checkHeaderArray.contains(groupPosition)) {
|
if (checkHeaderArray.contains(groupPosition)) {
|
||||||
|
// card_view.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
card_view.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
card_view.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
txt_categoryHeader.setTextColor(getResources().getColor(R.color.white));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
card_view.setCardBackgroundColor(getResources().getColor(R.color.grey_background));
|
card_view.setCardBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
}
|
}
|
||||||
@@ -412,7 +414,7 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
|||||||
holder.txt_skuName.setText(childData.getSku());
|
holder.txt_skuName.setText(childData.getSku());
|
||||||
|
|
||||||
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.light_green_background));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@@ -465,11 +467,12 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
|||||||
|
|
||||||
if (tempflag) {
|
if (tempflag) {
|
||||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
// holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
holder.lin_category.setBackgroundResource(R.drawable.cardview_error_border);
|
||||||
} else {
|
} else {
|
||||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||||
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.light_green_background));
|
||||||
} else {
|
} else {
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
}
|
}
|
||||||
@@ -491,11 +494,13 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
|||||||
|
|
||||||
if (tempflag) {
|
if (tempflag) {
|
||||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
// holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
holder.lin_category.setBackgroundResource(R.drawable.cardview_error_border);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||||
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.light_green_background));
|
||||||
} else {
|
} else {
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
}
|
}
|
||||||
@@ -593,6 +598,7 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
|||||||
|
|
||||||
return all_flag;
|
return all_flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
if (editFlag) {
|
if (editFlag) {
|
||||||
|
|||||||
@@ -135,12 +135,19 @@ public class StockDataActivity extends AppCompatActivity implements DialogCallba
|
|||||||
|
|
||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
if (db.checkMsl_Availability_StockFacingData(store_id, categoryId)) {
|
/*if (db.checkMsl_Availability_StockFacingData(store_id, categoryId)) {
|
||||||
db.updateMSL_Availability_StockFacing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
db.updateMSL_Availability_StockFacing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
Snackbar.make(expandableListView, getResources().getString(R.string.update_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(expandableListView, getResources().getString(R.string.update_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
} else {
|
} else {
|
||||||
db.InsertMSL_Availability_StockFacing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
db.InsertMSL_Availability_StockFacing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
Snackbar.make(expandableListView, getResources().getString(R.string.save_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(expandableListView, getResources().getString(R.string.save_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
}*/
|
||||||
|
if (db.checkMsl_Availability_StockFacingDataNew(store_id, categoryId,visit_date)) {
|
||||||
|
db.updateMSL_Availability_StockFacingNew(visit_date,store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
|
Snackbar.make(expandableListView, getResources().getString(R.string.update_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
} else {
|
||||||
|
db.InsertMSL_Availability_StockFacingNew(visit_date,store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
|
Snackbar.make(expandableListView, getResources().getString(R.string.save_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
}
|
}
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
@@ -276,6 +283,7 @@ public class StockDataActivity extends AppCompatActivity implements DialogCallba
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, null, CommonString.TABLE_MAPPING_STOCK,"0");
|
childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, null, CommonString.TABLE_MAPPING_STOCK,"0");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+16
-12
@@ -46,11 +46,11 @@ public class StockPricingActivity extends AppCompatActivity {
|
|||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
|
|
||||||
String categoryName, categoryId, Error_Message = "";
|
String categoryName, categoryId, Error_Message = "";
|
||||||
String store_id,store_flag_hide, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str;
|
String store_id, store_flag_hide, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str;
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
|
|
||||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> headerDataList;
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> headerDataList;
|
||||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> childDataList= new ArrayList<>();
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> childDataList = new ArrayList<>();
|
||||||
List<MSL_AvailabilityStockFacingGetterSetter> hashMapListHeaderData;
|
List<MSL_AvailabilityStockFacingGetterSetter> hashMapListHeaderData;
|
||||||
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> hashMapListChildData;
|
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> hashMapListChildData;
|
||||||
ExpandableListAdapter adapter;
|
ExpandableListAdapter adapter;
|
||||||
@@ -116,7 +116,7 @@ public class StockPricingActivity extends AppCompatActivity {
|
|||||||
hashMapListChildData = new HashMap<>();
|
hashMapListChildData = new HashMap<>();
|
||||||
|
|
||||||
//Header
|
//Header
|
||||||
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET,store_flag_hide);
|
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide);
|
||||||
|
|
||||||
if (headerDataList.size() > 0) {
|
if (headerDataList.size() > 0) {
|
||||||
for (int i = 0; i < headerDataList.size(); i++) {
|
for (int i = 0; i < headerDataList.size(); i++) {
|
||||||
@@ -124,9 +124,10 @@ public class StockPricingActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
childDataList = new ArrayList<>();
|
childDataList = new ArrayList<>();
|
||||||
//childDataList = db.getMSL_Availability_StockFacingSKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
//childDataList = db.getMSL_Availability_StockFacingSKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||||
if (childDataList.size() == 0) {
|
// childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK,"0");
|
||||||
childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(),categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK,"0");
|
childDataList = db.getMSL_Availability_StockFacingSKUDataNewUpdate(headerDataList.get(i).getSub_category_id(),
|
||||||
}
|
categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK, "0", visit_date, false);
|
||||||
|
|
||||||
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
||||||
}
|
}
|
||||||
@@ -263,7 +264,7 @@ public class StockPricingActivity extends AppCompatActivity {
|
|||||||
txt_categoryHeader.setTypeface(null, Typeface.BOLD);
|
txt_categoryHeader.setTypeface(null, Typeface.BOLD);
|
||||||
|
|
||||||
if (headerTitle.getCompany_id().equals("1")) {
|
if (headerTitle.getCompany_id().equals("1")) {
|
||||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
txt_categoryHeader.setTextColor(getResources().getColor(R.color.header_text_color));
|
||||||
} else {
|
} else {
|
||||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.black));
|
txt_categoryHeader.setTextColor(getResources().getColor(R.color.black));
|
||||||
}
|
}
|
||||||
@@ -273,6 +274,7 @@ public class StockPricingActivity extends AppCompatActivity {
|
|||||||
if (!checkflag) {
|
if (!checkflag) {
|
||||||
if (checkHeaderArray.contains(groupPosition)) {
|
if (checkHeaderArray.contains(groupPosition)) {
|
||||||
card_view.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
card_view.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
txt_categoryHeader.setTextColor(getResources().getColor(R.color.white));
|
||||||
} else {
|
} else {
|
||||||
card_view.setCardBackgroundColor(getResources().getColor(R.color.grey_background));
|
card_view.setCardBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
}
|
}
|
||||||
@@ -359,7 +361,7 @@ public class StockPricingActivity extends AppCompatActivity {
|
|||||||
holder.et_price.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
holder.et_price.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onFocusChange(View v, boolean hasFocus) {
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
if(!hasFocus){
|
if (!hasFocus) {
|
||||||
final EditText caption = (EditText) v;
|
final EditText caption = (EditText) v;
|
||||||
String edStock = caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
String edStock = caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
||||||
|
|
||||||
@@ -383,11 +385,12 @@ public class StockPricingActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (tempflag) {
|
if (tempflag) {
|
||||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
//holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
holder.lin_category.setBackgroundResource(R.drawable.cardview_error_border);
|
||||||
} else {
|
} else {
|
||||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||||
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.light_green_background));
|
||||||
} else {
|
} else {
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
}
|
}
|
||||||
@@ -403,11 +406,12 @@ public class StockPricingActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (tempflag) {
|
if (tempflag) {
|
||||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
//holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
holder.lin_category.setBackgroundResource(R.drawable.cardview_error_border);
|
||||||
} else {
|
} else {
|
||||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||||
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.light_green_background));
|
||||||
} else {
|
} else {
|
||||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
}
|
}
|
||||||
|
|||||||
+62
-63
@@ -1,5 +1,7 @@
|
|||||||
package cpm.com.gskmtorange.dailyentry;
|
package cpm.com.gskmtorange.dailyentry;
|
||||||
|
|
||||||
|
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@@ -19,6 +21,7 @@ import android.net.Uri;
|
|||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Looper;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -32,12 +35,18 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
import com.google.android.gms.common.ConnectionResult;
|
import com.google.android.gms.common.ConnectionResult;
|
||||||
import com.google.android.gms.common.api.GoogleApiClient;
|
import com.google.android.gms.common.api.GoogleApiClient;
|
||||||
|
import com.google.android.gms.location.FusedLocationProviderClient;
|
||||||
|
import com.google.android.gms.location.LocationCallback;
|
||||||
|
import com.google.android.gms.location.LocationRequest;
|
||||||
|
import com.google.android.gms.location.LocationResult;
|
||||||
import com.google.android.gms.location.LocationServices;
|
import com.google.android.gms.location.LocationServices;
|
||||||
|
import com.google.android.gms.location.Priority;
|
||||||
|
|
||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
import org.ksoap2.serialization.SoapObject;
|
import org.ksoap2.serialization.SoapObject;
|
||||||
@@ -58,6 +67,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import javax.xml.parsers.SAXParser;
|
import javax.xml.parsers.SAXParser;
|
||||||
import javax.xml.parsers.SAXParserFactory;
|
import javax.xml.parsers.SAXParserFactory;
|
||||||
@@ -93,7 +103,8 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
AlertDialog alert;
|
AlertDialog alert;
|
||||||
String img_str, strflag;
|
String img_str, strflag;
|
||||||
private GSKOrangeDB database;
|
private GSKOrangeDB database;
|
||||||
|
private FusedLocationProviderClient fusedLocationProviderClient;
|
||||||
|
LocationRequest locationRequest;
|
||||||
String lat = "0.0", lon = "0.0";
|
String lat = "0.0", lon = "0.0";
|
||||||
GoogleApiClient mGoogleApiClient;
|
GoogleApiClient mGoogleApiClient;
|
||||||
ArrayList<CoverageBean> coverage_list;
|
ArrayList<CoverageBean> coverage_list;
|
||||||
@@ -108,34 +119,25 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
context = this;
|
context = this;
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
|
||||||
|
|
||||||
img_cam = (ImageView) findViewById(R.id.img_selfie);
|
img_cam = (ImageView) findViewById(R.id.img_selfie);
|
||||||
img_clicked = (ImageView) findViewById(R.id.img_cam_selfie);
|
img_clicked = (ImageView) findViewById(R.id.img_cam_selfie);
|
||||||
|
|
||||||
btn_save = (Button) findViewById(R.id.btn_save_selfie);
|
btn_save = (Button) findViewById(R.id.btn_save_selfie);
|
||||||
|
|
||||||
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
date = preferences.getString(CommonString.KEY_DATE, null);
|
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
_UserId = preferences.getString(CommonString.KEY_USERNAME, "");
|
_UserId = preferences.getString(CommonString.KEY_USERNAME, "");
|
||||||
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
||||||
|
|
||||||
checkOutStore_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
checkOutStore_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||||
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
||||||
|
str = CommonString.getImagesFolder(context);
|
||||||
str = CommonString.FILE_PATH;
|
fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);
|
||||||
|
|
||||||
database = new GSKOrangeDB(this);
|
database = new GSKOrangeDB(this);
|
||||||
database.open();
|
database.open();
|
||||||
|
|
||||||
coverage_list = database.getCoverageData(date, store_flag_str);
|
coverage_list = database.getCoverageData(date, store_flag_str);
|
||||||
|
|
||||||
img_cam.setOnClickListener(this);
|
img_cam.setOnClickListener(this);
|
||||||
img_clicked.setOnClickListener(this);
|
img_clicked.setOnClickListener(this);
|
||||||
btn_save.setOnClickListener(this);
|
btn_save.setOnClickListener(this);
|
||||||
@@ -174,38 +176,31 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
/*Intent i = new Intent(this, DailyEntryScreen.class);
|
super.onBackPressed();
|
||||||
startActivity(i);*/
|
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NonConstantResourceId")
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
|
if (id == R.id.img_cam_selfie) {
|
||||||
|
_pathforcheck = checkOutStore_id + "CHK_SI_"
|
||||||
|
+ visit_date.replace("/", "") + "_"
|
||||||
|
+ CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
switch (id) {
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
case R.id.img_cam_selfie:
|
|
||||||
|
|
||||||
_pathforcheck = checkOutStore_id + "CHK_SI_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
|
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.btn_save_selfie:
|
|
||||||
|
|
||||||
|
} else if (id == R.id.btn_save_selfie) {
|
||||||
if (img_str != null) {
|
if (img_str != null) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(StoreCheckoutImageActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(StoreCheckoutImageActivity.this);
|
||||||
builder.setMessage(getResources().getString(R.string.title_activity_save_data))
|
builder.setMessage(getResources().getString(R.string.title_activity_save_data))
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
.setPositiveButton(getResources().getString(R.string.ok), (dialog, id1) -> {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
|
|
||||||
alert.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
|
alert.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
|
||||||
|
|
||||||
Intent i = new Intent(StoreCheckoutImageActivity.this, CheckoutActivity.class);
|
Intent i = new Intent(StoreCheckoutImageActivity.this, CheckoutActivity.class);
|
||||||
i.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
i.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
i.putExtra(CommonString.KEY_STORE_ID, checkOutStore_id);
|
i.putExtra(CommonString.KEY_STORE_ID, checkOutStore_id);
|
||||||
@@ -214,40 +209,24 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
i.putExtra(CommonString.KEY_LONGITUDE, lon);
|
i.putExtra(CommonString.KEY_LONGITUDE, lon);
|
||||||
startActivity(i);
|
startActivity(i);
|
||||||
finish();
|
finish();
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
.setNegativeButton(getResources().getString(R.string.cancel), (dialog, id12) -> dialog.cancel());
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
dialog.cancel();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
alert = builder.create();
|
alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(context, getResources().getString(R.string.clickimage), Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, getResources().getString(R.string.clickimage), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void startCameraActivity() {
|
protected void startCameraActivity() {
|
||||||
try {
|
try {
|
||||||
/*Log.i("MakeMachine", "startCameraActivity()");
|
|
||||||
File file = new File(_path);
|
|
||||||
Uri outputFileUri = FileProvider.getUriForFile(getApplicationContext(), "cpm.com.gskmtorange.fileprovider", file);
|
|
||||||
|
|
||||||
Intent intent = new Intent(
|
|
||||||
MediaStore.ACTION_IMAGE_CAPTURE);
|
|
||||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
|
||||||
|
|
||||||
startActivityForResult(intent, 0);*/
|
|
||||||
|
|
||||||
Log.i("MakeMachine", "startCameraActivity()");
|
Log.i("MakeMachine", "startCameraActivity()");
|
||||||
File file = new File(_path);
|
File file = new File(_path);
|
||||||
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||||
|
|
||||||
String defaultCameraPackage = "";
|
String defaultCameraPackage = "";
|
||||||
final PackageManager packageManager = getPackageManager();
|
final PackageManager packageManager = getPackageManager();
|
||||||
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||||
@@ -261,16 +240,13 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
if (packag.equalsIgnoreCase("Gallery") || packag.equalsIgnoreCase("Galeri") || packag.equalsIgnoreCase("الاستوديو")) {
|
if (packag.equalsIgnoreCase("Gallery") || packag.equalsIgnoreCase("Galeri") || packag.equalsIgnoreCase("الاستوديو")) {
|
||||||
gallery_package = list.get(n).packageName;
|
gallery_package = list.get(n).packageName;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
||||||
defaultCameraPackage = list.get(n).packageName;
|
defaultCameraPackage = list.get(n).packageName;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
||||||
|
|
||||||
defaultCameraPackage = list.get(n).packageName;
|
defaultCameraPackage = list.get(n).packageName;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -279,19 +255,16 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
}
|
}
|
||||||
|
|
||||||
//com.android.gallery3d
|
//com.android.gallery3d
|
||||||
|
|
||||||
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||||
intent.setPackage(defaultCameraPackage);
|
intent.setPackage(defaultCameraPackage);
|
||||||
startActivityForResult(intent, 0);
|
startActivityForResult(intent, 0);
|
||||||
} catch (ActivityNotFoundException e) {
|
} catch (ActivityNotFoundException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
||||||
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||||
intent.setPackage(gallery_package);
|
intent.setPackage(gallery_package);
|
||||||
startActivityForResult(intent, 0);
|
startActivityForResult(intent, 0);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -337,7 +310,9 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
|
|
||||||
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
||||||
cdate = arabicToenglish(cdate);
|
cdate = arabicToenglish(cdate);
|
||||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||||
cdate = arabicToenglish(cdate);
|
cdate = arabicToenglish(cdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,11 +321,11 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConnected(Bundle bundle) {
|
public void onConnected(Bundle bundle) {
|
||||||
@SuppressLint("MissingPermission") Location mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
|
/* @SuppressLint("MissingPermission") Location mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
|
||||||
if (mLastLocation != null) {
|
if (mLastLocation != null) {
|
||||||
lat = String.valueOf(mLastLocation.getLatitude());
|
lat = String.valueOf(mLastLocation.getLatitude());
|
||||||
lon = String.valueOf(mLastLocation.getLongitude());
|
lon = String.valueOf(mLastLocation.getLongitude());
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -368,6 +343,36 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
super.onResume();
|
super.onResume();
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
toolbar.setTitle(R.string.title_activity_store_checkout_image);
|
toolbar.setTitle(R.string.title_activity_store_checkout_image);
|
||||||
|
|
||||||
|
locationRequest = new LocationRequest.Builder(Priority.PRIORITY_HIGH_ACCURACY, 100000)
|
||||||
|
.setWaitForAccurateLocation(false)
|
||||||
|
.setMinUpdateIntervalMillis(IMPLICIT_MIN_UPDATE_INTERVAL)
|
||||||
|
.setMaxUpdateDelayMillis(1000)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
|
||||||
|
LocationCallback locationCallback = new LocationCallback() {
|
||||||
|
@Override
|
||||||
|
public void onLocationResult(LocationResult locationResult) {
|
||||||
|
if (locationResult != null) {
|
||||||
|
if (locationResult == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//Showing the latitude, longitude and accuracy on the home screen.
|
||||||
|
for (Location location : locationResult.getLocations()) {
|
||||||
|
lat = String.valueOf(location.getLatitude());
|
||||||
|
lon = String.valueOf(location.getLongitude());
|
||||||
|
// Log.e("latitude_inside",location.getLatitude() + "," +location.getLongitude());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
|
||||||
|
&& ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
ActivityCompat.requestPermissions(StoreCheckoutImageActivity.this, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, 1);
|
||||||
|
ActivityCompat.requestPermissions(StoreCheckoutImageActivity.this, new String[]{android.Manifest.permission.ACCESS_COARSE_LOCATION}, 2);
|
||||||
|
}
|
||||||
|
fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, Looper.getMainLooper());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onStart() {
|
protected void onStart() {
|
||||||
@@ -461,9 +466,6 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
|
|
||||||
SoapObject request = new SoapObject(CommonString.NAMESPACE,
|
SoapObject request = new SoapObject(CommonString.NAMESPACE,
|
||||||
CommonString.METHOD_UPLOAD_CURRENT_DATA);
|
CommonString.METHOD_UPLOAD_CURRENT_DATA);
|
||||||
//request.addProperty("MID", "0");
|
|
||||||
// request.addProperty("KEYS", "CURRENT_DATA");
|
|
||||||
// request.addProperty("USERNAME", username);
|
|
||||||
|
|
||||||
request.addProperty("onXML", current_xml);
|
request.addProperty("onXML", current_xml);
|
||||||
|
|
||||||
@@ -572,13 +574,10 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
|
|
||||||
//showAlert(getString(R.string.data_downloaded_successfully));
|
//showAlert(getString(R.string.data_downloaded_successfully));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
GSKOrangeDB db = new GSKOrangeDB(StoreCheckoutImageActivity.this);
|
GSKOrangeDB db = new GSKOrangeDB(StoreCheckoutImageActivity.this);
|
||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
db.deleteTableWithStoreID(store_id);
|
db.deleteTableWithStoreID(store_id);
|
||||||
|
|
||||||
showAlert(getString(R.string.datanotfound) + " " + result);
|
showAlert(getString(R.string.datanotfound) + " " + result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+146
-143
@@ -1,5 +1,7 @@
|
|||||||
package cpm.com.gskmtorange.dailyentry;
|
package cpm.com.gskmtorange.dailyentry;
|
||||||
|
|
||||||
|
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@@ -20,6 +22,8 @@ import android.net.Uri;
|
|||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.os.Looper;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
@@ -42,9 +46,13 @@ import androidx.core.content.FileProvider;
|
|||||||
import com.google.android.gms.common.ConnectionResult;
|
import com.google.android.gms.common.ConnectionResult;
|
||||||
import com.google.android.gms.common.GooglePlayServicesUtil;
|
import com.google.android.gms.common.GooglePlayServicesUtil;
|
||||||
import com.google.android.gms.common.api.GoogleApiClient;
|
import com.google.android.gms.common.api.GoogleApiClient;
|
||||||
|
import com.google.android.gms.location.FusedLocationProviderClient;
|
||||||
|
import com.google.android.gms.location.LocationCallback;
|
||||||
import com.google.android.gms.location.LocationListener;
|
import com.google.android.gms.location.LocationListener;
|
||||||
import com.google.android.gms.location.LocationRequest;
|
import com.google.android.gms.location.LocationRequest;
|
||||||
|
import com.google.android.gms.location.LocationResult;
|
||||||
import com.google.android.gms.location.LocationServices;
|
import com.google.android.gms.location.LocationServices;
|
||||||
|
import com.google.android.gms.location.Priority;
|
||||||
|
|
||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
import org.ksoap2.serialization.SoapObject;
|
import org.ksoap2.serialization.SoapObject;
|
||||||
@@ -98,7 +106,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
private FailureGetterSetter failureGetterSetter = null;
|
private FailureGetterSetter failureGetterSetter = null;
|
||||||
String _pathforcheck, _path, str;
|
String _pathforcheck, _path, str;
|
||||||
|
|
||||||
String store_id, visit_date, username, intime, date, _UserId, store_flag_str, country_id;
|
String store_id, visit_date, username, intime, date, _UserId, store_flag_str, country_id, keyAccount_id, class_id, storeType_id;
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
AlertDialog alert;
|
AlertDialog alert;
|
||||||
String img_str, strflag;
|
String img_str, strflag;
|
||||||
@@ -110,11 +118,10 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
Toolbar toolbar;
|
Toolbar toolbar;
|
||||||
boolean ResultFlag = true;
|
boolean ResultFlag = true;
|
||||||
ArrayList<CoverageBean> coverage = new ArrayList<CoverageBean>();
|
ArrayList<CoverageBean> coverage = new ArrayList<CoverageBean>();
|
||||||
|
String VISIT_TYPE_ID = "";
|
||||||
LocationManager locationManager;
|
LocationManager locationManager;
|
||||||
boolean enabled;
|
boolean enabled;
|
||||||
private final static int PLAY_SERVICES_RESOLUTION_REQUEST = 1000;
|
private final static int PLAY_SERVICES_RESOLUTION_REQUEST = 1000;
|
||||||
|
|
||||||
private LocationRequest mLocationRequest;
|
private LocationRequest mLocationRequest;
|
||||||
private static int UPDATE_INTERVAL = 500; // 5 sec
|
private static int UPDATE_INTERVAL = 500; // 5 sec
|
||||||
private static int FATEST_INTERVAL = 100; // 1 sec
|
private static int FATEST_INTERVAL = 100; // 1 sec
|
||||||
@@ -123,37 +130,39 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
|
|
||||||
private static final String TAG = StoreimageActivity.class.getSimpleName();
|
private static final String TAG = StoreimageActivity.class.getSimpleName();
|
||||||
|
|
||||||
|
//New Changes
|
||||||
|
private FusedLocationProviderClient fusedLocationProviderClient;
|
||||||
|
LocationRequest locationRequest;
|
||||||
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_storeimage);
|
setContentView(R.layout.activity_storeimage);
|
||||||
context = this;
|
context = this;
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
img_cam = (ImageView) findViewById(R.id.img_selfie);
|
img_cam = (ImageView) findViewById(R.id.img_selfie);
|
||||||
img_clicked = (ImageView) findViewById(R.id.img_cam_selfie);
|
img_clicked = (ImageView) findViewById(R.id.img_cam_selfie);
|
||||||
|
|
||||||
btn_save = (Button) findViewById(R.id.btn_save_selfie);
|
btn_save = (Button) findViewById(R.id.btn_save_selfie);
|
||||||
|
|
||||||
//store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
|
||||||
|
|
||||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
date = preferences.getString(CommonString.KEY_DATE, null);
|
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
_UserId = preferences.getString(CommonString.KEY_USERNAME, "");
|
_UserId = preferences.getString(CommonString.KEY_USERNAME, "");
|
||||||
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
||||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||||
// store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||||
|
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||||
|
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||||
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
||||||
store_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
store_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||||
|
VISIT_TYPE_ID = getIntent().getStringExtra("VISIT_TYPE_ID");
|
||||||
|
// Log.e("visittypeid",VISIT_TYPE_ID);
|
||||||
|
|
||||||
str = CommonString.FILE_PATH;
|
// str = CommonString.getImagesFolder(context);
|
||||||
|
str = CommonString.getImagesFolder(this);
|
||||||
database = new GSKOrangeDB(this);
|
database = new GSKOrangeDB(this);
|
||||||
database.open();
|
database.open();
|
||||||
|
|
||||||
@@ -164,10 +173,8 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
btn_save.setOnClickListener(this);
|
btn_save.setOnClickListener(this);
|
||||||
|
|
||||||
if (checkPlayServices()) {
|
if (checkPlayServices()) {
|
||||||
|
|
||||||
// Building the GoogleApi client
|
// Building the GoogleApi client
|
||||||
buildGoogleApiClient();
|
buildGoogleApiClient();
|
||||||
|
|
||||||
createLocationRequest();
|
createLocationRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -297,33 +304,6 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
@Override
|
@Override
|
||||||
public void onConnected(Bundle bundle) {
|
public void onConnected(Bundle bundle) {
|
||||||
|
|
||||||
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
// TODO: Consider calling
|
|
||||||
// ActivityCompat#requestPermissions
|
|
||||||
// here to request the missing permissions, and then overriding
|
|
||||||
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
|
|
||||||
// int[] grantResults)
|
|
||||||
// to handle the case where the user grants the permission. See the documentation
|
|
||||||
// for ActivityCompat#requestPermissions for more details.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
|
|
||||||
|
|
||||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
|
||||||
|| ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
if (mLastLocation != null) {
|
|
||||||
lat = mLastLocation.getLatitude();
|
|
||||||
lon = mLastLocation.getLongitude();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// if (mRequestingLocationUpdates) {
|
|
||||||
startLocationUpdates();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// startLocationUpdates();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -375,6 +355,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
/*Intent i = new Intent(this, DailyEntryScreen.class);
|
/*Intent i = new Intent(this, DailyEntryScreen.class);
|
||||||
startActivity(i);*/
|
startActivity(i);*/
|
||||||
|
|
||||||
|
super.onBackPressed();
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
@@ -474,41 +455,43 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
|
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
|
|
||||||
switch (id) {
|
if (id == R.id.img_cam_selfie) {
|
||||||
|
|
||||||
case R.id.img_cam_selfie:
|
|
||||||
|
|
||||||
_pathforcheck = store_id + "SI_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck = store_id + "SI_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
_path = str + _pathforcheck;
|
||||||
|
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
|
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.btn_save_selfie) {
|
||||||
|
|
||||||
case R.id.btn_save_selfie:
|
|
||||||
|
|
||||||
if (img_str != null) {
|
if (img_str != null) {
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(StoreimageActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(StoreimageActivity.this);
|
||||||
builder.setMessage(getResources().getString(R.string.title_activity_save_data))
|
builder.setMessage(getResources().getString(R.string.title_activity_save_data))
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
alert.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
|
alert.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
|
||||||
|
|
||||||
String status;
|
String status;
|
||||||
//if (store_flag_str.equals(CommonString.FROM_JCP) || country_id.equalsIgnoreCase("5") || country_id.equalsIgnoreCase(CommonString.COUNTRY_ID_EGYPT +"")
|
|
||||||
// || store_flag_str.equals(CommonString.FROM_ADDITIONAL) || store_flag_str.equals(CommonString.FROM_PHARMA)) {
|
if (store_flag_str.equals(CommonString.FROM_JCP)
|
||||||
if (store_flag_str.equals(CommonString.FROM_JCP) || country_id.equalsIgnoreCase("5")
|
|| country_id.equalsIgnoreCase("5")
|
||||||
|
|| country_id.equalsIgnoreCase("15")
|
||||||
|| store_flag_str.equals(CommonString.FROM_PHARMA)) {
|
|| store_flag_str.equals(CommonString.FROM_PHARMA)) {
|
||||||
status = CommonString.KEY_INVALID;
|
status = CommonString.KEY_INVALID;
|
||||||
|
} else {
|
||||||
|
if (VISIT_TYPE_ID != null) {
|
||||||
|
if (country_id.equals("2") && (VISIT_TYPE_ID.equals("1") || VISIT_TYPE_ID.equals("3"))) {
|
||||||
|
status = CommonString.KEY_INVALID;
|
||||||
} else {
|
} else {
|
||||||
status = CommonString.KEY_VALID;
|
status = CommonString.KEY_VALID;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
status = CommonString.KEY_VALID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CoverageBean cdata = new CoverageBean();
|
CoverageBean cdata = new CoverageBean();
|
||||||
cdata.setStoreId(store_id);
|
cdata.setStoreId(store_id);
|
||||||
@@ -522,12 +505,21 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
cdata.setImage(img_str);
|
cdata.setImage(img_str);
|
||||||
cdata.setSub_reasonId("0");
|
cdata.setSub_reasonId("0");
|
||||||
cdata.setRemark("");
|
cdata.setRemark("");
|
||||||
|
|
||||||
cdata.setStatus(status);
|
cdata.setStatus(status);
|
||||||
|
|
||||||
cdata.setCheckOut_Image("");
|
cdata.setCheckOut_Image("");
|
||||||
cdata.setFlag_from(store_flag_str);
|
cdata.setFlag_from(store_flag_str);
|
||||||
|
|
||||||
|
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||||
|
cdata.setKeyAccountId("0");
|
||||||
|
cdata.setStoreTypeId("0");
|
||||||
|
cdata.setClassId("0");
|
||||||
|
} else {
|
||||||
|
cdata.setKeyAccountId(keyAccount_id);
|
||||||
|
cdata.setStoreTypeId(storeType_id);
|
||||||
|
cdata.setClassId(class_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
database.open();
|
||||||
database.InsertCoverageData(cdata);
|
database.InsertCoverageData(cdata);
|
||||||
|
|
||||||
String table;
|
String table;
|
||||||
@@ -537,25 +529,15 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
table = CommonString.KEY_JOURNEY_PLAN_ADDITIONAL;
|
table = CommonString.KEY_JOURNEY_PLAN_ADDITIONAL;
|
||||||
} else if (store_flag_str.equals(CommonString.FROM_PHARMA)) {
|
} else if (store_flag_str.equals(CommonString.FROM_PHARMA)) {
|
||||||
table = CommonString.KEY_JOURNEY_PLAN_PHARMA;
|
table = CommonString.KEY_JOURNEY_PLAN_PHARMA;
|
||||||
}else if (store_flag_str.equals(CommonString.FROM_ADDITIONAL_ADHOC)) {
|
} else if (store_flag_str.equals(CommonString.FROM_ADDITIONAL_ADHOC)) {
|
||||||
table = CommonString.KEY_ADHOC_JOURNEYPLAN_ADDITIONAL;
|
table = CommonString.KEY_ADHOC_JOURNEYPLAN_ADDITIONAL;
|
||||||
} else{
|
} else {
|
||||||
table = CommonString.KEY_ADHOC_JOURNEY_PLAN;
|
table = CommonString.KEY_ADHOC_JOURNEY_PLAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
database.updateCheckoutStatus(store_id, status, table);
|
database.updateCheckoutStatus(store_id, status, table);
|
||||||
|
|
||||||
/* SharedPreferences.Editor editor = preferences.edit();
|
|
||||||
|
|
||||||
editor.putString(CommonString.KEY_STOREVISITED_STATUS, "");
|
|
||||||
editor.putString(CommonString.KEY_STORE_IN_TIME, "");
|
|
||||||
|
|
||||||
editor.commit();*/
|
|
||||||
|
|
||||||
|
|
||||||
//Intent in = new Intent(StoreimageActivity.this, CategoryListActivity.class);
|
|
||||||
new GeoTagUpload(StoreimageActivity.this).execute();
|
new GeoTagUpload(StoreimageActivity.this).execute();
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||||
@@ -570,28 +552,14 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
} else {
|
} else {
|
||||||
Toast.makeText(context, getResources().getString(R.string.clickimage), Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, getResources().getString(R.string.clickimage), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void startCameraActivity() {
|
}
|
||||||
|
|
||||||
|
/*protected void startCameraActivity() {
|
||||||
try {
|
try {
|
||||||
/*Log.i("MakeMachine", "startCameraActivity()");
|
|
||||||
File file = new File(_path);
|
|
||||||
Uri outputFileUri = FileProvider.getUriForFile(getApplicationContext(), "cpm.com.gskmtorange.fileprovider", file);
|
|
||||||
|
|
||||||
Intent intent = new Intent(
|
|
||||||
MediaStore.ACTION_IMAGE_CAPTURE);
|
|
||||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
|
||||||
|
|
||||||
startActivityForResult(intent, 0);*/
|
|
||||||
|
|
||||||
Log.i("MakeMachine", "startCameraActivity()");
|
Log.i("MakeMachine", "startCameraActivity()");
|
||||||
File file = new File(_path);
|
File file = new File(_path);
|
||||||
|
|
||||||
//android.os.FileUriExposedException: file:///storage/emulated/0/.GSK_MT_ORANGE_IMAGES/15024SI_01022019_120426.jpg exposed beyond app through ClipData.Item.getUri()
|
|
||||||
//outputFileUri = FileProvider.getUriForFile(getApplicationContext(), "cpm.com.gskmtorange.fileprovider", file);
|
|
||||||
|
|
||||||
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||||
|
|
||||||
String defaultCameraPackage = "";
|
String defaultCameraPackage = "";
|
||||||
@@ -640,9 +608,49 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
//Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
}
|
||||||
//Crashlytics.logException(e.getCause());
|
}*/
|
||||||
//Crashlytics.logException(new Exception(e.getCause()));
|
protected void startCameraActivity() {
|
||||||
|
try {
|
||||||
|
Log.i("MakeMachine", "startCameraActivity()");
|
||||||
|
|
||||||
|
File file = new File(_path);
|
||||||
|
outputFileUri = FileProvider.getUriForFile(
|
||||||
|
context,
|
||||||
|
"cpm.com.gskmtorange.fileprovider",
|
||||||
|
file
|
||||||
|
);
|
||||||
|
|
||||||
|
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||||
|
|
||||||
|
// ✅ important
|
||||||
|
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
|
intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
|
||||||
|
|
||||||
|
// 🚀 FORCE OPEN CAMERA (no resolveActivity check)
|
||||||
|
startActivityForResult(intent, 0);
|
||||||
|
|
||||||
|
} catch (ActivityNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
|
||||||
|
// 🔥 LAST fallback (Moto fix)
|
||||||
|
try {
|
||||||
|
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||||
|
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
|
intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
|
||||||
|
|
||||||
|
startActivityForResult(intent, 0);
|
||||||
|
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
Toast.makeText(this, "Camera not supported on this device", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Toast.makeText(this, "Camera error", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -658,15 +666,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
case -1:
|
case -1:
|
||||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||||
if (new File(str + _pathforcheck).exists()) {
|
if (new File(str + _pathforcheck).exists()) {
|
||||||
|
|
||||||
//temp check--------
|
|
||||||
/*File file = new File(str + _pathforcheck);
|
|
||||||
saveBitmapToFileSmaller(file);*/
|
|
||||||
//saveBitmapToFile(file);
|
|
||||||
//-------------------
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
Bitmap bmp = BitmapFactory.decodeFile(str + _pathforcheck);
|
Bitmap bmp = BitmapFactory.decodeFile(str + _pathforcheck);
|
||||||
img_cam.setImageBitmap(bmp);
|
img_cam.setImageBitmap(bmp);
|
||||||
} catch (OutOfMemoryError ex) {
|
} catch (OutOfMemoryError ex) {
|
||||||
@@ -711,26 +711,41 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
if (mGoogleApiClient.isConnected()) {
|
if (mGoogleApiClient.isConnected()) {
|
||||||
startLocationUpdates();
|
startLocationUpdates();
|
||||||
}
|
}
|
||||||
|
if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
|
||||||
|
&& ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
ActivityCompat.requestPermissions(StoreimageActivity.this, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, 1);
|
||||||
|
ActivityCompat.requestPermissions(StoreimageActivity.this, new String[]{android.Manifest.permission.ACCESS_COARSE_LOCATION}, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*protected void onStart() {
|
locationRequest= new LocationRequest.Builder(Priority.PRIORITY_HIGH_ACCURACY, 100000)
|
||||||
mGoogleApiClient.connect();
|
.setWaitForAccurateLocation(false)
|
||||||
super.onStart();
|
.setMinUpdateIntervalMillis(IMPLICIT_MIN_UPDATE_INTERVAL)
|
||||||
|
.setMaxUpdateDelayMillis(1000)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
LocationCallback locationCallback = new LocationCallback() {
|
||||||
|
@Override
|
||||||
|
public void onLocationResult(LocationResult locationResult) {
|
||||||
|
if (locationResult != null) {
|
||||||
|
if (locationResult == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//Showing the latitude, longitude and accuracy on the home screen.
|
||||||
|
for (Location location : locationResult.getLocations()) {
|
||||||
|
lat = location.getLatitude();
|
||||||
|
lon = location.getLongitude();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, Looper.getMainLooper());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onStop() {
|
|
||||||
mGoogleApiClient.disconnect();
|
|
||||||
super.onStop();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLocationChanged(Location location) {
|
public void onLocationChanged(Location location) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class GeoTagUpload extends AsyncTask<Void, Void, String> {
|
public class GeoTagUpload extends AsyncTask<Void, Void, String> {
|
||||||
|
|
||||||
private Context context;
|
private Context context;
|
||||||
@@ -770,24 +785,19 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
|
|
||||||
String service;
|
String service;
|
||||||
|
|
||||||
if(coverage.get(0).getFlag_from().equals(CommonString.FROM_ADDITIONAL)){
|
if (coverage.get(0).getFlag_from().equals(CommonString.FROM_ADDITIONAL)) {
|
||||||
service = CommonString.METHOD_UPLOAD_CURRENT_DATA_ADDITIONAL;
|
service = CommonString.METHOD_UPLOAD_CURRENT_DATA_ADDITIONAL;
|
||||||
}
|
} else if (coverage.get(0).getFlag_from().equals(CommonString.FROM_PHARMA)) {
|
||||||
else if(coverage.get(0).getFlag_from().equals(CommonString.FROM_PHARMA)){
|
|
||||||
service = CommonString.METHOD_UPLOAD_CURRENT_DATA_PHARMA;
|
service = CommonString.METHOD_UPLOAD_CURRENT_DATA_PHARMA;
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
service = CommonString.METHOD_UPLOAD_CURRENT_DATA;
|
service = CommonString.METHOD_UPLOAD_CURRENT_DATA;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String current_xml = "";
|
String current_xml = "";
|
||||||
|
|
||||||
if (coverage.size() > 0) {
|
if (coverage.size() > 0) {
|
||||||
|
|
||||||
//for (int i = 0; i < coverage.size(); i++) {
|
//for (int i = 0; i < coverage.size(); i++) {
|
||||||
|
|
||||||
|
|
||||||
String onXML = "[Coverage_Intime][USER_ID]"
|
String onXML = "[Coverage_Intime][USER_ID]"
|
||||||
+ _UserId
|
+ _UserId
|
||||||
+ "[/USER_ID]"
|
+ "[/USER_ID]"
|
||||||
@@ -814,12 +824,11 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
+ "[/REMARK][/Coverage_Intime]";
|
+ "[/REMARK][/Coverage_Intime]";
|
||||||
|
|
||||||
//current_xml = current_xml + onXML;
|
//current_xml = current_xml + onXML;
|
||||||
|
|
||||||
|
|
||||||
//}
|
//}
|
||||||
|
|
||||||
current_xml = "[DATA]" + onXML
|
current_xml = "[DATA]" + onXML
|
||||||
+ "[/DATA]";
|
+ "[/DATA]";
|
||||||
|
Log.d("currentdata",current_xml);
|
||||||
|
|
||||||
SoapObject request = new SoapObject(CommonString.NAMESPACE,
|
SoapObject request = new SoapObject(CommonString.NAMESPACE,
|
||||||
service);
|
service);
|
||||||
@@ -888,43 +897,26 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
strflag = CommonString.MESSAGE_EXCEPTION;
|
strflag = CommonString.MESSAGE_EXCEPTION;
|
||||||
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
strflag = CommonString.MESSAGE_SOCKETEXCEPTION;
|
strflag = CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||||
|
|
||||||
} catch (XmlPullParserException e) {
|
} catch (XmlPullParserException e) {
|
||||||
|
|
||||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
|
||||||
//Crashlytics.logException(e.getCause());
|
|
||||||
// Crashlytics.logException(new Exception(e.getCause()));
|
|
||||||
|
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
strflag = CommonString.MESSAGE_XmlPull;
|
strflag = CommonString.MESSAGE_XmlPull;
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
||||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
|
||||||
// Crashlytics.logException(e.getCause());
|
|
||||||
// Crashlytics.logException(new Exception(e.getCause()));
|
|
||||||
|
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
strflag = CommonString.MESSAGE_EXCEPTION;
|
strflag = CommonString.MESSAGE_EXCEPTION;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ResultFlag) {
|
if (ResultFlag) {
|
||||||
return CommonString.KEY_SUCCESS;
|
return CommonString.KEY_SUCCESS;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
return strflag;
|
return strflag;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(String result) {
|
protected void onPostExecute(String result) {
|
||||||
super.onPostExecute(result);
|
super.onPostExecute(result);
|
||||||
@@ -939,8 +931,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
/* if (store_flag_str.equals(CommonString.FROM_JCP)|| country_id.equalsIgnoreCase("5")
|
/* if (store_flag_str.equals(CommonString.FROM_JCP)|| country_id.equalsIgnoreCase("5")
|
||||||
||store_flag_str.equals(CommonString.FROM_DEVIATION)) {*/
|
||store_flag_str.equals(CommonString.FROM_DEVIATION)) {*/
|
||||||
|
|
||||||
if (store_flag_str.equals(CommonString.FROM_JCP)|| country_id.equalsIgnoreCase("5")) {
|
if (store_flag_str.equals(CommonString.FROM_JCP) || country_id.equalsIgnoreCase("5") || country_id.equalsIgnoreCase("15")) {
|
||||||
|
|
||||||
Intent in = new Intent(StoreimageActivity.this, StoreWisePerformanceActivity.class);
|
Intent in = new Intent(StoreimageActivity.this, StoreWisePerformanceActivity.class);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
@@ -950,12 +941,27 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
startActivity(in);
|
startActivity(in);
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
} else{
|
} else if (VISIT_TYPE_ID != null) {
|
||||||
|
if (store_flag_str.equals(CommonString.FROM_DEVIATION) &&
|
||||||
|
VISIT_TYPE_ID.equals("1") || VISIT_TYPE_ID.equals("3")) {
|
||||||
|
|
||||||
|
SharedPreferences.Editor editor = preferences.edit();
|
||||||
|
editor.putString(CommonString.KEY_VISIT_ID, VISIT_TYPE_ID);
|
||||||
|
editor.commit();
|
||||||
|
|
||||||
|
Intent in = new Intent(StoreimageActivity.this, StoreWisePerformanceActivity.class);
|
||||||
|
in.putExtra("VISIT_TYPE_ID", VISIT_TYPE_ID);
|
||||||
|
startActivity(in);
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
} else {
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//showAlert(getString(R.string.data_downloaded_successfully));
|
//showAlert(getString(R.string.data_downloaded_successfully));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@@ -978,10 +984,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
builder.setMessage(str).setCancelable(false)
|
builder.setMessage(str).setCancelable(false)
|
||||||
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
AlertDialog alert = builder.create();
|
AlertDialog alert = builder.create();
|
||||||
|
|||||||
+19
-43
@@ -83,7 +83,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
MyAdaptorStock adapterData;
|
MyAdaptorStock adapterData;
|
||||||
String categoryName, categoryId;
|
String categoryName, categoryId;
|
||||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str;
|
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str;
|
||||||
String str = CommonString.FILE_PATH,
|
String str = "",
|
||||||
path = "", path1 = "", path2 = "",
|
path = "", path1 = "", path2 = "",
|
||||||
_pathforcheck = "", _pathforcheck1 = "", _pathforcheck2 = "",
|
_pathforcheck = "", _pathforcheck1 = "", _pathforcheck2 = "",
|
||||||
img = "", img1 = "", img2 = "";
|
img = "", img1 = "", img2 = "";
|
||||||
@@ -116,6 +116,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
context = this;
|
context = this;
|
||||||
//preference data
|
//preference data
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
str = CommonString.getImagesFolder(this);
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
@@ -133,9 +134,9 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
rec_t2p = (RecyclerView) findViewById(R.id.rec_t2p);
|
rec_t2p = (RecyclerView) findViewById(R.id.rec_t2p);
|
||||||
|
|
||||||
|
|
||||||
if (country_id.equals("8")){
|
if (country_id.equals("8") || country_id.equals("17")) {
|
||||||
toolbar.setTitle(getResources().getString(R.string.title_posm));
|
toolbar.setTitle(getResources().getString(R.string.title_posm));
|
||||||
}else {
|
} else {
|
||||||
toolbar.setTitle(getResources().getString(R.string.title_activity_t2_pcompliance));
|
toolbar.setTitle(getResources().getString(R.string.title_activity_t2_pcompliance));
|
||||||
}
|
}
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
@@ -200,10 +201,8 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
t2PGetterSetters = db.getT2PDefaultData(store_id, categoryId, "MAPPING_T2P");
|
t2PGetterSetters = db.getT2PDefaultData(store_id, categoryId, "MAPPING_T2P");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < t2PGetterSetters.size(); i++) {
|
for (int i = 0; i < t2PGetterSetters.size(); i++) {
|
||||||
|
|
||||||
ArrayList<GapsChecklistGetterSetter> gapsList = db.getGapsData(t2PGetterSetters.get(i).getKey_id());
|
ArrayList<GapsChecklistGetterSetter> gapsList = db.getGapsData(t2PGetterSetters.get(i).getKey_id());
|
||||||
ArrayList<SkuGetterSetter> skuList = db.getT2PSKUData(t2PGetterSetters.get(i).getKey_id());
|
ArrayList<SkuGetterSetter> skuList = db.getT2PSKUData(t2PGetterSetters.get(i).getKey_id());
|
||||||
ArrayList<BrandAvabilityGetterSetter> brandList = db.getT2BrandData(t2PGetterSetters.get(i).getKey_id());
|
ArrayList<BrandAvabilityGetterSetter> brandList = db.getT2BrandData(t2PGetterSetters.get(i).getKey_id());
|
||||||
@@ -212,9 +211,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
//
|
//
|
||||||
t2PGetterSetters.get(i).setSkulist(skuList);
|
t2PGetterSetters.get(i).setSkulist(skuList);
|
||||||
t2PGetterSetters.get(i).setBrandlist(brandList);
|
t2PGetterSetters.get(i).setBrandlist(brandList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < t2PGetterSetters.size(); i++) {
|
for (int i = 0; i < t2PGetterSetters.size(); i++) {
|
||||||
@@ -856,13 +853,12 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showSkuDialog(final ArrayList<SkuGetterSetter> skuAddedList) {
|
public void showSkuDialog(final ArrayList<SkuGetterSetter> skuAddedList) {
|
||||||
|
|
||||||
final SkuGetterSetter[] sku_selected = new SkuGetterSetter[1];
|
final SkuGetterSetter[] sku_selected = new SkuGetterSetter[1];
|
||||||
final BrandMasterGetterSetter[] brand_selected = new BrandMasterGetterSetter[1];
|
final BrandMasterGetterSetter[] brand_selected = new BrandMasterGetterSetter[1];
|
||||||
|
|
||||||
final ArrayList<BrandMasterGetterSetter> brandList;
|
final ArrayList<BrandMasterGetterSetter> brandList;
|
||||||
//usk just
|
//usk just
|
||||||
if (country_id.equals("7")) {
|
if (country_id.equals("7") || country_id.equals("8")) {
|
||||||
brandList = db.getBrandT2PData(null, null, null, categoryId, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
brandList = db.getBrandT2PData(null, null, null, categoryId, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
brandList = db.getBrandT2PData(storeType_id, class_id, keyAccount_id, categoryId, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
brandList = db.getBrandT2PData(storeType_id, class_id, keyAccount_id, categoryId, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
@@ -875,7 +871,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
brand.setBRAND("select");
|
brand.setBRAND("select");
|
||||||
brandList.add(0, brand);
|
brandList.add(0, brand);
|
||||||
// ArrayList<SkuMasterGetterSetter> skuMasterGetterSetterArrayList = db.getSkuT2PData("1", "1", "1",)
|
// ArrayList<SkuMasterGetterSetter> skuMasterGetterSetterArrayList = db.getSkuT2PData("1", "1", "1",)
|
||||||
|
|
||||||
final Dialog dialog = new Dialog(T2PComplianceActivity.this);
|
final Dialog dialog = new Dialog(T2PComplianceActivity.this);
|
||||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
@@ -967,17 +962,12 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
spinner_brand.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
spinner_brand.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
|
|
||||||
sku_list.clear();
|
sku_list.clear();
|
||||||
|
|
||||||
brand_selected[0] = brandList.get(position);
|
brand_selected[0] = brandList.get(position);
|
||||||
|
|
||||||
String brand_id = brandList.get(position).getBRAND_ID().get(0);
|
String brand_id = brandList.get(position).getBRAND_ID().get(0);
|
||||||
|
|
||||||
ArrayList<SkuGetterSetter> temp_list;
|
ArrayList<SkuGetterSetter> temp_list;
|
||||||
if (country_id.equals("7")) {
|
if (country_id.equals("7") || country_id.equals("8")) {
|
||||||
temp_list = db.getSkuT2PData(null, null, null, brand_id, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
temp_list = db.getSkuT2PData(null, null, null, brand_id, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
temp_list = db.getSkuT2PData(storeType_id, class_id, keyAccount_id, brand_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
temp_list = db.getSkuT2PData(storeType_id, class_id, keyAccount_id, brand_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
@@ -1081,21 +1071,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
return new String(chars);
|
return new String(chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCurrentTimeNotUsed() {
|
|
||||||
Calendar m_cal = Calendar.getInstance();
|
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
|
||||||
String cdate = formatter.format(m_cal.getTime());
|
|
||||||
|
|
||||||
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
|
||||||
cdate = arabicToenglish(cdate);
|
|
||||||
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
|
||||||
cdate = arabicToenglish(cdate);
|
|
||||||
}
|
|
||||||
|
|
||||||
return cdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void startCameraActivity(int pos) {
|
private void startCameraActivity(int pos) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -1270,7 +1245,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
//super.onBackPressed();
|
super.onBackPressed();
|
||||||
|
|
||||||
if (editFlag) {
|
if (editFlag) {
|
||||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(T2PComplianceActivity.this);
|
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(T2PComplianceActivity.this);
|
||||||
@@ -1615,10 +1590,10 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
webView.getSettings().setBuiltInZoomControls(true);
|
webView.getSettings().setBuiltInZoomControls(true);
|
||||||
|
|
||||||
//String planogram_image = mp.get(0).getPLANOGRAM_IMAGE();
|
//String planogram_image = mp.get(0).getPLANOGRAM_IMAGE();
|
||||||
if (new File(CommonString.FILE_PATH_PLANOGRAM + planogram_image).exists()) {
|
if (new File(CommonString.getDownloadedImageFolder(this) + planogram_image).exists()) {
|
||||||
|
|
||||||
String imagePath = "file://" + CommonString.FILE_PATH_PLANOGRAM + "/" + planogram_image;
|
String imagePath = "file://" + CommonString.getDownloadedImageFolder(this) + "/" + planogram_image;
|
||||||
//String imagePath = "file://" + CommonString.FILE_PATH + "/" + "image_ref.png";
|
//String imagePath = "file://" + CommonString.getImagesFolder(context)+ "/" + "image_ref.png";
|
||||||
String html = "<html><head></head><body><img src=\"" + imagePath + "\"></body></html>";
|
String html = "<html><head></head><body><img src=\"" + imagePath + "\"></body></html>";
|
||||||
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
||||||
|
|
||||||
@@ -1660,15 +1635,16 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
|
|
||||||
public void showBrandAvabilitydialog(final ArrayList<BrandAvabilityGetterSetter> brandGetdata) {
|
public void showBrandAvabilitydialog(final ArrayList<BrandAvabilityGetterSetter> brandGetdata) {
|
||||||
|
|
||||||
final ArrayList<BrandAvabilityGetterSetter> brandList;
|
final ArrayList<BrandAvabilityGetterSetter> brandList;
|
||||||
|
|
||||||
if (country_id.equals("7") || country_id.equals("8")) {
|
if (country_id.equals("7") || country_id.equals("8")) {
|
||||||
brandList = db.getBrandAvailbilitydata(store_id, categoryId, null, null, null, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
brandList = db.getBrandAvailbilitydata(store_id, categoryId, null, null, null,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
brandList = db.getBrandAvailbilitydata(store_id, categoryId, keyAccount_id, class_id, storeType_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
brandList = db.getBrandAvailbilitydata(store_id, categoryId, keyAccount_id, class_id, storeType_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
} else {
|
} else {
|
||||||
brandList = db.getBrandAvailbilitydata(store_id, categoryId, keyAccount_id, class_id, storeType_id, CommonString.TABLE_MAPPING_STOCK);
|
brandList = db.getBrandAvailbilitydata(store_id, categoryId, keyAccount_id, class_id, storeType_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
BrandAvabilityGetterSetter brand = new BrandAvabilityGetterSetter();
|
BrandAvabilityGetterSetter brand = new BrandAvabilityGetterSetter();
|
||||||
@@ -1692,7 +1668,8 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
// cardlay = (CardView) dialog.findViewById(R.id.cardId);
|
// cardlay = (CardView) dialog.findViewById(R.id.cardId);
|
||||||
|
|
||||||
// Create custom adapter object ( see below CustomAdapter.java )
|
// Create custom adapter object ( see below CustomAdapter.java )
|
||||||
T2PComplianceActivity.CustomBRANDAdapter adapter = new T2PComplianceActivity.CustomBRANDAdapter(T2PComplianceActivity.this, R.layout.custom_spinner_item, brandList);
|
T2PComplianceActivity.CustomBRANDAdapter adapter = new T2PComplianceActivity.CustomBRANDAdapter(T2PComplianceActivity.this,
|
||||||
|
R.layout.custom_spinner_item, brandList);
|
||||||
|
|
||||||
spinner_brand.setAdapter(adapter);
|
spinner_brand.setAdapter(adapter);
|
||||||
|
|
||||||
@@ -1761,8 +1738,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
brand_id = "";
|
brand_id = "";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(v, "Please select dropdown", Snackbar.LENGTH_LONG)
|
Snackbar.make(v, "Please select dropdown", Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
.setAction("Action", null).show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+232
@@ -0,0 +1,232 @@
|
|||||||
|
package cpm.com.gskmtorange.dailyentry;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.cardview.widget.CardView;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.location.Location;
|
||||||
|
import android.location.LocationManager;
|
||||||
|
import android.net.ConnectivityManager;
|
||||||
|
import android.net.NetworkInfo;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
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.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.google.android.gms.common.api.GoogleApiClient;
|
||||||
|
import com.google.android.gms.location.LocationRequest;
|
||||||
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.GeotaggingBeans;
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
|
||||||
|
import cpm.com.gskmtorange.storeinmap.StoreListRouteActivity;
|
||||||
|
import cpm.com.gskmtorange.storeinmap.StoreRouteActivity;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.AdditionalQuestiongetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationContrywiseGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.DisplayChecklistMasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.GeoFencingGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SOS_TARGET_MasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingCategoryImageAllowGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingPlanogramStorewiseGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockStorewiseGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingSubCategoryImageAllowGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraLastVisitGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.NonT2pReasonGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingSubReasonGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.POGQuestionGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.STORE_PERFORMANCE_MasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.ShelfMasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.SkuGroupMasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
||||||
|
|
||||||
|
public class VisitTypeStatusActivity extends AppCompatActivity {
|
||||||
|
ArrayList<CoverageBean> coverage = new ArrayList<CoverageBean>();
|
||||||
|
ArrayList<Visit_Type_Master_GetterSetter> storelist = new ArrayList<Visit_Type_Master_GetterSetter>();
|
||||||
|
//ListView list;
|
||||||
|
private SharedPreferences preferences;
|
||||||
|
String date, visit_status;
|
||||||
|
GSKOrangeDB db;
|
||||||
|
ValueAdapter adapter;
|
||||||
|
RecyclerView recyclerView;
|
||||||
|
private SharedPreferences.Editor editor = null;
|
||||||
|
LinearLayout linearlay;
|
||||||
|
String store_id, userId, culture_id, visit_date, store_facing_hide;
|
||||||
|
private Dialog dialog;
|
||||||
|
boolean result_flag = false, leaveflag = false;
|
||||||
|
FloatingActionButton fab;
|
||||||
|
//String storeid;
|
||||||
|
Toolbar toolbar;
|
||||||
|
String language, country_id;
|
||||||
|
String store_flag_str;
|
||||||
|
String str_facing="";
|
||||||
|
|
||||||
|
Context context;
|
||||||
|
boolean enabled = true;
|
||||||
|
|
||||||
|
private ProgressBar pb;
|
||||||
|
|
||||||
|
private TextView percentage, message;
|
||||||
|
int eventType;
|
||||||
|
boolean ResultFlag = true;
|
||||||
|
String str;
|
||||||
|
StoreBean storeCurrentObj;
|
||||||
|
|
||||||
|
String from_checkedIn = "";
|
||||||
|
Visit_Type_Master_GetterSetter visit_type_master_getterSetter;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_visit_type_status);
|
||||||
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
|
context = this;
|
||||||
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
|
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
||||||
|
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
visit_status = preferences.getString(CommonString.KEY_STOREVISITED_STATUS, "");
|
||||||
|
language = preferences.getString(CommonString.KEY_LANGUAGE, "");
|
||||||
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||||
|
userId = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
|
culture_id = preferences.getString(CommonString.KEY_CULTURE_ID, "");
|
||||||
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
db = new GSKOrangeDB(context);
|
||||||
|
db.open();
|
||||||
|
|
||||||
|
linearlay = (LinearLayout) findViewById(R.id.no_data_lay);
|
||||||
|
recyclerView = (RecyclerView) findViewById(R.id.drawer_layout_recycle);
|
||||||
|
|
||||||
|
toolbar.setTitle("Ad-Hoc Visit Type" + "-"+ date);
|
||||||
|
storelist = db.getVisitType(date, "VISIT_TYPE_MASTER");
|
||||||
|
adapter = new ValueAdapter(context, storelist);
|
||||||
|
recyclerView.setAdapter(adapter);
|
||||||
|
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
|
||||||
|
store_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||||
|
str_facing = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG_FACING_HIDE);
|
||||||
|
|
||||||
|
}
|
||||||
|
public class ValueAdapter extends RecyclerView.Adapter<ValueAdapter.MyViewHolder> {
|
||||||
|
|
||||||
|
private LayoutInflater inflator;
|
||||||
|
|
||||||
|
List<Visit_Type_Master_GetterSetter> data = Collections.emptyList();
|
||||||
|
|
||||||
|
public ValueAdapter(Context context, List<Visit_Type_Master_GetterSetter> data) {
|
||||||
|
inflator = LayoutInflater.from(context);
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ValueAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int i) {
|
||||||
|
|
||||||
|
View view = inflator.inflate(R.layout.visittypelist_child, parent, false);
|
||||||
|
|
||||||
|
ValueAdapter.MyViewHolder holder = new ValueAdapter.MyViewHolder(view);
|
||||||
|
return holder;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(final ValueAdapter.MyViewHolder viewHolder, final int position) {
|
||||||
|
final Visit_Type_Master_GetterSetter current = data.get(position);
|
||||||
|
viewHolder.visitTypeTV.setText(current.getVISIT_TYPE().get(0));
|
||||||
|
viewHolder.Cardbtn.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
db.open();
|
||||||
|
db.insertVisitTypeData(visit_date,store_id,current.getVISIT_TYPE_ID().get(0));
|
||||||
|
|
||||||
|
Intent in = new Intent(VisitTypeStatusActivity.this, StoreimageActivity.class);
|
||||||
|
in.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
|
in.putExtra(CommonString.KEY_STORE_ID, store_id);
|
||||||
|
in.putExtra("VISIT_TYPE_ID", current.getVISIT_TYPE_ID().get(0));
|
||||||
|
in.putExtra(CommonString.KEY_STORE_FLAG_FACING_HIDE, str_facing);
|
||||||
|
startActivity(in);
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return data.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
class MyViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
TextView visitTypeTV;
|
||||||
|
CardView Cardbtn;
|
||||||
|
|
||||||
|
public MyViewHolder(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
visitTypeTV = itemView.findViewById(R.id.visitTypeTV);
|
||||||
|
Cardbtn = itemView.findViewById(R.id.card_view);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
if (id == android.R.id.home) {
|
||||||
|
// NavUtils.navigateUpFromSameTask(this);
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
super.onBackPressed();
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,10 +5,12 @@ import android.app.Dialog;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@@ -21,7 +23,6 @@ import androidx.appcompat.widget.Toolbar;
|
|||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
import org.ksoap2.serialization.SoapObject;
|
import org.ksoap2.serialization.SoapObject;
|
||||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
import org.ksoap2.transport.HttpTransportSE;
|
|
||||||
import org.xmlpull.v1.XmlPullParser;
|
import org.xmlpull.v1.XmlPullParser;
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
import org.xmlpull.v1.XmlPullParserFactory;
|
import org.xmlpull.v1.XmlPullParserFactory;
|
||||||
@@ -42,6 +43,7 @@ import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
|||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.utils.OkHttpTransportSE;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.AdditionalQuestiongetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.AdditionalQuestiongetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||||
@@ -71,6 +73,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.NoCameraLastVisitGetterSetter;
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.NonT2pReasonGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.NonT2pReasonGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingSubReasonGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingSubReasonGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.Order_Received_Status_GetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.POGQuestionGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.POGQuestionGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.PROMOTION_TYPE_MASTERGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.PROMOTION_TYPE_MASTERGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.STORE_CATEGORY_WISEGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.STORE_CATEGORY_WISEGetterSetter;
|
||||||
@@ -81,6 +84,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
||||||
|
|
||||||
public class DownloadActivity extends AppCompatActivity {
|
public class DownloadActivity extends AppCompatActivity {
|
||||||
@@ -122,9 +126,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
NonWorkingSubReasonGetterSetter nonWorkingSubReasonGetterSetter;
|
NonWorkingSubReasonGetterSetter nonWorkingSubReasonGetterSetter;
|
||||||
SupervisorListGetterSetter supervisorListGetterSetter;
|
SupervisorListGetterSetter supervisorListGetterSetter;
|
||||||
ConfigurationMasterGetterSetter configurationMasterGetterSetter;
|
ConfigurationMasterGetterSetter configurationMasterGetterSetter;
|
||||||
|
|
||||||
MappingPlanogramStorewiseGetterSetter mappingPlanogramStorewiseGetterSetter;
|
MappingPlanogramStorewiseGetterSetter mappingPlanogramStorewiseGetterSetter;
|
||||||
|
|
||||||
JourneyPlanGetterSetter additionalJcpGetterSetter;
|
JourneyPlanGetterSetter additionalJcpGetterSetter;
|
||||||
JourneyPlanGetterSetter additionalAdhocJcpGetterSetter;
|
JourneyPlanGetterSetter additionalAdhocJcpGetterSetter;
|
||||||
MappingStockGetterSetter mappingStockAdditionalGetterSetter;
|
MappingStockGetterSetter mappingStockAdditionalGetterSetter;
|
||||||
@@ -134,6 +136,9 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
PROMOTION_TYPE_MASTERGetterSetter promotion_type_masterGetterSetter;
|
PROMOTION_TYPE_MASTERGetterSetter promotion_type_masterGetterSetter;
|
||||||
STORE_CATEGORY_WISEGetterSetter store_category_wiseGetterSetter;
|
STORE_CATEGORY_WISEGetterSetter store_category_wiseGetterSetter;
|
||||||
MAPPING_SKU_PRICING_ENABLEGetterSetter mapping_sku_pricing_enableGetterSetter;
|
MAPPING_SKU_PRICING_ENABLEGetterSetter mapping_sku_pricing_enableGetterSetter;
|
||||||
|
Order_Received_Status_GetterSetter order_received_status_getterSetter;
|
||||||
|
Visit_Type_Master_GetterSetter visit_type_master_getterSetter;
|
||||||
|
|
||||||
|
|
||||||
private Dialog dialog;
|
private Dialog dialog;
|
||||||
private ProgressBar pb;
|
private ProgressBar pb;
|
||||||
@@ -185,16 +190,16 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
|
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
|
||||||
dialog.setContentView(R.layout.custom_dialog_progress);
|
dialog.setContentView(R.layout.custom_dialog_progress);
|
||||||
pb = (ProgressBar) dialog.findViewById(R.id.progressBar1);
|
pb = (ProgressBar) dialog.findViewById(R.id.progressBar1);
|
||||||
|
pb.getProgressDrawable().setColorFilter(
|
||||||
|
getResources().getColor(R.color.colorPrimaryDark), android.graphics.PorterDuff.Mode.SRC_IN);
|
||||||
percentage = (TextView) dialog.findViewById(R.id.percentage);
|
percentage = (TextView) dialog.findViewById(R.id.percentage);
|
||||||
message = (TextView) dialog.findViewById(R.id.message);
|
message = (TextView) dialog.findViewById(R.id.message);
|
||||||
dialog.setCancelable(false);
|
dialog.setCancelable(false);
|
||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String doInBackground(Void... voids) {
|
protected String doInBackground(Void... voids) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
boolean no_jcp_flag = false, no_adhoc_flag = false, no_addtional_jcp_flag = false;
|
boolean no_jcp_flag = false, no_adhoc_flag = false, no_addtional_jcp_flag = false;
|
||||||
|
|
||||||
String resultHttp = "";
|
String resultHttp = "";
|
||||||
@@ -213,17 +218,20 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
request.addProperty("Type", "JOURNEY_PLAN");
|
request.addProperty("Type", "JOURNEY_PLAN");
|
||||||
request.addProperty("cultureid", culture_id);
|
request.addProperty("cultureid", culture_id);
|
||||||
|
|
||||||
|
|
||||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
|
Log.d("requestdata",request.toString());
|
||||||
|
|
||||||
Object result = envelope.getResponse();
|
Object result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
//InputStream stream = new ByteArrayInputStream(result.toString().getBytes("UTF-8"));
|
|
||||||
|
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
// xpp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
|
// xpp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
|
||||||
@@ -259,11 +267,12 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
// xpp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
|
// xpp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
|
||||||
@@ -302,11 +311,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
xpp.next();
|
xpp.next();
|
||||||
@@ -325,6 +334,42 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
TableBean.setAdditionalJourneyPlan(additional_jcpTable);
|
TableBean.setAdditionalJourneyPlan(additional_jcpTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//SUPERVISOR_LIST
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
|
request.addProperty("UserName", userId);
|
||||||
|
request.addProperty("Type", "SUPERVISOR_LIST");
|
||||||
|
request.addProperty("cultureid", culture_id);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
|
if (result.toString() != null) {
|
||||||
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
|
xpp.next();
|
||||||
|
eventType = xpp.getEventType();
|
||||||
|
supervisorListGetterSetter = XMLHandlers.supervisorListXMLHandler(xpp, eventType);
|
||||||
|
|
||||||
|
String table_sup_list = supervisorListGetterSetter.getTable_SUPERVISOR_LIST();
|
||||||
|
if (table_sup_list != null) {
|
||||||
|
resultHttp = CommonString.KEY_SUCCESS;
|
||||||
|
TableBean.setTable_SUPERVISOR_LIST(table_sup_list);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supervisorListGetterSetter.getEMP_ID().size() > 0) {
|
||||||
|
data.value = 97;
|
||||||
|
data.name = "SUPERVISOR LIST DATA" + getResources().getString(R.string.download_data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
//ADHOC_JOURNEYPLAN_ADDITIONAL
|
//ADHOC_JOURNEYPLAN_ADDITIONAL
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
request.addProperty("UserName", userId);
|
request.addProperty("UserName", userId);
|
||||||
@@ -335,10 +380,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -369,10 +415,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -405,10 +452,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -441,10 +489,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -477,10 +526,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -512,10 +562,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -547,10 +598,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -581,10 +633,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -610,7 +663,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
//Added on 04/12/2018
|
//Added on 04/12/2018
|
||||||
// MAPPING_STOCK_STOREWISE
|
// MAPPING_STOCK_STOREWISE
|
||||||
if (country_id.equals("7")||country_id.equals("8")) {
|
if (country_id.equals("7")||country_id.equals("8") || country_id.equals("17")) {
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
request.addProperty("UserName", userId);
|
request.addProperty("UserName", userId);
|
||||||
request.addProperty("Type", "MAPPING_STOCK_STOREWISE");
|
request.addProperty("Type", "MAPPING_STOCK_STOREWISE");
|
||||||
@@ -620,10 +673,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -639,7 +693,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (mappingStockStorewiseGetterSetter.getSKU_ID().size() > 0) {
|
if (mappingStockStorewiseGetterSetter.getSKU_ID().size() > 0) {
|
||||||
data.value = 45;
|
data.value = 45;
|
||||||
data.name = "_MAPPING_STOCK_STOREWISE " + getResources().getString(R.string.download_data);
|
data.name = "MAPPING_STOCK_STOREWISE " + getResources().getString(R.string.download_data);
|
||||||
} else {
|
} else {
|
||||||
// return "MAPPING_STOCK";
|
// return "MAPPING_STOCK";
|
||||||
}
|
}
|
||||||
@@ -659,10 +713,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -697,10 +752,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -727,14 +783,16 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
request.addProperty("Type", "MAPPING_DISPLAY_CHECKLIST");
|
request.addProperty("Type", "MAPPING_DISPLAY_CHECKLIST");
|
||||||
request.addProperty("cultureid", culture_id);
|
request.addProperty("cultureid", culture_id);
|
||||||
|
|
||||||
|
Log.d("requestdata",request.toString());
|
||||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -754,11 +812,9 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
//return "MAPPING_DISPLAY_CHECKLIST";
|
//return "MAPPING_DISPLAY_CHECKLIST";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
// NON_WORKING_REASON
|
// NON_WORKING_REASON
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
request.addProperty("UserName", userId);
|
request.addProperty("UserName", userId);
|
||||||
@@ -770,10 +826,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -804,10 +861,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -827,7 +885,6 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
//return "NON_WORKING_SUB_REASON";
|
//return "NON_WORKING_SUB_REASON";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
@@ -842,10 +899,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -864,13 +922,10 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
data.name = "MAPPING_PROMOTION " + getResources().getString(R.string.download_data);
|
data.name = "MAPPING_PROMOTION " + getResources().getString(R.string.download_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
//Gagan start code
|
//Gagan start code
|
||||||
|
|
||||||
// MAPPING_ADDITIONAL_PROMOTION
|
// MAPPING_ADDITIONAL_PROMOTION
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
request.addProperty("UserName", userId);
|
request.addProperty("UserName", userId);
|
||||||
@@ -881,10 +936,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -917,10 +973,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -955,10 +1012,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -991,10 +1049,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1026,10 +1085,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1062,10 +1122,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1097,10 +1158,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1135,10 +1197,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1170,10 +1233,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1205,10 +1269,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1229,7 +1294,6 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
//MAPPING_CATEGORY_IMAGE_ALLOW
|
//MAPPING_CATEGORY_IMAGE_ALLOW
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
request.addProperty("UserName", userId);
|
request.addProperty("UserName", userId);
|
||||||
@@ -1240,10 +1304,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1274,10 +1339,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1296,6 +1362,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
data.name = "ADDITIONAL_QUESTION " + getResources().getString(R.string.download_data);
|
data.name = "ADDITIONAL_QUESTION " + getResources().getString(R.string.download_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
//ADDITIONAL_QUESTION
|
//ADDITIONAL_QUESTION
|
||||||
@@ -1309,10 +1376,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1343,10 +1411,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1377,10 +1446,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1411,10 +1481,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1435,41 +1506,6 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
//SUPERVISOR_LIST
|
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
|
||||||
request.addProperty("UserName", userId);
|
|
||||||
request.addProperty("Type", "SUPERVISOR_LIST");
|
|
||||||
request.addProperty("cultureid", culture_id);
|
|
||||||
|
|
||||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
|
||||||
envelope.dotNet = true;
|
|
||||||
envelope.setOutputSoapObject(request);
|
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
|
||||||
|
|
||||||
result = envelope.getResponse();
|
|
||||||
|
|
||||||
if (result.toString() != null) {
|
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
|
||||||
xpp.next();
|
|
||||||
eventType = xpp.getEventType();
|
|
||||||
supervisorListGetterSetter = XMLHandlers.supervisorListXMLHandler(xpp, eventType);
|
|
||||||
|
|
||||||
String table_sup_list = supervisorListGetterSetter.getTable_SUPERVISOR_LIST();
|
|
||||||
if (table_sup_list != null) {
|
|
||||||
resultHttp = CommonString.KEY_SUCCESS;
|
|
||||||
TableBean.setTable_SUPERVISOR_LIST(table_sup_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supervisorListGetterSetter.getEMP_ID().size() > 0) {
|
|
||||||
data.value = 97;
|
|
||||||
data.name = "SUPERVISOR LIST DATA" + getResources().getString(R.string.download_data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
publishProgress(data);
|
|
||||||
|
|
||||||
|
|
||||||
//CONFIGURATION_MASTER
|
//CONFIGURATION_MASTER
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
request.addProperty("UserName", userId);
|
request.addProperty("UserName", userId);
|
||||||
@@ -1480,10 +1516,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1515,10 +1552,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1542,7 +1580,6 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
//JOURNEY_PLAN_PHARMA
|
//JOURNEY_PLAN_PHARMA
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
request.addProperty("UserName", userId);
|
request.addProperty("UserName", userId);
|
||||||
@@ -1553,10 +1590,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1582,10 +1620,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1611,10 +1650,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1636,7 +1676,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
//usk
|
//usk
|
||||||
// MAPPING_PHARMA_MSL
|
// MAPPING_PHARMA_MSL
|
||||||
@@ -1649,10 +1689,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1676,6 +1717,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
request.addProperty("UserName", userId);
|
request.addProperty("UserName", userId);
|
||||||
@@ -1686,10 +1729,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1711,44 +1755,84 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
// return "MAPPING_PHARMA_MSL";
|
// return "MAPPING_PHARMA_MSL";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
/* //MAPPING_COUNTRYWISE_PLANOGRAM
|
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
request.addProperty("UserName", userId);
|
request.addProperty("UserName", userId);
|
||||||
request.addProperty("Type", "MAPPING_COUNTRYWISE_PLANOGRAM");
|
request.addProperty("Type", "ORDER_RECEIVED_STATUS");
|
||||||
request.addProperty("cultureid", culture_id);
|
request.addProperty("cultureid", culture_id);
|
||||||
|
|
||||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
xpp.next();
|
xpp.next();
|
||||||
eventType = xpp.getEventType();
|
eventType = xpp.getEventType();
|
||||||
mappingPlanogramCountrywiseGetterSetter = XMLHandlers.MAPPING_COUNTRYWISE_PLANOGRAM_XMLHandler(xpp, eventType);
|
|
||||||
|
|
||||||
String table_mapping_planogram = mappingPlanogramCountrywiseGetterSetter.getTable_MAPPING_COUNTRYWISE_PLANOGRAM();
|
order_received_status_getterSetter = XMLHandlers.order_Received_Status_XMLHandler(xpp, eventType);
|
||||||
if (table_mapping_planogram != null) {
|
String stocktable = order_received_status_getterSetter.getTable_Order_Received_Status();
|
||||||
|
if (stocktable != null) {
|
||||||
resultHttp = CommonString.KEY_SUCCESS;
|
resultHttp = CommonString.KEY_SUCCESS;
|
||||||
TableBean.setMappingCountrywisePlanogram(table_mapping_planogram);
|
TableBean.setTable_ORDER_RECEIVED_STATUS(stocktable);
|
||||||
}
|
}
|
||||||
if (mappingPlanogramCountrywiseGetterSetter.getCOUNTRY_ID().size() > 0) {
|
|
||||||
data.value = 92;
|
if (order_received_status_getterSetter.getSTORE_ID().size() > 0) {
|
||||||
data.name = "MAPPING_COUNTRYWISE_PLANOGRAM Data Download";
|
data.value = 99;
|
||||||
|
data.name = "ORDER_RECEIVED_STATUS" + getResources().getString(R.string.download_data);
|
||||||
} else {
|
} else {
|
||||||
//return "MAPPING_COUNTRYWISE_PLANOGRAM";
|
// return "MAPPING_PHARMA_MSL";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
publishProgress(data);*/
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
|
//VISIT_TYPE_MASTER
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
|
request.addProperty("UserName", userId);
|
||||||
|
request.addProperty("Type", "VISIT_TYPE_MASTER");
|
||||||
|
request.addProperty("cultureid", culture_id);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata",result.toString());
|
||||||
|
|
||||||
|
if (result.toString() != null) {
|
||||||
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
|
xpp.next();
|
||||||
|
eventType = xpp.getEventType();
|
||||||
|
|
||||||
|
visit_type_master_getterSetter = XMLHandlers.Visit_Type_Status_XMLHandler(xpp, eventType);
|
||||||
|
String stocktable = visit_type_master_getterSetter.getTable_Visit_Type_Status();
|
||||||
|
if (stocktable != null) {
|
||||||
|
resultHttp = CommonString.KEY_SUCCESS;
|
||||||
|
TableBean.setTable_VISIT_TYPE_STATUS(stocktable);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (order_received_status_getterSetter.getSTORE_ID().size() > 0) {
|
||||||
|
data.value = 99;
|
||||||
|
data.name = "VISIT_TYPE_MASTER" + getResources().getString(R.string.download_data);
|
||||||
|
} else {
|
||||||
|
// return "MAPPING_PHARMA_MSL";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Images DownLoads
|
//Images DownLoads
|
||||||
|
|
||||||
@@ -1765,8 +1849,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
String image_name = mapping_planogram_masterGetterSetter.getPLANOGRAM_IMAGE().get(i);
|
String image_name = mapping_planogram_masterGetterSetter.getPLANOGRAM_IMAGE().get(i);
|
||||||
String path = mapping_planogram_masterGetterSetter.getIMAGE_PATH().get(i);
|
String path = mapping_planogram_masterGetterSetter.getIMAGE_PATH().get(i);
|
||||||
|
String PATH = CommonString.getDownloadedImageFolder(context);
|
||||||
String PATH = CommonString.FILE_PATH_PLANOGRAM;
|
|
||||||
File file = new File(PATH);
|
File file = new File(PATH);
|
||||||
if (!file.isDirectory()) {
|
if (!file.isDirectory()) {
|
||||||
file.mkdir();
|
file.mkdir();
|
||||||
@@ -1828,7 +1911,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
String image_name = displayMasterGetterSetter.getIMAGE_URL().get(i);
|
String image_name = displayMasterGetterSetter.getIMAGE_URL().get(i);
|
||||||
String img_url = displayMasterGetterSetter.getIMAGE_PATH().get(i);
|
String img_url = displayMasterGetterSetter.getIMAGE_PATH().get(i);
|
||||||
|
|
||||||
String PATH = CommonString.FILE_PATH_PLANOGRAM;
|
String PATH = CommonString.getDownloadedImageFolder(context);
|
||||||
File file = new File(PATH);
|
File file = new File(PATH);
|
||||||
if (!file.isDirectory()) {
|
if (!file.isDirectory()) {
|
||||||
file.mkdir();
|
file.mkdir();
|
||||||
@@ -1892,7 +1975,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
String image_name = mappingPlanogramStorewiseGetterSetter.getPLANOGRAM_IMAGE().get(i);
|
String image_name = mappingPlanogramStorewiseGetterSetter.getPLANOGRAM_IMAGE().get(i);
|
||||||
String path = mappingPlanogramStorewiseGetterSetter.getIMAGE_PATH().get(i);
|
String path = mappingPlanogramStorewiseGetterSetter.getIMAGE_PATH().get(i);
|
||||||
|
|
||||||
String PATH = CommonString.FILE_PATH_PLANOGRAM;
|
String PATH = CommonString.getDownloadedImageFolder(context);
|
||||||
File file = new File(PATH);
|
File file = new File(PATH);
|
||||||
if (!file.isDirectory()) {
|
if (!file.isDirectory()) {
|
||||||
file.mkdir();
|
file.mkdir();
|
||||||
@@ -1937,10 +2020,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
db.open();
|
db.open();
|
||||||
db.InsertJCP(jcpgettersetter);
|
db.InsertJCP(jcpgettersetter);
|
||||||
|
db.InsertOrderReceivingStatus(order_received_status_getterSetter);
|
||||||
db.InsertAdhoc_JCP(adhoc_jcpgettersetter);
|
db.InsertAdhoc_JCP(adhoc_jcpgettersetter);
|
||||||
|
db.InsertVisit_Type_Status(visit_type_master_getterSetter);
|
||||||
db.InsertCategory(categoryMasterGetterSetter);
|
db.InsertCategory(categoryMasterGetterSetter);
|
||||||
db.InsertSubCategoryMaster(subCategoryMasterGetterSetter);
|
db.InsertSubCategoryMaster(subCategoryMasterGetterSetter);
|
||||||
db.InsertBrandMaster(brandMasterGetterSetter);
|
db.InsertBrandMaster(brandMasterGetterSetter);
|
||||||
@@ -1985,10 +2069,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
db.InsertPROMOTION_TYPE_MASTER(promotion_type_masterGetterSetter);
|
db.InsertPROMOTION_TYPE_MASTER(promotion_type_masterGetterSetter);
|
||||||
db.InsertCATEGORYWISE_SOS_TARGET(store_category_wiseGetterSetter);
|
db.InsertCATEGORYWISE_SOS_TARGET(store_category_wiseGetterSetter);
|
||||||
db.InsertMAPPING_SKU_PRICING_ENABLE(mapping_sku_pricing_enableGetterSetter);
|
db.InsertMAPPING_SKU_PRICING_ENABLE(mapping_sku_pricing_enableGetterSetter);
|
||||||
|
}
|
||||||
|
catch (MalformedURLException e) {
|
||||||
} catch (MalformedURLException e) {
|
|
||||||
|
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
str = CommonString.MESSAGE_EXCEPTION;
|
str = CommonString.MESSAGE_EXCEPTION;
|
||||||
return CommonString.MESSAGE_EXCEPTION;
|
return CommonString.MESSAGE_EXCEPTION;
|
||||||
@@ -1997,18 +2079,16 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
str = CommonString.MESSAGE_SOCKETEXCEPTION;
|
str = CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||||
return CommonString.MESSAGE_SOCKETEXCEPTION;
|
return CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||||
} catch (InterruptedIOException e) {
|
} catch (InterruptedIOException e) {
|
||||||
|
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
str = CommonString.MESSAGE_EXCEPTION;
|
str = CommonString.MESSAGE_EXCEPTION;
|
||||||
return CommonString.MESSAGE_EXCEPTION;
|
return CommonString.MESSAGE_EXCEPTION;
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
str = CommonString.MESSAGE_SOCKETEXCEPTION;
|
str = CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||||
return CommonString.MESSAGE_SOCKETEXCEPTION;
|
return CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||||
} catch (XmlPullParserException e) {
|
} catch (XmlPullParserException e) {
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
|
Log.d("exceptiondata",e.getMessage() + ","+data.name );
|
||||||
str = CommonString.MESSAGE_XmlPull;
|
str = CommonString.MESSAGE_XmlPull;
|
||||||
return CommonString.MESSAGE_XmlPull;
|
return CommonString.MESSAGE_XmlPull;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -2017,7 +2097,6 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
// Crashlytics.logException(new Exception(e.getCause()));
|
// Crashlytics.logException(new Exception(e.getCause()));
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
str = CommonString.MESSAGE_EXCEPTION;
|
str = CommonString.MESSAGE_EXCEPTION;
|
||||||
|
|
||||||
return CommonString.MESSAGE_EXCEPTION;
|
return CommonString.MESSAGE_EXCEPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2031,7 +2110,6 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onProgressUpdate(Data... values) {
|
protected void onProgressUpdate(Data... values) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
pb.setProgress(values[0].value);
|
pb.setProgress(values[0].value);
|
||||||
percentage.setText(values[0].value + "%");
|
percentage.setText(values[0].value + "%");
|
||||||
message.setText(values[0].name);
|
message.setText(values[0].name);
|
||||||
@@ -2043,7 +2121,6 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (s.equalsIgnoreCase("")) {
|
if (s.equalsIgnoreCase("")) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
|
|
||||||
showAlert(getString(R.string.data_downloaded_successfully));
|
showAlert(getString(R.string.data_downloaded_successfully));
|
||||||
} else {
|
} else {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
@@ -2054,7 +2131,6 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showAlert(String str) {
|
public void showAlert(String str) {
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(DownloadActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(DownloadActivity.this);
|
||||||
builder.setTitle("Parinaam");
|
builder.setTitle("Parinaam");
|
||||||
builder.setMessage(str).setCancelable(false)
|
builder.setMessage(str).setCancelable(false)
|
||||||
@@ -2076,10 +2152,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
toolbar.setTitle(getString(R.string.main_menu_activity_name));
|
toolbar.setTitle(getString(R.string.main_menu_activity_name));
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-13
@@ -116,10 +116,12 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
|||||||
if(lang.equals(language.get(0))){
|
if(lang.equals(language.get(0))){
|
||||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
|
btn_lang_1.setTextColor(getResources().getColor(R.color.white));
|
||||||
}
|
}
|
||||||
else if(lang.equals(language.get(1))){
|
else if(lang.equals(language.get(1))){
|
||||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
|
btn_lang_2.setTextColor(getResources().getColor(R.color.white));
|
||||||
}
|
}
|
||||||
|
|
||||||
btn_lang_1.setOnClickListener(this);
|
btn_lang_1.setOnClickListener(this);
|
||||||
@@ -131,7 +133,6 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
|||||||
// TODO: Rename method, update argument and hook method into UI event
|
// TODO: Rename method, update argument and hook method into UI event
|
||||||
public void onButtonPressed(String selected_lang, String culture_id, String notice_url) {
|
public void onButtonPressed(String selected_lang, String culture_id, String notice_url) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
|
|
||||||
mListener.onFragmentInteraction(selected_lang,culture_id,notice_url);
|
mListener.onFragmentInteraction(selected_lang,culture_id,notice_url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -157,42 +158,39 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
|||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
int id = view.getId();
|
int id = view.getId();
|
||||||
|
|
||||||
switch (id) {
|
if (id == R.id.btn_language_one) {
|
||||||
case R.id.btn_language_one:
|
|
||||||
|
|
||||||
//selected_flag = true;
|
//selected_flag = true;
|
||||||
onButtonPressed(language.get(0),culture_id.get(0),login_data.getNOTICE_URL().get(0));
|
onButtonPressed(language.get(0), culture_id.get(0), login_data.getNOTICE_URL().get(0));
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(getActivity(), language.get(0));
|
CommonFunctions.updateLangResources(getActivity(), language.get(0));
|
||||||
|
|
||||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
|
btn_lang_1.setTextColor(getResources().getColor(R.color.white));
|
||||||
|
btn_lang_2.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
|
||||||
editor.putString(CommonString.KEY_LANGUAGE, language.get(0));
|
editor.putString(CommonString.KEY_LANGUAGE, language.get(0));
|
||||||
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(0));
|
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(0));
|
||||||
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(0));
|
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(0));
|
||||||
editor.commit();
|
editor.commit();
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.btn_language_two) {
|
||||||
|
|
||||||
case R.id.btn_language_two:
|
|
||||||
|
|
||||||
//selected_flag = true;
|
//selected_flag = true;
|
||||||
|
onButtonPressed(language.get(1), culture_id.get(1), login_data.getNOTICE_URL().get(1));
|
||||||
onButtonPressed(language.get(1),culture_id.get(1),login_data.getNOTICE_URL().get(1));
|
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(getActivity(), language.get(1));
|
CommonFunctions.updateLangResources(getActivity(), language.get(1));
|
||||||
|
|
||||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
|
btn_lang_2.setTextColor(getResources().getColor(R.color.white));
|
||||||
|
btn_lang_1.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
|
||||||
editor.putString(CommonString.KEY_LANGUAGE, language.get(1));
|
editor.putString(CommonString.KEY_LANGUAGE, language.get(1));
|
||||||
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(1));
|
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(1));
|
||||||
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(1));
|
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(1));
|
||||||
editor.commit();
|
editor.commit();
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+21
-13
@@ -51,6 +51,7 @@ import retrofit.Retrofit;
|
|||||||
public class ServiceActivityFragment extends Fragment {
|
public class ServiceActivityFragment extends Fragment {
|
||||||
String result = "";
|
String result = "";
|
||||||
boolean isvalid = false;
|
boolean isvalid = false;
|
||||||
|
Context context;
|
||||||
|
|
||||||
public ServiceActivityFragment() {
|
public ServiceActivityFragment() {
|
||||||
}
|
}
|
||||||
@@ -67,6 +68,7 @@ public class ServiceActivityFragment extends Fragment {
|
|||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
View view = inflater.inflate(R.layout.fragment_service, container, false);
|
View view = inflater.inflate(R.layout.fragment_service, container, false);
|
||||||
|
|
||||||
|
context = view.getContext();
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
preferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
||||||
username = preferences.getString(CommonString.KEY_USERNAME, "");
|
username = preferences.getString(CommonString.KEY_USERNAME, "");
|
||||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
@@ -119,11 +121,11 @@ public class ServiceActivityFragment extends Fragment {
|
|||||||
|
|
||||||
if(position==0){
|
if(position==0){
|
||||||
showExportDialog();
|
showExportDialog();
|
||||||
//restoreBackup();
|
// restoreBackup();
|
||||||
}
|
}
|
||||||
/* else if(position==1){
|
/* else if(position==1){
|
||||||
|
|
||||||
File f = new File(CommonString.FILE_PATH);
|
File f = new File(CommonString.getImagesFolder(context));
|
||||||
if(f!=null){
|
if(f!=null){
|
||||||
File file[] = f.listFiles();
|
File file[] = f.listFiles();
|
||||||
if(file.length>0){
|
if(file.length>0){
|
||||||
@@ -196,12 +198,15 @@ public class ServiceActivityFragment extends Fragment {
|
|||||||
public void restoreBackup(){
|
public void restoreBackup(){
|
||||||
|
|
||||||
try {
|
try {
|
||||||
File sd = Environment.getExternalStorageDirectory();
|
/* File sd = Environment.getExternalStorageDirectory();
|
||||||
|
File data = Environment.getDataDirectory();*/
|
||||||
|
|
||||||
|
File sd = context.getExternalFilesDir("");
|
||||||
File data = Environment.getDataDirectory();
|
File data = Environment.getDataDirectory();
|
||||||
|
|
||||||
if (sd.canWrite()) {
|
if (sd.canWrite()) {
|
||||||
String currentDBPath = "//data//cpm.com.gskmtorange//databases//" + GSKOrangeDB.DATABASE_NAME;
|
String currentDBPath = "//data//cpm.com.gskmtorange//databases//" + GSKOrangeDB.DATABASE_NAME;
|
||||||
String backupDBPath = "GSKMT_ORANGE_Database_backup_testksa_02272019_155842";
|
String backupDBPath = "GSKMT_ORANGE_Database_backup_abdullah.bakr_06122024_144633.db";
|
||||||
File currentDB = new File(data, currentDBPath);
|
File currentDB = new File(data, currentDBPath);
|
||||||
File backupDB = new File(sd, backupDBPath);
|
File backupDB = new File(sd, backupDBPath);
|
||||||
|
|
||||||
@@ -229,14 +234,17 @@ public class ServiceActivityFragment extends Fragment {
|
|||||||
@SuppressWarnings("resource")
|
@SuppressWarnings("resource")
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
try {
|
try {
|
||||||
File file = new File(Environment
|
/*File file = new File(Environment
|
||||||
.getExternalStorageDirectory(),
|
.getExternalStorageDirectory(),
|
||||||
"gsk_orange_backup");
|
"gsk_orange_backup");
|
||||||
if (!file.isDirectory()) {
|
if (!file.isDirectory()) {
|
||||||
file.mkdir();
|
file.mkdir();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
File sd = Environment.getExternalStorageDirectory();
|
/* File sd = Environment.getExternalStorageDirectory();
|
||||||
|
File data = Environment.getDataDirectory();*/
|
||||||
|
|
||||||
|
File sd = context.getExternalFilesDir("");
|
||||||
File data = Environment.getDataDirectory();
|
File data = Environment.getDataDirectory();
|
||||||
|
|
||||||
if (sd.canWrite()) {
|
if (sd.canWrite()) {
|
||||||
@@ -249,8 +257,9 @@ public class ServiceActivityFragment extends Fragment {
|
|||||||
String backupDBPath = "GSKMT_ORANGE_Database_backup" + "_"+username+"_"+ visit_date.replace("/", "") + "_" +
|
String backupDBPath = "GSKMT_ORANGE_Database_backup" + "_"+username+"_"+ visit_date.replace("/", "") + "_" +
|
||||||
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") ;
|
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") ;
|
||||||
|
|
||||||
String path = Environment.getExternalStorageDirectory().getPath()+ "/gsk_orange_backup";
|
// String path = Environment.getExternalStorageDirectory().getPath()+ "/gsk_orange_backup";
|
||||||
|
|
||||||
|
String path = CommonString.getBackupFolder(context);
|
||||||
File currentDB = new File(data, currentDBPath);
|
File currentDB = new File(data, currentDBPath);
|
||||||
File backupDB = new File(path, backupDBPath);
|
File backupDB = new File(path, backupDBPath);
|
||||||
|
|
||||||
@@ -269,8 +278,7 @@ public class ServiceActivityFragment extends Fragment {
|
|||||||
|
|
||||||
//usk
|
//usk
|
||||||
// File dir = new File(CommonString.BACKUP_PATH);
|
// File dir = new File(CommonString.BACKUP_PATH);
|
||||||
File dir = new File(CommonString.BACKUP_PATH);
|
File dir = new File(CommonString.getBackupFolder(context));
|
||||||
|
|
||||||
ArrayList<String> list = new ArrayList();
|
ArrayList<String> list = new ArrayList();
|
||||||
list = getFileNames(dir.listFiles());
|
list = getFileNames(dir.listFiles());
|
||||||
if (list.size() > 0) {
|
if (list.size() > 0) {
|
||||||
@@ -278,9 +286,9 @@ public class ServiceActivityFragment extends Fragment {
|
|||||||
if (list.get(i1).contains("GSKMT_ORANGE_Database_backup")) {
|
if (list.get(i1).contains("GSKMT_ORANGE_Database_backup")) {
|
||||||
// File originalFile = new File(CommonString.BACKUP_PATH + list.get(i1));
|
// File originalFile = new File(CommonString.BACKUP_PATH + list.get(i1));
|
||||||
Object result = uploadBackup(getActivity(), list.get(i1), "DBBackup");
|
Object result = uploadBackup(getActivity(), list.get(i1), "DBBackup");
|
||||||
/* if (result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
if (result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
Toast.makeText(getActivity(), getString(R.string.databasexported), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), getString(R.string.databasexported), Toast.LENGTH_SHORT).show();
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -317,7 +325,7 @@ public class ServiceActivityFragment extends Fragment {
|
|||||||
RequestBody body1;
|
RequestBody body1;
|
||||||
result = "";
|
result = "";
|
||||||
isvalid = false;
|
isvalid = false;
|
||||||
final File originalFile = new File(CommonString.BACKUP_PATH +"/"+ file_name);
|
final File originalFile = new File(CommonString.getBackupFolder(context) + file_name);
|
||||||
RequestBody photo = RequestBody.create(MediaType.parse("application/octet-stream"), originalFile);
|
RequestBody photo = RequestBody.create(MediaType.parse("application/octet-stream"), originalFile);
|
||||||
body1 = new MultipartBuilder().type(MultipartBuilder.FORM)
|
body1 = new MultipartBuilder().type(MultipartBuilder.FORM)
|
||||||
.addFormDataPart("file", originalFile.getName(), photo)
|
.addFormDataPart("file", originalFile.getName(), photo)
|
||||||
|
|||||||
@@ -238,4 +238,43 @@ public class CoverageBean {
|
|||||||
public void setFlag_from(String flag_from) {
|
public void setFlag_from(String flag_from) {
|
||||||
this.flag_from = flag_from;
|
this.flag_from = flag_from;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String keyAccountId;
|
||||||
|
String classId;
|
||||||
|
|
||||||
|
public String getKeyAccountId() {
|
||||||
|
return keyAccountId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKeyAccountId(String keyAccountId) {
|
||||||
|
this.keyAccountId = keyAccountId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getClassId() {
|
||||||
|
return classId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClassId(String classId) {
|
||||||
|
this.classId = classId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStoreTypeId() {
|
||||||
|
return storeTypeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStoreTypeId(String storeTypeId) {
|
||||||
|
this.storeTypeId = storeTypeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
String storeTypeId;
|
||||||
|
|
||||||
|
public String getMappingStk() {
|
||||||
|
return mappingStk;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMappingStk(String mappingStk) {
|
||||||
|
this.mappingStk = mappingStk;
|
||||||
|
}
|
||||||
|
|
||||||
|
String mappingStk="";
|
||||||
}
|
}
|
||||||
|
|||||||
+400
-207
@@ -5,6 +5,7 @@ import android.content.Intent;
|
|||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
@@ -44,8 +45,9 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
ArrayList<CategoryGetterSetter> categoryList;
|
ArrayList<CategoryGetterSetter> categoryList;
|
||||||
CategoryListAdapter adapter;
|
CategoryListAdapter adapter;
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id,camera_allow, country_id, store_flag_str, pog_type_id;
|
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str, pog_type_id;
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
|
String visit_type_id = "";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -69,14 +71,15 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||||
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
||||||
pog_type_id = preferences.getString(CommonString.KEY_POG_TYPE_ID, "");
|
pog_type_id = preferences.getString(CommonString.KEY_POG_TYPE_ID, "");
|
||||||
|
if(preferences.getString(CommonString.KEY_VISIT_ID, "")!= null){
|
||||||
|
visit_type_id = preferences.getString(CommonString.KEY_VISIT_ID, "");
|
||||||
|
}
|
||||||
|
|
||||||
/*txt_categoryName = (TextView) findViewById(R.id.txt_categoryName);
|
/*txt_categoryName = (TextView) findViewById(R.id.txt_categoryName);
|
||||||
txt_categoryName.setText(getResources().getString(R.string.title_activity_category_list));*/
|
txt_categoryName.setText(getResources().getString(R.string.title_activity_category_list));*/
|
||||||
toolbar.setTitle(getResources().getString(R.string.title_activity_category_list));
|
toolbar.setTitle(getResources().getString(R.string.title_activity_category_list));
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab_category);
|
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab_category);
|
||||||
fab.setOnClickListener(new View.OnClickListener() {
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -90,95 +93,280 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
||||||
categoryList = new ArrayList<>();
|
categoryList = new ArrayList<>();
|
||||||
|
Log.e("country_data",country_id + ","+ keyAccount_id);
|
||||||
if(country_id.equals("7")||country_id.equals("8")){
|
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||||
categoryList = db.getCategoryListData(null, null, null, store_id, "MAPPING_STOCK_STOREWISE");
|
categoryList = db.getCategoryListData(null, null, null, store_id, "MAPPING_STOCK_STOREWISE");
|
||||||
}
|
Log.d("catlistsize", String.valueOf(categoryList.size()));
|
||||||
else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
categoryList = db.getCategoryListData(keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
categoryList = db.getCategoryListData(keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
}
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
||||||
else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)){
|
|
||||||
categoryList = db.getCategoryListData(keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADDITIONAL);
|
categoryList = db.getCategoryListData(keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADDITIONAL);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
categoryList = db.getCategoryListData(keyAccount_id, storeType_id, class_id, store_id, "MAPPING_STOCK");
|
categoryList = db.getCategoryListData(keyAccount_id, storeType_id, class_id, store_id, "MAPPING_STOCK");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (categoryList.size() > 0) {
|
if (categoryList.size() > 0) {
|
||||||
|
|
||||||
for (int i = 0; i < categoryList.size(); i++) {
|
for (int i = 0; i < categoryList.size(); i++) {
|
||||||
|
|
||||||
boolean flag_filled = false;
|
boolean flag_filled = false;
|
||||||
String category_id = categoryList.get(i).getCategory_id();
|
String category_id = categoryList.get(i).getCategory_id();
|
||||||
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
||||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)){
|
db.open();
|
||||||
boolean flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADDITIONAL);
|
boolean flag_mapping_stock = db.isMappingStockDataStockFacing(category_id,
|
||||||
|
keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADDITIONAL);
|
||||||
if (flag_mapping_stock) {
|
if (flag_mapping_stock) {
|
||||||
if (db.checkStockData(store_id, category_id)) {
|
if (db.checkStockData(store_id, category_id, visit_date)) {
|
||||||
flag_filled = true;
|
flag_filled = true;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
flag_filled = false;
|
flag_filled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION) &&
|
||||||
|
country_id.equals("2") && visit_type_id.equals("3")) {
|
||||||
|
db.open();
|
||||||
|
if (db.additionalVisibilitydata(store_id, category_id)) {
|
||||||
|
flag_filled = true;
|
||||||
|
} else {
|
||||||
|
flag_filled = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*else {
|
||||||
|
|
||||||
|
Log.e("KPI_DEBUG", "----------------------------------");
|
||||||
|
Log.e("KPI_DEBUG", "Checking Category: " + category_id);
|
||||||
|
|
||||||
|
//Additional_Visibility
|
||||||
|
if (db.additionalVisibilitydata(store_id, category_id)) {
|
||||||
|
|
||||||
|
Log.e("KPI_DEBUG", "Additional Visibility PASSED");
|
||||||
|
|
||||||
|
boolean flag = true;
|
||||||
|
|
||||||
|
//MSL_Availability
|
||||||
|
boolean flag_mapping_stock;
|
||||||
|
|
||||||
|
if (country_id.equals("7")) {
|
||||||
|
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||||
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
|
} else {
|
||||||
|
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag_mapping_stock) {
|
||||||
|
if (!db.checkMsl_Availability_StockFacingDataNew(store_id, category_id, visit_date)) {
|
||||||
|
Log.e("KPI_DEBUG", "MSL FAILED");
|
||||||
|
flag = false;
|
||||||
|
} else {
|
||||||
|
Log.e("KPI_DEBUG", "MSL PASSED");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.e("KPI_DEBUG", "MSL Mapping NOT REQUIRED");
|
||||||
|
}
|
||||||
|
|
||||||
|
//Stock Entry
|
||||||
|
boolean flag_stock_mapping_stock;
|
||||||
|
|
||||||
|
if (country_id.equals("10")) {
|
||||||
|
flag_stock_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||||
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
flag_stock_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
|
} else {
|
||||||
|
flag_stock_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag_stock_mapping_stock) {
|
||||||
|
if (!db.checkStock_Entry_FacingDataNew(store_id, category_id, visit_date)) {
|
||||||
|
Log.e("KPI_DEBUG", "Stock Entry FAILED");
|
||||||
|
flag = false;
|
||||||
|
} else {
|
||||||
|
Log.e("KPI_DEBUG", "Stock Entry PASSED");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.e("KPI_DEBUG", "Stock Entry Mapping NOT REQUIRED");
|
||||||
|
}
|
||||||
|
|
||||||
|
//Promo Compliance
|
||||||
|
if (flag) {
|
||||||
|
|
||||||
|
if (country_id.equals("7")) {
|
||||||
|
|
||||||
|
if (db.getPromoComplianceSkuwiseExistsAfterData(store_id, category_id).size() == 0) {
|
||||||
|
Log.e("KPI_DEBUG", "Promo Compliance FAILED");
|
||||||
|
flag = false;
|
||||||
|
} else {
|
||||||
|
Log.e("KPI_DEBUG", "Promo Compliance PASSED");
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
boolean isMappingPromotion_Flag;
|
||||||
|
|
||||||
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id,
|
||||||
|
CommonString.TABLE_MAPPING_PROMOTION_ADHOC);
|
||||||
|
} else {
|
||||||
|
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id,
|
||||||
|
CommonString.TABLE_MAPPING_PROMOTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isMappingPromotion_Flag) {
|
||||||
|
|
||||||
|
if (!db.checkPromoComplianceData(store_id, category_id)) {
|
||||||
|
Log.e("KPI_DEBUG", "Promo Compliance FAILED");
|
||||||
|
flag = false;
|
||||||
|
} else {
|
||||||
|
Log.e("KPI_DEBUG", "Promo Compliance PASSED");
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Log.e("KPI_DEBUG", "Promo Compliance Mapping NOT REQUIRED");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//T2P
|
||||||
|
if (flag) {
|
||||||
|
|
||||||
|
boolean flag_t2p_mapping;
|
||||||
|
|
||||||
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id,
|
||||||
|
CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||||
|
} else {
|
||||||
|
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id,
|
||||||
|
CommonString.TABLE_MAPPING_T2P);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag_t2p_mapping) {
|
||||||
|
|
||||||
|
if (!db.isFilledT2P(store_id, category_id)) {
|
||||||
|
Log.e("KPI_DEBUG", "T2P FAILED");
|
||||||
|
flag = false;
|
||||||
|
} else {
|
||||||
|
Log.e("KPI_DEBUG", "T2P PASSED");
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Log.e("KPI_DEBUG", "T2P Mapping NOT REQUIRED");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Category Image
|
||||||
|
if (camera_allow.equals("1")) {
|
||||||
|
|
||||||
|
if (!db.isCategoryPictureData(store_id, category_id)) {
|
||||||
|
Log.e("KPI_DEBUG", "Category Image FAILED");
|
||||||
|
flag = false;
|
||||||
|
} else {
|
||||||
|
Log.e("KPI_DEBUG", "Category Image PASSED");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//Order Taking
|
||||||
|
if (country_id.equals("15") || ((country_id.equals("17") && category_id.equals("2")))) {
|
||||||
|
|
||||||
|
if (!db.checkOrder_taking_Data(store_id, category_id)) {
|
||||||
|
Log.e("KPI_DEBUG", "Order Taking FAILED");
|
||||||
|
flag = false;
|
||||||
|
} else {
|
||||||
|
Log.e("KPI_DEBUG", "Order Taking PASSED");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//Audit
|
||||||
|
if (flag) {
|
||||||
|
|
||||||
|
ArrayList<AuditDataGetterSetter> question_list = getAuditQnsRemoved(category_id);
|
||||||
|
|
||||||
|
if (question_list.size() > 0) {
|
||||||
|
|
||||||
|
if (db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||||
|
Log.e("KPI_DEBUG", "Audit FAILED");
|
||||||
|
flag = false;
|
||||||
|
} else {
|
||||||
|
Log.e("KPI_DEBUG", "Audit PASSED");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Log.e("KPI_DEBUG", "FINAL FLAG RESULT = " + flag);
|
||||||
|
|
||||||
|
if (!flag) {
|
||||||
|
flag_filled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
Log.e("KPI_DEBUG", "Additional Visibility FAILED");
|
||||||
|
|
||||||
|
flag_filled = false;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
else {
|
else {
|
||||||
//Additional_Visibility
|
//Additional_Visibility
|
||||||
if (db.additionalVisibilitydata(store_id, category_id)) {
|
if (db.additionalVisibilitydata(store_id, category_id)) {
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
|
|
||||||
//MSL_Availability
|
//MSL_Availability
|
||||||
/*if (db.isMappingStockDataMSL_Availability(category_id, keyAccount_id, storeType_id, class_id)) {
|
|
||||||
if (!db.checkMsl_AvailabilityData(store_id, category_id)) {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Stock_Facing
|
|
||||||
if (flag) {
|
|
||||||
if (db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id)) {
|
|
||||||
if (!db.checkStockAndFacingData(store_id, category_id)) {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
boolean flag_mapping_stock;
|
boolean flag_mapping_stock;
|
||||||
//New MSL_Availability_StockFacing
|
//New MSL_Availability_StockFacing
|
||||||
if(country_id.equals("7")){
|
if (country_id.equals("7")) {
|
||||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id,
|
||||||
}
|
CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||||
else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||||
}
|
CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
else {
|
} else {
|
||||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK);
|
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK);
|
||||||
}
|
}
|
||||||
if (flag_mapping_stock) {
|
if (flag_mapping_stock) {
|
||||||
if (!db.checkMsl_Availability_StockFacingData(store_id, category_id)) {
|
if (!db.checkMsl_Availability_StockFacingDataNew(store_id, category_id, visit_date)) {
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Stock_Entry
|
||||||
|
boolean flag_stock_mapping_stock;
|
||||||
|
if (country_id.equals("10")) {
|
||||||
|
flag_stock_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||||
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
flag_stock_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
|
} else {
|
||||||
|
flag_stock_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK);
|
||||||
|
}
|
||||||
|
if (flag_stock_mapping_stock && country_id.equals("10")) {
|
||||||
|
if (!db.checkStock_Entry_FacingDataNew(store_id, category_id, visit_date)) {
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Promo Compliance
|
//Promo Compliance
|
||||||
if (flag) {
|
if (flag) {
|
||||||
if(country_id.equals("7")){
|
if (country_id.equals("7")) {
|
||||||
if(db.getPromoComplianceSkuwiseExistsAfterData(store_id, category_id).size()==0){
|
if (db.getPromoComplianceSkuwiseExistsAfterData(store_id, category_id).size() == 0) {
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
boolean isMappingPromotion_Flag;
|
boolean isMappingPromotion_Flag;
|
||||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION_ADHOC);
|
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION_ADHOC);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION);
|
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION);
|
||||||
}
|
}
|
||||||
if (isMappingPromotion_Flag) {
|
if (isMappingPromotion_Flag) {
|
||||||
@@ -193,11 +381,10 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
//T2P
|
//T2P
|
||||||
if (flag) {
|
if (flag) {
|
||||||
boolean flag_t2p_mapping;
|
boolean flag_t2p_mapping;
|
||||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id,CommonString.TABLE_MAPPING_T2P_ADHOC);
|
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id, CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||||
}
|
} else {
|
||||||
else {
|
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id, CommonString.TABLE_MAPPING_T2P);
|
||||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id,CommonString.TABLE_MAPPING_T2P);
|
|
||||||
}
|
}
|
||||||
if (flag_t2p_mapping) {
|
if (flag_t2p_mapping) {
|
||||||
if (!db.isFilledT2P(store_id, category_id)) {
|
if (!db.isFilledT2P(store_id, category_id)) {
|
||||||
@@ -207,103 +394,94 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Category image
|
//Category image
|
||||||
if (camera_allow.equalsIgnoreCase("1")) {
|
if (camera_allow.equals("1")) {
|
||||||
//if (category_camera_list.size()>0) {
|
//if (category_camera_list.size()>0) {
|
||||||
if (!db.isCategoryPictureData(store_id, category_id)) {
|
if (!db.isCategoryPictureData(store_id, category_id)) {
|
||||||
flag = false;
|
flag = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
final ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(category_id, store_id, country_id);
|
||||||
|
|
||||||
final ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(category_id,store_id,country_id);
|
|
||||||
|
|
||||||
//if Sub Group Data exists for any Sub Category of the Category
|
//if Sub Group Data exists for any Sub Category of the Category
|
||||||
boolean isSubGroupDataExists = false;
|
boolean isSubGroupDataExists = false;
|
||||||
for(int j=0;j<sub_category_list.size();j++){
|
for (int j = 0; j < sub_category_list.size(); j++) {
|
||||||
if(db.getSkuGroupMasterData(category_id, sub_category_list.get(j).getSub_category_id()).size()>0){
|
if (db.getSkuGroupMasterData(category_id, sub_category_list.get(j).getSub_category_id()).size() > 0) {
|
||||||
isSubGroupDataExists = true;
|
isSubGroupDataExists = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isSubGroupDataExists){
|
if (isSubGroupDataExists) {
|
||||||
if (db.getNoCameraCategoryDataInserted(store_id, category_id, null).size() == 0) {
|
if (db.getNoCameraCategoryDataInserted(store_id, category_id, null).size() == 0) {
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag){
|
|
||||||
|
|
||||||
//changed on 23.10.2018
|
//Order Taking Data
|
||||||
//ArrayList<AuditDataGetterSetter> question_list = getAuditAfterDeletion(category_id);
|
if (country_id.equals("15") || ((country_id.equals("17") && category_id.equals("2")))) {
|
||||||
//changed on 03.12.2018
|
if (!db.checkOrder_taking_Data(store_id, category_id)) {
|
||||||
ArrayList<AuditDataGetterSetter> question_list = getAuditQnsRemoved(category_id);
|
|
||||||
|
|
||||||
if(question_list.size()>0){
|
|
||||||
|
|
||||||
if(db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).size() == 0){
|
|
||||||
flag = false;
|
flag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// flag = true;
|
||||||
|
|
||||||
|
if (flag) {
|
||||||
|
ArrayList<AuditDataGetterSetter> question_list = getAuditQnsRemoved(category_id);
|
||||||
|
if (question_list.size() > 0) {
|
||||||
|
if (db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||||
|
flag = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//new add UAE pharma
|
//new add UAE pharma
|
||||||
if(flag){
|
if (flag) {
|
||||||
|
|
||||||
/* if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
|
||||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
if (country_id.equals("2")){
|
|
||||||
if (camera_allow.equals("1")){
|
|
||||||
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
||||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (country_id.equals("2")) {
|
||||||
|
if (camera_allow.equals("1")) {
|
||||||
|
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
||||||
|
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
||||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag){
|
if (flag) {
|
||||||
|
|
||||||
//Counterfeit Product Option - Egypt
|
//Counterfeit Product Option - Egypt
|
||||||
if(country_id.equals("6")){
|
if (country_id.equals("6")) {
|
||||||
|
|
||||||
if (db.getCounterfeitProductExistsAfterData(store_id, category_id).size() == 0) {
|
if (db.getCounterfeitProductExistsAfterData(store_id, category_id).size() == 0) {
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//usk
|
//usk
|
||||||
if(country_id.equals("6")&& category_id.equals("2")){
|
if (country_id.equals("6") && category_id.equals("2")) {
|
||||||
|
|
||||||
if (db.getCompetitionPromoExistsAfterData(store_id, category_id).size() == 0) {
|
if (db.getCompetitionPromoExistsAfterData(store_id, category_id).size() == 0) {
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
flag_filled = flag;
|
flag_filled = flag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (flag_filled) {
|
if (flag_filled) {
|
||||||
if (category_id.equals("1")) {
|
if (category_id.equals("1")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.health_food_drink_tick);
|
categoryList.get(i).setCategory_img(R.mipmap.health_food_drink_tick);
|
||||||
@@ -311,39 +489,40 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
categoryList.get(i).setCategory_img(R.mipmap.oralcare_tick);
|
categoryList.get(i).setCategory_img(R.mipmap.oralcare_tick);
|
||||||
} else if (category_id.equals("3")) {
|
} else if (category_id.equals("3")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.wellness_tick);
|
categoryList.get(i).setCategory_img(R.mipmap.wellness_tick);
|
||||||
}else if (category_id.equals("4")) {
|
} else if (category_id.equals("4")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.nutritionals_tick);
|
categoryList.get(i).setCategory_img(R.mipmap.nutritionals_tick);
|
||||||
}else if (category_id.equals("5")) {
|
} else if (category_id.equals("5")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.gastro_n_indigestion_tick);
|
categoryList.get(i).setCategory_img(R.mipmap.gastro_n_indigestion_tick);
|
||||||
}else if (category_id.equals("6")) {
|
} else if (category_id.equals("6")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.cough_n_cold_tick);
|
categoryList.get(i).setCategory_img(R.mipmap.cough_n_cold_tick);
|
||||||
}else if (category_id.equals("7")) {
|
} else if (category_id.equals("7")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.analgesics_tick);
|
categoryList.get(i).setCategory_img(R.mipmap.analgesics_tick);
|
||||||
}else if (category_id.equals("8")) {
|
} else if (category_id.equals("8")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.first_aid_tick);
|
categoryList.get(i).setCategory_img(R.mipmap.first_aid_tick);
|
||||||
}else if (category_id.equals("9")) {
|
} else if (category_id.equals("9")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.analgesics_tick);
|
categoryList.get(i).setCategory_img(R.mipmap.analgesics_tick);
|
||||||
} else if (category_id.equals("10")) {
|
} else if (category_id.equals("10")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.cough_n_cold_tick);
|
categoryList.get(i).setCategory_img(R.mipmap.cough_n_cold_tick);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// Log.e("CATEGORY_DEBUG", "Category: " + category_id + " Flag: " + flag_filled);
|
||||||
if (category_id.equals("1")) {
|
if (category_id.equals("1")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.health_food_drink);
|
categoryList.get(i).setCategory_img(R.mipmap.health_food_drink);
|
||||||
} else if (category_id.equals("2")) {
|
} else if (category_id.equals("2")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.oral_care);
|
categoryList.get(i).setCategory_img(R.mipmap.oral_care);
|
||||||
} else if (category_id.equals("3")) {
|
} else if (category_id.equals("3")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.wellness);
|
categoryList.get(i).setCategory_img(R.mipmap.wellness);
|
||||||
}else if (category_id.equals("4")) {
|
} else if (category_id.equals("4")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.nutritionals);
|
categoryList.get(i).setCategory_img(R.mipmap.nutritionals);
|
||||||
}else if (category_id.equals("5")) {
|
} else if (category_id.equals("5")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.gastro_n_indigestion);
|
categoryList.get(i).setCategory_img(R.mipmap.gastro_n_indigestion);
|
||||||
}else if (category_id.equals("6")) {
|
} else if (category_id.equals("6")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.cough_n_cold);
|
categoryList.get(i).setCategory_img(R.mipmap.cough_n_cold);
|
||||||
}else if (category_id.equals("7")) {
|
} else if (category_id.equals("7")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.analgesics);
|
categoryList.get(i).setCategory_img(R.mipmap.analgesics);
|
||||||
}else if (category_id.equals("8")) {
|
} else if (category_id.equals("8")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.first_aid);
|
categoryList.get(i).setCategory_img(R.mipmap.first_aid);
|
||||||
}else if (category_id.equals("9")) {
|
} else if (category_id.equals("9")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.analgesics);
|
categoryList.get(i).setCategory_img(R.mipmap.analgesics);
|
||||||
} else if (category_id.equals("10")) {
|
} else if (category_id.equals("10")) {
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.cough_n_cold);
|
categoryList.get(i).setCategory_img(R.mipmap.cough_n_cold);
|
||||||
@@ -354,14 +533,13 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
adapter = new CategoryListAdapter(CategoryListActivity.this, categoryList);
|
adapter = new CategoryListAdapter(CategoryListActivity.this, categoryList);
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
recyclerView.setLayoutManager(new GridLayoutManager(context, 2));
|
recyclerView.setLayoutManager(new GridLayoutManager(context, 2));
|
||||||
|
|
||||||
updateStatus();
|
updateStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<AuditDataGetterSetter> getAuditAfterDeletion(String category_id){
|
ArrayList<AuditDataGetterSetter> getAuditAfterDeletion(String category_id) {
|
||||||
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(category_id,storeType_id);
|
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(category_id, storeType_id);
|
||||||
|
|
||||||
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
@@ -371,11 +549,10 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
iterator.remove();
|
iterator.remove();
|
||||||
} else if (!item.getCHECK_TYPE().equals("NA") && item.getCHECK_TYPE().equals("T2P")) {
|
} else if (!item.getCHECK_TYPE().equals("NA") && item.getCHECK_TYPE().equals("T2P")) {
|
||||||
boolean flag_t2p_mapping;
|
boolean flag_t2p_mapping;
|
||||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id,CommonString.TABLE_MAPPING_T2P_ADHOC);
|
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id, CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||||
}
|
} else {
|
||||||
else {
|
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id, CommonString.TABLE_MAPPING_T2P);
|
||||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id,CommonString.TABLE_MAPPING_T2P);
|
|
||||||
}
|
}
|
||||||
if (!flag_t2p_mapping) {
|
if (!flag_t2p_mapping) {
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
@@ -387,14 +564,12 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<AuditDataGetterSetter> getAuditQnsRemoved(String categoryId) {
|
ArrayList<AuditDataGetterSetter> getAuditQnsRemoved(String categoryId) {
|
||||||
|
|
||||||
boolean t2p_flag = false;
|
boolean t2p_flag = false;
|
||||||
boolean flag_t2p_mapping;
|
boolean flag_t2p_mapping;
|
||||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId,CommonString.TABLE_MAPPING_T2P_ADHOC);
|
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||||
}
|
} else {
|
||||||
else {
|
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P);
|
||||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId,CommonString.TABLE_MAPPING_T2P);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag_t2p_mapping) {
|
if (flag_t2p_mapping) {
|
||||||
@@ -423,8 +598,9 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(categoryId, storeType_id);
|
|
||||||
|
|
||||||
|
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(categoryId, storeType_id);
|
||||||
|
Log.e("questionlistsize", String.valueOf(question_list.size()));
|
||||||
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
AuditDataGetterSetter item = iterator.next(); // must be called before you can call iterator.remove()
|
AuditDataGetterSetter item = iterator.next(); // must be called before you can call iterator.remove()
|
||||||
@@ -432,11 +608,9 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
if (!item.getKEYACCOUNT_ID().equals("0") && !item.getKEYACCOUNT_ID().equals(keyAccount_id)) {
|
if (!item.getKEYACCOUNT_ID().equals("0") && !item.getKEYACCOUNT_ID().equals(keyAccount_id)) {
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
} else if (!item.getCHECK_TYPE().equals("NA") && item.getCHECK_TYPE().equals("T2P")) {
|
} else if (!item.getCHECK_TYPE().equals("NA") && item.getCHECK_TYPE().equals("T2P")) {
|
||||||
|
|
||||||
if (!t2p_flag) {
|
if (!t2p_flag) {
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -456,7 +630,6 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
// automatically handle clicks on the Home/Up button, so long
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
// as you specify a parent activity in AndroidManifest.xml.
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
if (id == android.R.id.home) {
|
if (id == android.R.id.home) {
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
@@ -537,85 +710,99 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
public void updateStatus() {
|
public void updateStatus() {
|
||||||
//Update Checkout Status
|
//Update Checkout Status
|
||||||
boolean flag_filled = false;
|
boolean flag_filled = false;
|
||||||
|
|
||||||
for (int i = 0; i < categoryList.size(); i++) {
|
for (int i = 0; i < categoryList.size(); i++) {
|
||||||
String category_id = categoryList.get(i).getCategory_id();
|
String category_id = categoryList.get(i).getCategory_id();
|
||||||
|
|
||||||
/* if (db.checkMsl_AvailabilityData(store_id, category_id)
|
|
||||||
&& db.checkStockAndFacingData(store_id, category_id)
|
|
||||||
&& db.checkPromoComplianceData(store_id, category_id)
|
|
||||||
&& db.isFilledT2P(store_id, category_id)
|
|
||||||
&& db.additionalVisibilitydata(store_id, category_id)) {
|
|
||||||
|
|
||||||
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
||||||
|
boolean flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADDITIONAL);
|
||||||
|
if (flag_mapping_stock) {
|
||||||
|
if (db.checkStockData(store_id, category_id,visit_date)) {
|
||||||
flag_filled = true;
|
flag_filled = true;
|
||||||
} else {
|
} else {
|
||||||
flag_filled = false;
|
flag_filled = false;
|
||||||
break;
|
break;
|
||||||
}*/
|
}
|
||||||
|
}
|
||||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)){
|
}
|
||||||
boolean flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADDITIONAL);
|
else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION) &&
|
||||||
|
country_id.equals("2") && visit_type_id.equals("3")){
|
||||||
if (flag_mapping_stock) {
|
db.open();
|
||||||
if (db.checkStockData(store_id, category_id)) {
|
if (db.additionalVisibilitydata(store_id, category_id)) {
|
||||||
flag_filled = true;
|
flag_filled = true;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
flag_filled = false;
|
flag_filled = false;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
if (db.additionalVisibilitydata(store_id, category_id)) {
|
if (db.additionalVisibilitydata(store_id, category_id)) {
|
||||||
//boolean flag = true;
|
|
||||||
|
|
||||||
/*if (db.isMappingStockDataMSL_Availability(category_id, keyAccount_id, storeType_id, class_id)) {
|
|
||||||
if (!db.checkMsl_AvailabilityData(store_id, category_id)) {
|
|
||||||
flag_filled = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Stock_Facing
|
|
||||||
if (db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id)) {
|
|
||||||
if (!db.checkStockAndFacingData(store_id, category_id)) {
|
|
||||||
flag_filled = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
boolean flag_mapping_stock;
|
boolean flag_mapping_stock;
|
||||||
//New MSL_Availability_StockFacing
|
//New MSL_Availability_StockFacing
|
||||||
if(country_id.equals("7")){
|
if (country_id.equals("7")||country_id.equals("8")) {
|
||||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id,
|
||||||
}
|
CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||||
else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||||
}
|
CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
else {
|
} else {
|
||||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK);
|
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK);
|
||||||
}
|
}
|
||||||
if (flag_mapping_stock) {
|
if (flag_mapping_stock) {
|
||||||
if (!db.checkMsl_Availability_StockFacingData(store_id, category_id)) {
|
if (!db.checkMsl_Availability_StockFacingDataNew(store_id, category_id,visit_date)) {
|
||||||
flag_filled = false;
|
flag_filled = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(country_id.equals("7")){
|
|
||||||
if(db.getPromoComplianceSkuwiseExistsAfterData(store_id, category_id).size()==0){
|
//New MSL_Availability_StockFacing
|
||||||
|
if (country_id.equals("10")||country_id.equals("8")) {
|
||||||
|
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||||
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
|
} else {
|
||||||
|
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK);
|
||||||
|
}
|
||||||
|
if (flag_mapping_stock) {
|
||||||
|
if (!db.checkMsl_Availability_StockFacingDataNew(store_id, category_id,visit_date)) {
|
||||||
flag_filled = false;
|
flag_filled = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
boolean isMappingPromotion_Flag;
|
//Stock_Entry
|
||||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
boolean flag_stock_mapping_stock;
|
||||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION_ADHOC);
|
if (country_id.equals("10")) {
|
||||||
|
flag_stock_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||||
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
flag_stock_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
|
} else {
|
||||||
|
flag_stock_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK);
|
||||||
}
|
}
|
||||||
else {
|
if (flag_stock_mapping_stock) {
|
||||||
|
if (!db.checkStock_Entry_FacingDataNew(store_id, category_id,visit_date)) {
|
||||||
|
flag_filled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (country_id.equals("7")) {
|
||||||
|
if (db.getPromoComplianceSkuwiseExistsAfterData(store_id, category_id).size() == 0) {
|
||||||
|
flag_filled = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
boolean isMappingPromotion_Flag;
|
||||||
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION_ADHOC);
|
||||||
|
} else {
|
||||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION);
|
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION);
|
||||||
}
|
}
|
||||||
if (isMappingPromotion_Flag) {
|
if (isMappingPromotion_Flag) {
|
||||||
@@ -627,40 +814,38 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean flag_t2p_mapping;
|
boolean flag_t2p_mapping;
|
||||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id,CommonString.TABLE_MAPPING_T2P_ADHOC);
|
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id, CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||||
}
|
} else {
|
||||||
else {
|
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id, CommonString.TABLE_MAPPING_T2P);
|
||||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id,CommonString.TABLE_MAPPING_T2P);
|
|
||||||
}
|
}
|
||||||
if (flag_t2p_mapping) {
|
if (flag_t2p_mapping) {
|
||||||
if (!db.isFilledT2P(store_id, category_id)) {
|
if (!db.isFilledT2P(store_id, category_id)) {
|
||||||
flag_filled = false;
|
flag_filled = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (camera_allow.equalsIgnoreCase("1")) {
|
if (camera_allow.equals("1")) {
|
||||||
//if (category_camera_list.size()>0) {
|
//if (category_camera_list.size()>0) {
|
||||||
if (!db.isCategoryPictureData(store_id, category_id)) {
|
if (!db.isCategoryPictureData(store_id, category_id)) {
|
||||||
flag_filled = false;
|
flag_filled = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
|
|
||||||
final ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(category_id,store_id,country_id);
|
final ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(category_id, store_id, country_id);
|
||||||
|
|
||||||
//if Sub Group Data exists for any Sub Category of the Category
|
//if Sub Group Data exists for any Sub Category of the Category
|
||||||
boolean isSubGroupDataExists = false;
|
boolean isSubGroupDataExists = false;
|
||||||
for(int j=0;j<sub_category_list.size();j++){
|
for (int j = 0; j < sub_category_list.size(); j++) {
|
||||||
if(db.getSkuGroupMasterData(category_id, sub_category_list.get(j).getSub_category_id()).size()>0){
|
if (db.getSkuGroupMasterData(category_id, sub_category_list.get(j).getSub_category_id()).size() > 0) {
|
||||||
isSubGroupDataExists = true;
|
isSubGroupDataExists = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isSubGroupDataExists){
|
if (isSubGroupDataExists) {
|
||||||
if (db.getNoCameraCategoryDataInserted(store_id, category_id, null).size() == 0) {
|
if (db.getNoCameraCategoryDataInserted(store_id, category_id, null).size() == 0) {
|
||||||
flag_filled = false;
|
flag_filled = false;
|
||||||
break;
|
break;
|
||||||
@@ -668,14 +853,20 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getAuditQnsRemoved(category_id).size()>0){
|
if (getAuditQnsRemoved(category_id).size() > 0) {
|
||||||
|
///Make non Mandate Audit KPI for EGIPT
|
||||||
if(db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).size() == 0){
|
/*if (!country_id.equals("6") && db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||||
|
flag_filled = false;
|
||||||
|
break;
|
||||||
|
}*/
|
||||||
|
//Make Mandate Audit KPI FOR EGYPT 17-01-2023 BY VIKAS
|
||||||
|
if (db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||||
flag_filled = false;
|
flag_filled = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//add UAE pharma No camera pog disable
|
//add UAE pharma No camera pog disable
|
||||||
|
|
||||||
/* if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
/* if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
||||||
@@ -684,8 +875,8 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
if (country_id.equals("2")){
|
if (country_id.equals("2")) {
|
||||||
if (camera_allow.equals("1")){
|
if (camera_allow.equals("1")) {
|
||||||
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
||||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||||
flag_filled = false;
|
flag_filled = false;
|
||||||
@@ -700,7 +891,7 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
}else {
|
} else {
|
||||||
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
||||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
||||||
flag_filled = false;
|
flag_filled = false;
|
||||||
@@ -710,8 +901,7 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Counterfeit Product Option - Egypt
|
//Counterfeit Product Option - Egypt
|
||||||
if(country_id.equals("6")){
|
if (country_id.equals("6")) {
|
||||||
|
|
||||||
if (db.getCounterfeitProductExistsAfterData(store_id, category_id).size() == 0) {
|
if (db.getCounterfeitProductExistsAfterData(store_id, category_id).size() == 0) {
|
||||||
flag_filled = false;
|
flag_filled = false;
|
||||||
break;
|
break;
|
||||||
@@ -719,27 +909,30 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
//usk
|
//usk
|
||||||
if(country_id.equals("6")&& category_id.equals("2")){
|
if (country_id.equals("6") && category_id.equals("2")) {
|
||||||
|
|
||||||
if (db.getCompetitionPromoExistsAfterData(store_id, category_id).size() == 0) {
|
if (db.getCompetitionPromoExistsAfterData(store_id, category_id).size() == 0) {
|
||||||
flag_filled = false;
|
flag_filled = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(country_id.equals("15")){
|
||||||
|
if (!db.checkOrder_taking_Data(store_id, category_id)) {
|
||||||
|
flag_filled = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
flag_filled = true;
|
flag_filled = true;
|
||||||
} else {
|
}
|
||||||
|
else{
|
||||||
flag_filled = false;
|
flag_filled = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag_filled) {
|
if (flag_filled) {
|
||||||
db.updateCheckoutStatus(store_id, CommonString.KEY_VALID, CommonString.KEY_JOURNEY_PLAN);
|
db.updateCheckoutStatus(store_id, CommonString.KEY_VALID, CommonString.KEY_JOURNEY_PLAN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+199
-152
@@ -7,6 +7,7 @@ import android.content.res.Configuration;
|
|||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
@@ -41,6 +42,7 @@ import cpm.com.gskmtorange.dailyentry.CompetitionPromoActivity;
|
|||||||
import cpm.com.gskmtorange.dailyentry.CounterfeitProductsActivity;
|
import cpm.com.gskmtorange.dailyentry.CounterfeitProductsActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.CreateSelfActivity;
|
import cpm.com.gskmtorange.dailyentry.CreateSelfActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.NewStockDataActivity;
|
import cpm.com.gskmtorange.dailyentry.NewStockDataActivity;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.OrderTakingActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.POGQuestionsActivity;
|
import cpm.com.gskmtorange.dailyentry.POGQuestionsActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.StockActivity;
|
import cpm.com.gskmtorange.dailyentry.StockActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.StockDataActivity;
|
import cpm.com.gskmtorange.dailyentry.StockDataActivity;
|
||||||
@@ -49,6 +51,7 @@ import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.DailyDataMenuGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.DailyDataMenuGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
||||||
|
|
||||||
public class DailyDataMenuActivity extends AppCompatActivity {
|
public class DailyDataMenuActivity extends AppCompatActivity {
|
||||||
RecyclerView recyclerView;
|
RecyclerView recyclerView;
|
||||||
@@ -56,33 +59,28 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
DailyDataMenuAdapter adapter;
|
DailyDataMenuAdapter adapter;
|
||||||
TextView txt_categoryName;
|
TextView txt_categoryName;
|
||||||
private Context context;
|
private Context context;
|
||||||
|
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
String categoryName = "", categoryId;
|
String categoryName = "", categoryId;
|
||||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, pog_type_id, store_flag_str;
|
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, pog_type_id, store_flag_str;
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
|
|
||||||
ArrayList<CategoryPictureGetterSetter> category_camera_list;
|
ArrayList<CategoryPictureGetterSetter> category_camera_list;
|
||||||
|
ArrayList<Visit_Type_Master_GetterSetter> visittypelist = new ArrayList<Visit_Type_Master_GetterSetter>();
|
||||||
|
String visit_type_id = "";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
try {
|
try {
|
||||||
setContentView(R.layout.activity_daily_data_menu);
|
setContentView(R.layout.activity_daily_data_menu);
|
||||||
|
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
|
||||||
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
||||||
//txt_categoryName = (TextView) findViewById(R.id.txt_categoryName);
|
//txt_categoryName = (TextView) findViewById(R.id.txt_categoryName);
|
||||||
|
|
||||||
db = new GSKOrangeDB(this);
|
db = new GSKOrangeDB(this);
|
||||||
db.open();
|
db.open();
|
||||||
context = this;
|
context = this;
|
||||||
//preference data
|
//preference data
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
date = preferences.getString(CommonString.KEY_DATE, null);
|
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
@@ -95,24 +93,22 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||||
pog_type_id = preferences.getString(CommonString.KEY_POG_TYPE_ID, "");
|
pog_type_id = preferences.getString(CommonString.KEY_POG_TYPE_ID, "");
|
||||||
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
||||||
|
if (preferences.getString(CommonString.KEY_VISIT_ID, "") != null) {
|
||||||
|
visit_type_id = preferences.getString(CommonString.KEY_VISIT_ID, "");
|
||||||
|
}
|
||||||
//Intent data
|
//Intent data
|
||||||
categoryName = getIntent().getStringExtra("categoryName");
|
categoryName = getIntent().getStringExtra("categoryName");
|
||||||
categoryId = getIntent().getStringExtra("categoryId");
|
categoryId = getIntent().getStringExtra("categoryId");
|
||||||
|
|
||||||
//txt_categoryName.setText(getResources().getString(R.string.title_activity_daily_main_menu) + " - " + categoryName);
|
|
||||||
toolbar.setTitle(getResources().getString(R.string.title_activity_daily_main_menu) + " - " + categoryName);
|
toolbar.setTitle(getResources().getString(R.string.title_activity_daily_main_menu) + " - " + categoryName);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
db.open();
|
||||||
|
visittypelist = db.getInsertedVisitType(store_id, visit_date, "3");
|
||||||
|
if (visittypelist.size() > 0) {
|
||||||
|
if (visittypelist.get(0).getVISIT_TYPE_ID().equals("3")) {
|
||||||
|
|
||||||
/*FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
|
||||||
fab.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
|
||||||
.setAction("Action", null).show();
|
|
||||||
}
|
}
|
||||||
});*/
|
}
|
||||||
} catch (Resources.NotFoundException e) {
|
} catch (Resources.NotFoundException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -121,20 +117,16 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
categoryList = new ArrayList<>();
|
categoryList = new ArrayList<>();
|
||||||
|
|
||||||
DailyDataMenuGetterSetter data = new DailyDataMenuGetterSetter();
|
DailyDataMenuGetterSetter data = new DailyDataMenuGetterSetter();
|
||||||
|
|
||||||
//For Additional Stores in Egypt(6) Only Stock Data will be captured
|
//For Additional Stores in Egypt(6) Only Stock Data will be captured
|
||||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)){
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
data.setCategory_name(getResources().getString(R.string.stock));
|
data.setCategory_name(getResources().getString(R.string.stock));
|
||||||
if (isMappingStockData()) {
|
if (isMappingStockData()) {
|
||||||
if (db.checkStockData(store_id, categoryId)) {
|
if (db.checkStockData(store_id, categoryId, visit_date)) {
|
||||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||||
} else {
|
} else {
|
||||||
data.setCategory_img(R.mipmap.msl_availability);
|
data.setCategory_img(R.mipmap.msl_availability);
|
||||||
@@ -143,13 +135,21 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
data.setCategory_img(R.mipmap.msl_availability_grey);
|
data.setCategory_img(R.mipmap.msl_availability_grey);
|
||||||
}
|
}
|
||||||
categoryList.add(data);
|
categoryList.add(data);
|
||||||
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION) && country_id.equals("2") && visit_type_id.equals("3")) {
|
||||||
|
data = new DailyDataMenuGetterSetter();
|
||||||
|
data.setCategory_name(getResources().getString(R.string.daily_data_menu_additional_visibility));
|
||||||
|
if (db.additionalVisibilitydata(store_id, categoryId)) {
|
||||||
|
data.setCategory_img(R.mipmap.additional_visibility_done);
|
||||||
|
} else {
|
||||||
|
data.setCategory_img(R.mipmap.additional_visibility);
|
||||||
}
|
}
|
||||||
else {
|
categoryList.add(data);
|
||||||
if (country_id.equals(CommonString.COUNTRY_ID_EGYPT+"") && categoryId.equals("3")) {
|
} else {
|
||||||
|
if (country_id.equals(CommonString.COUNTRY_ID_EGYPT + "") && categoryId.equals("3")) {
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_stock_facing));
|
data.setCategory_name(getResources().getString(R.string.daily_data_menu_stock_facing));
|
||||||
if (isMappingStockData()) {
|
if (isMappingStockData()) {
|
||||||
if (db.checkMsl_Availability_StockFacingData(store_id, categoryId)) {
|
if (db.checkMsl_Availability_StockFacingDataNew(store_id, categoryId, visit_date)) {
|
||||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||||
} else {
|
} else {
|
||||||
data.setCategory_img(R.mipmap.msl_availability);
|
data.setCategory_img(R.mipmap.msl_availability);
|
||||||
@@ -162,7 +162,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_msl_availability));
|
data.setCategory_name(getResources().getString(R.string.daily_data_menu_msl_availability));
|
||||||
if (isMappingStockData()) {
|
if (isMappingStockData()) {
|
||||||
if (db.checkMsl_Availability_StockFacingData(store_id, categoryId)) {
|
if (db.checkMsl_Availability_StockFacingDataNew(store_id, categoryId, visit_date)) {
|
||||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||||
} else {
|
} else {
|
||||||
data.setCategory_img(R.mipmap.msl_availability);
|
data.setCategory_img(R.mipmap.msl_availability);
|
||||||
@@ -174,38 +174,11 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*data.setCategory_name(getResources().getString(R.string.daily_data_menu_msl_availability));
|
|
||||||
if (db.isMappingStockDataMSL_Availability(categoryId, keyAccount_id, storeType_id, class_id)) {
|
|
||||||
if (db.checkMsl_AvailabilityData(store_id, categoryId)) {
|
|
||||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
|
||||||
} else {
|
|
||||||
data.setCategory_img(R.mipmap.msl_availability);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
data.setCategory_img(R.mipmap.msl_availability_grey);
|
|
||||||
}
|
|
||||||
categoryList.add(data);
|
|
||||||
|
|
||||||
|
|
||||||
data = new DailyDataMenuGetterSetter();
|
|
||||||
//data.setCategory_name("Stock & Facing");
|
|
||||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_stock_facing));
|
|
||||||
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
|
||||||
if (db.checkStockAndFacingData(store_id, categoryId)) {
|
|
||||||
data.setCategory_img(R.mipmap.stock_facing_done);
|
|
||||||
} else {
|
|
||||||
data.setCategory_img(R.mipmap.stock_facing);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
data.setCategory_img(R.mipmap.stockandfacing_grey);
|
|
||||||
}
|
|
||||||
categoryList.add(data);*/
|
|
||||||
|
|
||||||
//T2p and kenya POSm
|
//T2p and kenya POSm
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
if (country_id.equals("8")){
|
if (country_id.equals("8") || country_id.equals("17")) {
|
||||||
data.setCategory_name(getResources().getString(R.string.title_posm));
|
data.setCategory_name(getResources().getString(R.string.title_posm));
|
||||||
}else {
|
} else {
|
||||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_t2p));
|
data.setCategory_name(getResources().getString(R.string.daily_data_menu_t2p));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,7 +203,13 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
//T2p added
|
//T2p added
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
|
if(country_id.equals("17")){
|
||||||
|
data.setCategory_name(getResources().getString(R.string.title_posm) +"/"+getResources().getString(R.string.daily_data_menu_additional_visibility));
|
||||||
|
}
|
||||||
|
else{
|
||||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_additional_visibility));
|
data.setCategory_name(getResources().getString(R.string.daily_data_menu_additional_visibility));
|
||||||
|
}
|
||||||
|
// data.setCategory_name(getResources().getString(R.string.daily_data_menu_additional_visibility));
|
||||||
if (db.additionalVisibilitydata(store_id, categoryId)) {
|
if (db.additionalVisibilitydata(store_id, categoryId)) {
|
||||||
data.setCategory_img(R.mipmap.additional_visibility_done);
|
data.setCategory_img(R.mipmap.additional_visibility_done);
|
||||||
} else {
|
} else {
|
||||||
@@ -238,7 +217,6 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
categoryList.add(data);
|
categoryList.add(data);
|
||||||
|
|
||||||
|
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_promo_compliance));
|
data.setCategory_name(getResources().getString(R.string.daily_data_menu_promo_compliance));
|
||||||
if (country_id.equals("7")) {
|
if (country_id.equals("7")) {
|
||||||
@@ -263,8 +241,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isMappingPromotion_Flag || isMappingAdditionalPromotion_Flag) {
|
if (isMappingPromotion_Flag || isMappingAdditionalPromotion_Flag) {
|
||||||
if (db.checkPromoComplianceData(store_id, categoryId) ||
|
if (db.checkPromoComplianceData(store_id, categoryId) || db.checkAdditionalPromoComplianceData(store_id, categoryId)) {
|
||||||
db.checkAdditionalPromoComplianceData(store_id, categoryId)) {
|
|
||||||
data.setCategory_img(R.mipmap.promo_compliance_done);
|
data.setCategory_img(R.mipmap.promo_compliance_done);
|
||||||
} else {
|
} else {
|
||||||
data.setCategory_img(R.mipmap.promo_compliance);
|
data.setCategory_img(R.mipmap.promo_compliance);
|
||||||
@@ -273,7 +250,6 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
data.setCategory_img(R.mipmap.promocompliance_grey);
|
data.setCategory_img(R.mipmap.promocompliance_grey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
categoryList.add(data);
|
categoryList.add(data);
|
||||||
|
|
||||||
//Category Pictures
|
//Category Pictures
|
||||||
@@ -290,8 +266,11 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
} /*else {
|
} /*else {
|
||||||
data.setCategory_img(R.mipmap.picturecatogory_grey);
|
data.setCategory_img(R.mipmap.picturecatogory_grey);
|
||||||
}*/
|
}*/
|
||||||
|
}
|
||||||
} else {
|
else if(country_id!=null && country_id.equals("17") && camera_allow.equalsIgnoreCase("0")){
|
||||||
|
data.setCategory_img(R.mipmap.picturecatogory_grey);
|
||||||
|
}
|
||||||
|
else {
|
||||||
if (db.getNoCameraCategoryDataInserted(store_id, categoryId, null).size() > 0) {
|
if (db.getNoCameraCategoryDataInserted(store_id, categoryId, null).size() > 0) {
|
||||||
data.setCategory_img(R.mipmap.picturecatogory_done);
|
data.setCategory_img(R.mipmap.picturecatogory_done);
|
||||||
} else {
|
} else {
|
||||||
@@ -301,6 +280,37 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
categoryList.add(data);
|
categoryList.add(data);
|
||||||
|
|
||||||
|
//Order Taking
|
||||||
|
data = new DailyDataMenuGetterSetter();
|
||||||
|
// ArrayList<AuditDataGetterSetter> question_list;
|
||||||
|
data.setCategory_img(R.mipmap.msl_availability);
|
||||||
|
if (country_id.equals("15") || (country_id.equals("17") && categoryId.equals("2"))) {
|
||||||
|
if (isMappingStockData()) {
|
||||||
|
if (db.checkOrder_taking_Data(store_id, categoryId)) {
|
||||||
|
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||||
|
} else {
|
||||||
|
data.setCategory_img(R.mipmap.msl_availability);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
data.setCategory_img(R.mipmap.msl_availability_grey);
|
||||||
|
}
|
||||||
|
data.setCategory_name(getString(R.string.order_taking));
|
||||||
|
categoryList.add(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Order Confirm
|
||||||
|
data = new DailyDataMenuGetterSetter();
|
||||||
|
// ArrayList<AuditDataGetterSetter> question_list;
|
||||||
|
if (country_id.equals("15") ) {
|
||||||
|
if (db.checkOrder_Received_Data(store_id, categoryId)) {
|
||||||
|
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||||
|
} else {
|
||||||
|
data.setCategory_img(R.mipmap.msl_availability);
|
||||||
|
}
|
||||||
|
data.setCategory_name(getString(R.string.order_confirm));
|
||||||
|
categoryList.add(data);
|
||||||
|
}
|
||||||
|
|
||||||
//Audit
|
//Audit
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
|
|
||||||
@@ -335,8 +345,8 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
}*/
|
}*/
|
||||||
//new add UAE Pharma
|
//new add UAE Pharma
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
if (country_id.equals("2")){
|
if (country_id.equals("2")) {
|
||||||
if (camera_allow.equals("1")){
|
if (camera_allow.equals("1")) {
|
||||||
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
||||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, categoryId).size() > 0) {
|
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, categoryId).size() > 0) {
|
||||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||||
@@ -347,10 +357,10 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
data.setCategory_img(R.mipmap.msl_availability_grey);
|
data.setCategory_img(R.mipmap.msl_availability_grey);
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
data.setCategory_img(R.mipmap.msl_availability_grey);
|
data.setCategory_img(R.mipmap.msl_availability_grey);
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
||||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, categoryId).size() > 0) {
|
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, categoryId).size() > 0) {
|
||||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||||
@@ -365,8 +375,24 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
data.setCategory_name(getString(R.string.pog));
|
data.setCategory_name(getString(R.string.pog));
|
||||||
categoryList.add(data);
|
categoryList.add(data);
|
||||||
|
|
||||||
|
//Warehouse Stock - Jordan
|
||||||
|
if (country_id.equals("10")) {
|
||||||
|
data = new DailyDataMenuGetterSetter();
|
||||||
|
data.setCategory_name(getResources().getString(R.string.stock_entry));
|
||||||
|
if (isMappingStockData()) {
|
||||||
|
if (db.checkStock_Entry_FacingDataNew(store_id, categoryId, visit_date)) {
|
||||||
|
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||||
|
} else {
|
||||||
|
data.setCategory_img(R.mipmap.msl_availability);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
data.setCategory_img(R.mipmap.msl_availability_grey);
|
||||||
|
}
|
||||||
|
categoryList.add(data);
|
||||||
|
}
|
||||||
|
|
||||||
//Counterfeit Product Option - Egypt
|
//Counterfeit Product Option - Egypt
|
||||||
if(country_id.equals("6")){
|
if (country_id.equals("6")) {
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
|
|
||||||
if (db.getCounterfeitProductExistsAfterData(store_id, categoryId).size() > 0) {
|
if (db.getCounterfeitProductExistsAfterData(store_id, categoryId).size() > 0) {
|
||||||
@@ -381,8 +407,8 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
//usk
|
//usk
|
||||||
//Cometition promo Option - Egypt
|
//Cometition promo Option - Egypt
|
||||||
if (categoryId.equals("2")){
|
if (categoryId.equals("2")) {
|
||||||
if(country_id.equals("6")){
|
if (country_id.equals("6")) {
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
|
|
||||||
if (db.getCompetitionPromoExistsAfterData(store_id, categoryId).size() > 0) {
|
if (db.getCompetitionPromoExistsAfterData(store_id, categoryId).size() > 0) {
|
||||||
@@ -397,6 +423,26 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//IR Images
|
||||||
|
data = new DailyDataMenuGetterSetter();
|
||||||
|
data.setCategory_name(getResources().getString(R.string.title_activity_ir_image));
|
||||||
|
//category_camera_list = db.getCategoryPicturedata(categoryId, keyAccount_id, storeType_id, class_id);
|
||||||
|
Log.e("catiddata",categoryId);
|
||||||
|
if (camera_allow.equalsIgnoreCase("1") && country_id.equals("8")) {
|
||||||
|
// Log.d("servicestatus", String.valueOf(!SessionService.isServiceRunning));
|
||||||
|
/*if(db.isSosData(store_id,visit_date,CommonString.KEY_COMPELETE)){
|
||||||
|
data.setCategory_img(R.mipmap.picturecatogory_done);
|
||||||
|
editor = preferences.edit();
|
||||||
|
editor.putString("Service_StoreValue","");
|
||||||
|
editor.commit();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
data.setCategory_img(R.mipmap.picturecatogory);
|
||||||
|
}*/
|
||||||
|
data.setCategory_img(R.mipmap.picturecatogory);
|
||||||
|
categoryList.add(data);
|
||||||
|
}
|
||||||
|
|
||||||
//Stock Pricing Option - Turkey
|
//Stock Pricing Option - Turkey
|
||||||
/*if(country_id.equals("4")){
|
/*if(country_id.equals("4")){
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
@@ -463,7 +509,6 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<AuditDataGetterSetter> getAuditQnsRemoved() {
|
ArrayList<AuditDataGetterSetter> getAuditQnsRemoved() {
|
||||||
|
|
||||||
boolean t2p_flag = false;
|
boolean t2p_flag = false;
|
||||||
boolean flag_t2p_mapping;
|
boolean flag_t2p_mapping;
|
||||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
@@ -499,6 +544,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(categoryId, storeType_id);
|
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(categoryId, storeType_id);
|
||||||
|
Log.e("catid", categoryId + "," + storeType_id + "," + question_list.size());
|
||||||
|
|
||||||
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
@@ -507,14 +553,12 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
if (!item.getKEYACCOUNT_ID().equals("0") && !item.getKEYACCOUNT_ID().equals(keyAccount_id)) {
|
if (!item.getKEYACCOUNT_ID().equals("0") && !item.getKEYACCOUNT_ID().equals(keyAccount_id)) {
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
} else if (!item.getCHECK_TYPE().equals("NA") && item.getCHECK_TYPE().equals("T2P")) {
|
} else if (!item.getCHECK_TYPE().equals("NA") && item.getCHECK_TYPE().equals("T2P")) {
|
||||||
|
|
||||||
if (!t2p_flag) {
|
if (!t2p_flag) {
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Log.e("questionlistsize", String.valueOf(question_list));
|
||||||
return question_list;
|
return question_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -543,23 +587,13 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
holder.categoryName.setText(dailyData.getCategory_name());
|
holder.categoryName.setText(dailyData.getCategory_name());
|
||||||
holder.categoryIcon.setImageResource(dailyData.getCategory_img());
|
holder.categoryIcon.setImageResource(dailyData.getCategory_img());
|
||||||
|
|
||||||
/*if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
|
||||||
if (db.isMappingStockDataMSL_Availability(categoryId, keyAccount_id, storeType_id, class_id)) {
|
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
|
||||||
} else {
|
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
|
||||||
}
|
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_stock_facing))) {
|
|
||||||
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
|
||||||
} else {
|
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
|
||||||
}
|
|
||||||
} else*/
|
|
||||||
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
|
||||||
|
|
||||||
|
db.open();
|
||||||
|
visittypelist = db.getInsertedVisitType(store_id, visit_date, "3");
|
||||||
|
// if(visittypelist.get(0).getVISIT_TYPE_ID().equals())
|
||||||
|
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
||||||
if (country_id.equals("7")) {
|
if (country_id.equals("7")) {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||||
} else {
|
} else {
|
||||||
boolean isMappingPromotion_Flag;
|
boolean isMappingPromotion_Flag;
|
||||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
@@ -576,12 +610,12 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isMappingPromotion_Flag || isMappingAdditionalPromotion_Flag) {
|
if (isMappingPromotion_Flag || isMappingAdditionalPromotion_Flag) {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||||
} else {
|
} else {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_t2p)))||dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.title_posm)))) {
|
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_t2p))) || dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.title_posm)))) {
|
||||||
|
|
||||||
boolean t2p_flag = false;
|
boolean t2p_flag = false;
|
||||||
boolean flag_t2p_mapping;
|
boolean flag_t2p_mapping;
|
||||||
@@ -592,85 +626,80 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flag_t2p_mapping) {
|
if (flag_t2p_mapping) {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||||
} else {
|
} else {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||||
}
|
}
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_category_picture)))) {
|
}
|
||||||
|
else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_category_picture)))) {
|
||||||
if (camera_allow.equalsIgnoreCase("1")) {
|
if (camera_allow.equalsIgnoreCase("1")) {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||||
} /*else {
|
}
|
||||||
|
else if(country_id.equals("17") && !camera_allow.equalsIgnoreCase("1")){
|
||||||
|
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||||
|
}
|
||||||
|
/*else {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||||
}*/
|
}*/
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
||||||
if (isMappingStockData()) {
|
if (isMappingStockData()) {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||||
} else {
|
} else {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||||
}
|
}
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_stock_facing))
|
}
|
||||||
|| dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.stock))) {
|
else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.stock_entry))) {
|
||||||
if (isMappingStockData()) {
|
if (isMappingStockData()) {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
} else {
|
||||||
|
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_stock_facing)) || dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.stock))) {
|
||||||
|
if (isMappingStockData()) {
|
||||||
|
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||||
} else {
|
} else {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||||
}
|
}
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.audit))) {
|
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.audit))) {
|
||||||
if (getAuditQnsRemoved().size() > 0) {
|
if (getAuditQnsRemoved().size() > 0) {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||||
} else {
|
} else {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.pog))) {
|
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.pog))) {
|
||||||
//new add UAE pharma
|
//new add UAE pharma
|
||||||
|
|
||||||
/*if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
/*if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||||
} else {
|
} else {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||||
}*/
|
}*/
|
||||||
if (country_id.equals("2")){
|
|
||||||
if (camera_allow.equals("1")){
|
|
||||||
|
if (country_id.equals("2")) {
|
||||||
|
if (camera_allow.equals("1")) {
|
||||||
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||||
} else {
|
} else {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||||
} else {
|
} else {
|
||||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
holder.lay_menu.setOnClickListener(new View.OnClickListener() {
|
holder.lay_menu.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
/*if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
|
||||||
if (db.isMappingStockDataMSL_Availability(categoryId, keyAccount_id, storeType_id, class_id)) {
|
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, MSL_AvailabilityActivity.class);
|
|
||||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
|
||||||
intent.putExtra("categoryId", categoryId);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_stock_facing))) {
|
|
||||||
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, Stock_FacingActivity.class);
|
|
||||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
|
||||||
intent.putExtra("categoryId", categoryId);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else */
|
|
||||||
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
||||||
if (country_id.equals("7")) {
|
if (country_id.equals("7")) {
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, AdditionalPromoSKUwiseActivity.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, AdditionalPromoSKUwiseActivity.class);
|
||||||
@@ -700,8 +729,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_t2p))) || dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.title_posm)))) {
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_t2p)))||dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.title_posm)))) {
|
|
||||||
boolean t2p_flag = false;
|
boolean t2p_flag = false;
|
||||||
boolean flag_t2p_mapping;
|
boolean flag_t2p_mapping;
|
||||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
@@ -716,30 +744,48 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
}
|
}
|
||||||
|
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.title_activity_Additional_visibility))) ||
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.title_activity_Additional_visibility)))) {
|
dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.title_posm) +"/"+getResources().getString(R.string.daily_data_menu_additional_visibility)))) {
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, AdditionalVisibility.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, AdditionalVisibility.class);
|
||||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||||
intent.putExtra("categoryId", categoryId);
|
intent.putExtra("categoryId", categoryId);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
}
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_category_picture)))) {
|
else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_category_picture)))) {
|
||||||
if (camera_allow.equalsIgnoreCase("1")) {
|
if (camera_allow.equalsIgnoreCase("1")) {
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, CategoryPicture.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, CategoryPicture.class);
|
||||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||||
intent.putExtra("categoryId", categoryId);
|
intent.putExtra("categoryId", categoryId);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
} else {
|
} else if(country_id!=null && !country_id.equals("17")) {
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, CreateSelfActivity.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, CreateSelfActivity.class);
|
||||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||||
intent.putExtra("categoryId", categoryId);
|
intent.putExtra("categoryId", categoryId);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.order_taking))) {
|
||||||
|
if (isMappingStockData()) {
|
||||||
|
Intent intent = new Intent(DailyDataMenuActivity.this, OrderTakingActivity.class);
|
||||||
|
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||||
|
intent.putExtra("categoryId", categoryId);
|
||||||
|
startActivity(intent);
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
}
|
||||||
|
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.order_confirm))) {
|
||||||
|
if (isMappingStockData()) {
|
||||||
|
Intent intent = new Intent(DailyDataMenuActivity.this, OrderConfirmActivity.class);
|
||||||
|
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||||
|
intent.putExtra("categoryId", categoryId);
|
||||||
|
startActivity(intent);
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
||||||
if (isMappingStockData()) {
|
if (isMappingStockData()) {
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, MSL_Availability_StockFacingActivity.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, MSL_Availability_StockFacingActivity.class);
|
||||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||||
@@ -747,8 +793,18 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.stock_entry))) {
|
||||||
|
if (isMappingStockData()) {
|
||||||
|
Intent intent = new Intent(DailyDataMenuActivity.this, StockEntryActivity.class);
|
||||||
|
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||||
|
intent.putExtra("categoryId", categoryId);
|
||||||
|
startActivity(intent);
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_stock_facing))) {
|
else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_stock_facing))) {
|
||||||
if (isMappingStockData()) {
|
if (isMappingStockData()) {
|
||||||
// Intent intent = new Intent(DailyDataMenuActivity.this, StockDataActivity.class);
|
// Intent intent = new Intent(DailyDataMenuActivity.this, StockDataActivity.class);
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, NewStockDataActivity.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, NewStockDataActivity.class);
|
||||||
@@ -760,7 +816,6 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.audit))) {
|
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.audit))) {
|
||||||
//if (db.getAuditCategoryWise(categoryId, storeType_id).size()>0) {
|
//if (db.getAuditCategoryWise(categoryId, storeType_id).size()>0) {
|
||||||
|
|
||||||
if (getAuditQnsRemoved().size() > 0) {
|
if (getAuditQnsRemoved().size() > 0) {
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, AuditActivity.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, AuditActivity.class);
|
||||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||||
@@ -772,8 +827,8 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.pog))) {
|
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.pog))) {
|
||||||
|
|
||||||
//add uae pharma
|
//add uae pharma
|
||||||
if (country_id.equals("2")){
|
if (country_id.equals("2")) {
|
||||||
if (camera_allow.equals("1")){
|
if (camera_allow.equals("1")) {
|
||||||
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, POGQuestionsActivity.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, POGQuestionsActivity.class);
|
||||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||||
@@ -783,7 +838,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, POGQuestionsActivity.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, POGQuestionsActivity.class);
|
||||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||||
@@ -800,7 +855,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
intent.putExtra("categoryId", categoryId);
|
intent.putExtra("categoryId", categoryId);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
}else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.stock))) {
|
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.stock))) {
|
||||||
if (isMappingStockData()) {
|
if (isMappingStockData()) {
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, StockActivity.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, StockActivity.class);
|
||||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||||
@@ -809,10 +864,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.title_activity_stock_pricing))) {
|
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.title_activity_stock_pricing))) {
|
||||||
/*if (isMappingStockData()) {
|
|
||||||
|
|
||||||
}*/
|
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, StockPricingActivity.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, StockPricingActivity.class);
|
||||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||||
intent.putExtra("categoryId", categoryId);
|
intent.putExtra("categoryId", categoryId);
|
||||||
@@ -825,11 +877,9 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -853,19 +903,16 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
boolean isMappingStockData() {
|
boolean isMappingStockData() {
|
||||||
boolean flag;
|
boolean flag;
|
||||||
if (country_id.equals("7")||country_id.equals("8")) {
|
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||||
flag = db.isMappingStockDataStockFacing(categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
flag = db.isMappingStockDataStockFacing(categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
flag = db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
flag = db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
} else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)){
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
||||||
flag = db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADDITIONAL);
|
flag = db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADDITIONAL);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
flag = db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK);
|
flag = db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -300,7 +300,8 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
|||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
//super.onBackPressed();
|
//super.onBackPressed();
|
||||||
|
|
||||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(MSL_AvailabilityActivity.this);
|
super.onBackPressed();
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(MSL_AvailabilityActivity.this);
|
||||||
builder.setTitle(getResources().getString(R.string.dialog_title));
|
builder.setTitle(getResources().getString(R.string.dialog_title));
|
||||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||||
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
@@ -314,7 +315,7 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
android.app.AlertDialog alert = builder.create();
|
AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+193
-405
File diff suppressed because it is too large
Load Diff
+188
@@ -0,0 +1,188 @@
|
|||||||
|
package cpm.com.gskmtorange.gsk_dailyentry;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.cardview.widget.CardView;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.OrderReceivedStatus;
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
||||||
|
|
||||||
|
public class OrderConfirmActivity extends AppCompatActivity {
|
||||||
|
RecyclerView recyclerview;
|
||||||
|
GSKOrangeDB db;
|
||||||
|
String visit_date, username, intime;
|
||||||
|
private SharedPreferences preferences;
|
||||||
|
JourneyPlanGetterSetter jcpGetset;
|
||||||
|
Recycler_view_adapter adapter;
|
||||||
|
ArrayList<OrderReceivedStatus> inserteslistData;
|
||||||
|
private Dialog dialog;
|
||||||
|
private boolean ResultFlag;
|
||||||
|
Context context;
|
||||||
|
LinearLayout poLL;
|
||||||
|
TextView sys_gen_poTV;
|
||||||
|
String storeid;
|
||||||
|
String categoryName="",categoryId="";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_order_confirm);
|
||||||
|
context = this;
|
||||||
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
//toolbar.setTitle("Order Status" + "-"+"PO List");
|
||||||
|
toolbar.setTitle(context.getString(R.string.order_status_polist));
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
declaration();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void declaration() {
|
||||||
|
recyclerview = (RecyclerView) findViewById(R.id.recyclerview);
|
||||||
|
db = new GSKOrangeDB(this);
|
||||||
|
db.open();
|
||||||
|
|
||||||
|
//Intent data
|
||||||
|
categoryName = getIntent().getStringExtra("categoryName");
|
||||||
|
categoryId = getIntent().getStringExtra("categoryId");
|
||||||
|
|
||||||
|
storeid = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||||
|
setDataToListView();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setDataToListView() {
|
||||||
|
try {
|
||||||
|
db.open();
|
||||||
|
inserteslistData=db.getOrderstatusData(storeid,categoryId);
|
||||||
|
if(inserteslistData.size()>0){
|
||||||
|
adapter = new Recycler_view_adapter(context, inserteslistData);
|
||||||
|
recyclerview.setAdapter(adapter);
|
||||||
|
recyclerview.setLayoutManager(new LinearLayoutManager(context));
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Recycler_view_adapter extends RecyclerView.Adapter<Recycler_view_adapter.Viewholder>{
|
||||||
|
ArrayList<OrderReceivedStatus> orderReceivedStatuses;
|
||||||
|
Context context;
|
||||||
|
public Recycler_view_adapter(Context context, ArrayList<OrderReceivedStatus> list) {
|
||||||
|
this.context = context;
|
||||||
|
this.orderReceivedStatuses = list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Recycler_view_adapter.Viewholder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
|
||||||
|
View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.order_status_item_layout,viewGroup,false);
|
||||||
|
return new Viewholder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull final Recycler_view_adapter.Viewholder viewholder, final int pos) {
|
||||||
|
final OrderReceivedStatus current = orderReceivedStatuses.get(pos);
|
||||||
|
viewholder.sys_gen_poTV.setText(current.getSys_gen_po());
|
||||||
|
viewholder.podateTV.setText(current.getPodate());
|
||||||
|
viewholder.storepoTV.setText(current.getStorepo());
|
||||||
|
|
||||||
|
viewholder.lineItemTV.setText( ""+current.getORDERQTY());
|
||||||
|
if(current.getStatus().equalsIgnoreCase("CONFIRMED")){
|
||||||
|
viewholder.statusTV.setText(context.getString(R.string.confirmed));
|
||||||
|
}
|
||||||
|
else if(current.getStatus().equalsIgnoreCase("CONFIRM")){
|
||||||
|
viewholder.statusTV.setText(context.getString(R.string.confirmed));
|
||||||
|
}
|
||||||
|
else if(current.getStatus().equalsIgnoreCase("NOT CONFIRMED")){
|
||||||
|
viewholder.statusTV.setText(context.getString(R.string.not_confirmed));
|
||||||
|
}
|
||||||
|
else if(current.getStatus().equalsIgnoreCase("PENDING")){
|
||||||
|
viewholder.statusTV.setText(context.getString(R.string.pending));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
viewholder.statusTV.setText(current.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
viewholder.cardview.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
startActivity(new Intent(OrderConfirmActivity.this,OrderStatusDetailActivity.class).putExtra("categoryId",String.valueOf(current.getCATEGORY_ID()))
|
||||||
|
.putExtra("SYS_PO_NUM",current.getSys_gen_po())
|
||||||
|
.putExtra("PO_NUM",current.getStorepo())
|
||||||
|
.putExtra("PO_DATE",current.getPodate())
|
||||||
|
.putExtra("POID",String.valueOf(current.getPOID()))
|
||||||
|
.putExtra("LINE",String.valueOf(current.getORDERQTY())));
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return orderReceivedStatuses.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Viewholder extends RecyclerView.ViewHolder {
|
||||||
|
TextView sys_gen_poTV,storepoTV,podateTV,lineItemTV,statusTV;
|
||||||
|
CardView cardview;
|
||||||
|
LinearLayout storepoLL;
|
||||||
|
public Viewholder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
cardview= (CardView) itemView.findViewById(R.id.cardview);
|
||||||
|
storepoLL= itemView.findViewById(R.id.storepoLL);
|
||||||
|
sys_gen_poTV= itemView.findViewById(R.id.sys_gen_poTV);
|
||||||
|
storepoTV= itemView.findViewById(R.id.storepoTV);
|
||||||
|
podateTV= itemView.findViewById(R.id.podateTV);
|
||||||
|
lineItemTV= itemView.findViewById(R.id.lineItemTV);
|
||||||
|
statusTV= itemView.findViewById(R.id.statusTV);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
|
//return super.onOptionsItemSelected(item);
|
||||||
|
int id = item.getItemId();
|
||||||
|
if (id == android.R.id.home) {
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
// super.onBackPressed();
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
+970
@@ -0,0 +1,970 @@
|
|||||||
|
package cpm.com.gskmtorange.gsk_dailyentry;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.cardview.widget.CardView;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.graphics.Typeface;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.text.InputFilter;
|
||||||
|
import android.text.Spanned;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
import android.widget.AbsListView;
|
||||||
|
import android.widget.BaseExpandableListAdapter;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ExpandableListView;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.RadioButton;
|
||||||
|
import android.widget.RadioGroup;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
import android.widget.ToggleButton;
|
||||||
|
|
||||||
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
|
|
||||||
|
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.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.OrderTakingActivity;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
|
||||||
|
|
||||||
|
public class OrderStatusDetailActivity extends AppCompatActivity{
|
||||||
|
ExpandableListView expandableListView;
|
||||||
|
private Context context;
|
||||||
|
TextView txt_mslAvailabilityName;
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> headerDataList;
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> childDataList;
|
||||||
|
List<MSL_AvailabilityStockFacingGetterSetter> hashMapListHeaderData;
|
||||||
|
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> hashMapListChildData;
|
||||||
|
List<Integer> checkHeaderArray = new ArrayList<>();
|
||||||
|
boolean checkflag = true; ExpandableListAdapter adapter;
|
||||||
|
ImageView camera1, camera2, camera3, camera4;
|
||||||
|
LinearLayout lin_camera1, lin_camera2, lin_camera3, lin_camera4;
|
||||||
|
GSKOrangeDB db;
|
||||||
|
String categoryName, categoryId, storeId, Error_Message = "";
|
||||||
|
String store_id, store_flag_hide, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str;
|
||||||
|
boolean isDialogOpen = true;
|
||||||
|
private SharedPreferences preferences;
|
||||||
|
int scrollPosition = 0;
|
||||||
|
|
||||||
|
String str_planogram = "", _pathforcheck = "";
|
||||||
|
EditText storepoET,podateET;
|
||||||
|
|
||||||
|
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> planogramShelfHeaderDataList = new ArrayList<>();
|
||||||
|
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> planogramSkuChildDataList;
|
||||||
|
HashMap<StockFacing_PlanogramTrackerDataGetterSetter, ArrayList<StockFacing_PlanogramTrackerDataGetterSetter>> planogramHashMapListChildData = new HashMap<>();
|
||||||
|
boolean editFlag = false;
|
||||||
|
//temp
|
||||||
|
public static final String FILE_PATH = Environment.getExternalStorageDirectory() + "/";
|
||||||
|
//ImageView bmImage;
|
||||||
|
RelativeLayout view;
|
||||||
|
RadioButton radio_yes,radio_no;
|
||||||
|
RadioGroup radio_group;
|
||||||
|
String isExist="";
|
||||||
|
String sys_po_number="";
|
||||||
|
TextView sys_gen_poTV,lineitemTV;
|
||||||
|
LinearLayout poLL;
|
||||||
|
String storepo ="";
|
||||||
|
TextView storepoTV,podateTV;
|
||||||
|
String SYS_PO_NUM,PO_NUM,PO_DATE,LINE,POID;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
context = this;
|
||||||
|
try {
|
||||||
|
setContentView(R.layout.activity_order_status_detail);
|
||||||
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
expandableListView = (ExpandableListView) findViewById(R.id.expandableListView);
|
||||||
|
txt_mslAvailabilityName = (TextView) findViewById(R.id.txt_mslAvailabilityName);
|
||||||
|
camera1 = (ImageView) findViewById(R.id.img_camera1);
|
||||||
|
camera2 = (ImageView) findViewById(R.id.img_camera2);
|
||||||
|
camera3 = (ImageView) findViewById(R.id.img_camera3);
|
||||||
|
camera4 = (ImageView) findViewById(R.id.img_camera4);
|
||||||
|
storepoTV = findViewById(R.id.storepoTV);
|
||||||
|
lineitemTV = findViewById(R.id.lineitemTV);
|
||||||
|
podateTV = findViewById(R.id.podateTV);
|
||||||
|
poLL = findViewById(R.id.poLL);
|
||||||
|
|
||||||
|
sys_gen_poTV = findViewById(R.id.sys_gen_poTV);
|
||||||
|
podateTV = findViewById(R.id.podateTV);
|
||||||
|
|
||||||
|
lin_camera1 = (LinearLayout) findViewById(R.id.lin_camera1);
|
||||||
|
lin_camera2 = (LinearLayout) findViewById(R.id.lin_camera2);
|
||||||
|
lin_camera3 = (LinearLayout) findViewById(R.id.lin_camera3);
|
||||||
|
lin_camera4 = (LinearLayout) findViewById(R.id.lin_camera4);
|
||||||
|
context = this;
|
||||||
|
db = new GSKOrangeDB(this);
|
||||||
|
db.open();
|
||||||
|
|
||||||
|
//preference data
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||||
|
store_flag_hide = preferences.getString(CommonString.KEY_STORE_FLAG_FACING_HIDE, null);
|
||||||
|
|
||||||
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
|
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
||||||
|
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||||
|
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||||
|
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||||
|
camera_allow = preferences.getString(CommonString.KEY_CAMERA_ALLOW, "");
|
||||||
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||||
|
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
||||||
|
|
||||||
|
//Intent data
|
||||||
|
categoryName = getIntent().getStringExtra("categoryName");
|
||||||
|
categoryId = getIntent().getStringExtra("categoryId");
|
||||||
|
SYS_PO_NUM = getIntent().getStringExtra("SYS_PO_NUM");
|
||||||
|
PO_NUM = getIntent().getStringExtra("PO_NUM");
|
||||||
|
PO_DATE = getIntent().getStringExtra("PO_DATE");
|
||||||
|
LINE = getIntent().getStringExtra("LINE");
|
||||||
|
POID = getIntent().getStringExtra("POID");
|
||||||
|
// Log.e("poid",POID);
|
||||||
|
// Log.e("podetai",SYS_PO_NUM + ","+PO_NUM + ","+PO_DATE + ","+LINE);
|
||||||
|
|
||||||
|
// toolbar.setTitle("Order Status" + "-"+"Entry");
|
||||||
|
toolbar.setTitle(context.getString(R.string.order_status_entry));
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
sys_gen_poTV.setText(SYS_PO_NUM);
|
||||||
|
storepoTV.setText(PO_NUM);
|
||||||
|
podateTV.setText(PO_DATE);
|
||||||
|
lineitemTV.setText(LINE);
|
||||||
|
|
||||||
|
// Log.e("sys_po_num",sys_po_number +","+timeMilli);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
str_planogram = CommonString.getDownloadedImageFolder(context);
|
||||||
|
|
||||||
|
prepareList();
|
||||||
|
|
||||||
|
//Camera
|
||||||
|
// prepareDefaultList();
|
||||||
|
|
||||||
|
// cameraMethod();
|
||||||
|
|
||||||
|
final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
|
|
||||||
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(final View view) {
|
||||||
|
expandableListView.clearFocus();
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
|
||||||
|
if (validateData(hashMapListHeaderData, hashMapListChildData)) {
|
||||||
|
db.open();
|
||||||
|
if (db.checkOrder_Received_Data(store_id, categoryId)) {
|
||||||
|
db.updateOrder_Received_data(storepoTV.getText().toString(), sys_gen_poTV.getText().toString(), podateTV.getText().toString(), store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
|
Toast.makeText(context, getResources().getString(R.string.update_message), Toast.LENGTH_SHORT).show();
|
||||||
|
} else {
|
||||||
|
db.InsertOrderReceivedStatusData(POID, storepoTV.getText().toString(), sys_gen_poTV.getText().toString(), podateTV.getText().toString(), store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
|
Toast.makeText(context, getResources().getString(R.string.save_message), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
|
||||||
|
/* String order_received_xml = "";
|
||||||
|
String onXML = "";
|
||||||
|
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> orderreceiveddata = db.getOrder_RECEIVED_UploadServerData(store_id);
|
||||||
|
|
||||||
|
if (orderreceiveddata.size() > 0) {
|
||||||
|
for (int j = 0; j < orderreceiveddata.size(); j++) {
|
||||||
|
onXML = "[ORDER_CONFIRM]"
|
||||||
|
+ "[MID]" + 0 + "[/MID]"
|
||||||
|
+ "[USERID]" + username + "[/USERID]"
|
||||||
|
+ "[CATEGORY_ID]" + orderreceiveddata.get(j).getCategory_id() + "[/CATEGORY_ID]"
|
||||||
|
+ "[PO_DATE]" + orderreceiveddata.get(j).getPO_Date() + "[/PO_DATE]"
|
||||||
|
+ "[POID]" + orderreceiveddata.get(j).getPOID() + "[/POID]"
|
||||||
|
+ "[SKU_ID]" + orderreceiveddata.get(j).getSku_id() + "[/SKU_ID]"
|
||||||
|
+ "[PO_QTY]" + orderreceiveddata.get(j).getOrderqty() + "[/PO_QTY]"
|
||||||
|
+ "[ACTUAL_QTY]" + orderreceiveddata.get(j).getFacing() + "[/ACTUAL_QTY]" +
|
||||||
|
"[/ORDER_CONFIRM]";
|
||||||
|
|
||||||
|
order_received_xml = order_received_xml + onXML;
|
||||||
|
}
|
||||||
|
|
||||||
|
final String sos_xml = "[DATA]" + order_received_xml + "[/DATA]";
|
||||||
|
Log.e("order_xml", sos_xml);
|
||||||
|
|
||||||
|
} */
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
for (int i = 0; i < adapter.getGroupCount(); i++)
|
||||||
|
expandableListView.expandGroup(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
expandableListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||||
|
@Override
|
||||||
|
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
||||||
|
|
||||||
|
expandableListView.invalidate();
|
||||||
|
|
||||||
|
int lastItem = firstVisibleItem + visibleItemCount;
|
||||||
|
|
||||||
|
if (firstVisibleItem == 0) {
|
||||||
|
fab.show();//.setVisibility(View.VISIBLE);
|
||||||
|
} else if (lastItem == totalItemCount) {
|
||||||
|
fab.hide();//setVisibility(View.INVISIBLE);
|
||||||
|
} else {
|
||||||
|
fab.show();//setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onScrollStateChanged(AbsListView arg0, int arg1) {
|
||||||
|
InputMethodManager inputManager = (InputMethodManager) context
|
||||||
|
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
if (getCurrentFocus() != null) {
|
||||||
|
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||||
|
getCurrentFocus().clearFocus();
|
||||||
|
}
|
||||||
|
expandableListView.invalidateViews();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Listview Group click listener
|
||||||
|
expandableListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Listview Group expanded listener
|
||||||
|
expandableListView.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() {
|
||||||
|
@Override
|
||||||
|
public void onGroupExpand(int groupPosition) {
|
||||||
|
InputMethodManager inputManager = (InputMethodManager) context
|
||||||
|
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
if (getWindow().getCurrentFocus() != null) {
|
||||||
|
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||||
|
getCurrentFocus().clearFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Listview Group collasped listener
|
||||||
|
expandableListView.setOnGroupCollapseListener(new ExpandableListView.OnGroupCollapseListener() {
|
||||||
|
@Override
|
||||||
|
public void onGroupCollapse(int groupPosition) {
|
||||||
|
InputMethodManager inputManager = (InputMethodManager) context
|
||||||
|
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
if (getWindow().getCurrentFocus() != null) {
|
||||||
|
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||||
|
getCurrentFocus().clearFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Listview on child click listener
|
||||||
|
expandableListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition,
|
||||||
|
int childPosition, long id) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Resources.NotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean validateData(List<MSL_AvailabilityStockFacingGetterSetter> listDataHeader,
|
||||||
|
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> listDataChild) {
|
||||||
|
boolean flag = true, child_flag = true, all_flag = true;
|
||||||
|
checkHeaderArray.clear();
|
||||||
|
int childCount = 0;
|
||||||
|
//temp list data for empty only
|
||||||
|
List<MSL_AvailabilityStockFacingGetterSetter> listDataHeaderTemp = new ArrayList<>();
|
||||||
|
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> listDataChildTemp = new HashMap<>();
|
||||||
|
for (int i = 0; i < listDataHeader.size(); i++) {
|
||||||
|
flag = true;
|
||||||
|
|
||||||
|
List<MSL_AvailabilityStockFacingGetterSetter> listTemp = new ArrayList<>();
|
||||||
|
for (int j = 0; j < listDataChild.get(listDataHeader.get(i)).size(); j++) {
|
||||||
|
child_flag = true;
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter data = listDataChild.get(listDataHeader.get(i)).get(j);
|
||||||
|
|
||||||
|
String faceup = data.getFacing();
|
||||||
|
// Log.e("facevalue",faceup);
|
||||||
|
|
||||||
|
//Company_id
|
||||||
|
if (listDataChild.get(listDataHeader.get(i)).get(j).getCompany_id().equals("1")) {
|
||||||
|
if (store_flag_hide.equals("0")) {
|
||||||
|
if (faceup.equals("")) {
|
||||||
|
if (!checkHeaderArray.contains(i)) {
|
||||||
|
checkHeaderArray.add(i);
|
||||||
|
}
|
||||||
|
// scrollPosition = i + j + childCount;
|
||||||
|
all_flag = false;
|
||||||
|
flag = false;
|
||||||
|
child_flag = false;
|
||||||
|
Error_Message = getResources().getString(R.string.faceup_value);
|
||||||
|
// Toast.makeText(context, getResources().getString(R.string.faceup_value), Toast.LENGTH_SHORT).show();
|
||||||
|
Toast.makeText(context, getResources().getString(R.string.pls_fill_order_qty), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!child_flag)
|
||||||
|
listTemp.add(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag == false) {
|
||||||
|
listDataHeaderTemp.add(listDataHeader.get(i));
|
||||||
|
// listDataChildTemp.put(listDataHeader.get(i), listTemp);
|
||||||
|
} else {
|
||||||
|
childCount = childCount + listDataChild.get(listDataHeader.get(i)).size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!all_flag) {
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
/*adapter = new ExpandableListAdapter(this, listDataHeaderTemp, listDataChildTemp);
|
||||||
|
expandableListView.setAdapter(adapter);*/
|
||||||
|
checkflag = false;
|
||||||
|
} else {
|
||||||
|
checkflag = true;
|
||||||
|
}
|
||||||
|
return all_flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void prepareList() {
|
||||||
|
// Log.e("store_flag_hide",store_flag_hide);
|
||||||
|
try {
|
||||||
|
hashMapListHeaderData = new ArrayList<>();
|
||||||
|
hashMapListChildData = new HashMap<>();
|
||||||
|
|
||||||
|
//Header
|
||||||
|
if (country_id.equals("7") || country_id.equals("8")) {
|
||||||
|
// Log.e("childlistsize2", String.valueOf(headerDataList.size()));
|
||||||
|
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide);
|
||||||
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
// Log.e("childlistsize1", String.valueOf(headerDataList.size()));
|
||||||
|
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC, CommonString.TABLE_MAPPING_SOS_TARGET_ADHOC, store_flag_hide);
|
||||||
|
} else {
|
||||||
|
//Log.e("categorydata",categoryId + ","+keyAccount_id + ","+storeType_id+","+class_id+","+store_id);
|
||||||
|
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide);
|
||||||
|
// Log.e("childlistsize", String.valueOf(headerDataList.size()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (headerDataList.size() > 0) {
|
||||||
|
for (int i = 0; i < headerDataList.size(); i++) {
|
||||||
|
hashMapListHeaderData.add(headerDataList.get(i));
|
||||||
|
//childDataList = new ArrayList<>();
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> filteredChildList =
|
||||||
|
new ArrayList<>();
|
||||||
|
|
||||||
|
// childDataList = db.getOrder_RECEIVED_SKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||||
|
if (!(childDataList.size() > 0)) {
|
||||||
|
if (country_id.equals("7") || country_id.equals("8")) {
|
||||||
|
childDataList = db.getOrderReceivedSKUData(headerDataList.get(i).getSub_category_id(), categoryId, headerDataList.get(i).getBrand_id(), null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE, store_flag_hide);
|
||||||
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
childDataList = db.getOrderReceivedSKUData(headerDataList.get(i).getSub_category_id(), categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC, store_flag_hide);
|
||||||
|
} else {
|
||||||
|
//childDataList = db.getMSL_Availability_StockFacingSKUData(headerDataList.get(i).getSub_category_id(), categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, store_flag_hide);
|
||||||
|
childDataList = db.getOrderReceivedSKUData(headerDataList.get(i).getSub_category_id(), categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, store_flag_hide);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
|
||||||
|
}
|
||||||
|
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
adapter = new ExpandableListAdapter(this, hashMapListHeaderData, hashMapListChildData);
|
||||||
|
expandableListView.setAdapter(adapter);
|
||||||
|
|
||||||
|
//expand all
|
||||||
|
for (int i = 0; i < adapter.getGroupCount(); i++)
|
||||||
|
expandableListView.expandGroup(i);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ExpandableListAdapter extends BaseExpandableListAdapter {
|
||||||
|
private Context _context;
|
||||||
|
private List<MSL_AvailabilityStockFacingGetterSetter> _listDataHeader;
|
||||||
|
private HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> _listDataChild;
|
||||||
|
|
||||||
|
public ExpandableListAdapter(Context context, List<MSL_AvailabilityStockFacingGetterSetter> listDataHeader,
|
||||||
|
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> listChildData) {
|
||||||
|
this._context = context;
|
||||||
|
this._listDataHeader = listDataHeader;
|
||||||
|
this._listDataChild = listChildData;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getGroup(int groupPosition) {
|
||||||
|
return this._listDataHeader.get(groupPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getGroupCount() {
|
||||||
|
return this._listDataHeader.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getGroupId(int groupPosition) {
|
||||||
|
return groupPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getGroupView(final int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter headerTitle = (MSL_AvailabilityStockFacingGetterSetter) getGroup(groupPosition);
|
||||||
|
|
||||||
|
if (convertView == null) {
|
||||||
|
LayoutInflater infalInflater = (LayoutInflater) this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
convertView = infalInflater.inflate(R.layout.item_order_taking, null, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
TextView txt_categoryHeader = (TextView) convertView.findViewById(R.id.txt_categoryHeader);
|
||||||
|
RelativeLayout rel_header = (RelativeLayout) convertView.findViewById(R.id.rel_categoryHeader);
|
||||||
|
ImageView img_camera = (ImageView) convertView.findViewById(R.id.img_camera);
|
||||||
|
CardView card_view = (CardView) convertView.findViewById(R.id.card_view);
|
||||||
|
|
||||||
|
txt_categoryHeader.setTypeface(null, Typeface.BOLD);
|
||||||
|
|
||||||
|
if (headerTitle.getCompany_id().equals("1")) {
|
||||||
|
txt_categoryHeader.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||||
|
} else {
|
||||||
|
txt_categoryHeader.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
}
|
||||||
|
txt_categoryHeader.setText(headerTitle.getSub_category() + "-" + headerTitle.getBrand());
|
||||||
|
|
||||||
|
|
||||||
|
if (!checkflag) {
|
||||||
|
if (checkHeaderArray.contains(groupPosition)) {
|
||||||
|
card_view.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
} else {
|
||||||
|
card_view.setCardBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getChild(int groupPosition, int childPosititon) {
|
||||||
|
return this._listDataChild.get(this._listDataHeader.get(groupPosition)).get(childPosititon);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getChildrenCount(int groupPosition) {
|
||||||
|
return this._listDataChild.get(this._listDataHeader.get(groupPosition)).size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getChildId(int groupPosition, int childPosition) {
|
||||||
|
return childPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild,
|
||||||
|
View convertView, ViewGroup parent) {
|
||||||
|
|
||||||
|
final MSL_AvailabilityStockFacingGetterSetter childData =
|
||||||
|
(MSL_AvailabilityStockFacingGetterSetter) getChild(groupPosition, childPosition);
|
||||||
|
OrderStatusDetailActivity.ViewHolder holder = null;
|
||||||
|
|
||||||
|
if (convertView == null) {
|
||||||
|
LayoutInflater infalInflater = (LayoutInflater) this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
convertView = infalInflater.inflate(R.layout.item_order_received_status_child, null, false);
|
||||||
|
holder = new OrderStatusDetailActivity.ViewHolder();
|
||||||
|
holder.cardView = (CardView) convertView.findViewById(R.id.card_view);
|
||||||
|
holder.lin_category = (LinearLayout) convertView.findViewById(R.id.lin_category);
|
||||||
|
holder.txt_skuName = (TextView) convertView.findViewById(R.id.txt_skuName);
|
||||||
|
holder.poqtyTV = (TextView) convertView.findViewById(R.id.poqtyTV);
|
||||||
|
holder.txt_mbq = (TextView) convertView.findViewById(R.id.txt_mbq);
|
||||||
|
holder.toggle_available = (ToggleButton) convertView.findViewById(R.id.toggle_available);
|
||||||
|
holder.facing = (EditText) convertView.findViewById(R.id.ed_facing);
|
||||||
|
holder.facing.setFilters(new InputFilter[]{new OrderStatusDetailActivity.DecimalDigitsInputFilter(3, 1)});
|
||||||
|
holder.stock = (EditText) convertView.findViewById(R.id.ed_stock);
|
||||||
|
holder.ed_pricing = (EditText) convertView.findViewById(R.id.ed_pricing);
|
||||||
|
|
||||||
|
holder.facing_view = convertView.findViewById(R.id.facing_view);
|
||||||
|
holder.stock_view = convertView.findViewById(R.id.stock_view);
|
||||||
|
holder.pricing_view = convertView.findViewById(R.id.pricing_view);
|
||||||
|
convertView.setTag(holder);
|
||||||
|
} else {
|
||||||
|
holder = (OrderStatusDetailActivity.ViewHolder) convertView.getTag();
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.poqtyTV.setText(context.getString(R.string.po_qty) + ":"+childData.getOrderqty());
|
||||||
|
holder.txt_skuName.setText(childData.getSku());
|
||||||
|
// holder.txt_mbq.setText(childData.getMbq());
|
||||||
|
|
||||||
|
|
||||||
|
if (childData.getCompany_id().equals("1")) {
|
||||||
|
holder.txt_skuName.setTextColor(getResources().getColor(R.color.colorPrimary));
|
||||||
|
} else {
|
||||||
|
holder.txt_skuName.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
final OrderStatusDetailActivity.ViewHolder finalHolder = holder;
|
||||||
|
holder.toggle_available.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
if (buttonView.isPressed()) {
|
||||||
|
|
||||||
|
editFlag = true;
|
||||||
|
|
||||||
|
if (isChecked) {
|
||||||
|
childData.setToggleValue("1");
|
||||||
|
//for Egypt
|
||||||
|
if (country_id.equals("6")) {
|
||||||
|
finalHolder.stock.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
finalHolder.stock.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*childData.setStock("");
|
||||||
|
childData.setFacing("");*/
|
||||||
|
} else {
|
||||||
|
/* childData.setStock("");
|
||||||
|
childData.setFacing("");*/
|
||||||
|
childData.setToggleValue("0");
|
||||||
|
finalHolder.stock.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
//If MBQ Value is 0
|
||||||
|
if (Integer.parseInt(childData.getMbq()) == 0) {
|
||||||
|
childData.setStock("0");
|
||||||
|
childData.setFacing("0");
|
||||||
|
} else {
|
||||||
|
//for Egypt
|
||||||
|
if (country_id.equals("6")) {
|
||||||
|
childData.setStock("");
|
||||||
|
childData.setFacing("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* else {
|
||||||
|
if (finalHolder.facing.getText().toString() != null && !finalHolder.facing.getText().toString().equals("")) {
|
||||||
|
if (Integer.parseInt(finalHolder.facing.getText().toString()) >= 0
|
||||||
|
&& Integer.parseInt(finalHolder.facing.getText().toString()) >= Integer.parseInt(childData.getMbq())) {
|
||||||
|
childData.setFacing("");
|
||||||
|
finalHolder.facing.setText("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
expandableListView.clearFocus();
|
||||||
|
expandableListView.invalidateViews();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/*if (childData.getToggleValue().equals("1")) {
|
||||||
|
holder.toggle_available.setChecked(true);
|
||||||
|
if (country_id.equals("6") && childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||||
|
finalHolder.stock.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
finalHolder.stock.setVisibility(View.GONE);
|
||||||
|
childData.setStock("");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
holder.toggle_available.setChecked(false);
|
||||||
|
finalHolder.stock.setVisibility(View.VISIBLE);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
/*holder.stock.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
|
final EditText caption = (EditText) v;
|
||||||
|
String edStock = caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
||||||
|
|
||||||
|
*//*if (!childData.getFacing().equals("") && Integer.parseInt(stock) >= 0 && Integer.parseInt(childData.getFacing()) < Integer.parseInt(stock)) {
|
||||||
|
|
||||||
|
}*//*
|
||||||
|
editFlag = true;
|
||||||
|
if (!edStock.equals("")) {
|
||||||
|
String stock = edStock;
|
||||||
|
|
||||||
|
//for Egypt
|
||||||
|
if (country_id.equals("6") && childData.getToggleValue().equals("1")) {
|
||||||
|
if (!childData.getFacing().equals("")) {
|
||||||
|
if (Integer.parseInt(stock) >= 0 && Double.parseDouble(childData.getFacing()) <= Integer.parseInt(stock)) {
|
||||||
|
|
||||||
|
childData.setStock(stock);
|
||||||
|
} else {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(OrderStatusDetailActivity.this);
|
||||||
|
builder.setMessage(getString(R.string.check_faceup))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
finalHolder.stock.setText("");
|
||||||
|
dialog.dismiss();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
childData.setStock(stock);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
int mbq = Integer.parseInt(childData.getMbq());
|
||||||
|
if (mbq != 0) {
|
||||||
|
if (Integer.parseInt(stock) >= 0 && Integer.parseInt(stock) < mbq) {
|
||||||
|
|
||||||
|
if (!childData.getFacing().equals("")) {
|
||||||
|
if (Integer.parseInt(stock) >= 0 && Double.parseDouble(childData.getFacing()) <= Integer.parseInt(stock)) {
|
||||||
|
|
||||||
|
childData.setStock(stock);
|
||||||
|
} else {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(OrderStatusDetailActivity.this);
|
||||||
|
builder.setMessage(getString(R.string.check_faceup))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
finalHolder.stock.setText("");
|
||||||
|
dialog.dismiss();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
childData.setStock(stock);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (isDialogOpen) {
|
||||||
|
isDialogOpen = !isDialogOpen;
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(OrderStatusDetailActivity.this);
|
||||||
|
builder.setMessage(getString(R.string.check_stock))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
finalHolder.stock.setText("");
|
||||||
|
dialog.dismiss();
|
||||||
|
isDialogOpen = !isDialogOpen;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (Integer.parseInt(stock) > 0) {
|
||||||
|
if (isDialogOpen) {
|
||||||
|
isDialogOpen = !isDialogOpen;
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(OrderStatusDetailActivity.this);
|
||||||
|
builder.setMessage(getString(R.string.check_stock))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
finalHolder.stock.setText("");
|
||||||
|
dialog.dismiss();
|
||||||
|
isDialogOpen = !isDialogOpen;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
childData.setStock("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});*/
|
||||||
|
/* holder.stock.setText(childData.getStock());*/
|
||||||
|
|
||||||
|
/*holder.ed_pricing.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
|
if (!hasFocus) {
|
||||||
|
final EditText Caption = (EditText) v;
|
||||||
|
String value1 = Caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
||||||
|
if (value1.equals("")) {
|
||||||
|
childData.setPricingStock("");
|
||||||
|
finalHolder.ed_pricing.setText("");
|
||||||
|
finalHolder.ed_pricing.setId(childPosition);
|
||||||
|
} else {
|
||||||
|
childData.setPricingStock(value1);
|
||||||
|
finalHolder.ed_pricing.setText(value1);
|
||||||
|
finalHolder.ed_pricing.setId(childPosition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});*/
|
||||||
|
|
||||||
|
// holder.ed_pricing.setText(childData.getPricingStock());
|
||||||
|
|
||||||
|
|
||||||
|
final OrderStatusDetailActivity.ViewHolder finalHolder1 = holder;
|
||||||
|
final OrderStatusDetailActivity.ViewHolder finalHolder2 = holder;
|
||||||
|
holder.facing.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
|
final EditText caption = (EditText) v;
|
||||||
|
String edFaceup = caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
||||||
|
|
||||||
|
editFlag = true;
|
||||||
|
|
||||||
|
if (edFaceup != null && !edFaceup.equals("") && !edFaceup.equals(".")) {
|
||||||
|
//int num = Integer.parseInt(edFaceup);
|
||||||
|
double faceup = Double.parseDouble(edFaceup);
|
||||||
|
int num = (int) faceup;
|
||||||
|
//int faceint = (int)(faceup - Math.floor( faceup ));
|
||||||
|
int faceint = (int) ((faceup % 1.0) * 10);
|
||||||
|
if (faceint != 0) {
|
||||||
|
if ((faceup % 1.0) * 10 != 5) {
|
||||||
|
faceint = 5;
|
||||||
|
edFaceup = String.valueOf(num + faceint / 10.0);
|
||||||
|
finalHolder2.facing.setText(edFaceup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*Double faceup = Double.parseDouble(edFaceup);
|
||||||
|
DecimalFormat twoDForm = new DecimalFormat(".#");
|
||||||
|
faceup= Double.valueOf(twoDForm.format(faceup));*/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
boolean isFill = false;
|
||||||
|
|
||||||
|
//Toggle is no selected
|
||||||
|
|
||||||
|
if (country_id.equals("6")) {
|
||||||
|
if (!childData.getStock().equals("")) {
|
||||||
|
|
||||||
|
String faceup = edFaceup.replaceFirst("^0+(?!$)", "");
|
||||||
|
|
||||||
|
if (edFaceup != null && !edFaceup.equals("") && !edFaceup.equals(".")) {
|
||||||
|
if (Double.parseDouble(faceup) <= Integer.parseInt(childData.getStock())) {
|
||||||
|
|
||||||
|
isFill = true;
|
||||||
|
|
||||||
|
/* if (!edFaceup.equals("")) {
|
||||||
|
childData.setFacing(faceup);
|
||||||
|
} else {
|
||||||
|
childData.setFacing("");
|
||||||
|
}*/
|
||||||
|
} else {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(OrderStatusDetailActivity.this);
|
||||||
|
builder.setMessage(getString(R.string.check_faceup))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
finalHolder1.facing.setText("");
|
||||||
|
dialog.dismiss();
|
||||||
|
finalHolder2.facing.setText("");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
isFill = true;
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
} else {
|
||||||
|
isFill = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
isFill = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isFill) {
|
||||||
|
if (!edFaceup.equals("") && !edFaceup.equals(".")) {
|
||||||
|
String faceup = "";
|
||||||
|
if (edFaceup.equals("0") || edFaceup.equals(".0")) {
|
||||||
|
faceup = "0";
|
||||||
|
} else {
|
||||||
|
faceup = edFaceup.replaceFirst("^0+(?!$)", "");
|
||||||
|
//faceup = new DecimalFormat("##.#").format(Double.parseDouble(faceup));
|
||||||
|
}
|
||||||
|
|
||||||
|
// String str2 = PerfectDecimal(faceup, 3, 1);
|
||||||
|
childData.setFacing(faceup);
|
||||||
|
} else {
|
||||||
|
childData.setFacing("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
holder.facing.setText(childData.getFacing());
|
||||||
|
|
||||||
|
//empty check color change
|
||||||
|
if (!checkflag) {
|
||||||
|
boolean tempflag = false;
|
||||||
|
//usk pricing
|
||||||
|
/*if (!childData.getPricing().equals("0")) {
|
||||||
|
if (holder.ed_pricing.getText().toString().equals("")) {
|
||||||
|
holder.ed_pricing.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
holder.ed_pricing.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
holder.ed_pricing.setHint(getString(R.string.empty));
|
||||||
|
tempflag = true;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
if (holder.facing.getText().toString().equals("")) {
|
||||||
|
holder.facing.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
holder.facing.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
holder.facing.setHint(getString(R.string.empty));
|
||||||
|
tempflag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (childData.getCompany_id().equals("1")) {
|
||||||
|
holder.facing.setHint("");
|
||||||
|
/* if (childData.getToggleValue().equals("0")) {
|
||||||
|
if (holder.stock.getText().toString().equals("")) {
|
||||||
|
holder.stock.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
holder.stock.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
holder.stock.setHint(getString(R.string.empty));
|
||||||
|
tempflag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (holder.facing.getText().toString().equals("")) {
|
||||||
|
holder.facing.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
holder.facing.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
holder.facing.setHint(getString(R.string.empty));
|
||||||
|
tempflag = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}*/
|
||||||
|
if (tempflag) {
|
||||||
|
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
} else {
|
||||||
|
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
if (childData.getCompany_id().equals("1")) {
|
||||||
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||||
|
} else {
|
||||||
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (holder.facing.getText().toString().equals("")) {
|
||||||
|
holder.facing.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
holder.facing.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
holder.facing.setHint(getString(R.string.empty));
|
||||||
|
tempflag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tempflag) {
|
||||||
|
//holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
} else {
|
||||||
|
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
if (childData.getCompany_id().equals("1")) {
|
||||||
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||||
|
} else {
|
||||||
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasStableIds() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isChildSelectable(int groupPosition, int childPosition) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public class ViewHolder {
|
||||||
|
CardView cardView;
|
||||||
|
TextView txt_skuName, txt_mbq,poqtyTV;
|
||||||
|
ToggleButton toggle_available;
|
||||||
|
LinearLayout lin_category;
|
||||||
|
EditText facing, stock, ed_pricing;
|
||||||
|
View stock_view, pricing_view, facing_view;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DecimalDigitsInputFilter implements InputFilter {
|
||||||
|
Pattern mPattern;
|
||||||
|
|
||||||
|
public DecimalDigitsInputFilter(int digitsBeforeZero, int digitsAfterZero) {
|
||||||
|
mPattern = Pattern.compile("[0-9]{0," + (digitsBeforeZero - 1) + "}+((\\.[0-9]{0," + (digitsAfterZero - 1) + "})?)||(\\.)?");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
|
||||||
|
Matcher matcher = mPattern.matcher(dest);
|
||||||
|
if (!matcher.matches())
|
||||||
|
return "";
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
|
//return super.onOptionsItemSelected(item);
|
||||||
|
int id = item.getItemId();
|
||||||
|
if (id == android.R.id.home) {
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
// super.onBackPressed();
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
}
|
||||||
+24
-13
@@ -77,8 +77,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
|||||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, store_flag_str;
|
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, store_flag_str;
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
|
|
||||||
String str = CommonString.FILE_PATH,
|
String str ="",path = "", _pathforcheck = "", img = "";
|
||||||
path = "", _pathforcheck = "", img = "";
|
|
||||||
int child_position = -1;
|
int child_position = -1;
|
||||||
Uri outputFileUri;
|
Uri outputFileUri;
|
||||||
String gallery_package = "";
|
String gallery_package = "";
|
||||||
@@ -100,6 +99,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
context = this;
|
context = this;
|
||||||
|
str = CommonString.getImagesFolder(context);
|
||||||
lin_promo_sku = (LinearLayout) findViewById(R.id.lin_promo_sku);
|
lin_promo_sku = (LinearLayout) findViewById(R.id.lin_promo_sku);
|
||||||
lin_addtional_promo = (LinearLayout) findViewById(R.id.lin_addtional_promo);
|
lin_addtional_promo = (LinearLayout) findViewById(R.id.lin_addtional_promo);
|
||||||
view_promo_sku = findViewById(R.id.view_promo_sku);
|
view_promo_sku = findViewById(R.id.view_promo_sku);
|
||||||
@@ -196,8 +196,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
|||||||
img_addPromotion.setClickable(false);
|
img_addPromotion.setClickable(false);
|
||||||
img_addPromotion.setBackgroundResource(R.mipmap.camera_grey);
|
img_addPromotion.setBackgroundResource(R.mipmap.camera_grey);
|
||||||
|
|
||||||
if(!cd.getImage_promotion().equalsIgnoreCase(""))
|
if (!cd.getImage_promotion().equalsIgnoreCase("")) {
|
||||||
{
|
|
||||||
if (new File(str + cd.getImage_promotion()).exists()) {
|
if (new File(str + cd.getImage_promotion()).exists()) {
|
||||||
//img = _pathforcheck;
|
//img = _pathforcheck;
|
||||||
new File(str + cd.getImage_promotion()).delete();
|
new File(str + cd.getImage_promotion()).delete();
|
||||||
@@ -210,8 +209,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
|||||||
cd.setIn_stock("-1");
|
cd.setIn_stock("-1");
|
||||||
img_addPromotion.setClickable(false);
|
img_addPromotion.setClickable(false);
|
||||||
img_addPromotion.setBackgroundResource(R.mipmap.camera_grey);
|
img_addPromotion.setBackgroundResource(R.mipmap.camera_grey);
|
||||||
if(!cd.getImage_promotion().equalsIgnoreCase(""))
|
if (!cd.getImage_promotion().equalsIgnoreCase("")) {
|
||||||
{
|
|
||||||
if (new File(str + cd.getImage_promotion()).exists()) {
|
if (new File(str + cd.getImage_promotion()).exists()) {
|
||||||
//img = _pathforcheck;
|
//img = _pathforcheck;
|
||||||
new File(str + cd.getImage_promotion()).delete();
|
new File(str + cd.getImage_promotion()).delete();
|
||||||
@@ -456,20 +454,17 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
|||||||
promoSkuListData = db.getPromoComplianceSkuAfterData(store_id, categoryId);
|
promoSkuListData = db.getPromoComplianceSkuAfterData(store_id, categoryId);
|
||||||
if (!(promoSkuListData.size() > 0)) {
|
if (!(promoSkuListData.size() > 0)) {
|
||||||
|
|
||||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
promoSkuListData = db.getPromoComplianceSkuData(store_id, categoryId, CommonString.TABLE_MAPPING_PROMOTION_ADHOC);
|
promoSkuListData = db.getPromoComplianceSkuData(store_id, categoryId, CommonString.TABLE_MAPPING_PROMOTION_ADHOC);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
promoSkuListData = db.getPromoComplianceSkuData(store_id, categoryId, CommonString.TABLE_MAPPING_PROMOTION);
|
promoSkuListData = db.getPromoComplianceSkuData(store_id, categoryId, CommonString.TABLE_MAPPING_PROMOTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Promo Spinner List
|
//Promo Spinner List
|
||||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
promoSpinnerListData = db.getPromoSpinnerData(store_id, categoryId, CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION_ADHOC);
|
promoSpinnerListData = db.getPromoSpinnerData(store_id, categoryId, CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION_ADHOC);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
promoSpinnerListData = db.getPromoSpinnerData(store_id, categoryId, CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION);
|
promoSpinnerListData = db.getPromoSpinnerData(store_id, categoryId, CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1095,6 +1090,22 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
|||||||
cdate = arabicToenglish(cdate);
|
cdate = arabicToenglish(cdate);
|
||||||
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
||||||
cdate = arabicToenglish(cdate);
|
cdate = arabicToenglish(cdate);
|
||||||
|
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KUWAIT)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_BAHRAIN)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_OMAN)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_QATAR)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}
|
||||||
|
else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LEBANON)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}
|
||||||
|
else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LIBIYA)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cdate;
|
return cdate;
|
||||||
|
|||||||
@@ -0,0 +1,855 @@
|
|||||||
|
package cpm.com.gskmtorange.gsk_dailyentry;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.pm.ActivityInfo;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.graphics.Typeface;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.text.InputFilter;
|
||||||
|
import android.text.Spanned;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
import android.webkit.WebView;
|
||||||
|
import android.webkit.WebViewClient;
|
||||||
|
import android.widget.AbsListView;
|
||||||
|
import android.widget.BaseExpandableListAdapter;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ExpandableListView;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.ToggleButton;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.cardview.widget.CardView;
|
||||||
|
|
||||||
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.OrderTakingActivity;
|
||||||
|
import cpm.com.gskmtorange.interfaces.DialogCallbackListener;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_DataGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
|
||||||
|
|
||||||
|
public class StockEntryActivity extends AppCompatActivity implements DialogCallbackListener {
|
||||||
|
ExpandableListView expandableListView;
|
||||||
|
private Context context;
|
||||||
|
TextView txt_mslAvailabilityName;
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> headerDataList;
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> childDataList;
|
||||||
|
List<MSL_AvailabilityStockFacingGetterSetter> hashMapListHeaderData;
|
||||||
|
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> hashMapListChildData;
|
||||||
|
List<Integer> checkHeaderArray = new ArrayList<>();
|
||||||
|
boolean checkflag = true;
|
||||||
|
ExpandableListAdapter adapter;
|
||||||
|
ImageView camera1, camera2, camera3, camera4;
|
||||||
|
LinearLayout lin_camera1, lin_camera2, lin_camera3, lin_camera4;
|
||||||
|
GSKOrangeDB db;
|
||||||
|
String categoryName, categoryId, storeId, Error_Message = "";
|
||||||
|
String store_id, store_flag_hide, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str;
|
||||||
|
boolean isDialogOpen = true;
|
||||||
|
private SharedPreferences preferences;
|
||||||
|
int scrollPosition = 0;
|
||||||
|
|
||||||
|
String str_planogram = "", _pathforcheck = "";
|
||||||
|
|
||||||
|
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> planogramShelfHeaderDataList = new ArrayList<>();
|
||||||
|
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> planogramSkuChildDataList;
|
||||||
|
HashMap<StockFacing_PlanogramTrackerDataGetterSetter, ArrayList<StockFacing_PlanogramTrackerDataGetterSetter>> planogramHashMapListChildData = new HashMap<>();
|
||||||
|
boolean editFlag = false;
|
||||||
|
public static final String FILE_PATH = Environment.getExternalStorageDirectory() + "/";
|
||||||
|
LinearLayout pricingLL;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
try {
|
||||||
|
setContentView(R.layout.activity_msl_availability_stock_entry);
|
||||||
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
expandableListView = (ExpandableListView) findViewById(R.id.expandableListView);
|
||||||
|
txt_mslAvailabilityName = (TextView) findViewById(R.id.txt_mslAvailabilityName);
|
||||||
|
camera1 = (ImageView) findViewById(R.id.img_camera1);
|
||||||
|
camera2 = (ImageView) findViewById(R.id.img_camera2);
|
||||||
|
camera3 = (ImageView) findViewById(R.id.img_camera3);
|
||||||
|
camera4 = (ImageView) findViewById(R.id.img_camera4);
|
||||||
|
lin_camera1 = (LinearLayout) findViewById(R.id.lin_camera1);
|
||||||
|
lin_camera2 = (LinearLayout) findViewById(R.id.lin_camera2);
|
||||||
|
lin_camera3 = (LinearLayout) findViewById(R.id.lin_camera3);
|
||||||
|
lin_camera4 = (LinearLayout) findViewById(R.id.lin_camera4);
|
||||||
|
pricingLL = findViewById(R.id.pricingLL);
|
||||||
|
context = this;
|
||||||
|
db = new GSKOrangeDB(this);
|
||||||
|
db.open();
|
||||||
|
//preference data
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||||
|
store_flag_hide = preferences.getString(CommonString.KEY_STORE_FLAG_FACING_HIDE, null);
|
||||||
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
|
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
||||||
|
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||||
|
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||||
|
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||||
|
camera_allow = preferences.getString(CommonString.KEY_CAMERA_ALLOW, "");
|
||||||
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||||
|
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
||||||
|
//Intent data
|
||||||
|
categoryName = getIntent().getStringExtra("categoryName");
|
||||||
|
categoryId = getIntent().getStringExtra("categoryId");
|
||||||
|
/*if (country_id != null && country_id.equals("5")) {
|
||||||
|
pricingLL.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
pricingLL.setVisibility(View.VISIBLE);
|
||||||
|
}*/
|
||||||
|
toolbar.setTitle(getResources().getString(R.string.stock_entry));
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
str_planogram = CommonString.getDownloadedImageFolder(context);
|
||||||
|
prepareList();
|
||||||
|
prepareDefaultList();
|
||||||
|
cameraMethod();
|
||||||
|
final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
|
fab.setOnClickListener(view -> {
|
||||||
|
expandableListView.clearFocus();
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
//if (validateData(hashMapListHeaderData, hashMapListChildData)) {
|
||||||
|
// if (!validateData(hashMapListHeaderData, hashMapListChildData)) {
|
||||||
|
db.open();
|
||||||
|
if (db.checkStock_Entry_FacingDataNew(store_id, categoryId, visit_date)) {
|
||||||
|
db.updateStock_Entry_FacingNew(visit_date, store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
|
Snackbar.make(expandableListView, getResources().getString(R.string.update_message), Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> msl_availabilityStockFacingList;
|
||||||
|
String mslAvailability_stockFacing_xml = "";
|
||||||
|
String onXML = "";
|
||||||
|
db.open();
|
||||||
|
Log.d("listdata", store_id + "," + visit_date);
|
||||||
|
msl_availabilityStockFacingList = db.getStock_Entry_UploadServerDataNew(store_id, visit_date,
|
||||||
|
keyAccount_id, storeType_id, class_id,CommonString.TABLE_MAPPING_STOCK);
|
||||||
|
Log.d("msllistsize", String.valueOf(msl_availabilityStockFacingList.size()));
|
||||||
|
|
||||||
|
if (msl_availabilityStockFacingList.size() > 0) {
|
||||||
|
for (int j = 0; j < msl_availabilityStockFacingList.size(); j++) {
|
||||||
|
if (!msl_availabilityStockFacingList.get(j).getSku_id().equals("0")) {
|
||||||
|
|
||||||
|
String stock, pricing;
|
||||||
|
if (!msl_availabilityStockFacingList.get(j).getStock().equals("")) {
|
||||||
|
stock = msl_availabilityStockFacingList.get(j).getStock();
|
||||||
|
} else {
|
||||||
|
stock = "0";
|
||||||
|
}
|
||||||
|
if (!msl_availabilityStockFacingList.get(j).getPricingStock().equals("")) {
|
||||||
|
pricing = msl_availabilityStockFacingList.get(j).getPricingStock();
|
||||||
|
} else {
|
||||||
|
pricing = "-1";
|
||||||
|
}
|
||||||
|
onXML = "[ST]"
|
||||||
|
+ "[MID]" + "0" + "[/MID]"
|
||||||
|
+ "[USERID]" + username + "[/USERID]"
|
||||||
|
+ "[SID]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getSku_id()) + "[/SID]"
|
||||||
|
+ "[POSM_STOCK]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getPosmStock()) + "[/POSM_STOCK]"
|
||||||
|
+ "[WAREHOUSE_STOCK]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getWarehouseStock()) + "[/WAREHOUSE_STOCK]"
|
||||||
|
+ "[MBQ]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMbq()) + "[/MBQ]"
|
||||||
|
+ "[ML]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMust_have()) + "[/ML]" +
|
||||||
|
"[/ST]";
|
||||||
|
|
||||||
|
mslAvailability_stockFacing_xml = mslAvailability_stockFacing_xml + onXML;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
final String sos_xml = "[DATA]" + mslAvailability_stockFacing_xml + "[/DATA]";
|
||||||
|
Log.d("MSL_DATA", sos_xml);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
db.InsertStock_EntryNew(visit_date, store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
|
Snackbar.make(expandableListView, getResources().getString(R.string.save_message), Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||||
|
}
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
/*} else {
|
||||||
|
Snackbar.make(expandableListView, Error_Message, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||||
|
for (int i = 0; i < adapter.getGroupCount(); i++)
|
||||||
|
expandableListView.expandGroup(i);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
expandableListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||||
|
@Override
|
||||||
|
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
||||||
|
|
||||||
|
expandableListView.invalidate();
|
||||||
|
|
||||||
|
int lastItem = firstVisibleItem + visibleItemCount;
|
||||||
|
|
||||||
|
if (firstVisibleItem == 0) {
|
||||||
|
fab.show();//.setVisibility(View.VISIBLE);
|
||||||
|
} else if (lastItem == totalItemCount) {
|
||||||
|
fab.hide();//setVisibility(View.INVISIBLE);
|
||||||
|
} else {
|
||||||
|
fab.show();//setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onScrollStateChanged(AbsListView arg0, int arg1) {
|
||||||
|
InputMethodManager inputManager = (InputMethodManager) context
|
||||||
|
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
if (getCurrentFocus() != null) {
|
||||||
|
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||||
|
getCurrentFocus().clearFocus();
|
||||||
|
}
|
||||||
|
expandableListView.invalidateViews();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Listview Group click listener
|
||||||
|
expandableListView.setOnGroupClickListener((parent, v, groupPosition, id) -> false);
|
||||||
|
|
||||||
|
// Listview Group expanded listener
|
||||||
|
expandableListView.setOnGroupExpandListener(groupPosition -> {
|
||||||
|
InputMethodManager inputManager = (InputMethodManager) context
|
||||||
|
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
if (getWindow().getCurrentFocus() != null) {
|
||||||
|
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||||
|
getCurrentFocus().clearFocus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Listview Group collasped listener
|
||||||
|
expandableListView.setOnGroupCollapseListener(groupPosition -> {
|
||||||
|
InputMethodManager inputManager = (InputMethodManager) context
|
||||||
|
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
if (getWindow().getCurrentFocus() != null) {
|
||||||
|
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||||
|
getCurrentFocus().clearFocus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Listview on child click listener
|
||||||
|
expandableListView.setOnChildClickListener((parent, v, groupPosition, childPosition, id) -> false);
|
||||||
|
} catch (Resources.NotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
// getMenuInflater().inflate(R.menu.planogram, menu);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
int id = item.getItemId();
|
||||||
|
if (id == android.R.id.home) {
|
||||||
|
if (editFlag) {
|
||||||
|
CommonFunctions.showAlertDialog(context, getResources().getString(R.string.data_will_be_lost));
|
||||||
|
} else {
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSelect(boolean flag) {
|
||||||
|
if (flag) {
|
||||||
|
if (!validateData(hashMapListHeaderData, hashMapListChildData)) {
|
||||||
|
if (!camera_allow.equals("1")) {
|
||||||
|
db.deletePlanogramListStoreAndCategorywise(store_id, categoryId,
|
||||||
|
planogramShelfHeaderDataList, planogramHashMapListChildData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSave(boolean flag) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private class MyWebViewClient extends WebViewClient {
|
||||||
|
@Override
|
||||||
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||||
|
view.loadUrl(url);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPageFinished(WebView view, String url) {
|
||||||
|
super.onPageFinished(view, url);
|
||||||
|
view.clearCache(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
||||||
|
super.onPageStarted(view, url, favicon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cameraMethod() {
|
||||||
|
if (!camera_allow.equals("1")) {
|
||||||
|
findViewById(R.id.lin_camera).setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
findViewById(R.id.lin_camera).setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Planogram List for check and delete on backPress
|
||||||
|
private void prepareDefaultList() {
|
||||||
|
// Planogram After save shelf header data
|
||||||
|
planogramShelfHeaderDataList = db.getPlanogramAddShelfHeaderAfterSaveData(store_id, categoryId);
|
||||||
|
if (planogramShelfHeaderDataList.size() > 0) {
|
||||||
|
for (int i = 0; i < planogramShelfHeaderDataList.size(); i++) {
|
||||||
|
planogramSkuChildDataList = db.getStockAndFacingPlanogramAfterSKUData(planogramShelfHeaderDataList.get(i).getKey_id());
|
||||||
|
//After save sku child data
|
||||||
|
if (planogramSkuChildDataList.size() > 0) {
|
||||||
|
planogramHashMapListChildData.put(planogramShelfHeaderDataList.get(i), planogramSkuChildDataList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void prepareList() {
|
||||||
|
try {
|
||||||
|
hashMapListHeaderData = new ArrayList<>();
|
||||||
|
hashMapListChildData = new HashMap<>();
|
||||||
|
//Header
|
||||||
|
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||||
|
headerDataList = db.getStockEntryHeaderData(country_id,categoryId, null, null, null,
|
||||||
|
store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide);
|
||||||
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
headerDataList = db.getStockEntryHeaderData(country_id,categoryId, keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADHOC, CommonString.TABLE_MAPPING_SOS_TARGET_ADHOC, store_flag_hide);
|
||||||
|
} else {
|
||||||
|
headerDataList = db.getStockEntryHeaderData(country_id,categoryId, keyAccount_id, storeType_id, class_id,
|
||||||
|
store_id, CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide);
|
||||||
|
}
|
||||||
|
if (headerDataList.size() > 0) {
|
||||||
|
for (int i = 0; i < headerDataList.size(); i++) {
|
||||||
|
hashMapListHeaderData.add(headerDataList.get(i));
|
||||||
|
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||||
|
db.open();
|
||||||
|
childDataList = db.getStock_Entry_SKUDataNewUpdate(headerDataList.get(i).getSub_category_id(),
|
||||||
|
categoryId, headerDataList.get(i).getBrand_id(), null, null, null, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_STOREWISE, store_flag_hide, visit_date, false);
|
||||||
|
updateCoverage(CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||||
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
childDataList = db.getStock_Entry_SKUDataNewUpdate(headerDataList.get(i).getSub_category_id(),
|
||||||
|
categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADHOC, store_flag_hide, visit_date, false);
|
||||||
|
updateCoverage(CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
|
} else {
|
||||||
|
childDataList = db.getStock_Entry_SKUDataNewUpdate(headerDataList.get(i).getSub_category_id(), categoryId,
|
||||||
|
headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK, store_flag_hide, visit_date, false);
|
||||||
|
updateCoverage(CommonString.TABLE_MAPPING_STOCK);
|
||||||
|
}
|
||||||
|
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
adapter = new ExpandableListAdapter(this, hashMapListHeaderData, hashMapListChildData);
|
||||||
|
expandableListView.setAdapter(adapter);
|
||||||
|
//expand all
|
||||||
|
for (int i = 0; i < adapter.getGroupCount(); i++)
|
||||||
|
expandableListView.expandGroup(i);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean validateData(List<MSL_AvailabilityStockFacingGetterSetter> listDataHeader,
|
||||||
|
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> listDataChild) {
|
||||||
|
boolean flag = true, child_flag = true, all_flag = true;
|
||||||
|
checkHeaderArray.clear();
|
||||||
|
int childCount = 0;
|
||||||
|
//temp list data for empty only
|
||||||
|
List<MSL_AvailabilityStockFacingGetterSetter> listDataHeaderTemp = new ArrayList<>();
|
||||||
|
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> listDataChildTemp = new HashMap<>();
|
||||||
|
for (int i = 0; i < listDataHeader.size(); i++) {
|
||||||
|
flag = true;
|
||||||
|
List<MSL_AvailabilityStockFacingGetterSetter> listTemp = new ArrayList<>();
|
||||||
|
for (int j = 0; j < listDataChild.get(listDataHeader.get(i)).size(); j++) {
|
||||||
|
child_flag = true;
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter data = listDataChild.get(listDataHeader.get(i)).get(j);
|
||||||
|
String stock = data.getStock();
|
||||||
|
String faceup = data.getFacing();
|
||||||
|
String defaultpricing = data.getPricing();
|
||||||
|
String pricing = data.getPricingStock();
|
||||||
|
String companyId = data.getCompany_id();
|
||||||
|
String must_have = data.getMust_have();
|
||||||
|
//Company_id
|
||||||
|
if (companyId.equals("1")) {
|
||||||
|
if (must_have.equals("1")) {
|
||||||
|
//usk ksa pricing
|
||||||
|
if (!defaultpricing.equals("0")) {
|
||||||
|
if (!country_id.equals("17") && pricing.equals("")) {
|
||||||
|
if (!checkHeaderArray.contains(i)) {
|
||||||
|
checkHeaderArray.add(i);
|
||||||
|
}
|
||||||
|
scrollPosition = i + j + childCount;
|
||||||
|
all_flag = false;
|
||||||
|
flag = false;
|
||||||
|
child_flag = false;
|
||||||
|
Error_Message = getResources().getString(R.string.title_activity_stock_pricing);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (store_flag_hide.equals("0") && !country_id.equals("15")) {
|
||||||
|
if (!country_id.equals("17") && faceup.equals("")) {
|
||||||
|
if (!checkHeaderArray.contains(i)) {
|
||||||
|
checkHeaderArray.add(i);
|
||||||
|
}
|
||||||
|
scrollPosition = i + j + childCount;
|
||||||
|
all_flag = false;
|
||||||
|
flag = false;
|
||||||
|
child_flag = false;
|
||||||
|
Error_Message = getResources().getString(R.string.faceup_value);
|
||||||
|
} else {
|
||||||
|
if (data.getToggleValue().equals("0") && !country_id.equals("10")) {
|
||||||
|
if (stock.equals("")) {
|
||||||
|
if (!checkHeaderArray.contains(i)) {
|
||||||
|
checkHeaderArray.add(i);
|
||||||
|
}
|
||||||
|
scrollPosition = i + j + childCount;
|
||||||
|
all_flag = false;
|
||||||
|
flag = false;
|
||||||
|
child_flag = false;
|
||||||
|
Error_Message = getResources().getString(R.string.stock_value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//for Egypt
|
||||||
|
if (country_id.equals("6")) {
|
||||||
|
if (stock.equals("")) {
|
||||||
|
if (!checkHeaderArray.contains(i)) {
|
||||||
|
checkHeaderArray.add(i);
|
||||||
|
}
|
||||||
|
scrollPosition = i + j + childCount;
|
||||||
|
all_flag = false;
|
||||||
|
flag = false;
|
||||||
|
child_flag = false;
|
||||||
|
Error_Message = getResources().getString(R.string.stock_value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (data.getToggleValue().equals("0") && !country_id.equals("10")) {
|
||||||
|
if (stock.equals("")) {
|
||||||
|
if (!checkHeaderArray.contains(i)) {
|
||||||
|
checkHeaderArray.add(i);
|
||||||
|
}
|
||||||
|
scrollPosition = i + j + childCount;
|
||||||
|
all_flag = false;
|
||||||
|
flag = false;
|
||||||
|
child_flag = false;
|
||||||
|
Error_Message = getResources().getString(R.string.stock_value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//for Egypt
|
||||||
|
if (country_id.equals("6")) {
|
||||||
|
if (stock.equals("")) {
|
||||||
|
if (!checkHeaderArray.contains(i)) {
|
||||||
|
checkHeaderArray.add(i);
|
||||||
|
}
|
||||||
|
all_flag = false;
|
||||||
|
flag = false;
|
||||||
|
child_flag = false;
|
||||||
|
Error_Message = getResources().getString(R.string.stock_value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (store_flag_hide.equals("0")) {
|
||||||
|
if (country_id != null && !country_id.equals("17") && faceup.equals("")) {
|
||||||
|
if (!checkHeaderArray.contains(i)) {
|
||||||
|
checkHeaderArray.add(i);
|
||||||
|
}
|
||||||
|
scrollPosition = i + j + childCount;
|
||||||
|
all_flag = false;
|
||||||
|
flag = false;
|
||||||
|
child_flag = false;
|
||||||
|
Error_Message = getResources().getString(R.string.faceup_value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!child_flag)
|
||||||
|
listTemp.add(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!flag) {
|
||||||
|
listDataHeaderTemp.add(listDataHeader.get(i));
|
||||||
|
listDataChildTemp.put(listDataHeader.get(i), listTemp);
|
||||||
|
} else {
|
||||||
|
childCount = childCount + listDataChild.get(listDataHeader.get(i)).size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!all_flag) {
|
||||||
|
adapter = new ExpandableListAdapter(context, listDataHeaderTemp, listDataChildTemp);
|
||||||
|
expandableListView.setAdapter(adapter);
|
||||||
|
checkflag = false;
|
||||||
|
} else {
|
||||||
|
checkflag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
super.onBackPressed();
|
||||||
|
if (editFlag) {
|
||||||
|
CommonFunctions.showAlertDialog(context, getResources().getString(R.string.data_will_be_lost));
|
||||||
|
} else {
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ExpandableListAdapter extends BaseExpandableListAdapter {
|
||||||
|
private Context _context;
|
||||||
|
private List<MSL_AvailabilityStockFacingGetterSetter> _listDataHeader;
|
||||||
|
private HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> _listDataChild;
|
||||||
|
|
||||||
|
public ExpandableListAdapter(Context context, List<MSL_AvailabilityStockFacingGetterSetter> listDataHeader,
|
||||||
|
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> listChildData) {
|
||||||
|
this._context = context;
|
||||||
|
this._listDataHeader = listDataHeader;
|
||||||
|
this._listDataChild = listChildData;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getGroup(int groupPosition) {
|
||||||
|
return this._listDataHeader.get(groupPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getGroupCount() {
|
||||||
|
return this._listDataHeader.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getGroupId(int groupPosition) {
|
||||||
|
return groupPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getGroupView(final int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter headerTitle = (MSL_AvailabilityStockFacingGetterSetter) getGroup(groupPosition);
|
||||||
|
|
||||||
|
if (convertView == null) {
|
||||||
|
LayoutInflater infalInflater = (LayoutInflater) this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
convertView = infalInflater.inflate(R.layout.item_msl_availability_stock_facing_header, null, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
TextView txt_categoryHeader = (TextView) convertView.findViewById(R.id.txt_categoryHeader);
|
||||||
|
RelativeLayout rel_header = (RelativeLayout) convertView.findViewById(R.id.rel_categoryHeader);
|
||||||
|
ImageView img_camera = (ImageView) convertView.findViewById(R.id.img_camera);
|
||||||
|
CardView card_view = (CardView) convertView.findViewById(R.id.card_view);
|
||||||
|
txt_categoryHeader.setTypeface(null, Typeface.BOLD);
|
||||||
|
|
||||||
|
if (headerTitle.getCompany_id().equals("1")) {
|
||||||
|
txt_categoryHeader.setTextColor(getResources().getColor(R.color.header_text_color));
|
||||||
|
} else {
|
||||||
|
txt_categoryHeader.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
}
|
||||||
|
txt_categoryHeader.setText(headerTitle.getSub_category() + "-" + headerTitle.getBrand());
|
||||||
|
|
||||||
|
if (!checkflag) {
|
||||||
|
if (checkHeaderArray.contains(groupPosition)) {
|
||||||
|
card_view.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
txt_categoryHeader.setTextColor(getResources().getColor(R.color.white));
|
||||||
|
} else {
|
||||||
|
card_view.setCardBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getChild(int groupPosition, int childPosititon) {
|
||||||
|
return this._listDataChild.get(this._listDataHeader.get(groupPosition)).get(childPosititon);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getChildrenCount(int groupPosition) {
|
||||||
|
return this._listDataChild.get(this._listDataHeader.get(groupPosition)).size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getChildId(int groupPosition, int childPosition) {
|
||||||
|
return childPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild,
|
||||||
|
View convertView, ViewGroup parent) {
|
||||||
|
|
||||||
|
final MSL_AvailabilityStockFacingGetterSetter childData =
|
||||||
|
(MSL_AvailabilityStockFacingGetterSetter) getChild(groupPosition, childPosition);
|
||||||
|
ViewHolder holder = null;
|
||||||
|
|
||||||
|
if (convertView == null) {
|
||||||
|
LayoutInflater infalInflater = (LayoutInflater) this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
convertView = infalInflater.inflate(R.layout.item_stock_entry_child, null, false);
|
||||||
|
holder = new ViewHolder();
|
||||||
|
holder.cardView = (CardView) convertView.findViewById(R.id.card_view);
|
||||||
|
holder.txt_skuName = (TextView) convertView.findViewById(R.id.txt_skuName);
|
||||||
|
holder.posmStockET = convertView.findViewById(R.id.posmStockET);
|
||||||
|
holder.warehouse_StockET = convertView.findViewById(R.id.warehouse_StockET);
|
||||||
|
convertView.setTag(holder);
|
||||||
|
} else {
|
||||||
|
holder = (ViewHolder) convertView.getTag();
|
||||||
|
}
|
||||||
|
holder.txt_skuName.setText(childData.getSku());
|
||||||
|
|
||||||
|
|
||||||
|
/* if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
|
||||||
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.light_green_background));
|
||||||
|
holder.txt_mbq.setVisibility(View.VISIBLE);
|
||||||
|
holder.toggle_available.setVisibility(View.VISIBLE);
|
||||||
|
holder.toggle_available.setId(childPosition);
|
||||||
|
if (country_id.equals("6") || country_id.equals("10")) {
|
||||||
|
holder.stock.setVisibility(View.VISIBLE);
|
||||||
|
holder.stock_view.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (childData.getToggleValue().equals("1")) {
|
||||||
|
holder.stock.setVisibility(View.GONE);
|
||||||
|
holder.stock_view.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
holder.stock.setVisibility(View.VISIBLE);
|
||||||
|
holder.stock_view.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
holder.txt_mbq.setVisibility(View.GONE);
|
||||||
|
holder.toggle_available.setVisibility(View.GONE);
|
||||||
|
holder.toggle_available.setId(childPosition);
|
||||||
|
holder.stock.setVisibility(View.GONE);
|
||||||
|
holder.stock_view.setVisibility(View.GONE);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/*if (country_id != null && !country_id.equals("17")) {
|
||||||
|
if (childData.getPricing().equals("0")) {
|
||||||
|
holder.ed_pricing.setVisibility(View.GONE);
|
||||||
|
holder.pricing_view.setVisibility(View.GONE);
|
||||||
|
holder.ed_pricing.setId(childPosition);
|
||||||
|
holder.pricing_view.setId(childPosition);
|
||||||
|
} else {
|
||||||
|
holder.ed_pricing.setVisibility(View.VISIBLE);
|
||||||
|
holder.pricing_view.setVisibility(View.VISIBLE);
|
||||||
|
holder.ed_pricing.setId(childPosition);
|
||||||
|
holder.pricing_view.setId(childPosition);
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/* if (childData.getCompany_id().equals("1")) {
|
||||||
|
if (country_id != null && country_id.equals("17") && !childData.getPricing().equals("0")) {
|
||||||
|
holder.ed_pricing.setVisibility(View.VISIBLE);
|
||||||
|
holder.pricing_view.setVisibility(View.VISIBLE);
|
||||||
|
holder.ed_pricing.setId(childPosition);
|
||||||
|
holder.pricing_view.setId(childPosition);
|
||||||
|
} else {
|
||||||
|
holder.ed_pricing.setVisibility(View.GONE);
|
||||||
|
holder.pricing_view.setVisibility(View.GONE);
|
||||||
|
holder.ed_pricing.setId(childPosition);
|
||||||
|
holder.pricing_view.setId(childPosition);
|
||||||
|
}
|
||||||
|
if (childData.getMust_have().equals("1")) {
|
||||||
|
holder.txt_skuName.setTextColor(getResources().getColor(R.color.colorPrimary));
|
||||||
|
} else {
|
||||||
|
if (country_id != null && country_id.equals("17")) {
|
||||||
|
holder.toggle_available.setVisibility(View.VISIBLE);
|
||||||
|
holder.toggle_available.setId(childPosition);
|
||||||
|
}
|
||||||
|
holder.txt_skuName.setTextColor(getResources().getColor(R.color.blue));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (country_id != null && country_id.equals("17")) {
|
||||||
|
holder.ed_pricing.setVisibility(View.GONE);
|
||||||
|
holder.pricing_view.setVisibility(View.GONE);
|
||||||
|
holder.ed_pricing.setId(childPosition);
|
||||||
|
holder.pricing_view.setId(childPosition);
|
||||||
|
holder.toggle_available.setVisibility(View.VISIBLE);
|
||||||
|
holder.toggle_available.setId(childPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.txt_skuName.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
}*/
|
||||||
|
|
||||||
|
final ViewHolder finalHolder = holder;
|
||||||
|
|
||||||
|
holder.warehouse_StockET.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
|
final EditText caption = (EditText) v;
|
||||||
|
String edFaceup = caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
||||||
|
|
||||||
|
editFlag = true;
|
||||||
|
|
||||||
|
if (edFaceup != null && !edFaceup.equals("") && !edFaceup.equals(".")) {
|
||||||
|
finalHolder.warehouse_StockET.setText(edFaceup);
|
||||||
|
childData.setWarehouseStock(edFaceup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
holder.warehouse_StockET.setText(childData.getWarehouseStock());
|
||||||
|
|
||||||
|
holder.posmStockET.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
|
final EditText caption = (EditText) v;
|
||||||
|
String edFaceup = caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
||||||
|
|
||||||
|
editFlag = true;
|
||||||
|
|
||||||
|
if (edFaceup != null && !edFaceup.equals("") && !edFaceup.equals(".")) {
|
||||||
|
finalHolder.posmStockET.setText(edFaceup);
|
||||||
|
childData.setPosmStock(edFaceup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
holder.posmStockET.setText(childData.getPosmStock());
|
||||||
|
|
||||||
|
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasStableIds() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isChildSelectable(int groupPosition, int childPosition) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewHolder {
|
||||||
|
CardView cardView;
|
||||||
|
TextView txt_skuName;
|
||||||
|
EditText posmStockET, warehouse_StockET;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressLint("LongLogTag")
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
Log.e("MSL_AVailability_StockFacing", "resultCode: " + resultCode);
|
||||||
|
|
||||||
|
switch (requestCode) {
|
||||||
|
case 100:
|
||||||
|
//Planogram List for check and delete on backPress
|
||||||
|
prepareDefaultList();
|
||||||
|
if (db.isPlanogramAddShelfSaveData(store_id, categoryId)) {
|
||||||
|
camera1.setBackgroundResource(R.mipmap.new_no_camera_done_edit);
|
||||||
|
} else {
|
||||||
|
camera1.setBackgroundResource(R.mipmap.new_no_camera);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String PerfectDecimal(String str, int MAX_BEFORE_POINT, int MAX_DECIMAL) {
|
||||||
|
if (str.charAt(0) == '.') str = "0" + str;
|
||||||
|
int max = str.length();
|
||||||
|
|
||||||
|
String rFinal = "";
|
||||||
|
boolean after = false;
|
||||||
|
int i = 0, up = 0, decimal = 0;
|
||||||
|
char t;
|
||||||
|
while (i < max) {
|
||||||
|
t = str.charAt(i);
|
||||||
|
if (t != '.' && after == false) {
|
||||||
|
up++;
|
||||||
|
if (up > MAX_BEFORE_POINT) return rFinal;
|
||||||
|
} else if (t == '.') {
|
||||||
|
after = true;
|
||||||
|
} else {
|
||||||
|
decimal++;
|
||||||
|
if (decimal > MAX_DECIMAL)
|
||||||
|
return rFinal;
|
||||||
|
}
|
||||||
|
rFinal = rFinal + t;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return rFinal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DecimalDigitsInputFilter implements InputFilter {
|
||||||
|
Pattern mPattern;
|
||||||
|
|
||||||
|
public DecimalDigitsInputFilter(int digitsBeforeZero, int digitsAfterZero) {
|
||||||
|
mPattern = Pattern.compile("[0-9]{0," + (digitsBeforeZero - 1) + "}+((\\.[0-9]{0," + (digitsAfterZero - 1) + "})?)||(\\.)?");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
|
||||||
|
Matcher matcher = mPattern.matcher(dest);
|
||||||
|
if (!matcher.matches())
|
||||||
|
return "";
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateCoverage(String table) {
|
||||||
|
long l = db.updateStockMapping(store_id, visit_date, table);
|
||||||
|
if (l > 0) Log.e("CoverageUpdate", "" + l);
|
||||||
|
}
|
||||||
|
}
|
||||||
+26
-227
@@ -161,7 +161,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
//Stock Facing List
|
//Stock Facing List
|
||||||
prepareList();
|
prepareList();
|
||||||
|
|
||||||
str = CommonString.FILE_PATH + _pathforcheck;
|
str = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
|
|
||||||
prepareDefaultList();
|
prepareDefaultList();
|
||||||
|
|
||||||
@@ -552,15 +552,6 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
Error_Message = getResources().getString(R.string.fill_data);
|
Error_Message = getResources().getString(R.string.fill_data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/*} else {
|
|
||||||
if (!checkHeaderArray.contains(i)) {
|
|
||||||
checkHeaderArray.add(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
flag = false;
|
|
||||||
Error_Message = getResources().getString(R.string.click_image);
|
|
||||||
break;
|
|
||||||
}*/
|
|
||||||
} else {
|
} else {
|
||||||
if (stock.equals("")) {
|
if (stock.equals("")) {
|
||||||
if (!checkHeaderArray.contains(i)) {
|
if (!checkHeaderArray.contains(i)) {
|
||||||
@@ -777,43 +768,6 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void startCameraActivity1(int position) {
|
private void startCameraActivity1(int position) {
|
||||||
/*try {
|
|
||||||
Log.e("Stock & Facing ", "startCameraActivity()");
|
|
||||||
File file = new File(path);
|
|
||||||
Uri outputFileUri = FileProvider.getUriForFile(getApplicationContext(), "cpm.com.gskmtorange.fileprovider", file);
|
|
||||||
|
|
||||||
String defaultCameraPackage = "";
|
|
||||||
final PackageManager packageManager = getPackageManager();
|
|
||||||
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
|
||||||
for (int n = 0; n < list.size(); n++) {
|
|
||||||
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
|
||||||
*//*Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
|
||||||
Log.e("TAG", "package name : " + list.get(n).packageName);*//*
|
|
||||||
|
|
||||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
||||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
|
||||||
defaultCameraPackage = list.get(n).packageName;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Gallery")) {
|
|
||||||
defaultCameraPackage = list.get(n).packageName;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
|
|
||||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
|
||||||
intent.setPackage(defaultCameraPackage);
|
|
||||||
startActivityForResult(intent, 1);
|
|
||||||
//startActivityForResult(intent, position);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Log.e("MakeMachine", "startCameraActivity()");
|
Log.e("MakeMachine", "startCameraActivity()");
|
||||||
File file = new File(path);
|
File file = new File(path);
|
||||||
@@ -863,40 +817,6 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void startCameraActivity2(int position) {
|
private void startCameraActivity2(int position) {
|
||||||
/*try {
|
|
||||||
Log.i("Stock & Facing ", "startCameraActivity()");
|
|
||||||
File file = new File(path);
|
|
||||||
Uri outputFileUri = FileProvider.getUriForFile(getApplicationContext(), "cpm.com.gskmtorange.fileprovider", file);
|
|
||||||
|
|
||||||
String defaultCameraPackage = "";
|
|
||||||
final PackageManager packageManager = getPackageManager();
|
|
||||||
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
|
||||||
for (int n = 0; n < list.size(); n++) {
|
|
||||||
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
|
||||||
*//*Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
|
||||||
Log.e("TAG", "package name : " + list.get(n).packageName);*//*
|
|
||||||
|
|
||||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
||||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
|
||||||
defaultCameraPackage = list.get(n).packageName;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Gallery")) {
|
|
||||||
defaultCameraPackage = list.get(n).packageName;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
|
|
||||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
|
||||||
intent.setPackage(defaultCameraPackage);
|
|
||||||
startActivityForResult(intent, 2);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Log.e("MakeMachine", "startCameraActivity()");
|
Log.e("MakeMachine", "startCameraActivity()");
|
||||||
@@ -949,144 +869,8 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
Log.e("Stock & Facing", "resultCode: " + resultCode);
|
Log.e("Stock & Facing", "resultCode: " + resultCode);
|
||||||
/*switch (resultCode) {
|
|
||||||
case 0:
|
|
||||||
Log.e("Stock & Facing", "User cancelled");
|
|
||||||
break;
|
|
||||||
case -1:
|
|
||||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
|
||||||
if (new File(str + _pathforcheck).exists()) {
|
|
||||||
img1 = _pathforcheck;
|
|
||||||
adapter.notifyDataSetChanged();
|
|
||||||
_pathforcheck = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
switch (requestCode) {
|
switch (requestCode) {
|
||||||
/*case 1:
|
|
||||||
if (resultCode == -1) {
|
|
||||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
|
||||||
if (new File(str + _pathforcheck).exists()) {
|
|
||||||
img1 = _pathforcheck;
|
|
||||||
adapter.notifyDataSetChanged();
|
|
||||||
_pathforcheck = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.e("Stock & Facing", "User cancelled");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
if (resultCode == -1) {
|
|
||||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
|
||||||
if (new File(str + _pathforcheck).exists()) {
|
|
||||||
img2 = _pathforcheck;
|
|
||||||
adapter.notifyDataSetChanged();
|
|
||||||
_pathforcheck = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.e("Stock & Facing", "User cancelled");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
if (resultCode == -1) {
|
|
||||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
|
||||||
if (new File(str + _pathforcheck).exists()) {
|
|
||||||
img3 = _pathforcheck;
|
|
||||||
_pathforcheck = "";
|
|
||||||
|
|
||||||
if (!img3.equalsIgnoreCase("")) {
|
|
||||||
cameraData.setCamera1(img3);
|
|
||||||
img3 = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cameraData.getCamera1().equals("")) {
|
|
||||||
camera1.setBackgroundResource(R.mipmap.camera_orange);
|
|
||||||
} else {
|
|
||||||
camera1.setBackgroundResource(R.mipmap.camera_green);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.e("Stock & Facing", "User cancelled");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
if (resultCode == -1) {
|
|
||||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
|
||||||
if (new File(str + _pathforcheck).exists()) {
|
|
||||||
img4 = _pathforcheck;
|
|
||||||
_pathforcheck = "";
|
|
||||||
|
|
||||||
if (!img4.equalsIgnoreCase("")) {
|
|
||||||
cameraData.setCamera2(img4);
|
|
||||||
img4 = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cameraData.getCamera2().equals("")) {
|
|
||||||
camera2.setBackgroundResource(R.mipmap.camera_orange);
|
|
||||||
} else {
|
|
||||||
camera2.setBackgroundResource(R.mipmap.camera_green);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.e("Stock & Facing", "User cancelled");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 5:
|
|
||||||
if (resultCode == -1) {
|
|
||||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
|
||||||
if (new File(str + _pathforcheck).exists()) {
|
|
||||||
img5 = _pathforcheck;
|
|
||||||
_pathforcheck = "";
|
|
||||||
|
|
||||||
if (!img5.equalsIgnoreCase("")) {
|
|
||||||
cameraData.setCamera3(img5);
|
|
||||||
img5 = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cameraData.getCamera3().equals("")) {
|
|
||||||
camera3.setBackgroundResource(R.mipmap.camera_orange);
|
|
||||||
} else {
|
|
||||||
camera3.setBackgroundResource(R.mipmap.camera_green);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.e("Stock & Facing", "User cancelled");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 6:
|
|
||||||
if (resultCode == -1) {
|
|
||||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
|
||||||
if (new File(str + _pathforcheck).exists()) {
|
|
||||||
img6 = _pathforcheck;
|
|
||||||
_pathforcheck = "";
|
|
||||||
|
|
||||||
if (!img6.equalsIgnoreCase("")) {
|
|
||||||
cameraData.setCamera4(img6);
|
|
||||||
img6 = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cameraData.getCamera4().equals("")) {
|
|
||||||
camera4.setBackgroundResource(R.mipmap.camera_orange);
|
|
||||||
} else {
|
|
||||||
camera4.setBackgroundResource(R.mipmap.camera_green);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.e("Stock & Facing", "User cancelled");
|
|
||||||
}
|
|
||||||
break;*/
|
|
||||||
|
|
||||||
case 100:
|
case 100:
|
||||||
//Planogram List for check and delete on backPress
|
//Planogram List for check and delete on backPress
|
||||||
@@ -1132,10 +916,25 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
|
||||||
cdate = arabicToenglish(cdate);
|
cdate = arabicToenglish(cdate);
|
||||||
}else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KUWAIT)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_BAHRAIN)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_OMAN)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_QATAR)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}
|
||||||
|
else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LEBANON)) {
|
||||||
|
cdate = arabicToenglish(cdate);
|
||||||
|
}
|
||||||
|
else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LIBIYA)) {
|
||||||
cdate = arabicToenglish(cdate);
|
cdate = arabicToenglish(cdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cdate;
|
return cdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1192,9 +991,9 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> mappingPlanogramList;
|
ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> mappingPlanogramList;
|
||||||
|
|
||||||
if (country_id.equals("7")) {
|
if (country_id.equals("7")) {
|
||||||
mappingPlanogramList= db.getMappingPlanogramData(categoryId, null, null, store_id, CommonString.TABLE_MAPPING_PLANOGRAM_STORE_WISE);
|
mappingPlanogramList = db.getMappingPlanogramData(categoryId, null, null, store_id, CommonString.TABLE_MAPPING_PLANOGRAM_STORE_WISE);
|
||||||
} else {
|
} else {
|
||||||
mappingPlanogramList= db.getMappingPlanogramData(categoryId, storeType_id, class_id, null, CommonString.TABLE_MAPPING_PLANOGRAM);
|
mappingPlanogramList = db.getMappingPlanogramData(categoryId, storeType_id, class_id, null, CommonString.TABLE_MAPPING_PLANOGRAM);
|
||||||
}
|
}
|
||||||
|
|
||||||
//ImageView img_planogram = (ImageView) dialog.findViewById(R.id.img_planogram);
|
//ImageView img_planogram = (ImageView) dialog.findViewById(R.id.img_planogram);
|
||||||
@@ -1210,13 +1009,13 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
planogram_image = mappingPlanogramList.get(0).getPLANOGRAM_IMAGE();
|
planogram_image = mappingPlanogramList.get(0).getPLANOGRAM_IMAGE();
|
||||||
}
|
}
|
||||||
if (!planogram_image.equals("")) {
|
if (!planogram_image.equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH_PLANOGRAM + planogram_image).exists()) {
|
if (new File(CommonString.getDownloadedImageFolder(context) + planogram_image).exists()) {
|
||||||
Bitmap bmp = BitmapFactory.decodeFile(CommonString.FILE_PATH_PLANOGRAM + planogram_image);
|
Bitmap bmp = BitmapFactory.decodeFile(CommonString.getDownloadedImageFolder(context) + planogram_image);
|
||||||
// img_planogram.setRotation(90);
|
// img_planogram.setRotation(90);
|
||||||
//img_planogram.setImageBitmap(bmp);
|
//img_planogram.setImageBitmap(bmp);
|
||||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||||
|
|
||||||
String imagePath = "file://" + CommonString.FILE_PATH_PLANOGRAM + "/" + planogram_image;
|
String imagePath = "file://" + CommonString.getDownloadedImageFolder(context) + "/" + planogram_image;
|
||||||
String html = "<html><head></head><body><img src=\"" + imagePath + "\"></body></html>";
|
String html = "<html><head></head><body><img src=\"" + imagePath + "\"></body></html>";
|
||||||
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
||||||
|
|
||||||
@@ -1267,9 +1066,9 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
//super.onBackPressed();
|
|
||||||
|
|
||||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(Stock_FacingActivity.this);
|
super.onBackPressed();
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(Stock_FacingActivity.this);
|
||||||
builder.setTitle(getResources().getString(R.string.dialog_title));
|
builder.setTitle(getResources().getString(R.string.dialog_title));
|
||||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||||
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
@@ -1290,7 +1089,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
android.app.AlertDialog alert = builder.create();
|
AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-25
@@ -31,10 +31,7 @@ import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
|||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.dailyentry.CoachingVisitActivity;
|
|
||||||
import cpm.com.gskmtorange.dailyentry.MessageActivity;
|
import cpm.com.gskmtorange.dailyentry.MessageActivity;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.StoreWisePerformaceGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.StoreWisePerformaceGetterSetter;
|
||||||
|
|
||||||
public class StoreWisePerformanceActivity extends AppCompatActivity {
|
public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||||
@@ -64,7 +61,7 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
|||||||
context = this;
|
context = this;
|
||||||
//preference data
|
//preference data
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
CommonFunctions.updateLangResources(context,preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
date = preferences.getString(CommonString.KEY_DATE, null);
|
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
@@ -75,8 +72,6 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
|||||||
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||||
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
||||||
|
|
||||||
|
|
||||||
toolbar.setTitle(getResources().getString(R.string.title_activity_store_wise_performance));
|
toolbar.setTitle(getResources().getString(R.string.title_activity_store_wise_performance));
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
@@ -116,12 +111,10 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
|||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
Intent intent = new Intent(StoreWisePerformanceActivity.this, MessageActivity.class);
|
Intent intent = new Intent(StoreWisePerformanceActivity.this, MessageActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Resources.NotFoundException e) {
|
} catch (Resources.NotFoundException e) {
|
||||||
@@ -134,17 +127,12 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
try {
|
try {
|
||||||
CommonFunctions.updateLangResources(context,preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
|
||||||
storeWisePerformanceList = db.getStoreWisePerformance(store_id, CommonString.TABLE_STORE_PERFORMANCE_NEW_ADHOC);
|
storeWisePerformanceList = db.getStoreWisePerformance(store_id, CommonString.TABLE_STORE_PERFORMANCE_NEW_ADHOC);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
storeWisePerformanceList = db.getStoreWisePerformance(store_id, "STORE_PERFORMANCE_REVISED");
|
storeWisePerformanceList = db.getStoreWisePerformance(store_id, "STORE_PERFORMANCE_REVISED");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
adapter = new StoreWisePerformaceAdapter(StoreWisePerformanceActivity.this, storeWisePerformanceList);
|
adapter = new StoreWisePerformaceAdapter(StoreWisePerformanceActivity.this, storeWisePerformanceList);
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||||
@@ -155,21 +143,15 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
// Handle action bar item clicks here. The action bar will
|
|
||||||
// automatically handle clicks on the Home/Up button, so long
|
|
||||||
// as you specify a parent activity in AndroidManifest.xml.
|
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
if (id == android.R.id.home) {
|
if (id == android.R.id.home) {
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
//noinspection SimplifiableIfStatement
|
//noinspection SimplifiableIfStatement
|
||||||
if (id == R.id.action_settings) {
|
if (id == R.id.action_settings) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +183,6 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(StoreWisePerformaceAdapter.MyViewHolder holder, int position) {
|
public void onBindViewHolder(StoreWisePerformaceAdapter.MyViewHolder holder, int position) {
|
||||||
final StoreWisePerformaceGetterSetter categoryData = list.get(position);
|
final StoreWisePerformaceGetterSetter categoryData = list.get(position);
|
||||||
|
|
||||||
if (categoryData.getPeriod().equalsIgnoreCase("LTM")) {
|
if (categoryData.getPeriod().equalsIgnoreCase("LTM")) {
|
||||||
holder.txt_period.setText(getResources().getString(R.string.category_performance_ltm));
|
holder.txt_period.setText(getResources().getString(R.string.category_performance_ltm));
|
||||||
} else if (categoryData.getPeriod().equalsIgnoreCase("MTD")) {
|
} else if (categoryData.getPeriod().equalsIgnoreCase("MTD")) {
|
||||||
@@ -223,7 +204,7 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MyViewHolder extends RecyclerView.ViewHolder {
|
class MyViewHolder extends RecyclerView.ViewHolder {
|
||||||
TextView txt_period, txt_sos, txt_t2p, txt_promo, txt_msl_availability,txt_planogram;
|
TextView txt_period, txt_sos, txt_t2p, txt_promo, txt_msl_availability, txt_planogram;
|
||||||
LinearLayout lay_menu;
|
LinearLayout lay_menu;
|
||||||
|
|
||||||
public MyViewHolder(View itemView) {
|
public MyViewHolder(View itemView) {
|
||||||
@@ -236,7 +217,6 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
|||||||
txt_msl_availability = (TextView) itemView.findViewById(R.id.txt_msl_availability);
|
txt_msl_availability = (TextView) itemView.findViewById(R.id.txt_msl_availability);
|
||||||
txt_planogram = (TextView) itemView.findViewById(R.id.txt_planogram);
|
txt_planogram = (TextView) itemView.findViewById(R.id.txt_planogram);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,8 +138,7 @@ public class ChangePasswordActivity extends AppCompatActivity implements View.On
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
|
|
||||||
switch (id){
|
if (id == R.id.img_info) {
|
||||||
case R.id.img_info:
|
|
||||||
|
|
||||||
Dialog dialog = new Dialog(ChangePasswordActivity.this);
|
Dialog dialog = new Dialog(ChangePasswordActivity.this);
|
||||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
@@ -147,16 +146,14 @@ public class ChangePasswordActivity extends AppCompatActivity implements View.On
|
|||||||
dialog.setContentView(R.layout.password_rule_dialog);
|
dialog.setContentView(R.layout.password_rule_dialog);
|
||||||
dialog.show();
|
dialog.show();
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.btn_submit) {
|
||||||
|
|
||||||
case R.id.btn_submit:
|
if (isValid()) {
|
||||||
|
// your code here
|
||||||
if(isValid()){
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isValid(){
|
boolean isValid(){
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
package cpm.com.gskmtorange.password;
|
package cpm.com.gskmtorange.password;
|
||||||
|
|
||||||
|
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.ProgressDialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -21,8 +22,9 @@ import android.os.AsyncTask;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.os.Trace;
|
import android.os.Looper;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
@@ -30,7 +32,6 @@ import android.view.WindowManager;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
//import com.crashlytics.android.Crashlytics;
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.core.app.ActivityCompat;
|
import androidx.core.app.ActivityCompat;
|
||||||
@@ -42,12 +43,16 @@ import com.google.android.gms.common.api.GoogleApiClient;
|
|||||||
import com.google.android.gms.common.api.PendingResult;
|
import com.google.android.gms.common.api.PendingResult;
|
||||||
import com.google.android.gms.common.api.ResultCallback;
|
import com.google.android.gms.common.api.ResultCallback;
|
||||||
import com.google.android.gms.common.api.Status;
|
import com.google.android.gms.common.api.Status;
|
||||||
|
import com.google.android.gms.location.FusedLocationProviderClient;
|
||||||
|
import com.google.android.gms.location.LocationCallback;
|
||||||
import com.google.android.gms.location.LocationListener;
|
import com.google.android.gms.location.LocationListener;
|
||||||
import com.google.android.gms.location.LocationRequest;
|
import com.google.android.gms.location.LocationRequest;
|
||||||
|
import com.google.android.gms.location.LocationResult;
|
||||||
import com.google.android.gms.location.LocationServices;
|
import com.google.android.gms.location.LocationServices;
|
||||||
import com.google.android.gms.location.LocationSettingsRequest;
|
import com.google.android.gms.location.LocationSettingsRequest;
|
||||||
import com.google.android.gms.location.LocationSettingsResult;
|
import com.google.android.gms.location.LocationSettingsResult;
|
||||||
import com.google.android.gms.location.LocationSettingsStatusCodes;
|
import com.google.android.gms.location.LocationSettingsStatusCodes;
|
||||||
|
import com.google.android.gms.location.Priority;
|
||||||
import com.google.android.gms.maps.model.LatLng;
|
import com.google.android.gms.maps.model.LatLng;
|
||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
@@ -69,7 +74,9 @@ import java.io.StringReader;
|
|||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.LoginActivity;
|
import cpm.com.gskmtorange.LoginActivity;
|
||||||
import cpm.com.gskmtorange.MainActivity;
|
import cpm.com.gskmtorange.MainActivity;
|
||||||
@@ -87,10 +94,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
||||||
|
|
||||||
public class MPinActivity extends AppCompatActivity implements
|
public class MPinActivity extends AppCompatActivity implements View.OnClickListener, BlurLockView.OnPasswordInputListener, BlurLockView.OnLeftButtonClickListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
||||||
View.OnClickListener,
|
|
||||||
BlurLockView.OnPasswordInputListener,
|
|
||||||
BlurLockView.OnLeftButtonClickListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
|
||||||
|
|
||||||
BlurLockView blurLockView;
|
BlurLockView blurLockView;
|
||||||
ImageView imageView1;
|
ImageView imageView1;
|
||||||
@@ -115,6 +119,8 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
private static final int MY_PERMISSIONS_REQUEST_STORAGE_READ = 12;
|
private static final int MY_PERMISSIONS_REQUEST_STORAGE_READ = 12;
|
||||||
private static final int MY_PERMISSIONS_REQUEST_STORAGE_WRITE = 14;
|
private static final int MY_PERMISSIONS_REQUEST_STORAGE_WRITE = 14;
|
||||||
|
|
||||||
|
private static final int PERMISSION_ALL = 99;
|
||||||
|
|
||||||
GoogleApiClient mGoogleApiClient;
|
GoogleApiClient mGoogleApiClient;
|
||||||
private static int UPDATE_INTERVAL = 200; // 5 sec
|
private static int UPDATE_INTERVAL = 200; // 5 sec
|
||||||
private static int FATEST_INTERVAL = 100; // 1 sec
|
private static int FATEST_INTERVAL = 100; // 1 sec
|
||||||
@@ -125,6 +131,10 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
private LocationRequest mLocationRequest;
|
private LocationRequest mLocationRequest;
|
||||||
private Context context;
|
private Context context;
|
||||||
|
|
||||||
|
//New Location Changes
|
||||||
|
private FusedLocationProviderClient fusedLocationProviderClient;
|
||||||
|
LocationRequest locationRequest;
|
||||||
|
|
||||||
double lat = 0.0;
|
double lat = 0.0;
|
||||||
double lon = 0.0;
|
double lon = 0.0;
|
||||||
|
|
||||||
@@ -137,13 +147,7 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
setContentView(R.layout.activity_mpin);
|
setContentView(R.layout.activity_mpin);
|
||||||
|
|
||||||
context = this;
|
context = this;
|
||||||
/*Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);
|
||||||
setSupportActionBar(toolbar);*/
|
|
||||||
|
|
||||||
// Obtain the FirebaseAnalytics instance.
|
|
||||||
// mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
|
|
||||||
// myTrace = FirebasePerformance.getInstance().newTrace("test_trace");
|
|
||||||
// myTrace.start();
|
|
||||||
|
|
||||||
IS_PASSWORD_CHECK = getIntent().getBooleanExtra(CommonString.IS_PASSWORD_CHECK, false);
|
IS_PASSWORD_CHECK = getIntent().getBooleanExtra(CommonString.IS_PASSWORD_CHECK, false);
|
||||||
|
|
||||||
@@ -153,6 +157,8 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
editor = preferences.edit();
|
editor = preferences.edit();
|
||||||
|
//USK
|
||||||
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
app_ver = String.valueOf(getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
|
app_ver = String.valueOf(getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
|
||||||
@@ -186,26 +192,124 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
blurLockView.setTypeface(getTypeface());
|
blurLockView.setTypeface(getTypeface());
|
||||||
blurLockView.setOnLeftButtonClickListener(this);
|
blurLockView.setOnLeftButtonClickListener(this);
|
||||||
blurLockView.setOnPasswordInputListener(this);
|
blurLockView.setOnPasswordInputListener(this);
|
||||||
|
|
||||||
//blurLockView.setType(getPasswordType(), false);
|
|
||||||
//blurLockView.setPasswordLength(4);
|
|
||||||
|
|
||||||
/* blurLockView.show(
|
|
||||||
getIntent().getIntExtra("SHOW_DURATION", 1000),
|
|
||||||
getShowType(getIntent().getIntExtra("SHOW_DIRECTION", 0)),
|
|
||||||
getEaseType(getIntent().getIntExtra("SHOW_EASE_TYPE", 30)));*/
|
|
||||||
blurLockView.setType(Password.NUMBER, true);
|
blurLockView.setType(Password.NUMBER, true);
|
||||||
|
|
||||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
fab.setOnClickListener(new View.OnClickListener() {
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
.setAction("Action", null).show();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
checkAppPermission(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA);
|
// checkAppPermission(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA);
|
||||||
|
checkAndRequestPermissions();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkAndRequestPermissions() {
|
||||||
|
int CAMERA = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA);
|
||||||
|
int ACCESS_NETWORK_STATE = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_NETWORK_STATE);
|
||||||
|
int ACCESS_COARSE_LOCATION = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION);
|
||||||
|
int locationPermission = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);
|
||||||
|
int READ_PHONE_STATE = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE);
|
||||||
|
List<String> listPermissionsNeeded = new ArrayList<>();
|
||||||
|
|
||||||
|
if (CAMERA != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
listPermissionsNeeded.add(Manifest.permission.CAMERA);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ACCESS_NETWORK_STATE != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
listPermissionsNeeded.add(Manifest.permission.ACCESS_NETWORK_STATE);
|
||||||
|
}
|
||||||
|
if (ACCESS_COARSE_LOCATION != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
listPermissionsNeeded.add(Manifest.permission.ACCESS_COARSE_LOCATION);
|
||||||
|
}
|
||||||
|
if (locationPermission != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
listPermissionsNeeded.add(Manifest.permission.ACCESS_FINE_LOCATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (READ_PHONE_STATE != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
listPermissionsNeeded.add(Manifest.permission.READ_PHONE_STATE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!listPermissionsNeeded.isEmpty()) {
|
||||||
|
ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]), PERMISSION_ALL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (checkPlayServices()) {
|
||||||
|
// Building the GoogleApi client
|
||||||
|
buildGoogleApiClient();
|
||||||
|
createLocationRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create an instance of GoogleAPIClient.
|
||||||
|
if (mGoogleApiClient == null) {
|
||||||
|
mGoogleApiClient = new GoogleApiClient.Builder(context).addConnectionCallbacks(this).addOnConnectionFailedListener(this).addApi(LocationServices.API).build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[], @NonNull int[] grantResults) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
|
Log.d("", "Permission callback called-------");
|
||||||
|
|
||||||
|
if (checkPlayServices()) {
|
||||||
|
// Building the GoogleApi client
|
||||||
|
buildGoogleApiClient();
|
||||||
|
createLocationRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create an instance of GoogleAPIClient.
|
||||||
|
if (mGoogleApiClient == null) {
|
||||||
|
mGoogleApiClient = new GoogleApiClient.Builder(this).addConnectionCallbacks(this).addOnConnectionFailedListener(this).addApi(LocationServices.API).build();
|
||||||
|
}
|
||||||
|
if (requestCode == PERMISSION_ALL) {
|
||||||
|
Map<String, Integer> perms = new HashMap<>();
|
||||||
|
// Initialize the map with both permissions
|
||||||
|
perms.put(Manifest.permission.CAMERA, PackageManager.PERMISSION_GRANTED);
|
||||||
|
perms.put(Manifest.permission.ACCESS_NETWORK_STATE, PackageManager.PERMISSION_GRANTED);
|
||||||
|
perms.put(Manifest.permission.ACCESS_COARSE_LOCATION, PackageManager.PERMISSION_GRANTED);
|
||||||
|
perms.put(Manifest.permission.ACCESS_FINE_LOCATION, PackageManager.PERMISSION_GRANTED);
|
||||||
|
perms.put(Manifest.permission.READ_PHONE_STATE, PackageManager.PERMISSION_GRANTED);
|
||||||
|
// Fill with actual results from user
|
||||||
|
if (grantResults.length > 0) {
|
||||||
|
for (int i = 0; i < permissions.length; i++)
|
||||||
|
perms.put(permissions[i], grantResults[i]);
|
||||||
|
// Check for both permissions//
|
||||||
|
if (perms.get(Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED && perms.get(Manifest.permission.ACCESS_NETWORK_STATE) == PackageManager.PERMISSION_GRANTED && perms.get(Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED && perms.get(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED && perms.get(Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) {
|
||||||
|
// imeiNumbers = imei.getDeviceImei();
|
||||||
|
Log.d("", "sms & location services permission granted");
|
||||||
|
// process the normal flow
|
||||||
|
//else any one or both the permissions are not granted
|
||||||
|
} else {
|
||||||
|
Log.d("", "Some permissions are not granted ask again ");
|
||||||
|
//permission is denied (this is the first time, when "never ask again" is not checked) so ask again explaining the usage of permission
|
||||||
|
// // shouldShowRequestPermissionRationale will return true
|
||||||
|
//show the dialog or snackbar saying its necessary and try again otherwise proceed with setup.
|
||||||
|
if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CAMERA) || ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_NETWORK_STATE) || ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_COARSE_LOCATION) || ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION) || ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.READ_EXTERNAL_STORAGE) || ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.READ_PHONE_STATE)) {
|
||||||
|
showDialogOK("Location,Photos,media,file,manage phone calls and Camera Services Permission required for this app", (dialog, which) -> {
|
||||||
|
switch (which) {
|
||||||
|
case DialogInterface.BUTTON_POSITIVE:
|
||||||
|
checkAndRequestPermissions();
|
||||||
|
break;
|
||||||
|
case DialogInterface.BUTTON_NEGATIVE:
|
||||||
|
// proceed with logic by disabling the related features or quit the app.
|
||||||
|
Intent startMain = new Intent(Intent.ACTION_MAIN);
|
||||||
|
startMain.addCategory(Intent.CATEGORY_HOME);
|
||||||
|
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
startActivity(startMain);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showDialogOK(String message, DialogInterface.OnClickListener okListener) {
|
||||||
|
new androidx.appcompat.app.AlertDialog.Builder(this).setMessage(message).setPositiveButton("OK", okListener).setNegativeButton("Cancel", okListener).create().show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -217,6 +321,32 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
}
|
}
|
||||||
checkgpsEnableDevice();
|
checkgpsEnableDevice();
|
||||||
|
|
||||||
|
locationRequest = new LocationRequest.Builder(Priority.PRIORITY_HIGH_ACCURACY, 100000).setWaitForAccurateLocation(false).setMinUpdateIntervalMillis(IMPLICIT_MIN_UPDATE_INTERVAL).setMaxUpdateDelayMillis(1000).build();
|
||||||
|
|
||||||
|
|
||||||
|
LocationCallback locationCallback = new LocationCallback() {
|
||||||
|
@Override
|
||||||
|
public void onLocationResult(LocationResult locationResult) {
|
||||||
|
if (locationResult != null) {
|
||||||
|
if (locationResult == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//Showing the latitude, longitude and accuracy on the home screen.
|
||||||
|
for (Location location : locationResult.getLocations()) {
|
||||||
|
lat = location.getLatitude();
|
||||||
|
lon = location.getLongitude();
|
||||||
|
// Log.e("latitude_inside",location.getLatitude() + "," +location.getLongitude());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
ActivityCompat.requestPermissions(MPinActivity.this, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, 1);
|
||||||
|
ActivityCompat.requestPermissions(MPinActivity.this, new String[]{android.Manifest.permission.ACCESS_COARSE_LOCATION}, 2);
|
||||||
|
}
|
||||||
|
fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, Looper.getMainLooper());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Password getPasswordType() {
|
private Password getPasswordType() {
|
||||||
@@ -230,8 +360,7 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
private Typeface getTypeface() {
|
private Typeface getTypeface() {
|
||||||
if ("SAN".equals(getIntent().getStringExtra("TYPEFACE")))
|
if ("SAN".equals(getIntent().getStringExtra("TYPEFACE")))
|
||||||
return Typeface.createFromAsset(getAssets(), "fonts/San Francisco Regular.ttf");
|
return Typeface.createFromAsset(getAssets(), "fonts/San Francisco Regular.ttf");
|
||||||
else if ("DEFAULT".equals(getIntent().getStringExtra("TYPEFACE")))
|
else if ("DEFAULT".equals(getIntent().getStringExtra("TYPEFACE"))) return Typeface.DEFAULT;
|
||||||
return Typeface.DEFAULT;
|
|
||||||
return Typeface.DEFAULT;
|
return Typeface.DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,16 +373,8 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
new AuthenticateTask().execute();
|
new AuthenticateTask().execute();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(this,
|
Toast.makeText(this, "Correct", Toast.LENGTH_SHORT).show();
|
||||||
"Correct",
|
|
||||||
Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* blurLockView.hide(
|
|
||||||
getIntent().getIntExtra("HIDE_DURATION", 1000),
|
|
||||||
getHideType(getIntent().getIntExtra("HIDE_DIRECTION", 0)),
|
|
||||||
getEaseType(getIntent().getIntExtra("HIDE_EASE_TYPE", 30)));*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -269,27 +390,16 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
Snackbar snackbar = Snackbar.make(blurLockView, R.string.incorrect_mpin_limit_reached, Snackbar.LENGTH_INDEFINITE);
|
Snackbar snackbar = Snackbar.make(blurLockView, R.string.incorrect_mpin_limit_reached, Snackbar.LENGTH_INDEFINITE);
|
||||||
View view = snackbar.getView();
|
View view = snackbar.getView();
|
||||||
/*TextView tv = (TextView)view.findViewById(android.support.design.R.id.snackbar_text);
|
snackbar.setAction(R.string.reset, v -> {
|
||||||
tv.setTextColor(Color.RED);*/
|
|
||||||
snackbar.setAction(R.string.reset, new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
|
|
||||||
editor.putString(CommonString.MPIN, null);
|
editor.putString(CommonString.MPIN, null);
|
||||||
|
|
||||||
editor.commit();
|
editor.commit();
|
||||||
|
Intent in = new Intent(context, LoginActivity.class);
|
||||||
finish();
|
|
||||||
|
|
||||||
Intent in = new Intent(context , LoginActivity.class);
|
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
|
finish();
|
||||||
}
|
|
||||||
});
|
});
|
||||||
snackbar.setActionTextColor(Color.GREEN);
|
snackbar.setActionTextColor(Color.GREEN);
|
||||||
snackbar.show();
|
snackbar.show();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
int count = 3 - incorrect_times;
|
int count = 3 - incorrect_times;
|
||||||
String attemt_str;
|
String attemt_str;
|
||||||
if (count == 1) {
|
if (count == 1) {
|
||||||
@@ -299,12 +409,8 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
String msg = getString(R.string.error_incorrect_pin) + attemt_str;
|
String msg = getString(R.string.error_incorrect_pin) + attemt_str;
|
||||||
//blurLockView.setIncorrectInputTimes(incorrect_times);
|
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
|
||||||
Toast.makeText(this,
|
|
||||||
msg,
|
|
||||||
Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
pin = inputPassword;
|
pin = inputPassword;
|
||||||
}
|
}
|
||||||
@@ -324,13 +430,7 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
case R.id.image_1:
|
|
||||||
/* blurLockView.show(
|
|
||||||
getIntent().getIntExtra("SHOW_DURATION", 1000),
|
|
||||||
getShowType(getIntent().getIntExtra("SHOW_DIRECTION", 0)),
|
|
||||||
getEaseType(getIntent().getIntExtra("SHOW_EASE_TYPE", 30)));
|
|
||||||
blurLockView.setType(Password.TEXT, true);*/
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -525,37 +625,6 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
return easeType;
|
return easeType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public void showComment(){
|
|
||||||
|
|
||||||
dialog = new Dialog(MPinActivity.this);
|
|
||||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
|
||||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
|
|
||||||
dialog.setContentView(R.layout.comment_layout);
|
|
||||||
TextView tv = (TextView) dialog.findViewById(R.id.tv_comment);
|
|
||||||
|
|
||||||
tv.setText("");
|
|
||||||
|
|
||||||
Window window = dialog.getWindow();
|
|
||||||
WindowManager.LayoutParams wlp = window.getAttributes();
|
|
||||||
|
|
||||||
wlp.gravity = Gravity.TOP;
|
|
||||||
//wlp.flags &= ~WindowManager.LayoutParams.FLAG_DIM_BEHIND;
|
|
||||||
window.setAttributes(wlp);
|
|
||||||
|
|
||||||
dialog.show();
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents an asynchronous login/registration task used to authenticate
|
|
||||||
* the user.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents an asynchronous login/registration task used to authenticate
|
|
||||||
* the user.
|
|
||||||
*/
|
|
||||||
|
|
||||||
private class AuthenticateTask extends AsyncTask<Void, Void, String> {
|
private class AuthenticateTask extends AsyncTask<Void, Void, String> {
|
||||||
private Dialog dialog;
|
private Dialog dialog;
|
||||||
|
|
||||||
@@ -590,15 +659,7 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
versionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
|
versionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
|
||||||
|
|
||||||
String userauth_xml = "[DATA]" + "[USER_DATA][USER_ID]"
|
String userauth_xml = "[DATA]" + "[USER_DATA][USER_ID]" + userId + "[/USER_ID]" + "[PASSWORD]" + password + "[/PASSWORD]" + "[IN_TIME]" + CommonFunctions.getCurrentTimeWithLanguage(context) + "[/IN_TIME]" + "[LATITUDE]" + lat + "[/LATITUDE]" + "[LONGITUDE]" + lon + "[/LONGITUDE]" + "[APP_VERSION]" + app_ver +"-T3"+ "[/APP_VERSION]" + "[ATT_MODE]OnLine[/ATT_MODE]" + "[NETWORK_STATUS]" + "LoginStatus" + "[/NETWORK_STATUS]" + "[/USER_DATA][/DATA]";
|
||||||
+ userId + "[/USER_ID]" + "[PASSWORD]" + password
|
|
||||||
+ "[/PASSWORD]" + "[IN_TIME]" + CommonFunctions.getCurrentTimeWithLanguage(context)
|
|
||||||
+ "[/IN_TIME]" + "[LATITUDE]" + lat
|
|
||||||
+ "[/LATITUDE]" + "[LONGITUDE]" + lon
|
|
||||||
+ "[/LONGITUDE]" + "[APP_VERSION]" + app_ver
|
|
||||||
+ "[/APP_VERSION]" + "[ATT_MODE]OnLine[/ATT_MODE]"
|
|
||||||
+ "[NETWORK_STATUS]" + "LoginStatus"
|
|
||||||
+ "[/NETWORK_STATUS]" + "[/USER_DATA][/DATA]";
|
|
||||||
|
|
||||||
SoapObject request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_LOGIN);
|
SoapObject request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_LOGIN);
|
||||||
request.addProperty("onXML", userauth_xml);
|
request.addProperty("onXML", userauth_xml);
|
||||||
@@ -654,10 +715,6 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
final FailureGetterSetter failureGetterSetter = XMLHandlers.failureXMLHandler(xpp, eventType);
|
final FailureGetterSetter failureGetterSetter = XMLHandlers.failureXMLHandler(xpp, eventType);
|
||||||
|
|
||||||
if (failureGetterSetter.getStatus().equalsIgnoreCase(CommonString.KEY_FAILURE)) {
|
if (failureGetterSetter.getStatus().equalsIgnoreCase(CommonString.KEY_FAILURE)) {
|
||||||
/* final AlertMessage message = new AlertMessage(
|
|
||||||
MPinActivity.this, CommonString.METHOD_LOGIN
|
|
||||||
+ failureGetterSetter.getErrorMsg(),
|
|
||||||
"login", null);*/
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -698,10 +755,6 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, CommonString.KEY_LOGIN_DATA);
|
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, CommonString.KEY_LOGIN_DATA);
|
||||||
bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "Data");
|
bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "Data");
|
||||||
bundle.putString(CommonString.KEY_LANGUAGE, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
bundle.putString(CommonString.KEY_LANGUAGE, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
// mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
|
|
||||||
|
|
||||||
// Crashlytics.setUserIdentifier(userId);
|
|
||||||
|
|
||||||
return CommonString.KEY_SUCCESS;
|
return CommonString.KEY_SUCCESS;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -711,10 +764,6 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
|
|
||||||
/* final AlertMessage message = new AlertMessage(
|
|
||||||
MPinActivity.this, AlertMessage.MESSAGE_EXCEPTION,
|
|
||||||
"acra_login", e);*/
|
|
||||||
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -744,12 +793,6 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
/* final AlertMessage message = new AlertMessage(
|
|
||||||
MPinActivity.this, AlertMessage.MESSAGE_EXCEPTION,
|
|
||||||
"acra_login", e);*/
|
|
||||||
//Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
|
||||||
//Crashlytics.logException(e.getCause());
|
|
||||||
// Crashlytics.logException(new Exception("My custom login Exception"));
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -770,8 +813,8 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
//Stop performance trace
|
//Stop performance trace
|
||||||
// myTrace.stop();
|
// myTrace.stop();
|
||||||
|
|
||||||
if (result.equals(CommonString.KEY_SUCCESS)) {
|
if (result.equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
|
// initializePDSDK(context, userId);
|
||||||
//set true for South Africa
|
//set true for South Africa
|
||||||
boolean forSA = false;
|
boolean forSA = false;
|
||||||
|
|
||||||
@@ -779,8 +822,7 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
//For SA Only
|
//For SA Only
|
||||||
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equals("")) {
|
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equals("")) {
|
||||||
|
|
||||||
Intent intent = new Intent(getBaseContext(),
|
Intent intent = new Intent(getBaseContext(), SelectLanguageActivity.class);
|
||||||
SelectLanguageActivity.class);
|
|
||||||
|
|
||||||
intent.putExtra(CommonString.KEY_LOGIN_DATA, lgs);
|
intent.putExtra(CommonString.KEY_LOGIN_DATA, lgs);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
@@ -792,8 +834,7 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
Intent intent = new Intent(getBaseContext(),
|
Intent intent = new Intent(getBaseContext(), MainActivity.class);
|
||||||
MainActivity.class);
|
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
@@ -803,8 +844,7 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
} else {
|
} else {
|
||||||
//for other than SA
|
//for other than SA
|
||||||
//database.open();
|
//database.open();
|
||||||
if (preferences.getString(CommonString.KEY_VERSION, "").equals(
|
if (preferences.getString(CommonString.KEY_VERSION, "").equals(Integer.toString(versionCode))) {
|
||||||
Integer.toString(versionCode))) {
|
|
||||||
|
|
||||||
setLanguageDataFromSharedPreferences();
|
setLanguageDataFromSharedPreferences();
|
||||||
|
|
||||||
@@ -816,11 +856,9 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Intent intent = new Intent(getBaseContext(),
|
Intent intent = new Intent(getBaseContext(), AutoUpdateActivity.class);
|
||||||
AutoUpdateActivity.class);
|
|
||||||
|
|
||||||
intent.putExtra(CommonString.KEY_PATH,
|
intent.putExtra(CommonString.KEY_PATH, preferences.getString(CommonString.KEY_PATH, ""));
|
||||||
preferences.getString(CommonString.KEY_PATH, ""));
|
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
@@ -833,19 +871,15 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<String> language, culture_id, notice_url;
|
ArrayList<String> language, culture_id, notice_url;
|
||||||
|
|
||||||
LoginGetterSetter login_data;
|
LoginGetterSetter login_data;
|
||||||
|
|
||||||
private void setLanguageDataFromSharedPreferences() {
|
private void setLanguageDataFromSharedPreferences() {
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
login_data = new LoginGetterSetter();
|
login_data = new LoginGetterSetter();
|
||||||
|
|
||||||
String jsonPreferences = preferences.getString(CommonString.KEY_LOOGIN_PREF, "");
|
String jsonPreferences = preferences.getString(CommonString.KEY_LOOGIN_PREF, "");
|
||||||
|
|
||||||
Type type = new TypeToken<LoginGetterSetter>() {
|
Type type = new TypeToken<LoginGetterSetter>() {
|
||||||
}.getType();
|
}.getType();
|
||||||
login_data = gson.fromJson(jsonPreferences, type);
|
login_data = gson.fromJson(jsonPreferences, type);
|
||||||
|
|
||||||
language = login_data.getCULTURE_NAME();
|
language = login_data.getCULTURE_NAME();
|
||||||
culture_id = login_data.getCULTURE_ID();
|
culture_id = login_data.getCULTURE_ID();
|
||||||
notice_url = login_data.getNOTICE_URL();
|
notice_url = login_data.getNOTICE_URL();
|
||||||
@@ -871,8 +905,7 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(MPinActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(MPinActivity.this);
|
||||||
builder.setTitle("Parinaam");
|
builder.setTitle("Parinaam");
|
||||||
builder.setMessage(str).setCancelable(false)
|
builder.setMessage(str).setCancelable(false).setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
/* Intent i = new Intent(activity, StorelistActivity.class);
|
/* Intent i = new Intent(activity, StorelistActivity.class);
|
||||||
@@ -900,10 +933,8 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
char[] chars = new char[number.length()];
|
char[] chars = new char[number.length()];
|
||||||
for (int i = 0; i < number.length(); i++) {
|
for (int i = 0; i < number.length(); i++) {
|
||||||
char ch = number.charAt(i);
|
char ch = number.charAt(i);
|
||||||
if (ch >= 0x0660 && ch <= 0x0669)
|
if (ch >= 0x0660 && ch <= 0x0669) ch -= 0x0660 - '0';
|
||||||
ch -= 0x0660 - '0';
|
else if (ch >= 0x06f0 && ch <= 0x06F9) ch -= 0x06f0 - '0';
|
||||||
else if (ch >= 0x06f0 && ch <= 0x06F9)
|
|
||||||
ch -= 0x06f0 - '0';
|
|
||||||
chars[i] = ch;
|
chars[i] = ch;
|
||||||
}
|
}
|
||||||
return new String(chars);
|
return new String(chars);
|
||||||
@@ -912,7 +943,6 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
|
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
String jsonCurProduct = gson.toJson(lgs);
|
String jsonCurProduct = gson.toJson(lgs);
|
||||||
|
|
||||||
SharedPreferences.Editor editor = preferences.edit();
|
SharedPreferences.Editor editor = preferences.edit();
|
||||||
editor.putString(CommonString.KEY_LOOGIN_PREF, jsonCurProduct);
|
editor.putString(CommonString.KEY_LOOGIN_PREF, jsonCurProduct);
|
||||||
editor.commit();
|
editor.commit();
|
||||||
@@ -920,26 +950,20 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
//permission and location related
|
//permission and location related
|
||||||
void checkAppPermission(String permission, int requestCode) {
|
void checkAppPermission(String permission, int requestCode) {
|
||||||
|
|
||||||
boolean permission_flag = false;
|
boolean permission_flag = false;
|
||||||
// Here, thisActivity is the current activity
|
// Here, thisActivity is the current activity
|
||||||
if (ContextCompat.checkSelfPermission(MPinActivity.this,
|
if (ContextCompat.checkSelfPermission(MPinActivity.this, permission) != PackageManager.PERMISSION_GRANTED) {
|
||||||
permission)
|
|
||||||
!= PackageManager.PERMISSION_GRANTED) {
|
|
||||||
|
|
||||||
// Permission is not granted
|
// Permission is not granted
|
||||||
// Should we show an explanation?
|
// Should we show an explanation?
|
||||||
if (ActivityCompat.shouldShowRequestPermissionRationale(MPinActivity.this,
|
if (ActivityCompat.shouldShowRequestPermissionRationale(MPinActivity.this, permission)) {
|
||||||
permission)) {
|
|
||||||
// Show an explanation to the user *asynchronously* -- don't block
|
// Show an explanation to the user *asynchronously* -- don't block
|
||||||
// this thread waiting for the user's response! After the user
|
// this thread waiting for the user's response! After the user
|
||||||
// sees the explanation, try again to request the permission.
|
// sees the explanation, try again to request the permission.
|
||||||
showOnPermissiondenied(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA, 1);
|
showOnPermissiondenied(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA, 1);
|
||||||
} else {
|
} else {
|
||||||
// No explanation needed; request the permission
|
// No explanation needed; request the permission
|
||||||
ActivityCompat.requestPermissions(MPinActivity.this,
|
ActivityCompat.requestPermissions(MPinActivity.this, new String[]{permission}, requestCode);
|
||||||
new String[]{permission},
|
|
||||||
requestCode);
|
|
||||||
|
|
||||||
// MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
|
// MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
|
||||||
// app-defined int constant. The callback method gets the
|
// app-defined int constant. The callback method gets the
|
||||||
@@ -966,10 +990,7 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
file_planogram.mkdir();
|
file_planogram.mkdir();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= 23 && ContextCompat.checkSelfPermission(context,
|
if (Build.VERSION.SDK_INT >= 23 && ContextCompat.checkSelfPermission(context, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(context, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&
|
|
||||||
ContextCompat.checkSelfPermission(context,
|
|
||||||
android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -982,11 +1003,7 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
// Create an instance of GoogleAPIClient.
|
// Create an instance of GoogleAPIClient.
|
||||||
if (mGoogleApiClient == null) {
|
if (mGoogleApiClient == null) {
|
||||||
mGoogleApiClient = new GoogleApiClient.Builder(this)
|
mGoogleApiClient = new GoogleApiClient.Builder(this).addConnectionCallbacks(this).addOnConnectionFailedListener(this).addApi(LocationServices.API).build();
|
||||||
.addConnectionCallbacks(this)
|
|
||||||
.addOnConnectionFailedListener(this)
|
|
||||||
.addApi(LocationServices.API)
|
|
||||||
.build();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//attemptLogin();
|
//attemptLogin();
|
||||||
@@ -1006,9 +1023,7 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
if (check == 0) {
|
if (check == 0) {
|
||||||
checkAppPermission(permissionsRequired, request_code);
|
checkAppPermission(permissionsRequired, request_code);
|
||||||
} else {
|
} else {
|
||||||
ActivityCompat.requestPermissions(MPinActivity.this,
|
ActivityCompat.requestPermissions(MPinActivity.this, new String[]{permissionsRequired}, request_code);
|
||||||
new String[]{permissionsRequired},
|
|
||||||
request_code);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1023,18 +1038,18 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
builder.show();
|
builder.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/* @Override
|
||||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||||
|
|
||||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
checkAppPermission(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA);
|
checkAppPermission(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA);
|
||||||
|
|
||||||
/*if (requestCode == PERMISSIONS_REQUEST_READ_PHONE_STATE
|
*//*if (requestCode == PERMISSIONS_REQUEST_READ_PHONE_STATE
|
||||||
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||||
imeiNumbers = imei.getDeviceImei();
|
imeiNumbers = imei.getDeviceImei();
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*//*
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= 23 && ContextCompat.checkSelfPermission(context,
|
if (Build.VERSION.SDK_INT >= 23 && ContextCompat.checkSelfPermission(context,
|
||||||
Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&
|
Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&
|
||||||
@@ -1060,18 +1075,14 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
private boolean checkPlayServices() {
|
private boolean checkPlayServices() {
|
||||||
int resultCode = GooglePlayServicesUtil
|
int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
|
||||||
.isGooglePlayServicesAvailable(this);
|
|
||||||
if (resultCode != ConnectionResult.SUCCESS) {
|
if (resultCode != ConnectionResult.SUCCESS) {
|
||||||
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
|
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
|
||||||
GooglePlayServicesUtil.getErrorDialog(resultCode, this,
|
GooglePlayServicesUtil.getErrorDialog(resultCode, this, PLAY_SERVICES_RESOLUTION_REQUEST).show();
|
||||||
PLAY_SERVICES_RESOLUTION_REQUEST).show();
|
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(context, getResources().getString(R.string.notsuppoted)
|
Toast.makeText(context, getResources().getString(R.string.notsuppoted), Toast.LENGTH_LONG).show();
|
||||||
, Toast.LENGTH_LONG)
|
|
||||||
.show();
|
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -1081,11 +1092,7 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
protected synchronized void buildGoogleApiClient() {
|
protected synchronized void buildGoogleApiClient() {
|
||||||
if (mGoogleApiClient == null) {
|
if (mGoogleApiClient == null) {
|
||||||
mGoogleApiClient = new GoogleApiClient.Builder(context)
|
mGoogleApiClient = new GoogleApiClient.Builder(context).addConnectionCallbacks(this).addOnConnectionFailedListener(this).addApi(LocationServices.API).build();
|
||||||
.addConnectionCallbacks(this)
|
|
||||||
.addOnConnectionFailedListener(this)
|
|
||||||
.addApi(LocationServices.API)
|
|
||||||
.build();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1117,8 +1124,7 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
@SuppressLint("MissingPermission")
|
@SuppressLint("MissingPermission")
|
||||||
protected void startLocationUpdates() {
|
protected void startLocationUpdates() {
|
||||||
|
|
||||||
if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
||||||
|| ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
if (mGoogleApiClient != null) {
|
if (mGoogleApiClient != null) {
|
||||||
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
|
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
|
||||||
}
|
}
|
||||||
@@ -1130,9 +1136,7 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
double earthRadius = 6371000; //meters
|
double earthRadius = 6371000; //meters
|
||||||
double dLat = Math.toRadians(lat2 - lat1);
|
double dLat = Math.toRadians(lat2 - lat1);
|
||||||
double dLng = Math.toRadians(lng2 - lng1);
|
double dLng = Math.toRadians(lng2 - lng1);
|
||||||
double a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
|
double a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.sin(dLng / 2) * Math.sin(dLng / 2);
|
||||||
Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) *
|
|
||||||
Math.sin(dLng / 2) * Math.sin(dLng / 2);
|
|
||||||
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
||||||
int dist = (int) (earthRadius * c);
|
int dist = (int) (earthRadius * c);
|
||||||
|
|
||||||
@@ -1141,7 +1145,7 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConnected(Bundle bundle) {
|
public void onConnected(Bundle bundle) {
|
||||||
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
/* if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
// TODO: Consider calling
|
// TODO: Consider calling
|
||||||
// ActivityCompat#requestPermissions
|
// ActivityCompat#requestPermissions
|
||||||
// here to request the missing permissions, and then overriding
|
// here to request the missing permissions, and then overriding
|
||||||
@@ -1159,7 +1163,7 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
lon = mLastLocation.getLongitude();
|
lon = mLastLocation.getLongitude();
|
||||||
}
|
}
|
||||||
startLocationUpdates();
|
startLocationUpdates();
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1193,11 +1197,9 @@ public class MPinActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
private boolean hasGPSDevice(Context context) {
|
private boolean hasGPSDevice(Context context) {
|
||||||
final LocationManager mgr = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
final LocationManager mgr = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||||
if (mgr == null)
|
if (mgr == null) return false;
|
||||||
return false;
|
|
||||||
final List<String> providers = mgr.getAllProviders();
|
final List<String> providers = mgr.getAllProviders();
|
||||||
if (providers == null)
|
if (providers == null) return false;
|
||||||
return false;
|
|
||||||
return providers.contains(LocationManager.GPS_PROVIDER);
|
return providers.contains(LocationManager.GPS_PROVIDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public class MSLFragment extends Fragment {
|
|||||||
String gallery_package = "";
|
String gallery_package = "";
|
||||||
Uri outputFileUri;
|
Uri outputFileUri;
|
||||||
|
|
||||||
String str = CommonString.FILE_PATH, path = "", _pathforcheck = "";
|
String str = CommonString.getImagesFolder(getContext()), path = "", _pathforcheck = "";
|
||||||
|
|
||||||
int child_position = -1;
|
int child_position = -1;
|
||||||
int group_position = -1;
|
int group_position = -1;
|
||||||
@@ -153,6 +153,7 @@ public class MSLFragment extends Fragment {
|
|||||||
|
|
||||||
getActivity().setTitle(R.string.msl_availability_availability);
|
getActivity().setTitle(R.string.msl_availability_availability);
|
||||||
|
|
||||||
|
|
||||||
db = new GSKOrangeDB(getActivity());
|
db = new GSKOrangeDB(getActivity());
|
||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ import com.google.android.material.snackbar.Snackbar;
|
|||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
|
||||||
public class PharmaActivity extends AppCompatActivity implements StoreDetailFragment.OnFragmentInteractionListener, MSLFragment.OnFragmentInteractionListener, SOSFragment.OnFragmentInteractionListener{
|
public class PharmaActivity extends AppCompatActivity implements StoreDetailFragment.OnFragmentInteractionListener,
|
||||||
|
MSLFragment.OnFragmentInteractionListener, SOSFragment.OnFragmentInteractionListener{
|
||||||
private SharedPreferences.Editor editor = null;
|
private SharedPreferences.Editor editor = null;
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
FloatingActionButton fab;
|
FloatingActionButton fab;
|
||||||
|
|||||||
+6
-12
@@ -95,7 +95,7 @@ public class StoreDetailFragment extends Fragment implements View.OnClickListene
|
|||||||
String gallery_package = "";
|
String gallery_package = "";
|
||||||
Uri outputFileUri;
|
Uri outputFileUri;
|
||||||
|
|
||||||
String str = CommonString.FILE_PATH, path = "", _pathforcheck = "", pathForCam1 = "", pathForCam2 = "", pathForCam3 = "", pathForCam4 = "";
|
String str = CommonString.getImagesFolder(getContext()), path = "", _pathforcheck = "", pathForCam1 = "", pathForCam2 = "", pathForCam3 = "", pathForCam4 = "";
|
||||||
|
|
||||||
int child_position = -1;
|
int child_position = -1;
|
||||||
int group_position = -1;
|
int group_position = -1;
|
||||||
@@ -253,40 +253,35 @@ public class StoreDetailFragment extends Fragment implements View.OnClickListene
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
switch (id) {
|
if (id == R.id.img_camera1) {
|
||||||
|
|
||||||
case R.id.img_camera1:
|
|
||||||
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
||||||
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(1);
|
startCameraActivity(1);
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.img_camera2:
|
} else if (id == R.id.img_camera2) {
|
||||||
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
||||||
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(2);
|
startCameraActivity(2);
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.img_camera3:
|
} else if (id == R.id.img_camera3) {
|
||||||
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
||||||
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(3);
|
startCameraActivity(3);
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.img_camera4:
|
} else if (id == R.id.img_camera4) {
|
||||||
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
||||||
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(4);
|
startCameraActivity(4);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -688,7 +683,6 @@ public class StoreDetailFragment extends Fragment implements View.OnClickListene
|
|||||||
|
|
||||||
private void startCameraActivity(int pos) {
|
private void startCameraActivity(int pos) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
Log.i("Stock & Facing ", "startCameraActivity()");
|
Log.i("Stock & Facing ", "startCameraActivity()");
|
||||||
File file = new File(path);
|
File file = new File(path);
|
||||||
outputFileUri = FileProvider.getUriForFile(getActivity(), "cpm.com.gskmtorange.fileprovider", file);
|
outputFileUri = FileProvider.getUriForFile(getActivity(), "cpm.com.gskmtorange.fileprovider", file);
|
||||||
|
|||||||
@@ -7,10 +7,6 @@ import retrofit.Call;
|
|||||||
import retrofit.http.Body;
|
import retrofit.http.Body;
|
||||||
import retrofit.http.POST;
|
import retrofit.http.POST;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by jeevanp on 05-10-2017.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public interface PostApiForFile {
|
public interface PostApiForFile {
|
||||||
@POST("Uploadimages")
|
@POST("Uploadimages")
|
||||||
Call<String> getUploadImage(@Body RequestBody reqesBody);
|
Call<String> getUploadImage(@Body RequestBody reqesBody);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ public class FCMNotificationService extends FirebaseMessagingService {
|
|||||||
String TAG ="FCM Notification";
|
String TAG ="FCM Notification";
|
||||||
|
|
||||||
public FCMNotificationService() {
|
public FCMNotificationService() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+150
-326
@@ -6,7 +6,6 @@ import android.content.pm.PackageManager;
|
|||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -24,11 +23,10 @@ import androidx.fragment.app.FragmentActivity;
|
|||||||
import com.google.android.gms.appindexing.Action;
|
import com.google.android.gms.appindexing.Action;
|
||||||
import com.google.android.gms.appindexing.AppIndex;
|
import com.google.android.gms.appindexing.AppIndex;
|
||||||
import com.google.android.gms.appindexing.Thing;
|
import com.google.android.gms.appindexing.Thing;
|
||||||
import com.google.android.gms.common.ConnectionResult;
|
import com.google.android.gms.location.FusedLocationProviderClient;
|
||||||
import com.google.android.gms.common.GooglePlayServicesUtil;
|
import com.google.android.gms.location.LocationCallback;
|
||||||
import com.google.android.gms.common.api.GoogleApiClient;
|
|
||||||
import com.google.android.gms.location.LocationListener;
|
|
||||||
import com.google.android.gms.location.LocationRequest;
|
import com.google.android.gms.location.LocationRequest;
|
||||||
|
import com.google.android.gms.location.LocationResult;
|
||||||
import com.google.android.gms.location.LocationServices;
|
import com.google.android.gms.location.LocationServices;
|
||||||
import com.google.android.gms.maps.CameraUpdateFactory;
|
import com.google.android.gms.maps.CameraUpdateFactory;
|
||||||
import com.google.android.gms.maps.GoogleMap;
|
import com.google.android.gms.maps.GoogleMap;
|
||||||
@@ -40,9 +38,7 @@ import com.google.android.gms.maps.model.LatLngBounds;
|
|||||||
import com.google.android.gms.maps.model.MarkerOptions;
|
import com.google.android.gms.maps.model.MarkerOptions;
|
||||||
import com.google.android.gms.maps.model.PolylineOptions;
|
import com.google.android.gms.maps.model.PolylineOptions;
|
||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@@ -57,281 +53,135 @@ import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
|||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
|
||||||
public class StoreRouteActivity extends FragmentActivity implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
public class StoreRouteActivity extends FragmentActivity implements OnMapReadyCallback {
|
||||||
|
|
||||||
private Context context;
|
private Context context;
|
||||||
private GoogleMap mMap;
|
private GoogleMap mMap;
|
||||||
StoreBean store;
|
private StoreBean store;
|
||||||
LatLng origin, destination;
|
private LatLng origin, destination;
|
||||||
private final static int PLAY_SERVICES_RESOLUTION_REQUEST = 1000;
|
private FusedLocationProviderClient fusedLocationClient;
|
||||||
private GoogleApiClient mGoogleApiClient;
|
private LocationRequest locationRequest;
|
||||||
private LocationRequest mLocationRequest;
|
private LocationCallback locationCallback;
|
||||||
private static int UPDATE_INTERVAL = 500; // 5 sec
|
|
||||||
private static int FATEST_INTERVAL = 100; // 1 sec
|
private static final int LOCATION_PERMISSION_REQUEST = 1001;
|
||||||
private static int DISPLACEMENT = 5; // 10 meters
|
|
||||||
private Location mLastLocation;
|
|
||||||
double latitude = 0.0;
|
|
||||||
double longitude = 0.0;
|
|
||||||
Boolean markerflag = true;
|
|
||||||
FloatingActionButton fab_cancel;
|
FloatingActionButton fab_cancel;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_store_route);
|
setContentView(R.layout.activity_store_route);
|
||||||
fab_cancel = (FloatingActionButton) findViewById(R.id.fab_cancel);
|
|
||||||
context = this;
|
context = this;
|
||||||
fab_cancel.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
fab_cancel = findViewById(R.id.fab_cancel);
|
||||||
public void onClick(View v) {
|
fab_cancel.setOnClickListener(v -> {
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
store = (StoreBean) getIntent().getSerializableExtra(CommonString.KEY_STORE_LIST);
|
store = (StoreBean) getIntent().getSerializableExtra(CommonString.KEY_STORE_LIST);
|
||||||
/*store.setLATITUDE("28.5420901");
|
|
||||||
store.setLONGITUDE("77.2430997");*/
|
|
||||||
/*store.setLATITUDE("28.544055");
|
|
||||||
store.setLONGITUDE("77.264060");*/
|
|
||||||
|
|
||||||
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
|
fusedLocationClient = LocationServices.getFusedLocationProviderClient(this);
|
||||||
|
|
||||||
|
locationRequest = LocationRequest.create()
|
||||||
|
.setInterval(2000) // 2 sec
|
||||||
|
.setFastestInterval(1000) // 1 sec
|
||||||
|
.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
|
||||||
|
|
||||||
|
locationCallback = new LocationCallback() {
|
||||||
|
@Override
|
||||||
|
public void onLocationResult(@NonNull LocationResult locationResult) {
|
||||||
|
if (locationResult.getLastLocation() != null) {
|
||||||
|
Location loc = locationResult.getLastLocation();
|
||||||
|
updateMapWithCurrentLocation(loc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
|
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
|
||||||
.findFragmentById(R.id.map);
|
.findFragmentById(R.id.map);
|
||||||
|
if (mapFragment != null) {
|
||||||
mapFragment.getMapAsync(this);
|
mapFragment.getMapAsync(this);
|
||||||
|
|
||||||
if (checkPlayServices()) {
|
|
||||||
|
|
||||||
// Building the GoogleApi client
|
|
||||||
buildGoogleApiClient();
|
|
||||||
|
|
||||||
createLocationRequest();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkPlayServices() {
|
@Override
|
||||||
int resultCode = GooglePlayServicesUtil
|
public void onMapReady(GoogleMap googleMap) {
|
||||||
.isGooglePlayServicesAvailable(this);
|
mMap = googleMap;
|
||||||
if (resultCode != ConnectionResult.SUCCESS) {
|
|
||||||
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
|
// Enable zoom controls for user
|
||||||
GooglePlayServicesUtil.getErrorDialog(resultCode, this,
|
mMap.getUiSettings().setZoomControlsEnabled(true);
|
||||||
PLAY_SERVICES_RESOLUTION_REQUEST).show();
|
|
||||||
|
// Request permissions
|
||||||
|
if (checkLocationPermission()) {
|
||||||
|
startLocationUpdates();
|
||||||
|
fusedLocationClient.getLastLocation()
|
||||||
|
.addOnSuccessListener(this, location -> {
|
||||||
|
if (location != null) {
|
||||||
|
updateMapWithCurrentLocation(location); // show instantly with last known location
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(context, getResources().getString(R.string.notsuppoted)
|
Toast.makeText(this, "Waiting for current location...", Toast.LENGTH_SHORT).show();
|
||||||
, Toast.LENGTH_LONG)
|
|
||||||
.show();
|
|
||||||
finish();
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/* if (store != null) {
|
||||||
|
LatLng storeLoc = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
||||||
|
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(storeLoc, 15));
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean checkLocationPermission() {
|
||||||
|
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
|
||||||
|
!= PackageManager.PERMISSION_GRANTED) {
|
||||||
|
ActivityCompat.requestPermissions(
|
||||||
|
this,
|
||||||
|
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
|
||||||
|
LOCATION_PERMISSION_REQUEST
|
||||||
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected synchronized void buildGoogleApiClient() {
|
private void startLocationUpdates() {
|
||||||
mGoogleApiClient = new GoogleApiClient.Builder(this)
|
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
||||||
.addConnectionCallbacks(this)
|
fusedLocationClient.requestLocationUpdates(locationRequest, locationCallback, null);
|
||||||
.addOnConnectionFailedListener(this)
|
}
|
||||||
.addApi(LocationServices.API).build();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateMapWithCurrentLocation(Location location) {
|
||||||
protected void createLocationRequest() {
|
double latitude = location.getLatitude();
|
||||||
mLocationRequest = new LocationRequest();
|
double longitude = location.getLongitude();
|
||||||
mLocationRequest.setInterval(UPDATE_INTERVAL);
|
|
||||||
mLocationRequest.setFastestInterval(FATEST_INTERVAL);
|
|
||||||
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
|
|
||||||
mLocationRequest.setSmallestDisplacement(DISPLACEMENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void startLocationUpdates() {
|
|
||||||
|
|
||||||
|
|
||||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
|
||||||
|| ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
|
|
||||||
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Manipulates the map once available.
|
|
||||||
* This callback is triggered when the map is ready to be used.
|
|
||||||
* This is where we can add markers or lines, add listeners or move the camera. In this case,
|
|
||||||
* we just add a marker near Sydney, Australia.
|
|
||||||
* If Google Play services is not installed on the device, the user will be prompted to install
|
|
||||||
* it inside the SupportMapFragment. This method will only be triggered once the user has
|
|
||||||
* installed Google Play services and returned to the app.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onMapReady(GoogleMap googleMap) {
|
|
||||||
mMap = googleMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showMarker(double lat, double lon) {
|
|
||||||
// Add a marker and move the camera
|
|
||||||
LinearLayout tv = (LinearLayout) this.getLayoutInflater().inflate(R.layout.marker_view, null, false);
|
|
||||||
|
|
||||||
TextView desc = (TextView) tv.findViewById(R.id.tv_desc);
|
|
||||||
desc.setText(store.getSTORE_NAME());
|
|
||||||
|
|
||||||
tv.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
|
|
||||||
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
|
|
||||||
tv.layout(0, 0, tv.getMeasuredWidth(), tv.getMeasuredHeight());
|
|
||||||
|
|
||||||
tv.setDrawingCacheEnabled(true);
|
|
||||||
tv.buildDrawingCache();
|
|
||||||
Bitmap bm = tv.getDrawingCache();
|
|
||||||
LatLng loc = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
|
||||||
mMap.addMarker(new MarkerOptions().position(loc).anchor(0.5f, 0.5f).icon(BitmapDescriptorFactory.fromBitmap(bm)));
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getUrl(LatLng origin, LatLng dest) {
|
|
||||||
|
|
||||||
// Origin of route
|
|
||||||
String str_origin = "origin=" + origin.latitude + "," + origin.longitude;
|
|
||||||
|
|
||||||
// Destination of route
|
|
||||||
String str_dest = "destination=" + dest.latitude + "," + dest.longitude;
|
|
||||||
|
|
||||||
|
|
||||||
// Sensor enabled
|
|
||||||
String sensor = "sensor=false";
|
|
||||||
|
|
||||||
// Building the parameters to the web service
|
|
||||||
String parameters = str_origin + "&" + str_dest + "&" + sensor;
|
|
||||||
|
|
||||||
// Output format
|
|
||||||
String output = "json";
|
|
||||||
|
|
||||||
// Building the url to the web service
|
|
||||||
String url = "https://maps.googleapis.com/maps/api/directions/" + output + "?" + parameters+"&key=AIzaSyCPo-giwVv5h8AzsbE1IDRsFsPHjVlCm5A";
|
|
||||||
|
|
||||||
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A method to download json data from url
|
|
||||||
*/
|
|
||||||
private String downloadUrl(String strUrl) throws IOException {
|
|
||||||
String data = "";
|
|
||||||
InputStream iStream = null;
|
|
||||||
HttpURLConnection urlConnection = null;
|
|
||||||
try {
|
|
||||||
URL url = new URL(strUrl);
|
|
||||||
|
|
||||||
// Creating an http connection to communicate with url
|
|
||||||
urlConnection = (HttpURLConnection) url.openConnection();
|
|
||||||
|
|
||||||
// Connecting to url
|
|
||||||
urlConnection.connect();
|
|
||||||
|
|
||||||
// Reading data from url
|
|
||||||
iStream = urlConnection.getInputStream();
|
|
||||||
|
|
||||||
BufferedReader br = new BufferedReader(new InputStreamReader(iStream));
|
|
||||||
|
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
|
|
||||||
String line = "";
|
|
||||||
while ((line = br.readLine()) != null) {
|
|
||||||
sb.append(line);
|
|
||||||
}
|
|
||||||
|
|
||||||
data = sb.toString();
|
|
||||||
Log.d("downloadUrl", data.toString());
|
|
||||||
br.close();
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.d("Exception", e.toString());
|
|
||||||
} finally {
|
|
||||||
iStream.close();
|
|
||||||
urlConnection.disconnect();
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onConnected(@Nullable Bundle bundle) {
|
|
||||||
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
// TODO: Consider calling
|
|
||||||
// ActivityCompat#requestPermissions
|
|
||||||
// here to request the missing permissions, and then overriding
|
|
||||||
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
|
|
||||||
// int[] grantResults)
|
|
||||||
// to handle the case where the user grants the permission. See the documentation
|
|
||||||
// for ActivityCompat#requestPermissions for more details.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
|
|
||||||
|
|
||||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
|
||||||
|| ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
if (mLastLocation != null) {
|
|
||||||
latitude = mLastLocation.getLatitude();
|
|
||||||
longitude = mLastLocation.getLongitude();
|
|
||||||
|
|
||||||
mMap.setMyLocationEnabled(true);
|
|
||||||
|
|
||||||
origin = new LatLng(latitude, longitude);
|
origin = new LatLng(latitude, longitude);
|
||||||
destination = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
destination = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
||||||
|
|
||||||
StoreBean store1 = new StoreBean();
|
// Show markers
|
||||||
store1.setLATITUDE(latitude+"");
|
StoreBean currentStore = new StoreBean();
|
||||||
store1.setLONGITUDE(longitude+"");
|
currentStore.setLATITUDE(latitude + "");
|
||||||
store1.setSTORE_NAME("Current Location");
|
currentStore.setLONGITUDE(longitude + "");
|
||||||
showMarker(store1, R.layout.current_marker_view);
|
currentStore.setSTORE_NAME("Current Location");
|
||||||
|
showMarker(currentStore, R.layout.current_marker_view);
|
||||||
|
|
||||||
showMarker(store, R.layout.marker_view);
|
showMarker(store, R.layout.marker_view);
|
||||||
|
|
||||||
|
// Move camera to fit both points
|
||||||
LatLngBounds.Builder builder = new LatLngBounds.Builder();
|
LatLngBounds.Builder builder = new LatLngBounds.Builder();
|
||||||
builder.include(new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE())));
|
builder.include(origin);
|
||||||
builder.include(new LatLng(latitude, longitude));
|
builder.include(destination);
|
||||||
//mMap.moveCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 48));
|
mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 100));
|
||||||
mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 48));
|
|
||||||
|
|
||||||
//destination = new LatLng(mapLat[1], mapLon[1]);
|
// Fetch and draw route
|
||||||
/*mMap.moveCamera(CameraUpdateFactory.newLatLng(origin));
|
|
||||||
mMap.animateCamera(CameraUpdateFactory.zoomTo(17));*/
|
|
||||||
|
|
||||||
//new GetDirection().execute();
|
|
||||||
// Getting URL to the Google Directions API
|
|
||||||
String url = getUrl(origin, destination);
|
String url = getUrl(origin, destination);
|
||||||
Log.d("onMapClick", url.toString());
|
new FetchUrl().execute(url);
|
||||||
FetchUrl FetchUrl = new FetchUrl();
|
|
||||||
|
|
||||||
// Start downloading json data from Google Directions API
|
// Stop updates once we get location
|
||||||
FetchUrl.execute(url);
|
fusedLocationClient.removeLocationUpdates(locationCallback);
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void showMarker(StoreBean store, int layout_resource) {
|
||||||
// if (mRequestingLocationUpdates) {
|
|
||||||
startLocationUpdates();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onConnectionSuspended(int i) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLocationChanged(Location location) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showMarker(StoreBean store, int layout_resource){
|
|
||||||
// Add a marker of latest location and move the camera
|
|
||||||
LinearLayout tv = (LinearLayout) this.getLayoutInflater().inflate(layout_resource, null, false);
|
LinearLayout tv = (LinearLayout) this.getLayoutInflater().inflate(layout_resource, null, false);
|
||||||
|
TextView desc = tv.findViewById(R.id.tv_desc);
|
||||||
TextView desc = (TextView) tv.findViewById(R.id.tv_desc);
|
|
||||||
desc.setText(store.getSTORE_NAME());
|
desc.setText(store.getSTORE_NAME());
|
||||||
|
|
||||||
tv.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
|
tv.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
|
||||||
@@ -339,143 +189,117 @@ public class StoreRouteActivity extends FragmentActivity implements OnMapReadyCa
|
|||||||
tv.layout(0, 0, tv.getMeasuredWidth(), tv.getMeasuredHeight());
|
tv.layout(0, 0, tv.getMeasuredWidth(), tv.getMeasuredHeight());
|
||||||
|
|
||||||
tv.setDrawingCacheEnabled(true);
|
tv.setDrawingCacheEnabled(true);
|
||||||
tv.buildDrawingCache();
|
|
||||||
Bitmap bm = tv.getDrawingCache();
|
Bitmap bm = tv.getDrawingCache();
|
||||||
|
|
||||||
LatLng loc = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
LatLng loc = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
||||||
mMap.addMarker(new MarkerOptions().position(loc).anchor(0.5f, 0.5f).icon(BitmapDescriptorFactory.fromBitmap(bm)));
|
mMap.addMarker(new MarkerOptions()
|
||||||
|
.position(loc)
|
||||||
|
.anchor(0.5f, 0.5f)
|
||||||
|
.icon(BitmapDescriptorFactory.fromBitmap(bm)));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onStart() {
|
private String getUrl(LatLng origin, LatLng dest) {
|
||||||
super.onStart();// ATTENTION: This was auto-generated to implement the App Indexing API.
|
String str_origin = "origin=" + origin.latitude + "," + origin.longitude;
|
||||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
String str_dest = "destination=" + dest.latitude + "," + dest.longitude;
|
||||||
mGoogleApiClient.connect();
|
String parameters = str_origin + "&" + str_dest + "&sensor=false";
|
||||||
if (mGoogleApiClient != null) {
|
String output = "json";
|
||||||
mGoogleApiClient.connect();
|
return "https://maps.googleapis.com/maps/api/directions/" + output + "?" + parameters + "&key=AIzaSyCPo-giwVv5h8AzsbE1IDRsFsPHjVlCm5A";
|
||||||
}
|
|
||||||
// ATTENTION: This was auto-generated to implement the App Indexing API.
|
|
||||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
|
||||||
// AppIndex.AppIndexApi.start(mGoogleApiClient, getIndexApiAction());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private String downloadUrl(String strUrl) throws IOException {
|
||||||
* ATTENTION: This was auto-generated to implement the App Indexing API.
|
StringBuilder sb = new StringBuilder();
|
||||||
* See https://g.co/AppIndexing/AndroidStudio for more information.
|
InputStream iStream = null;
|
||||||
*/
|
HttpURLConnection urlConnection = null;
|
||||||
public Action getIndexApiAction() {
|
try {
|
||||||
Thing object = new Thing.Builder()
|
URL url = new URL(strUrl);
|
||||||
.setName("GeoTag Page") // TODO: Define a title for the content shown.
|
urlConnection = (HttpURLConnection) url.openConnection();
|
||||||
// TODO: Make sure this auto-generated URL is correct.
|
urlConnection.connect();
|
||||||
.setUrl(Uri.parse("http://[ENTER-YOUR-URL-HERE]"))
|
iStream = urlConnection.getInputStream();
|
||||||
.build();
|
BufferedReader br = new BufferedReader(new InputStreamReader(iStream));
|
||||||
return new Action.Builder(Action.TYPE_VIEW)
|
String line;
|
||||||
.setObject(object)
|
while ((line = br.readLine()) != null) {
|
||||||
.setActionStatus(Action.STATUS_TYPE_COMPLETED)
|
sb.append(line);
|
||||||
.build();
|
}
|
||||||
|
br.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e("Exception", e.toString());
|
||||||
|
} finally {
|
||||||
|
if (iStream != null) iStream.close();
|
||||||
|
if (urlConnection != null) urlConnection.disconnect();
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetches data from url passed
|
// AsyncTask to fetch directions
|
||||||
private class FetchUrl extends AsyncTask<String, Void, String> {
|
private class FetchUrl extends AsyncTask<String, Void, String> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String doInBackground(String... url) {
|
protected String doInBackground(String... url) {
|
||||||
|
|
||||||
// For storing data from web service
|
|
||||||
String data = "";
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Fetching the data from web service
|
return downloadUrl(url[0]);
|
||||||
data = downloadUrl(url[0]);
|
} catch (IOException e) {
|
||||||
Log.d("Background Task data", data.toString());
|
Log.e("Background Task", e.toString());
|
||||||
} catch (Exception e) {
|
return "";
|
||||||
Log.d("Background Task", e.toString());
|
|
||||||
}
|
}
|
||||||
return data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(String result) {
|
protected void onPostExecute(String result) {
|
||||||
super.onPostExecute(result);
|
super.onPostExecute(result);
|
||||||
|
Log.d("DirectionsResponse", result);
|
||||||
ParserTask parserTask = new ParserTask();
|
new ParserTask().execute(result);
|
||||||
|
|
||||||
// Invokes the thread for parsing the JSON data
|
|
||||||
parserTask.execute(result);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* A class to parse the Google Places in JSON format
|
|
||||||
*/
|
|
||||||
private class ParserTask extends AsyncTask<String, Integer, List<List<HashMap<String, String>>>> {
|
private class ParserTask extends AsyncTask<String, Integer, List<List<HashMap<String, String>>>> {
|
||||||
|
|
||||||
// Parsing the data in non-ui thread
|
|
||||||
@Override
|
@Override
|
||||||
protected List<List<HashMap<String, String>>> doInBackground(String... jsonData) {
|
protected List<List<HashMap<String, String>>> doInBackground(String... jsonData) {
|
||||||
|
|
||||||
JSONObject jObject;
|
|
||||||
List<List<HashMap<String, String>>> routes = null;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
jObject = new JSONObject(jsonData[0]);
|
JSONObject jObject = new JSONObject(jsonData[0]);
|
||||||
Log.d("ParserTask",jsonData[0].toString());
|
|
||||||
DataParser parser = new DataParser();
|
DataParser parser = new DataParser();
|
||||||
Log.d("ParserTask", parser.toString());
|
return parser.parse(jObject);
|
||||||
|
|
||||||
// Starts parsing data
|
|
||||||
routes = parser.parse(jObject);
|
|
||||||
Log.d("ParserTask","Executing routes");
|
|
||||||
Log.d("ParserTask",routes.toString());
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.d("ParserTask",e.toString());
|
Log.e("ParserTask", e.toString());
|
||||||
e.printStackTrace();
|
return null;
|
||||||
}
|
}
|
||||||
return routes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Executes in UI thread, after the parsing process
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(List<List<HashMap<String, String>>> result) {
|
protected void onPostExecute(List<List<HashMap<String, String>>> result) {
|
||||||
|
if (result == null) return;
|
||||||
|
|
||||||
ArrayList<LatLng> points;
|
ArrayList<LatLng> points;
|
||||||
PolylineOptions lineOptions = null;
|
PolylineOptions lineOptions = null;
|
||||||
|
|
||||||
// Traversing through all the routes
|
for (List<HashMap<String, String>> path : result) {
|
||||||
for (int i = 0; i < result.size(); i++) {
|
|
||||||
points = new ArrayList<>();
|
points = new ArrayList<>();
|
||||||
lineOptions = new PolylineOptions();
|
lineOptions = new PolylineOptions();
|
||||||
|
|
||||||
// Fetching i-th route
|
for (HashMap<String, String> point : path) {
|
||||||
List<HashMap<String, String>> path = result.get(i);
|
|
||||||
|
|
||||||
// Fetching all the points in i-th route
|
|
||||||
for (int j = 0; j < path.size(); j++) {
|
|
||||||
HashMap<String, String> point = path.get(j);
|
|
||||||
|
|
||||||
double lat = Double.parseDouble(point.get("lat"));
|
double lat = Double.parseDouble(point.get("lat"));
|
||||||
double lng = Double.parseDouble(point.get("lng"));
|
double lng = Double.parseDouble(point.get("lng"));
|
||||||
LatLng position = new LatLng(lat, lng);
|
points.add(new LatLng(lat, lng));
|
||||||
|
|
||||||
points.add(position);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adding all the points in the route to LineOptions
|
|
||||||
lineOptions.addAll(points);
|
lineOptions.addAll(points);
|
||||||
lineOptions.width(12);
|
lineOptions.width(12);
|
||||||
lineOptions.color(Color.parseColor("#5ac614"));
|
lineOptions.color(Color.parseColor("#5ac614"));
|
||||||
|
|
||||||
Log.d("onPostExecute","onPostExecute lineoptions decoded");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Drawing polyline in the Google Map for the i-th route
|
if (lineOptions != null) {
|
||||||
if(lineOptions != null) {
|
|
||||||
mMap.addPolyline(lineOptions);
|
mMap.addPolyline(lineOptions);
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
Log.d("onPostExecute","without Polylines drawn");
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
|
||||||
|
@NonNull int[] grantResults) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
|
if (requestCode == LOCATION_PERMISSION_REQUEST) {
|
||||||
|
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||||
|
startLocationUpdates();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, "Location permission required", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+337
-72
@@ -10,6 +10,7 @@ import android.graphics.BitmapFactory;
|
|||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@@ -21,7 +22,6 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
import org.ksoap2.serialization.SoapObject;
|
import org.ksoap2.serialization.SoapObject;
|
||||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
import org.ksoap2.transport.HttpTransportSE;
|
|
||||||
import org.xml.sax.InputSource;
|
import org.xml.sax.InputSource;
|
||||||
import org.xml.sax.XMLReader;
|
import org.xml.sax.XMLReader;
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
@@ -47,6 +47,7 @@ import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
|||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.utils.OkHttpTransportSE;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CompetitonPromoGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.CompetitonPromoGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CounterfeitProductGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.CounterfeitProductGetterSetter;
|
||||||
@@ -67,11 +68,11 @@ import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGette
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.Store_wise_camera_DataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.Store_wise_camera_DataGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
||||||
|
|
||||||
public class PreviousDataUploadActivity extends AppCompatActivity {
|
public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||||
private Context context;
|
private Context context;
|
||||||
|
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
ArrayList<CoverageBean> coverageList;
|
ArrayList<CoverageBean> coverageList;
|
||||||
String date, userId, app_version;
|
String date, userId, app_version;
|
||||||
@@ -89,7 +90,6 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
ArrayList<AddittionalGetterSetter> additionalVisibilityList;
|
ArrayList<AddittionalGetterSetter> additionalVisibilityList;
|
||||||
ArrayList<AdditionalDialogGetterSetter> additionalVisibilitySkuList;
|
ArrayList<AdditionalDialogGetterSetter> additionalVisibilitySkuList;
|
||||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> msl_availabilityStockFacingList;
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> msl_availabilityStockFacingList;
|
||||||
|
|
||||||
private Dialog dialog;
|
private Dialog dialog;
|
||||||
private ProgressBar pb;
|
private ProgressBar pb;
|
||||||
private TextView percentage, message;
|
private TextView percentage, message;
|
||||||
@@ -99,14 +99,10 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
ArrayList<CategoryPictureGetterSetter> adddata = new ArrayList<CategoryPictureGetterSetter>();
|
ArrayList<CategoryPictureGetterSetter> adddata = new ArrayList<CategoryPictureGetterSetter>();
|
||||||
ArrayList<CategoryPictureGetterSetter> listdat = new ArrayList<CategoryPictureGetterSetter>();
|
ArrayList<CategoryPictureGetterSetter> listdat = new ArrayList<CategoryPictureGetterSetter>();
|
||||||
ArrayList<CoachingVisitGetterSetter> coachingVisitData;
|
ArrayList<CoachingVisitGetterSetter> coachingVisitData;
|
||||||
|
|
||||||
Object result = "";
|
Object result = "";
|
||||||
|
|
||||||
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> stockFacingPlanogramDataList;
|
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> stockFacingPlanogramDataList;
|
||||||
ArrayList<Store_wise_camera_DataGetterSetter> storeWiseCameraDataGetterSetters;
|
ArrayList<Store_wise_camera_DataGetterSetter> storeWiseCameraDataGetterSetters;
|
||||||
|
|
||||||
ArrayList<PromoComplianceSkuwiseGetterSetter> promoComplianceSkuwiseGetterSetters, promoComplianceSkuwiseExistsGetterSetters;
|
ArrayList<PromoComplianceSkuwiseGetterSetter> promoComplianceSkuwiseGetterSetters, promoComplianceSkuwiseExistsGetterSetters;
|
||||||
|
|
||||||
ArrayList<CounterfeitProductGetterSetter> counterfeitProductGetterSetters, counterfeitProductExistsGetterSetters;
|
ArrayList<CounterfeitProductGetterSetter> counterfeitProductGetterSetters, counterfeitProductExistsGetterSetters;
|
||||||
ArrayList<CompetitonPromoGetterSetter> competitonGetterSetters, competitonExistsGetterSetters;
|
ArrayList<CompetitonPromoGetterSetter> competitonGetterSetters, competitonExistsGetterSetters;
|
||||||
|
|
||||||
@@ -122,7 +118,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
db = new GSKOrangeDB(this);
|
db = new GSKOrangeDB(this);
|
||||||
db.open();
|
db.open();
|
||||||
context = this;
|
context = this;
|
||||||
Path = CommonString.FILE_PATH;
|
Path = CommonString.getImagesFolder(context);
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
//start upload
|
//start upload
|
||||||
new UploadTask(this).execute();
|
new UploadTask(this).execute();
|
||||||
@@ -172,7 +168,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UPLOAD_IMAGE, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UPLOAD_IMAGE, envelope);
|
||||||
|
|
||||||
Object result = envelope.getResponse();
|
Object result = envelope.getResponse();
|
||||||
@@ -271,7 +267,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -299,13 +295,13 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (storeData.getCHECKOUT_STATUS().equals(CommonString.KEY_Y) ||
|
if (storeData.getCHECKOUT_STATUS().equals(CommonString.KEY_Y) ||
|
||||||
storeData.getCHECKOUT_STATUS().equals(CommonString.KEY_L) ||
|
storeData.getCHECKOUT_STATUS().equals(CommonString.KEY_L) ||
|
||||||
!storeData.getUPLOAD_STATUS().equals(CommonString.KEY_U)||
|
!storeData.getUPLOAD_STATUS().equals(CommonString.KEY_U) ||
|
||||||
!storeData.getUPLOAD_STATUS().equals(CommonString.KEY_UN)) {
|
!storeData.getUPLOAD_STATUS().equals(CommonString.KEY_UN)) {
|
||||||
|
|
||||||
String camera_allow = storeData.getCAMERA_ALLOW();
|
String camera_allow = storeData.getCAMERA_ALLOW();
|
||||||
|
|
||||||
String adhoc;
|
String adhoc;
|
||||||
if (coverageList.get(i).getFlag_from()!=null && coverageList.get(i).getFlag_from().equals(CommonString.FROM_DEVIATION)) {
|
if (coverageList.get(i).getFlag_from() != null && coverageList.get(i).getFlag_from().equals(CommonString.FROM_DEVIATION)) {
|
||||||
adhoc = "1";
|
adhoc = "1";
|
||||||
} else {
|
} else {
|
||||||
adhoc = "0";
|
adhoc = "0";
|
||||||
@@ -313,20 +309,18 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
String coverage_service, status_service;
|
String coverage_service, status_service;
|
||||||
|
|
||||||
if(coverageList.get(i).getFlag_from().equals(CommonString.FROM_ADDITIONAL)){
|
if (coverageList.get(i).getFlag_from().equals(CommonString.FROM_ADDITIONAL)) {
|
||||||
status_service = CommonString.METHOD_UPLOAD_COVERAGE_STATUS_ADDITIONAL;
|
status_service = CommonString.METHOD_UPLOAD_COVERAGE_STATUS_ADDITIONAL;
|
||||||
coverage_service = CommonString.METHOD_UPLOAD_COVERAGE_NEW_ADDITIONAL;
|
coverage_service = CommonString.METHOD_UPLOAD_COVERAGE_NEW_ADDITIONAL;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
status_service = CommonString.METHOD_UPLOAD_COVERAGE_STATUS;
|
status_service = CommonString.METHOD_UPLOAD_COVERAGE_STATUS;
|
||||||
coverage_service = CommonString.METHOD_UPLOAD_COVERAGE_NEW;
|
coverage_service = CommonString.METHOD_UPLOAD_COVERAGE_NEW;
|
||||||
}
|
}
|
||||||
|
|
||||||
String sub_reason_id = coverageList.get(i).getSub_reasonId();
|
String sub_reason_id = coverageList.get(i).getSub_reasonId();
|
||||||
if (sub_reason_id!=null && sub_reason_id.equals("")) {
|
if (sub_reason_id != null && sub_reason_id.equals("")) {
|
||||||
sub_reason_id = "0";
|
sub_reason_id = "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
String onXML = "[DATA]"
|
String onXML = "[DATA]"
|
||||||
+ "[USER_DATA]"
|
+ "[USER_DATA]"
|
||||||
+ "[STORE_CD]" + coverageList.get(i).getStoreId() + "[/STORE_CD]"
|
+ "[STORE_CD]" + coverageList.get(i).getStoreId() + "[/STORE_CD]"
|
||||||
@@ -355,7 +349,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + coverage_service, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + coverage_service, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -418,7 +412,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -468,7 +462,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
store_detail_xml = store_detail_xml + onXML;
|
store_detail_xml = store_detail_xml + onXML;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String sos_xml = "[DATA]" + image_xml+ store_detail_xml + "[/DATA]";
|
final String sos_xml = "[DATA]" + image_xml + store_detail_xml + "[/DATA]";
|
||||||
|
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
request.addProperty("XMLDATA", sos_xml);
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
@@ -480,7 +474,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -527,7 +521,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -554,7 +548,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
+ "[USERID]" + userId + "[/USERID]"
|
+ "[USERID]" + userId + "[/USERID]"
|
||||||
+ "[BID]" + Integer.parseInt(pharmaMSLList.get(j).getBrandId()) + "[/BID]"
|
+ "[BID]" + Integer.parseInt(pharmaMSLList.get(j).getBrandId()) + "[/BID]"
|
||||||
+ "[SKID]" + Integer.parseInt(pharmaMSLList.get(j).getSkuId()) + "[/SKID]"
|
+ "[SKID]" + Integer.parseInt(pharmaMSLList.get(j).getSkuId()) + "[/SKID]"
|
||||||
+ "[PRESENT]" + pharmaMSLList.get(j).getPresent() + "[/PRESENT]"+
|
+ "[PRESENT]" + pharmaMSLList.get(j).getPresent() + "[/PRESENT]" +
|
||||||
"[/ST]";
|
"[/ST]";
|
||||||
|
|
||||||
pharma_msl_xml = pharma_msl_xml + onXML;
|
pharma_msl_xml = pharma_msl_xml + onXML;
|
||||||
@@ -572,7 +566,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -591,13 +585,16 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
String mslAvailability_stockFacing_xml = "";
|
String mslAvailability_stockFacing_xml = "";
|
||||||
onXML = "";
|
onXML = "";
|
||||||
db.open();
|
db.open();
|
||||||
msl_availabilityStockFacingList = db.getMSL_Availability_StockFacing_UploadServerData(coverageList.get(i).getStoreId());
|
msl_availabilityStockFacingList = db.getMSL_Availability_StockFacing_UploadServerDataNew(coverageList.get(i)
|
||||||
|
.getStoreId(), coverageList.get(i).getVisitDate(),
|
||||||
|
coverageList.get(i).getKeyAccountId(),
|
||||||
|
coverageList.get(i).getStoreTypeId(),
|
||||||
|
coverageList.get(i).getClassId(),
|
||||||
|
coverageList.get(i).getMappingStk());
|
||||||
if (msl_availabilityStockFacingList.size() > 0) {
|
if (msl_availabilityStockFacingList.size() > 0) {
|
||||||
for (int j = 0; j < msl_availabilityStockFacingList.size(); j++) {
|
for (int j = 0; j < msl_availabilityStockFacingList.size(); j++) {
|
||||||
if (!msl_availabilityStockFacingList.get(j).getSku_id().equals("0")) {
|
if (!msl_availabilityStockFacingList.get(j).getSku_id().equals("0")) {
|
||||||
|
String stock, pricing;
|
||||||
String stock,pricing;
|
|
||||||
if (!msl_availabilityStockFacingList.get(j).getStock().equals("")) {
|
if (!msl_availabilityStockFacingList.get(j).getStock().equals("")) {
|
||||||
stock = msl_availabilityStockFacingList.get(j).getStock();
|
stock = msl_availabilityStockFacingList.get(j).getStock();
|
||||||
} else {
|
} else {
|
||||||
@@ -616,7 +613,8 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
+ "[AVL]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getToggleValue()) + "[/AVL]"
|
+ "[AVL]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getToggleValue()) + "[/AVL]"
|
||||||
+ "[FC]" + Double.parseDouble(msl_availabilityStockFacingList.get(j).getFacing()) + "[/FC]"
|
+ "[FC]" + Double.parseDouble(msl_availabilityStockFacingList.get(j).getFacing()) + "[/FC]"
|
||||||
+ "[SK]" + Integer.parseInt(stock) + "[/SK]"
|
+ "[SK]" + Integer.parseInt(stock) + "[/SK]"
|
||||||
+ "[PRICING]" + Integer.parseInt(pricing) + "[/PRICING]"
|
+ "[PRICING]" + Double.parseDouble(pricing) + "[/PRICING]"
|
||||||
|
// + "[PRICING]" + Integer.parseInt(pricing) + "[/PRICING]"
|
||||||
+ "[ML]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMust_have()) + "[/ML]" +
|
+ "[ML]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMust_have()) + "[/ML]" +
|
||||||
"[/ST]";
|
"[/ST]";
|
||||||
|
|
||||||
@@ -625,18 +623,72 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final String sos_xml = "[DATA]" + mslAvailability_stockFacing_xml + "[/DATA]";
|
final String sos_xml = "[DATA]" + mslAvailability_stockFacing_xml + "[/DATA]";
|
||||||
|
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
request.addProperty("XMLDATA", sos_xml);
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
request.addProperty("KEYS", "STOCK_AVAILABILITY_WITH_PRICING");
|
request.addProperty("KEYS", "STOCK_AVAILABILITY_WITH_PRICING");
|
||||||
request.addProperty("USERNAME", userId);
|
request.addProperty("USERNAME", userId);
|
||||||
request.addProperty("MID", mid);
|
request.addProperty("MID", mid);
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
result = envelope.getResponse();
|
||||||
|
}
|
||||||
|
data.value = 15;
|
||||||
|
data.name = getString(R.string.availability_data_uploading);
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
String msl_availabilityStockEntryXml = "";
|
||||||
|
onXML = "";
|
||||||
|
db.open();
|
||||||
|
msl_availabilityStockFacingList = db.getStock_Entry_UploadServerDataNew(coverageList.get(i)
|
||||||
|
.getStoreId(),coverageList.get(i).getVisitDate(),
|
||||||
|
coverageList.get(i).getKeyAccountId(),
|
||||||
|
coverageList.get(i).getStoreTypeId(),
|
||||||
|
coverageList.get(i).getClassId(),
|
||||||
|
coverageList.get(i).getMappingStk());
|
||||||
|
|
||||||
|
if (msl_availabilityStockFacingList.size() > 0) {
|
||||||
|
for (int j = 0; j < msl_availabilityStockFacingList.size(); j++) {
|
||||||
|
if (!msl_availabilityStockFacingList.get(j).getSku_id().equals("0")) {
|
||||||
|
String posm_stock,warehouse_stock;
|
||||||
|
if (!msl_availabilityStockFacingList.get(j).getPosmStock().equals("")) {
|
||||||
|
posm_stock = msl_availabilityStockFacingList.get(j).getPosmStock();
|
||||||
|
} else {
|
||||||
|
posm_stock = "0";
|
||||||
|
}
|
||||||
|
if (!msl_availabilityStockFacingList.get(j).getWarehouseStock().equals("")) {
|
||||||
|
warehouse_stock = msl_availabilityStockFacingList.get(j).getWarehouseStock();
|
||||||
|
} else {
|
||||||
|
warehouse_stock = "0";
|
||||||
|
}
|
||||||
|
onXML = "[ST]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USERID]" + userId + "[/USERID]"
|
||||||
|
+ "[SID]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getSku_id()) + "[/SID]"
|
||||||
|
+ "[POSM_STOCK]" + Integer.parseInt(posm_stock) + "[/POSM_STOCK]"
|
||||||
|
+ "[WAREHOUSE_STOCK]" + Integer.parseInt(warehouse_stock) + "[/WAREHOUSE_STOCK]"
|
||||||
|
+ "[MBQ]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMbq()) + "[/MBQ]"
|
||||||
|
+ "[ML]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMust_have()) + "[/ML]" +
|
||||||
|
"[/ST]";
|
||||||
|
|
||||||
|
msl_availabilityStockEntryXml = msl_availabilityStockEntryXml + onXML;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
final String sos_xml = "[DATA]" + msl_availabilityStockEntryXml + "[/DATA]";
|
||||||
|
Log.d("STOCK_ENTRY_DATA",sos_xml);
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
|
request.addProperty("KEYS", "STOCK_ENTRY");
|
||||||
|
request.addProperty("USERNAME", userId);
|
||||||
|
request.addProperty("MID", mid);
|
||||||
|
|
||||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -645,11 +697,12 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
data.value = 15;
|
data.value = 16;
|
||||||
data.name = getString(R.string.availability_data_uploading);
|
data.name = getString(R.string.stock_entry_data_uploading);
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Promo Compliance - Promotion Data
|
//Promo Compliance - Promotion Data
|
||||||
String promoition_data_xml = "";
|
String promoition_data_xml = "";
|
||||||
onXML = "";
|
onXML = "";
|
||||||
@@ -689,7 +742,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -767,7 +820,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -822,7 +875,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -922,7 +975,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1007,8 +1060,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
present = "1";
|
present = "1";
|
||||||
} else {
|
} else {
|
||||||
present = "0";
|
present = "0";
|
||||||
}*/String qty = t2PGetterSetters.get(i1).getQty();
|
}*/
|
||||||
if(qty.equals("")){
|
String qty = t2PGetterSetters.get(i1).getQty();
|
||||||
|
if (qty.equals("")) {
|
||||||
qty = "0";
|
qty = "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1051,7 +1105,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1102,7 +1156,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1200,7 +1254,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1252,7 +1306,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1299,7 +1353,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1342,7 +1396,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1391,7 +1445,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1401,6 +1455,55 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Coaching check visit data
|
||||||
|
db.open();
|
||||||
|
coachingVisitData = db.getCoachingVisitStoreData(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
|
if (coachingVisitData.size() > 0) {
|
||||||
|
|
||||||
|
String onXml_coaching_data = "", coaching_xml = "";
|
||||||
|
for (int j = 0; j < coachingVisitData.size(); j++) {
|
||||||
|
|
||||||
|
String exist;
|
||||||
|
|
||||||
|
if (coachingVisitData.get(j).isExists()) {
|
||||||
|
exist = "1";
|
||||||
|
} else {
|
||||||
|
exist = "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
coaching_xml = "[CHECK_VISIT_DATA]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||||
|
+ "[EMP_ID]" + coachingVisitData.get(j).getEmp_id() + "[/EMP_ID]"
|
||||||
|
+ "[IMAGE]" + coachingVisitData.get(j).getImg_path() + "[/IMAGE]"
|
||||||
|
+ "[IS_EXIST]" + exist + "[/IS_EXIST]"
|
||||||
|
+ "[/CHECK_VISIT_DATA]";
|
||||||
|
onXml_coaching_data = onXml_coaching_data + coaching_xml;
|
||||||
|
}
|
||||||
|
|
||||||
|
final String sos_xml = "[DATA]" + onXml_coaching_data + "[/DATA]";
|
||||||
|
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
|
request.addProperty("KEYS", "CHECK_VISIT_DATA");
|
||||||
|
request.addProperty("USERNAME", userId);
|
||||||
|
request.addProperty("MID", mid);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
|
||||||
|
data.value = 65;
|
||||||
|
data.name = getString(R.string.coaching_visit);
|
||||||
|
publishProgress(data);
|
||||||
|
}
|
||||||
|
|
||||||
//Counterfeit Product - Country Id - 6 (UAE)
|
//Counterfeit Product - Country Id - 6 (UAE)
|
||||||
String counterfeit_product_data_xml = "", add_product_data_xml = "", product_exists_xml = "", product_add_xml = "";
|
String counterfeit_product_data_xml = "", add_product_data_xml = "", product_exists_xml = "", product_add_xml = "";
|
||||||
|
|
||||||
@@ -1462,7 +1565,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1521,7 +1624,6 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
+ "[/COMPETITION_PROMOTION_DATA]";
|
+ "[/COMPETITION_PROMOTION_DATA]";
|
||||||
|
|
||||||
competiton_data_xml = competiton_data_xml + competiton_exists_xml;
|
competiton_data_xml = competiton_data_xml + competiton_exists_xml;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final String sos_xml = "[DATA]" + competiton_data_xml + "[/DATA]";
|
final String sos_xml = "[DATA]" + competiton_data_xml + "[/DATA]";
|
||||||
@@ -1536,7 +1638,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1545,6 +1647,169 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
data.value = 68;
|
data.value = 68;
|
||||||
data.name = getString(R.string.title_activity_competition_promo);
|
data.name = getString(R.string.title_activity_competition_promo);
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
|
String order_taking_xml = "";
|
||||||
|
String _onxml = "";
|
||||||
|
String categoryxml = "";
|
||||||
|
db.open();
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> ordertakingdata = db.getOrder_TAKING_UploadServerData(coverageList.get(i).getStoreId());
|
||||||
|
db.open();
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> getOrder_TAKING_CategoryData = db.getOrder_TAKING_CategoryData(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
|
if (ordertakingdata.size() > 0) {
|
||||||
|
for (int k = 0; k < getOrder_TAKING_CategoryData.size(); k++) {
|
||||||
|
_onxml = "[CATEGORY_DATA]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USERID]" + userId + "[/USERID]"
|
||||||
|
+ "[PRESENT]" + getOrder_TAKING_CategoryData.get(k).getIsExist() + "[/PRESENT]"
|
||||||
|
+ "[CATEGORY_ID]" + getOrder_TAKING_CategoryData.get(k).getCategory_id() + "[/CATEGORY_ID]"
|
||||||
|
+ "[/CATEGORY_DATA]";
|
||||||
|
categoryxml = categoryxml + _onxml;
|
||||||
|
}
|
||||||
|
|
||||||
|
String cat_xml = categoryxml;
|
||||||
|
for (int j = 0; j < ordertakingdata.size(); j++) {
|
||||||
|
if (ordertakingdata.get(j).getIsExist() == 1) {
|
||||||
|
if (!ordertakingdata.get(j).getFacing().equals("0") &&
|
||||||
|
!ordertakingdata.get(j).getFacing().equals("")) {
|
||||||
|
onXML = "[ORDER_TAKING]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USERID]" + userId + "[/USERID]"
|
||||||
|
+ "[CATEGORY_ID]" + ordertakingdata.get(j).getCategory_id() + "[/CATEGORY_ID]"
|
||||||
|
+ "[SYSTEM_PO_NUM]" + ordertakingdata.get(j).getSys_PO_No() + "[/SYSTEM_PO_NUM]"
|
||||||
|
+ "[STORE_PO_NUM]" + ordertakingdata.get(j).getStore_PO_No() + "[/STORE_PO_NUM]"
|
||||||
|
+ "[PO_DATE]" + ordertakingdata.get(j).getPO_Date() + "[/PO_DATE]"
|
||||||
|
+ "[BRAND_ID]" + ordertakingdata.get(j).getBrand_id() + "[/BRAND_ID]"
|
||||||
|
+ "[SKU_ID]" + ordertakingdata.get(j).getSku_id() + "[/SKU_ID]"
|
||||||
|
+ "[ORDER_QTY]" + ordertakingdata.get(j).getFacing() + "[/ORDER_QTY]"
|
||||||
|
+ "[PO_IMAGE]" + ordertakingdata.get(j).getPO_Img() + "[/PO_IMAGE]" +
|
||||||
|
"[/ORDER_TAKING]";
|
||||||
|
order_taking_xml = order_taking_xml + onXML;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String data_xml = cat_xml + order_taking_xml;
|
||||||
|
|
||||||
|
final String sos_xml = "[DATA]" + data_xml + "[/DATA]";
|
||||||
|
Log.e("order_xml_data", sos_xml);
|
||||||
|
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
|
request.addProperty("KEYS", "ORDER_TAKING_NEW_XML");
|
||||||
|
request.addProperty("USERNAME", userId);
|
||||||
|
request.addProperty("MID", mid);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
|
||||||
|
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
|
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
data.value = 69;
|
||||||
|
data.name = getString(R.string.order_taking_data_uploading);
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
|
String order_received_xml = "";
|
||||||
|
onXML = "";
|
||||||
|
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> orderreceiveddata = db.getOrder_RECEIVED_UploadServerData(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
|
if (orderreceiveddata.size() > 0) {
|
||||||
|
for (int j = 0; j < orderreceiveddata.size(); j++) {
|
||||||
|
onXML = "[ORDER_CONFIRM]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USERID]" + userId + "[/USERID]"
|
||||||
|
+ "[CATEGORY_ID]" + orderreceiveddata.get(j).getCategory_id() + "[/CATEGORY_ID]"
|
||||||
|
+ "[SYSTEM_PO_NUM]" + orderreceiveddata.get(j).getSys_PO_No() + "[/SYSTEM_PO_NUM]"
|
||||||
|
+ "[STORE_PO_NUM]" + orderreceiveddata.get(j).getStore_PO_No() + "[/STORE_PO_NUM]"
|
||||||
|
+ "[PO_DATE]" + orderreceiveddata.get(j).getPO_Date() + "[/PO_DATE]"
|
||||||
|
+ "[BRAND_ID]" + orderreceiveddata.get(j).getBrand_id() + "[/BRAND_ID]"
|
||||||
|
+ "[SKU_ID]" + orderreceiveddata.get(j).getSku_id() + "[/SKU_ID]"
|
||||||
|
+ "[PO_QTY]" + orderreceiveddata.get(j).getOrderqty() + "[/PO_QTY]"
|
||||||
|
+ "[ACTUAL_QTY]" + orderreceiveddata.get(j).getFacing() + "[/ACTUAL_QTY]" +
|
||||||
|
"[/ORDER_CONFIRM]";
|
||||||
|
|
||||||
|
order_received_xml = order_received_xml + onXML;
|
||||||
|
}
|
||||||
|
|
||||||
|
final String sos_xml = "[DATA]" + order_received_xml + "[/DATA]";
|
||||||
|
Log.e("order_xml_data", sos_xml);
|
||||||
|
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
|
request.addProperty("KEYS", "ORDER_RECEIVED_STATUS_XML");
|
||||||
|
request.addProperty("USERNAME", userId);
|
||||||
|
request.addProperty("MID", mid);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
|
||||||
|
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
|
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
data.value = 70;
|
||||||
|
data.name = getString(R.string.order_received_data_uploading);
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
String visit_xml = "";
|
||||||
|
onXML = "";
|
||||||
|
ArrayList<Visit_Type_Master_GetterSetter> visittypelist = db.getUploadedVisitType(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
|
if (visittypelist.size() > 0) {
|
||||||
|
for (int j = 0; j < visittypelist.size(); j++) {
|
||||||
|
onXML = "[VISIT_TYPE_STATUS]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USERID]" + userId + "[/USERID]"
|
||||||
|
+ "[STORE_ID]" + coverageList.get(i).getStoreId() + "[/STORE_ID]"
|
||||||
|
+ "[VISIT_TYPE_ID]" + visittypelist.get(j).getVISIT_TYPE_ID().get(0) + "[/VISIT_TYPE_ID]"
|
||||||
|
+ "[/VISIT_TYPE_STATUS]";
|
||||||
|
|
||||||
|
visit_xml = visit_xml + onXML;
|
||||||
|
}
|
||||||
|
final String sos_xml = "[DATA]" + visit_xml + "[/DATA]";
|
||||||
|
Log.e("visit_xml_data", sos_xml);
|
||||||
|
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
|
|
||||||
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
|
request.addProperty("KEYS", "VISIT_TYPE_XML");
|
||||||
|
request.addProperty("USERNAME", userId);
|
||||||
|
request.addProperty("MID", mid);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
|
||||||
|
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
|
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data.value = 71;
|
||||||
|
data.name = getString(R.string.visit_type_data_uploading);
|
||||||
|
publishProgress(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -1556,7 +1821,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
for (int i1 = 0; i1 < additionalVisibilityList.size(); i1++) {
|
for (int i1 = 0; i1 < additionalVisibilityList.size(); i1++) {
|
||||||
|
|
||||||
if (additionalVisibilityList.get(i1).getImage() != null && !additionalVisibilityList.get(i1).getImage().equals("")) {
|
if (additionalVisibilityList.get(i1).getImage() != null && !additionalVisibilityList.get(i1).getImage().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + additionalVisibilityList.get(i1).getImage()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + additionalVisibilityList.get(i1).getImage()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(additionalVisibilityList.get(i1).getImage(), "AdditionalVisibilityImages");
|
result = UploadImage(additionalVisibilityList.get(i1).getImage(), "AdditionalVisibilityImages");
|
||||||
@@ -1576,7 +1841,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (additionalVisibilityList.get(i1).getImage2() != null && !additionalVisibilityList.get(i1).getImage2().equals("")) {
|
if (additionalVisibilityList.get(i1).getImage2() != null && !additionalVisibilityList.get(i1).getImage2().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + additionalVisibilityList.get(i1).getImage2()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + additionalVisibilityList.get(i1).getImage2()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(additionalVisibilityList.get(i1).getImage2(), "AdditionalVisibilityImages");
|
result = UploadImage(additionalVisibilityList.get(i1).getImage2(), "AdditionalVisibilityImages");
|
||||||
@@ -1597,7 +1862,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
|
|
||||||
if (additionalVisibilityList.get(i1).getImage3() != null && !additionalVisibilityList.get(i1).getImage3().equals("")) {
|
if (additionalVisibilityList.get(i1).getImage3() != null && !additionalVisibilityList.get(i1).getImage3().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + additionalVisibilityList.get(i1).getImage3()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + additionalVisibilityList.get(i1).getImage3()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(additionalVisibilityList.get(i1).getImage3(), "AdditionalVisibilityImages");
|
result = UploadImage(additionalVisibilityList.get(i1).getImage3(), "AdditionalVisibilityImages");
|
||||||
@@ -1635,7 +1900,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
for (int i1 = 0; i1 < listdat.size(); i1++) {
|
for (int i1 = 0; i1 < listdat.size(); i1++) {
|
||||||
|
|
||||||
if (listdat.get(i1).getSubCategoryCamera1() != null && !listdat.get(i1).getSubCategoryCamera1().equals("")) {
|
if (listdat.get(i1).getSubCategoryCamera1() != null && !listdat.get(i1).getSubCategoryCamera1().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + listdat.get(i1).getSubCategoryCamera1()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + listdat.get(i1).getSubCategoryCamera1()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(listdat.get(i1).getSubCategoryCamera1(), "CategoryImages");
|
result = UploadImage(listdat.get(i1).getSubCategoryCamera1(), "CategoryImages");
|
||||||
@@ -1655,7 +1920,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (listdat.get(i1).getSubCategoryCamera2() != null && !listdat.get(i1).getSubCategoryCamera2().equals("")) {
|
if (listdat.get(i1).getSubCategoryCamera2() != null && !listdat.get(i1).getSubCategoryCamera2().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + listdat.get(i1).getSubCategoryCamera2()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + listdat.get(i1).getSubCategoryCamera2()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(listdat.get(i1).getSubCategoryCamera2(), "CategoryImages");
|
result = UploadImage(listdat.get(i1).getSubCategoryCamera2(), "CategoryImages");
|
||||||
@@ -1687,7 +1952,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
for (int i1 = 0; i1 < adddata.size(); i1++) {
|
for (int i1 = 0; i1 < adddata.size(); i1++) {
|
||||||
|
|
||||||
if (adddata.get(i1).getCategoryImage1() != null && !adddata.get(i1).getCategoryImage1().equals("")) {
|
if (adddata.get(i1).getCategoryImage1() != null && !adddata.get(i1).getCategoryImage1().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + adddata.get(i1).getCategoryImage1()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + adddata.get(i1).getCategoryImage1()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(adddata.get(i1).getCategoryImage1(), "CategoryImages");
|
result = UploadImage(adddata.get(i1).getCategoryImage1(), "CategoryImages");
|
||||||
@@ -1707,7 +1972,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (adddata.get(i1).getCategoryImage2() != null && !adddata.get(i1).getCategoryImage2().equals("")) {
|
if (adddata.get(i1).getCategoryImage2() != null && !adddata.get(i1).getCategoryImage2().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + adddata.get(i1).getCategoryImage2()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + adddata.get(i1).getCategoryImage2()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(adddata.get(i1).getCategoryImage2(), "CategoryImages");
|
result = UploadImage(adddata.get(i1).getCategoryImage2(), "CategoryImages");
|
||||||
@@ -1727,7 +1992,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (adddata.get(i1).getCategoryImage3() != null && !adddata.get(i1).getCategoryImage3().equals("")) {
|
if (adddata.get(i1).getCategoryImage3() != null && !adddata.get(i1).getCategoryImage3().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + adddata.get(i1).getCategoryImage3()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + adddata.get(i1).getCategoryImage3()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(adddata.get(i1).getCategoryImage3(), "CategoryImages");
|
result = UploadImage(adddata.get(i1).getCategoryImage3(), "CategoryImages");
|
||||||
@@ -1746,7 +2011,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (adddata.get(i1).getCategoryImage4() != null && !adddata.get(i1).getCategoryImage4().equals("")) {
|
if (adddata.get(i1).getCategoryImage4() != null && !adddata.get(i1).getCategoryImage4().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + adddata.get(i1).getCategoryImage4()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + adddata.get(i1).getCategoryImage4()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(adddata.get(i1).getCategoryImage4(), "CategoryImages");
|
result = UploadImage(adddata.get(i1).getCategoryImage4(), "CategoryImages");
|
||||||
@@ -1775,7 +2040,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
for (int i1 = 0; i1 < adddata.size(); i1++) {
|
for (int i1 = 0; i1 < adddata.size(); i1++) {
|
||||||
|
|
||||||
if (adddata.get(i1).getCategoryImage1() != null && !adddata.get(i1).getCategoryImage1().equals("")) {
|
if (adddata.get(i1).getCategoryImage1() != null && !adddata.get(i1).getCategoryImage1().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + adddata.get(i1).getCategoryImage1()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + adddata.get(i1).getCategoryImage1()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(adddata.get(i1).getCategoryImage1(), "CategoryImages");
|
result = UploadImage(adddata.get(i1).getCategoryImage1(), "CategoryImages");
|
||||||
@@ -1795,7 +2060,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (adddata.get(i1).getCategoryImage2() != null && !adddata.get(i1).getCategoryImage2().equals("")) {
|
if (adddata.get(i1).getCategoryImage2() != null && !adddata.get(i1).getCategoryImage2().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + adddata.get(i1).getCategoryImage2()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + adddata.get(i1).getCategoryImage2()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(adddata.get(i1).getCategoryImage2(), "CategoryImages");
|
result = UploadImage(adddata.get(i1).getCategoryImage2(), "CategoryImages");
|
||||||
@@ -1815,7 +2080,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (adddata.get(i1).getCategoryImage3() != null && !adddata.get(i1).getCategoryImage3().equals("")) {
|
if (adddata.get(i1).getCategoryImage3() != null && !adddata.get(i1).getCategoryImage3().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + adddata.get(i1).getCategoryImage3()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + adddata.get(i1).getCategoryImage3()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(adddata.get(i1).getCategoryImage3(), "CategoryImages");
|
result = UploadImage(adddata.get(i1).getCategoryImage3(), "CategoryImages");
|
||||||
@@ -1834,7 +2099,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (adddata.get(i1).getCategoryImage4() != null && !adddata.get(i1).getCategoryImage4().equals("")) {
|
if (adddata.get(i1).getCategoryImage4() != null && !adddata.get(i1).getCategoryImage4().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + adddata.get(i1).getCategoryImage4()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + adddata.get(i1).getCategoryImage4()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(adddata.get(i1).getCategoryImage4(), "CategoryImages");
|
result = UploadImage(adddata.get(i1).getCategoryImage4(), "CategoryImages");
|
||||||
@@ -1863,7 +2128,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
for (int i1 = 0; i1 < coverageList.size(); i1++) {
|
for (int i1 = 0; i1 < coverageList.size(); i1++) {
|
||||||
|
|
||||||
if (coverageList.get(i1).getImage() != null && !coverageList.get(i1).getImage().equals("")) {
|
if (coverageList.get(i1).getImage() != null && !coverageList.get(i1).getImage().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + coverageList.get(i1).getImage()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + coverageList.get(i1).getImage()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(coverageList.get(i1).getImage(), "StoreImages");
|
result = UploadImage(coverageList.get(i1).getImage(), "StoreImages");
|
||||||
@@ -1892,7 +2157,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
for (int i1 = 0; i1 < promotionSkuList.size(); i1++) {
|
for (int i1 = 0; i1 < promotionSkuList.size(); i1++) {
|
||||||
|
|
||||||
if (promotionSkuList.get(i1).getImage_promotion() != null && !promotionSkuList.get(i1).getImage_promotion().equals("")) {
|
if (promotionSkuList.get(i1).getImage_promotion() != null && !promotionSkuList.get(i1).getImage_promotion().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + promotionSkuList.get(i1).getImage_promotion()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + promotionSkuList.get(i1).getImage_promotion()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(promotionSkuList.get(i1).getImage_promotion(), "PromotionImages");
|
result = UploadImage(promotionSkuList.get(i1).getImage_promotion(), "PromotionImages");
|
||||||
@@ -1921,7 +2186,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
for (int i1 = 0; i1 < additionalPromotionList.size(); i1++) {
|
for (int i1 = 0; i1 < additionalPromotionList.size(); i1++) {
|
||||||
|
|
||||||
if (additionalPromotionList.get(i1).getImage_promotion() != null && !additionalPromotionList.get(i1).getImage_promotion().equals("")) {
|
if (additionalPromotionList.get(i1).getImage_promotion() != null && !additionalPromotionList.get(i1).getImage_promotion().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + additionalPromotionList.get(i1).getImage_promotion()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + additionalPromotionList.get(i1).getImage_promotion()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(additionalPromotionList.get(i1).getImage_promotion(), "AdditionalPromotionImages");
|
result = UploadImage(additionalPromotionList.get(i1).getImage_promotion(), "AdditionalPromotionImages");
|
||||||
@@ -1950,7 +2215,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
for (int i1 = 0; i1 < coverageList.size(); i1++) {
|
for (int i1 = 0; i1 < coverageList.size(); i1++) {
|
||||||
|
|
||||||
if (coverageList.get(i1).getCheckOut_Image() != null && !coverageList.get(i1).getCheckOut_Image().equals("")) {
|
if (coverageList.get(i1).getCheckOut_Image() != null && !coverageList.get(i1).getCheckOut_Image().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + coverageList.get(i1).getCheckOut_Image()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + coverageList.get(i1).getCheckOut_Image()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(coverageList.get(i1).getCheckOut_Image(), "StoreImages");
|
result = UploadImage(coverageList.get(i1).getCheckOut_Image(), "StoreImages");
|
||||||
@@ -1978,7 +2243,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
for (int m = 0; m < t2PGetterSetters.size(); m++) {
|
for (int m = 0; m < t2PGetterSetters.size(); m++) {
|
||||||
|
|
||||||
if (t2PGetterSetters.get(m).getImage() != null && !t2PGetterSetters.get(m).getImage().equals("")) {
|
if (t2PGetterSetters.get(m).getImage() != null && !t2PGetterSetters.get(m).getImage().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + t2PGetterSetters.get(m).getImage()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + t2PGetterSetters.get(m).getImage()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(t2PGetterSetters.get(m).getImage(), "T2PImages");
|
result = UploadImage(t2PGetterSetters.get(m).getImage(), "T2PImages");
|
||||||
@@ -1998,7 +2263,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (t2PGetterSetters.get(m).getImage1() != null && !t2PGetterSetters.get(m).getImage1().equals("")) {
|
if (t2PGetterSetters.get(m).getImage1() != null && !t2PGetterSetters.get(m).getImage1().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + t2PGetterSetters.get(m).getImage1()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + t2PGetterSetters.get(m).getImage1()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(t2PGetterSetters.get(m).getImage1(), "T2PImages");
|
result = UploadImage(t2PGetterSetters.get(m).getImage1(), "T2PImages");
|
||||||
@@ -2018,7 +2283,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (t2PGetterSetters.get(m).getImage2() != null && !t2PGetterSetters.get(m).getImage2().equals("")) {
|
if (t2PGetterSetters.get(m).getImage2() != null && !t2PGetterSetters.get(m).getImage2().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + t2PGetterSetters.get(m).getImage2()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + t2PGetterSetters.get(m).getImage2()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(t2PGetterSetters.get(m).getImage2(), "T2PImages");
|
result = UploadImage(t2PGetterSetters.get(m).getImage2(), "T2PImages");
|
||||||
@@ -2042,7 +2307,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
for (int m = 0; m < audit_data.size(); m++) {
|
for (int m = 0; m < audit_data.size(); m++) {
|
||||||
|
|
||||||
if (audit_data.get(m).getCAM_IMAGE() != null && !audit_data.get(m).getCAM_IMAGE().equals("")) {
|
if (audit_data.get(m).getCAM_IMAGE() != null && !audit_data.get(m).getCAM_IMAGE().equals("")) {
|
||||||
if (new File(CommonString.FILE_PATH + audit_data.get(m).getCAM_IMAGE()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + audit_data.get(m).getCAM_IMAGE()).exists()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = UploadImage(audit_data.get(m).getCAM_IMAGE(), "AuditImages");
|
result = UploadImage(audit_data.get(m).getCAM_IMAGE(), "AuditImages");
|
||||||
@@ -2085,7 +2350,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + status_service, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + status_service, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -2149,7 +2414,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
if (result.contains(CommonString.KEY_SUCCESS)) {
|
if (result.contains(CommonString.KEY_SUCCESS)) {
|
||||||
//db.deleteAllTables();
|
//db.deleteAllTables();
|
||||||
|
|
||||||
File f = new File(CommonString.FILE_PATH);
|
File f = new File(CommonString.getImagesFolder(context));
|
||||||
//if (f != null && f.listFiles().length > 0) {
|
//if (f != null && f.listFiles().length > 0) {
|
||||||
File file[] = f.listFiles();
|
File file[] = f.listFiles();
|
||||||
UploadImageWithRetrofit.uploadedFiles = 0;
|
UploadImageWithRetrofit.uploadedFiles = 0;
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import com.squareup.okhttp.RequestBody;
|
|||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
import org.ksoap2.serialization.SoapObject;
|
import org.ksoap2.serialization.SoapObject;
|
||||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
import org.ksoap2.transport.HttpTransportSE;
|
|
||||||
import org.xml.sax.InputSource;
|
import org.xml.sax.InputSource;
|
||||||
import org.xml.sax.XMLReader;
|
import org.xml.sax.XMLReader;
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
@@ -63,6 +62,7 @@ import cpm.com.gskmtorange.constant.CommonFunctions;
|
|||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.retrofit.PostApiForFile;
|
import cpm.com.gskmtorange.retrofit.PostApiForFile;
|
||||||
import cpm.com.gskmtorange.retrofit.StringConverterFactory;
|
import cpm.com.gskmtorange.retrofit.StringConverterFactory;
|
||||||
|
import cpm.com.gskmtorange.utils.OkHttpTransportSE;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CompetitonPromoGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.CompetitonPromoGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CounterfeitProductGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.CounterfeitProductGetterSetter;
|
||||||
@@ -83,6 +83,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGette
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.Store_wise_camera_DataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.Store_wise_camera_DataGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
||||||
import retrofit.Retrofit;
|
import retrofit.Retrofit;
|
||||||
|
|
||||||
@@ -96,8 +97,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
String[] words;
|
String[] words;
|
||||||
String validity;
|
String validity;
|
||||||
int mid;
|
int mid;
|
||||||
String errormsg = "", Path;
|
String errormsg = "", Path; Data data;
|
||||||
Data data;
|
|
||||||
ArrayList<MSL_AvailabilityGetterSetter> msl_availabilityList;
|
ArrayList<MSL_AvailabilityGetterSetter> msl_availabilityList;
|
||||||
ArrayList<Stock_FacingGetterSetter> stock_facingHeaderList, stock_facingChildList;
|
ArrayList<Stock_FacingGetterSetter> stock_facingHeaderList, stock_facingChildList;
|
||||||
ArrayList<Promo_Compliance_DataGetterSetter> promotionSkuList, additionalPromotionList;
|
ArrayList<Promo_Compliance_DataGetterSetter> promotionSkuList, additionalPromotionList;
|
||||||
@@ -123,14 +123,6 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
ArrayList<PromoComplianceSkuwiseGetterSetter> promoComplianceSkuwiseGetterSetters, promoComplianceSkuwiseExistsGetterSetters;
|
ArrayList<PromoComplianceSkuwiseGetterSetter> promoComplianceSkuwiseGetterSetters, promoComplianceSkuwiseExistsGetterSetters;
|
||||||
ArrayList<CounterfeitProductGetterSetter> counterfeitProductGetterSetters, counterfeitProductExistsGetterSetters;
|
ArrayList<CounterfeitProductGetterSetter> counterfeitProductGetterSetters, counterfeitProductExistsGetterSetters;
|
||||||
ArrayList<CompetitonPromoGetterSetter> competitonGetterSetters, competitonExistsGetterSetters;
|
ArrayList<CompetitonPromoGetterSetter> competitonGetterSetters, competitonExistsGetterSetters;
|
||||||
|
|
||||||
RequestBody body1;
|
|
||||||
private Retrofit adapter;
|
|
||||||
int status = 0;
|
|
||||||
int count = 0;
|
|
||||||
public static int uploadedFiles = 0;
|
|
||||||
public static int totalFiles = 0;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -150,7 +142,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
db = new GSKOrangeDB(this);
|
db = new GSKOrangeDB(this);
|
||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
Path = CommonString.FILE_PATH;
|
Path = CommonString.getImagesFolder(context);
|
||||||
|
|
||||||
//start upload
|
//start upload
|
||||||
new UploadTask(this).execute();
|
new UploadTask(this).execute();
|
||||||
@@ -202,7 +194,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UPLOAD_IMAGE, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UPLOAD_IMAGE, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -303,7 +295,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -337,7 +329,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -375,7 +367,6 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
adhoc = "0";
|
adhoc = "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
String coverage_service, status_service;
|
String coverage_service, status_service;
|
||||||
|
|
||||||
if (coverageList.get(i).getFlag_from().equals(CommonString.FROM_ADDITIONAL) || coverageList.get(i).getFlag_from().equals(CommonString.FROM_ADDITIONAL_ADHOC)) {
|
if (coverageList.get(i).getFlag_from().equals(CommonString.FROM_ADDITIONAL) || coverageList.get(i).getFlag_from().equals(CommonString.FROM_ADDITIONAL_ADHOC)) {
|
||||||
@@ -425,7 +416,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + coverage_service, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + coverage_service, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -481,7 +472,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -537,7 +528,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -559,7 +550,6 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
publishProgress(data);*/
|
publishProgress(data);*/
|
||||||
|
|
||||||
if (coverageList.get(i).getFlag_from().equals(CommonString.FROM_ADDITIONAL)) {
|
if (coverageList.get(i).getFlag_from().equals(CommonString.FROM_ADDITIONAL)) {
|
||||||
|
|
||||||
//MSL_Availability_StockFacing
|
//MSL_Availability_StockFacing
|
||||||
String mslAvailability_stockFacing_xml = "";
|
String mslAvailability_stockFacing_xml = "";
|
||||||
onXML = "";
|
onXML = "";
|
||||||
@@ -583,7 +573,6 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
+ "[STK]" + Integer.parseInt(stock) + "[/STK]"
|
+ "[STK]" + Integer.parseInt(stock) + "[/STK]"
|
||||||
+ "[MBQ]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMbq()) + "[/MBQ]"
|
+ "[MBQ]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMbq()) + "[/MBQ]"
|
||||||
+ "[MSL]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMust_have()) + "[/MSL]" +
|
+ "[MSL]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMust_have()) + "[/MSL]" +
|
||||||
|
|
||||||
"[/ST]";
|
"[/ST]";
|
||||||
|
|
||||||
mslAvailability_stockFacing_xml = mslAvailability_stockFacing_xml + onXML;
|
mslAvailability_stockFacing_xml = mslAvailability_stockFacing_xml + onXML;
|
||||||
@@ -602,14 +591,11 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
|
||||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
|
||||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
data.value = 15;
|
data.value = 15;
|
||||||
data.name = getString(R.string.availability_data_uploading);
|
data.name = getString(R.string.availability_data_uploading);
|
||||||
@@ -655,7 +641,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -664,6 +650,54 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
data.name = getString(R.string.coaching_visit);
|
data.name = getString(R.string.coaching_visit);
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
}
|
}
|
||||||
|
//Coaching check visit data
|
||||||
|
db.open();
|
||||||
|
coachingVisitData = db.getCoachingVisitStoreData(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
|
if (coachingVisitData.size() > 0) {
|
||||||
|
|
||||||
|
String onXml_coaching_data = "", coaching_xml = "";
|
||||||
|
for (int j = 0; j < coachingVisitData.size(); j++) {
|
||||||
|
|
||||||
|
String exist;
|
||||||
|
|
||||||
|
if (coachingVisitData.get(j).isExists()) {
|
||||||
|
exist = "1";
|
||||||
|
} else {
|
||||||
|
exist = "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
coaching_xml = "[CHECK_VISIT_DATA]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||||
|
+ "[EMP_ID]" + coachingVisitData.get(j).getEmp_id() + "[/EMP_ID]"
|
||||||
|
+ "[IMAGE]" + coachingVisitData.get(j).getImg_path() + "[/IMAGE]"
|
||||||
|
+ "[IS_EXIST]" + exist + "[/IS_EXIST]"
|
||||||
|
+ "[/CHECK_VISIT_DATA]";
|
||||||
|
onXml_coaching_data = onXml_coaching_data + coaching_xml;
|
||||||
|
}
|
||||||
|
|
||||||
|
final String sos_xml = "[DATA]" + onXml_coaching_data + "[/DATA]";
|
||||||
|
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
|
request.addProperty("KEYS", "CHECK_VISIT_DATA");
|
||||||
|
request.addProperty("USERNAME", userId);
|
||||||
|
request.addProperty("MID", mid);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
|
||||||
|
data.value = 65;
|
||||||
|
data.name = getString(R.string.coaching_visit);
|
||||||
|
publishProgress(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//end usk
|
//end usk
|
||||||
@@ -717,7 +751,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -764,7 +798,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -809,7 +843,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -828,7 +862,12 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
String mslAvailability_stockFacing_xml = "";
|
String mslAvailability_stockFacing_xml = "";
|
||||||
onXML = "";
|
onXML = "";
|
||||||
db.open();
|
db.open();
|
||||||
msl_availabilityStockFacingList = db.getMSL_Availability_StockFacing_UploadServerData(coverageList.get(i).getStoreId());
|
msl_availabilityStockFacingList = db.getMSL_Availability_StockFacing_UploadServerDataNew(coverageList.get(i)
|
||||||
|
.getStoreId(),coverageList.get(i).getVisitDate(),
|
||||||
|
coverageList.get(i).getKeyAccountId(),
|
||||||
|
coverageList.get(i).getStoreTypeId(),
|
||||||
|
coverageList.get(i).getClassId(),
|
||||||
|
coverageList.get(i).getMappingStk());
|
||||||
|
|
||||||
if (msl_availabilityStockFacingList.size() > 0) {
|
if (msl_availabilityStockFacingList.size() > 0) {
|
||||||
for (int j = 0; j < msl_availabilityStockFacingList.size(); j++) {
|
for (int j = 0; j < msl_availabilityStockFacingList.size(); j++) {
|
||||||
@@ -853,7 +892,8 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
+ "[AVL]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getToggleValue()) + "[/AVL]"
|
+ "[AVL]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getToggleValue()) + "[/AVL]"
|
||||||
+ "[FC]" + Double.parseDouble(msl_availabilityStockFacingList.get(j).getFacing()) + "[/FC]"
|
+ "[FC]" + Double.parseDouble(msl_availabilityStockFacingList.get(j).getFacing()) + "[/FC]"
|
||||||
+ "[SK]" + Integer.parseInt(stock) + "[/SK]"
|
+ "[SK]" + Integer.parseInt(stock) + "[/SK]"
|
||||||
+ "[PRICING]" + Integer.parseInt(pricing) + "[/PRICING]"
|
+ "[PRICING]" + Double.parseDouble(pricing) + "[/PRICING]"
|
||||||
|
// + "[PRICING]" + Integer.parseInt(pricing) + "[/PRICING]"
|
||||||
+ "[ML]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMust_have()) + "[/ML]" +
|
+ "[ML]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMust_have()) + "[/ML]" +
|
||||||
"[/ST]";
|
"[/ST]";
|
||||||
|
|
||||||
@@ -862,7 +902,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final String sos_xml = "[DATA]" + mslAvailability_stockFacing_xml + "[/DATA]";
|
final String sos_xml = "[DATA]" + mslAvailability_stockFacing_xml + "[/DATA]";
|
||||||
|
Log.d("MSL_DATA",sos_xml);
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
request.addProperty("XMLDATA", sos_xml);
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
request.addProperty("KEYS", "STOCK_AVAILABILITY_WITH_PRICING");
|
request.addProperty("KEYS", "STOCK_AVAILABILITY_WITH_PRICING");
|
||||||
@@ -873,7 +913,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -886,6 +926,69 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
data.name = getString(R.string.availability_data_uploading);
|
data.name = getString(R.string.availability_data_uploading);
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
//MSL_Availability_StockFacing
|
||||||
|
String msl_availabilityStockEntryXml = "";
|
||||||
|
onXML = "";
|
||||||
|
db.open();
|
||||||
|
msl_availabilityStockFacingList = db.getStock_Entry_UploadServerDataNew(coverageList.get(i)
|
||||||
|
.getStoreId(),coverageList.get(i).getVisitDate(),
|
||||||
|
coverageList.get(i).getKeyAccountId(),
|
||||||
|
coverageList.get(i).getStoreTypeId(),
|
||||||
|
coverageList.get(i).getClassId(),
|
||||||
|
coverageList.get(i).getMappingStk());
|
||||||
|
|
||||||
|
if (msl_availabilityStockFacingList.size() > 0) {
|
||||||
|
for (int j = 0; j < msl_availabilityStockFacingList.size(); j++) {
|
||||||
|
if (!msl_availabilityStockFacingList.get(j).getSku_id().equals("0")) {
|
||||||
|
String posm_stock,warehouse_stock;
|
||||||
|
if (!msl_availabilityStockFacingList.get(j).getPosmStock().equals("")) {
|
||||||
|
posm_stock = msl_availabilityStockFacingList.get(j).getPosmStock();
|
||||||
|
} else {
|
||||||
|
posm_stock = "0";
|
||||||
|
}
|
||||||
|
if (!msl_availabilityStockFacingList.get(j).getWarehouseStock().equals("")) {
|
||||||
|
warehouse_stock = msl_availabilityStockFacingList.get(j).getWarehouseStock();
|
||||||
|
} else {
|
||||||
|
warehouse_stock = "0";
|
||||||
|
}
|
||||||
|
onXML = "[ST]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USERID]" + userId + "[/USERID]"
|
||||||
|
+ "[SID]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getSku_id()) + "[/SID]"
|
||||||
|
+ "[POSM_STOCK]" + Integer.parseInt(posm_stock) + "[/POSM_STOCK]"
|
||||||
|
+ "[WAREHOUSE_STOCK]" + Integer.parseInt(warehouse_stock) + "[/WAREHOUSE_STOCK]"
|
||||||
|
+ "[MBQ]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMbq()) + "[/MBQ]"
|
||||||
|
+ "[ML]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMust_have()) + "[/ML]" +
|
||||||
|
"[/ST]";
|
||||||
|
|
||||||
|
msl_availabilityStockEntryXml = msl_availabilityStockEntryXml + onXML;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
final String sos_xml = "[DATA]" + msl_availabilityStockEntryXml + "[/DATA]";
|
||||||
|
Log.d("STOCK_ENTRY_DATA",sos_xml);
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
|
request.addProperty("KEYS", "STOCK_ENTRY");
|
||||||
|
request.addProperty("USERNAME", userId);
|
||||||
|
request.addProperty("MID", mid);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
|
||||||
|
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
|
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
data.value = 16;
|
||||||
|
data.name = getString(R.string.stock_entry_data_uploading);
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
//Promo Compliance - Promotion Data
|
//Promo Compliance - Promotion Data
|
||||||
String promoition_data_xml = "";
|
String promoition_data_xml = "";
|
||||||
@@ -926,7 +1029,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -970,7 +1073,6 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
+ "[PROMO_IMAGE]" + promoComplianceSkuwiseGetterSetters.get(i1).getImg() + "[/PROMO_IMAGE]"
|
+ "[PROMO_IMAGE]" + promoComplianceSkuwiseGetterSetters.get(i1).getImg() + "[/PROMO_IMAGE]"
|
||||||
+ "[PRICE_FLASHER_AVAILABLE]" + promoComplianceSkuwiseGetterSetters.get(i1).getPrice_flasher() + "[/PRICE_FLASHER_AVAILABLE]"
|
+ "[PRICE_FLASHER_AVAILABLE]" + promoComplianceSkuwiseGetterSetters.get(i1).getPrice_flasher() + "[/PRICE_FLASHER_AVAILABLE]"
|
||||||
+ "[/PROMOTION_DATA]";
|
+ "[/PROMOTION_DATA]";
|
||||||
|
|
||||||
add_promotion_data_xml = add_promotion_data_xml + add_xml;
|
add_promotion_data_xml = add_promotion_data_xml + add_xml;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1004,7 +1106,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1059,7 +1161,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1159,7 +1261,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1289,7 +1391,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1340,7 +1442,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1438,7 +1540,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1490,7 +1592,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1506,7 +1608,6 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
ArrayList<AuditDataGetterSetter> audit_data = db.getAuditDataForUpload(coverageList.get(i).getStoreId());
|
ArrayList<AuditDataGetterSetter> audit_data = db.getAuditDataForUpload(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
if (audit_data.size() > 0) {
|
if (audit_data.size() > 0) {
|
||||||
|
|
||||||
String onXml_audit_data = "", Audit_data = "";
|
String onXml_audit_data = "", Audit_data = "";
|
||||||
for (int n = 0; n < audit_data.size(); n++) {
|
for (int n = 0; n < audit_data.size(); n++) {
|
||||||
|
|
||||||
@@ -1526,7 +1627,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final String sos_xml = "[DATA]" + Audit_data + "[/DATA]";
|
final String sos_xml = "[DATA]" + Audit_data + "[/DATA]";
|
||||||
|
Log.d("sos_xml_audit",sos_xml);
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
request.addProperty("XMLDATA", sos_xml);
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
request.addProperty("KEYS", "AUDIT_DATA_NEW_REMARK");
|
request.addProperty("KEYS", "AUDIT_DATA_NEW_REMARK");
|
||||||
@@ -1537,7 +1638,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1580,7 +1681,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1629,7 +1730,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1639,6 +1740,55 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Coaching check visit data
|
||||||
|
db.open();
|
||||||
|
coachingVisitData = db.getCoachingVisitStoreData(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
|
if (coachingVisitData.size() > 0) {
|
||||||
|
|
||||||
|
String onXml_coaching_data = "", coaching_xml = "";
|
||||||
|
for (int j = 0; j < coachingVisitData.size(); j++) {
|
||||||
|
|
||||||
|
String exist;
|
||||||
|
|
||||||
|
if (coachingVisitData.get(j).isExists()) {
|
||||||
|
exist = "1";
|
||||||
|
} else {
|
||||||
|
exist = "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
coaching_xml = "[CHECK_VISIT_DATA]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||||
|
+ "[EMP_ID]" + coachingVisitData.get(j).getEmp_id() + "[/EMP_ID]"
|
||||||
|
+ "[IMAGE]" + coachingVisitData.get(j).getImg_path() + "[/IMAGE]"
|
||||||
|
+ "[IS_EXIST]" + exist + "[/IS_EXIST]"
|
||||||
|
+ "[/CHECK_VISIT_DATA]";
|
||||||
|
onXml_coaching_data = onXml_coaching_data + coaching_xml;
|
||||||
|
}
|
||||||
|
|
||||||
|
final String sos_xml = "[DATA]" + onXml_coaching_data + "[/DATA]";
|
||||||
|
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
|
request.addProperty("KEYS", "CHECK_VISIT_DATA");
|
||||||
|
request.addProperty("USERNAME", userId);
|
||||||
|
request.addProperty("MID", mid);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
|
||||||
|
data.value = 65;
|
||||||
|
data.name = getString(R.string.coaching_visit);
|
||||||
|
publishProgress(data);
|
||||||
|
}
|
||||||
|
|
||||||
//Counterfeit Product - Country Id - 6 (UAE)
|
//Counterfeit Product - Country Id - 6 (UAE)
|
||||||
String counterfeit_product_data_xml = "", add_product_data_xml = "", product_exists_xml = "", product_add_xml = "";
|
String counterfeit_product_data_xml = "", add_product_data_xml = "", product_exists_xml = "", product_add_xml = "";
|
||||||
|
|
||||||
@@ -1700,7 +1850,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1757,9 +1907,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
+ "[IS_EXISTS]" + exists + "[/IS_EXISTS]"
|
+ "[IS_EXISTS]" + exists + "[/IS_EXISTS]"
|
||||||
+ "[COMPETITION_DATA]" + add_competiton_data_xml + "[/COMPETITION_DATA]"
|
+ "[COMPETITION_DATA]" + add_competiton_data_xml + "[/COMPETITION_DATA]"
|
||||||
+ "[/COMPETITION_PROMOTION_DATA]";
|
+ "[/COMPETITION_PROMOTION_DATA]";
|
||||||
|
|
||||||
competiton_data_xml = competiton_data_xml + competiton_exists_xml;
|
competiton_data_xml = competiton_data_xml + competiton_exists_xml;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final String sos_xml = "[DATA]" + competiton_data_xml + "[/DATA]";
|
final String sos_xml = "[DATA]" + competiton_data_xml + "[/DATA]";
|
||||||
@@ -1774,7 +1922,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1783,6 +1931,167 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
data.value = 68;
|
data.value = 68;
|
||||||
data.name = getString(R.string.title_activity_competition_promo);
|
data.name = getString(R.string.title_activity_competition_promo);
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
|
String order_taking_xml = "";
|
||||||
|
String _onxml = "";
|
||||||
|
String categoryxml = "";
|
||||||
|
db.open();
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> ordertakingdata = db.getOrder_TAKING_UploadServerData(coverageList.get(i).getStoreId());
|
||||||
|
db.open();
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> getOrder_TAKING_CategoryData = db.getOrder_TAKING_CategoryData(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
|
if (ordertakingdata.size() > 0) {
|
||||||
|
for(int k = 0; k < getOrder_TAKING_CategoryData.size(); k++){
|
||||||
|
_onxml = "[CATEGORY_DATA]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USERID]" + userId + "[/USERID]"
|
||||||
|
+ "[PRESENT]" + getOrder_TAKING_CategoryData.get(k).getIsExist() + "[/PRESENT]"
|
||||||
|
+ "[CATEGORY_ID]" + getOrder_TAKING_CategoryData.get(k).getCategory_id() + "[/CATEGORY_ID]"
|
||||||
|
+ "[/CATEGORY_DATA]";
|
||||||
|
categoryxml = categoryxml + _onxml;
|
||||||
|
}
|
||||||
|
|
||||||
|
String cat_xml = categoryxml;
|
||||||
|
for (int j = 0; j < ordertakingdata.size(); j++) {
|
||||||
|
if(ordertakingdata.get(j).getIsExist()==1){
|
||||||
|
if(!ordertakingdata.get(j).getFacing().equals("0") &&
|
||||||
|
!ordertakingdata.get(j).getFacing().equals("")){
|
||||||
|
onXML = "[ORDER_TAKING]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USERID]" + userId + "[/USERID]"
|
||||||
|
+ "[CATEGORY_ID]" + ordertakingdata.get(j).getCategory_id() + "[/CATEGORY_ID]"
|
||||||
|
+ "[SYSTEM_PO_NUM]" + ordertakingdata.get(j).getSys_PO_No() + "[/SYSTEM_PO_NUM]"
|
||||||
|
+ "[STORE_PO_NUM]" + ordertakingdata.get(j).getStore_PO_No() + "[/STORE_PO_NUM]"
|
||||||
|
+ "[PO_DATE]" + ordertakingdata.get(j).getPO_Date() + "[/PO_DATE]"
|
||||||
|
+ "[BRAND_ID]" + ordertakingdata.get(j).getBrand_id() + "[/BRAND_ID]"
|
||||||
|
+ "[SKU_ID]" + ordertakingdata.get(j).getSku_id() + "[/SKU_ID]"
|
||||||
|
+ "[ORDER_QTY]" + ordertakingdata.get(j).getFacing() + "[/ORDER_QTY]"
|
||||||
|
+ "[PO_IMAGE]" + ordertakingdata.get(j).getPO_Img() + "[/PO_IMAGE]" +
|
||||||
|
"[/ORDER_TAKING]";
|
||||||
|
order_taking_xml = order_taking_xml + onXML;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String data_xml = cat_xml + order_taking_xml;
|
||||||
|
|
||||||
|
final String sos_xml = "[DATA]" + data_xml + "[/DATA]";
|
||||||
|
Log.e("order_xml_data",sos_xml);
|
||||||
|
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
|
request.addProperty("KEYS", "ORDER_TAKING_NEW_XML");
|
||||||
|
request.addProperty("USERNAME", userId);
|
||||||
|
request.addProperty("MID", mid);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
|
||||||
|
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
|
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
data.value = 69;
|
||||||
|
data.name = getString(R.string.order_taking_data_uploading);
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
|
String order_received_xml = "";
|
||||||
|
onXML = "";
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> orderreceiveddata = db.getOrder_RECEIVED_UploadServerData(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
|
if (orderreceiveddata.size() > 0) {
|
||||||
|
for (int j = 0; j < orderreceiveddata.size(); j++) {
|
||||||
|
onXML = "[ORDER_CONFIRM]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USERID]" + userId + "[/USERID]"
|
||||||
|
+ "[CATEGORY_ID]" + orderreceiveddata.get(j).getCategory_id() + "[/CATEGORY_ID]"
|
||||||
|
+ "[PO_DATE]" + orderreceiveddata.get(j).getPO_Date() + "[/PO_DATE]"
|
||||||
|
+ "[POID]" + orderreceiveddata.get(j).getPOID() + "[/POID]"
|
||||||
|
+ "[SKU_ID]" + orderreceiveddata.get(j).getSku_id() + "[/SKU_ID]"
|
||||||
|
+ "[PO_QTY]" + orderreceiveddata.get(j).getOrderqty() + "[/PO_QTY]"
|
||||||
|
+ "[ACTUAL_QTY]" + orderreceiveddata.get(j).getFacing() + "[/ACTUAL_QTY]" +
|
||||||
|
"[/ORDER_CONFIRM]";
|
||||||
|
|
||||||
|
order_received_xml = order_received_xml + onXML;
|
||||||
|
}
|
||||||
|
|
||||||
|
final String sos_xml = "[DATA]" + order_received_xml + "[/DATA]";
|
||||||
|
// Log.e("order_xml_data",sos_xml);
|
||||||
|
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
|
request.addProperty("KEYS", "ORDER_RECEIVED_STATUS_XML");
|
||||||
|
request.addProperty("USERNAME", userId);
|
||||||
|
request.addProperty("MID", mid);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
|
||||||
|
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
|
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
data.value = 70;
|
||||||
|
data.name = getString(R.string.order_received_data_uploading);
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
|
String visit_xml = "";
|
||||||
|
onXML = "";
|
||||||
|
ArrayList<Visit_Type_Master_GetterSetter> visittypelist = db.getUploadedVisitType(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
|
if (visittypelist.size() > 0) {
|
||||||
|
for (int j = 0; j < visittypelist.size(); j++) {
|
||||||
|
onXML = "[VISIT_TYPE_STATUS]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USERID]" + userId + "[/USERID]"
|
||||||
|
+ "[STORE_ID]" + coverageList.get(i).getStoreId() + "[/STORE_ID]"
|
||||||
|
+ "[VISIT_TYPE_ID]" + visittypelist.get(j).getVISIT_TYPE_ID().get(0) + "[/VISIT_TYPE_ID]"
|
||||||
|
+ "[/VISIT_TYPE_STATUS]";
|
||||||
|
|
||||||
|
visit_xml = visit_xml + onXML;
|
||||||
|
}
|
||||||
|
final String sos_xml = "[DATA]" + visit_xml + "[/DATA]";
|
||||||
|
Log.e("visit_xml_data", sos_xml);
|
||||||
|
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
|
|
||||||
|
request.addProperty("XMLDATA", sos_xml);
|
||||||
|
request.addProperty("KEYS", "VISIT_TYPE_XML");
|
||||||
|
request.addProperty("USERNAME", userId);
|
||||||
|
request.addProperty("MID", mid);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
|
||||||
|
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
|
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data.value = 71;
|
||||||
|
data.name = getString(R.string.visit_type_data_uploading);
|
||||||
|
publishProgress(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1808,7 +2117,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + status_service, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + status_service, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1850,10 +2159,9 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(String result) {
|
protected void onPostExecute(String result) {
|
||||||
super.onPostExecute(result);
|
super.onPostExecute(result);
|
||||||
|
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
if (result.contains(CommonString.KEY_SUCCESS)) {
|
if (result.contains(CommonString.KEY_SUCCESS)) {
|
||||||
File f = new File(CommonString.FILE_PATH);
|
File f = new File(CommonString.getImagesFolder(context));
|
||||||
//if (f != null && f.listFiles().length > 0) {
|
//if (f != null && f.listFiles().length > 0) {
|
||||||
File file[] = f.listFiles();
|
File file[] = f.listFiles();
|
||||||
UploadImageWithRetrofit.uploadedFiles = 0;
|
UploadImageWithRetrofit.uploadedFiles = 0;
|
||||||
@@ -1894,5 +2202,4 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+68
-105
@@ -12,14 +12,11 @@ import android.graphics.Matrix;
|
|||||||
import android.graphics.RectF;
|
import android.graphics.RectF;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
//import com.crashlytics.android.Crashlytics;
|
|
||||||
import com.google.gson.JsonSyntaxException;
|
import com.google.gson.JsonSyntaxException;
|
||||||
|
import com.squareup.okhttp.MediaType;
|
||||||
import com.squareup.okhttp.MultipartBuilder;
|
import com.squareup.okhttp.MultipartBuilder;
|
||||||
import com.squareup.okhttp.OkHttpClient;
|
import com.squareup.okhttp.OkHttpClient;
|
||||||
import com.squareup.okhttp.RequestBody;
|
import com.squareup.okhttp.RequestBody;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
|
||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
import org.ksoap2.serialization.SoapObject;
|
import org.ksoap2.serialization.SoapObject;
|
||||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
@@ -35,6 +32,7 @@ import java.net.MalformedURLException;
|
|||||||
import java.net.SocketException;
|
import java.net.SocketException;
|
||||||
import java.net.SocketTimeoutException;
|
import java.net.SocketTimeoutException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
@@ -46,11 +44,9 @@ import cpm.com.gskmtorange.constant.CommonString;
|
|||||||
import cpm.com.gskmtorange.retrofit.PostApiForFile;
|
import cpm.com.gskmtorange.retrofit.PostApiForFile;
|
||||||
import cpm.com.gskmtorange.retrofit.StringConverterFactory;
|
import cpm.com.gskmtorange.retrofit.StringConverterFactory;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
||||||
|
import retrofit.GsonConverterFactory;
|
||||||
import retrofit.Retrofit;
|
import retrofit.Retrofit;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by yadavendras on 4/5/2018.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class UploadImageWithRetrofit {
|
public class UploadImageWithRetrofit {
|
||||||
RequestBody body1;
|
RequestBody body1;
|
||||||
@@ -86,15 +82,15 @@ public class UploadImageWithRetrofit {
|
|||||||
status = 0;
|
status = 0;
|
||||||
String filename = null, foldername = null;
|
String filename = null, foldername = null;
|
||||||
int totalfiles = 0;
|
int totalfiles = 0;
|
||||||
File f = new File(CommonString.FILE_PATH);
|
File f = new File(CommonString.getImagesFolder(context));
|
||||||
File file[] = f.listFiles();
|
File file[] = f.listFiles();
|
||||||
count = file.length;
|
count = file.length;
|
||||||
if (file.length > 0) {
|
if (file.length > 0) {
|
||||||
filename = "";
|
filename = "";
|
||||||
totalfiles = f.listFiles().length;
|
totalfiles = f.listFiles().length;
|
||||||
pd.setMessage(context.getString(R.string.uploaddata)+" - " +context.getString(R.string.image) + " (" + uploadedFiles + "/" + totalFiles + ")");
|
pd.setMessage(context.getString(R.string.uploaddata) + " - " + context.getString(R.string.image) + " (" + uploadedFiles + "/" + totalFiles + ")");
|
||||||
for (int i = 0; i < file.length; i++) {
|
for (int i = 0; i < file.length; i++) {
|
||||||
if (new File(CommonString.FILE_PATH + file[i].getName()).exists()) {
|
if (new File(CommonString.getImagesFolder(context) + file[i].getName()).exists()) {
|
||||||
if (file[i].getName().contains("SI_") || file[i].getName().contains("CHK_SI_") || file[i].getName().contains("NonWorking")) {
|
if (file[i].getName().contains("SI_") || file[i].getName().contains("CHK_SI_") || file[i].getName().contains("NonWorking")) {
|
||||||
foldername = "StoreImages";
|
foldername = "StoreImages";
|
||||||
} else if (file[i].getName().contains("GeoTag")) {
|
} else if (file[i].getName().contains("GeoTag")) {
|
||||||
@@ -103,7 +99,7 @@ public class UploadImageWithRetrofit {
|
|||||||
foldername = "T2PImages";
|
foldername = "T2PImages";
|
||||||
} else if (file[i].getName().contains("AddPromo_Image") || file[i].getName().contains("Additional_Promo_Skuwise_Image")) {
|
} else if (file[i].getName().contains("AddPromo_Image") || file[i].getName().contains("Additional_Promo_Skuwise_Image")) {
|
||||||
foldername = "AdditionalPromotionImages";
|
foldername = "AdditionalPromotionImages";
|
||||||
}else if (file[i].getName().contains("AdditionalImage")) {
|
} else if (file[i].getName().contains("AdditionalImage")) {
|
||||||
foldername = "AdditionalVisibilityImages";
|
foldername = "AdditionalVisibilityImages";
|
||||||
} else if (file[i].getName().contains("Promo_Image")) {
|
} else if (file[i].getName().contains("Promo_Image")) {
|
||||||
foldername = "PromotionImages";
|
foldername = "PromotionImages";
|
||||||
@@ -111,13 +107,17 @@ public class UploadImageWithRetrofit {
|
|||||||
foldername = "CategoryImages";
|
foldername = "CategoryImages";
|
||||||
} else if (file[i].getName().contains("AuditAnsPic")) {
|
} else if (file[i].getName().contains("AuditAnsPic")) {
|
||||||
foldername = "AuditImages";
|
foldername = "AuditImages";
|
||||||
} else if (file[i].getName().contains("CoachingVisit")) {
|
} else if (file[i].getName().contains("CoachingVisit") || file[i].getName().contains("CheckVisit")) {
|
||||||
foldername = "CoachingVisits";
|
foldername = "CoachingVisits";
|
||||||
} else if (file[i].getName().contains("DeliveryCalls")) {
|
} else if (file[i].getName().contains("DeliveryCalls")) {
|
||||||
foldername = "DeliveryCallsImages";
|
foldername = "DeliveryCallsImages";
|
||||||
} else if (file[i].getName().contains("CounterfeitProduct")) {//added 15.04.2019
|
} else if (file[i].getName().contains("CounterfeitProduct")) {//added 15.04.2019
|
||||||
foldername = "CounterFeitImages";
|
foldername = "CounterFeitImages";
|
||||||
} else{
|
}
|
||||||
|
else if (file[i].getName().contains("POImage")) {//added 15.04.2019
|
||||||
|
foldername = "POImages";
|
||||||
|
}
|
||||||
|
else {
|
||||||
foldername = "Bulkimages";
|
foldername = "Bulkimages";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,35 +125,37 @@ public class UploadImageWithRetrofit {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
File originalFile = new File(CommonString.getImagesFolder(context) + filename);
|
||||||
|
File finalFile = saveBitmapToFileSmaller(originalFile);
|
||||||
File originalFile = new File(CommonString.FILE_PATH+ filename);
|
if (finalFile == null) {
|
||||||
final File finalFile = saveBitmapToFileSmaller(originalFile);
|
finalFile = originalFile;
|
||||||
|
}
|
||||||
|
|
||||||
OkHttpClient okHttpClient = new OkHttpClient();
|
OkHttpClient okHttpClient = new OkHttpClient();
|
||||||
okHttpClient.setConnectTimeout(20, TimeUnit.SECONDS);
|
okHttpClient.setConnectTimeout(20, TimeUnit.SECONDS);
|
||||||
okHttpClient.setWriteTimeout(20, TimeUnit.SECONDS);
|
okHttpClient.setWriteTimeout(20, TimeUnit.SECONDS);
|
||||||
okHttpClient.setReadTimeout(20, TimeUnit.SECONDS);
|
okHttpClient.setReadTimeout(20, TimeUnit.SECONDS);
|
||||||
|
|
||||||
com.squareup.okhttp.RequestBody photo = com.squareup.okhttp.RequestBody.create(com.squareup.okhttp.MediaType.parse("application/octet-stream"), finalFile);
|
RequestBody photo = RequestBody.create(MediaType.parse("application/octet-stream"), finalFile);
|
||||||
body1 = new MultipartBuilder()
|
body1 = new MultipartBuilder()
|
||||||
.type(MultipartBuilder.FORM)
|
.type(MultipartBuilder.FORM)
|
||||||
.addFormDataPart("file", finalFile.getName(), photo)
|
.addFormDataPart("file", finalFile.getName(), photo)
|
||||||
.addFormDataPart("FolderName", foldername)
|
.addFormDataPart("FolderName", foldername)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
adapter = new retrofit.Retrofit.Builder()
|
adapter = new Retrofit.Builder()
|
||||||
.baseUrl(CommonString.URL + "/")
|
.baseUrl(CommonString.URL + "/")
|
||||||
.addConverterFactory(new StringConverterFactory())
|
.addConverterFactory(new StringConverterFactory())
|
||||||
.build();
|
.build();
|
||||||
PostApiForFile api = adapter.create(PostApiForFile.class);
|
|
||||||
|
|
||||||
|
PostApiForFile api = adapter.create(PostApiForFile.class);
|
||||||
retrofit.Call<String> call = api.getUploadImage(body1);
|
retrofit.Call<String> call = api.getUploadImage(body1);
|
||||||
|
File finalFile1 = finalFile;
|
||||||
call.enqueue(new retrofit.Callback<String>() {
|
call.enqueue(new retrofit.Callback<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(retrofit.Response<String> response) {
|
public void onResponse(retrofit.Response<String> response) {
|
||||||
if (response.isSuccess() && response.body().contains("Success")) {
|
if (response.isSuccess() && response.body().contains("Success")) {
|
||||||
finalFile.delete();
|
finalFile1.delete();
|
||||||
status = 1;
|
status = 1;
|
||||||
uploadedFiles++;
|
uploadedFiles++;
|
||||||
} else {
|
} else {
|
||||||
@@ -163,50 +165,42 @@ public class UploadImageWithRetrofit {
|
|||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
pd.dismiss();
|
pd.dismiss();
|
||||||
if (!((Activity) context).isFinishing()) {
|
if (!((Activity) context).isFinishing()) {
|
||||||
showAlert((Activity) context, context.getString(R.string.DataNot),false);
|
showAlert((Activity) context, context.getString(R.string.DataNot), false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
UploadImageRecursiveNew(context);
|
UploadImageRecursiveNew(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable t) {
|
public void onFailure(Throwable t) {
|
||||||
if (t instanceof IOException || t instanceof SocketTimeoutException || t instanceof SocketException) {
|
if (t instanceof IOException || t instanceof SocketTimeoutException || t instanceof SocketException) {
|
||||||
status = -1;
|
status = -1;
|
||||||
//uploadedFiles = 0;
|
//uploadedFiles = 0;
|
||||||
pd.dismiss();
|
pd.dismiss();
|
||||||
|
// Log.e("Errormsg :",t.toString());
|
||||||
// AlertandMessages.showAlert((Activity) context, "Network Error in upload", false);
|
// AlertandMessages.showAlert((Activity) context, "Network Error in upload", false);
|
||||||
if (!((Activity) context).isFinishing()) {
|
if (!((Activity) context).isFinishing()) {
|
||||||
showAlert((Activity) context, context.getString(R.string.NetworkError),false);
|
showAlert((Activity) context, context.getString(R.string.NetworkError), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (totalFiles == uploadedFiles) {
|
if (totalFiles == uploadedFiles) {
|
||||||
//region Coverage upload status Data
|
|
||||||
new StatusUpload().execute();
|
new StatusUpload().execute();
|
||||||
//endregion
|
|
||||||
//pd.cancel();
|
|
||||||
//showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (JsonSyntaxException e) {
|
} catch (JsonSyntaxException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
showAlert((Activity) context, "Invalid Json",false);
|
showAlert((Activity) context, "Invalid Json", false);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
if (totalFiles == uploadedFiles) {
|
if (totalFiles == uploadedFiles) {
|
||||||
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully), true);
|
||||||
} else {
|
} else {
|
||||||
showAlert((Activity) context, CommonString.KEY_FAILURE,false);
|
showAlert((Activity) context, CommonString.KEY_FAILURE, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UploadDeliveryImageRecursive(final Context context, final ArrayList<String> file_list, final int index) {
|
public void UploadDeliveryImageRecursive(final Context context, final ArrayList<String> file_list, final int index) {
|
||||||
@@ -218,17 +212,21 @@ public class UploadImageWithRetrofit {
|
|||||||
if (_index[0] < file_list.size()) {
|
if (_index[0] < file_list.size()) {
|
||||||
filename = file_list.get(_index[0]);
|
filename = file_list.get(_index[0]);
|
||||||
|
|
||||||
pd.setMessage(context.getString(R.string.uploaddata)+" - " +context.getString(R.string.image) + " (" + uploadedFiles + "/" + totalFiles + ")");
|
pd.setMessage(context.getString(R.string.uploaddata) + " - " + context.getString(R.string.image) + " (" + uploadedFiles + "/" + totalFiles + ")");
|
||||||
|
|
||||||
File originalFile = new File(CommonString.FILE_PATH + filename);
|
File originalFile = new File(CommonString.getImagesFolder(context) + filename);
|
||||||
final File finalFile = saveBitmapToFileSmaller(originalFile);
|
File finalFile = saveBitmapToFileSmaller(originalFile);
|
||||||
|
|
||||||
|
if (finalFile == null) {
|
||||||
|
finalFile = originalFile;
|
||||||
|
}
|
||||||
|
|
||||||
OkHttpClient okHttpClient = new OkHttpClient();
|
OkHttpClient okHttpClient = new OkHttpClient();
|
||||||
okHttpClient.setConnectTimeout(20, TimeUnit.SECONDS);
|
okHttpClient.setConnectTimeout(20, TimeUnit.SECONDS);
|
||||||
okHttpClient.setWriteTimeout(20, TimeUnit.SECONDS);
|
okHttpClient.setWriteTimeout(20, TimeUnit.SECONDS);
|
||||||
okHttpClient.setReadTimeout(20, TimeUnit.SECONDS);
|
okHttpClient.setReadTimeout(20, TimeUnit.SECONDS);
|
||||||
|
|
||||||
com.squareup.okhttp.RequestBody photo = com.squareup.okhttp.RequestBody.create(com.squareup.okhttp.MediaType.parse("application/octet-stream"), finalFile);
|
RequestBody photo = RequestBody.create(MediaType.parse("application/octet-stream"), finalFile);
|
||||||
body1 = new MultipartBuilder()
|
body1 = new MultipartBuilder()
|
||||||
.type(MultipartBuilder.FORM)
|
.type(MultipartBuilder.FORM)
|
||||||
.addFormDataPart("file", finalFile.getName(), photo)
|
.addFormDataPart("file", finalFile.getName(), photo)
|
||||||
@@ -242,11 +240,12 @@ public class UploadImageWithRetrofit {
|
|||||||
PostApiForFile api = adapter.create(PostApiForFile.class);
|
PostApiForFile api = adapter.create(PostApiForFile.class);
|
||||||
|
|
||||||
retrofit.Call<String> call = api.getUploadImage(body1);
|
retrofit.Call<String> call = api.getUploadImage(body1);
|
||||||
|
File finalFile1 = finalFile;
|
||||||
call.enqueue(new retrofit.Callback<String>() {
|
call.enqueue(new retrofit.Callback<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(retrofit.Response<String> response) {
|
public void onResponse(retrofit.Response<String> response) {
|
||||||
if (response.isSuccess() && response.body().contains("Success")) {
|
if (response.isSuccess() && response.body().contains("Success")) {
|
||||||
finalFile.delete();
|
finalFile1.delete();
|
||||||
status = 1;
|
status = 1;
|
||||||
uploadedFiles++;
|
uploadedFiles++;
|
||||||
} else {
|
} else {
|
||||||
@@ -256,7 +255,7 @@ public class UploadImageWithRetrofit {
|
|||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
pd.dismiss();
|
pd.dismiss();
|
||||||
if (!((Activity) context).isFinishing()) {
|
if (!((Activity) context).isFinishing()) {
|
||||||
showAlert((Activity) context, context.getString(R.string.DataNot),false);
|
showAlert((Activity) context, context.getString(R.string.DataNot), false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
UploadDeliveryImageRecursive(context, file_list, ++_index[0]);
|
UploadDeliveryImageRecursive(context, file_list, ++_index[0]);
|
||||||
@@ -271,7 +270,7 @@ public class UploadImageWithRetrofit {
|
|||||||
pd.dismiss();
|
pd.dismiss();
|
||||||
// AlertandMessages.showAlert((Activity) context, "Network Error in upload", false);
|
// AlertandMessages.showAlert((Activity) context, "Network Error in upload", false);
|
||||||
if (!((Activity) context).isFinishing()) {
|
if (!((Activity) context).isFinishing()) {
|
||||||
showAlert((Activity) context, context.getString(R.string.NetworkError),false);
|
showAlert((Activity) context, context.getString(R.string.NetworkError), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -290,55 +289,22 @@ public class UploadImageWithRetrofit {
|
|||||||
//pd.cancel();
|
//pd.cancel();
|
||||||
//showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
//showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
||||||
}
|
}
|
||||||
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully), true);
|
||||||
}
|
}
|
||||||
} catch (JsonSyntaxException e) {
|
} catch (JsonSyntaxException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
showAlert((Activity) context, "Invalid Json",false);
|
showAlert((Activity) context, "Invalid Json", false);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
if (totalFiles == uploadedFiles) {
|
if (totalFiles == uploadedFiles) {
|
||||||
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully), true);
|
||||||
} else {
|
} else {
|
||||||
showAlert((Activity) context, CommonString.KEY_FAILURE,false);
|
showAlert((Activity) context, CommonString.KEY_FAILURE, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
public File saveBitmapToFileSmaller(File file) {
|
|
||||||
File file2 = file;
|
|
||||||
try {
|
|
||||||
|
|
||||||
InputStream in = new FileInputStream(file2);
|
|
||||||
// decode image size (decode metadata only, not the whole image)
|
|
||||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
|
||||||
options.inJustDecodeBounds = true;
|
|
||||||
BitmapFactory.decodeStream(in, null, options);
|
|
||||||
in.close();
|
|
||||||
|
|
||||||
// decode full image pre-resized
|
|
||||||
in = new FileInputStream(file2);
|
|
||||||
options = new BitmapFactory.Options();
|
|
||||||
// decode full image
|
|
||||||
Bitmap roughBitmap = BitmapFactory.decodeStream(in, null, options);
|
|
||||||
|
|
||||||
// save image
|
|
||||||
FileOutputStream out = new FileOutputStream(file2);
|
|
||||||
roughBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.e("Image", e.toString(), e);
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
return file2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public File saveBitmapToFileSmaller(File file) {
|
public File saveBitmapToFileSmaller(File file) {
|
||||||
File file2 = file;
|
File file2 = file;
|
||||||
try {
|
try {
|
||||||
@@ -364,6 +330,9 @@ public class UploadImageWithRetrofit {
|
|||||||
options.inSampleSize = Math.max(inWidth / 1632, inHeight / 1224);
|
options.inSampleSize = Math.max(inWidth / 1632, inHeight / 1224);
|
||||||
// decode full image
|
// decode full image
|
||||||
Bitmap roughBitmap = BitmapFactory.decodeStream(in, null, options);
|
Bitmap roughBitmap = BitmapFactory.decodeStream(in, null, options);
|
||||||
|
if (roughBitmap == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// calc exact destination size
|
// calc exact destination size
|
||||||
Matrix m = new Matrix();
|
Matrix m = new Matrix();
|
||||||
@@ -375,6 +344,9 @@ public class UploadImageWithRetrofit {
|
|||||||
// resize bitmap
|
// resize bitmap
|
||||||
Bitmap resizedBitmap = Bitmap.createScaledBitmap(roughBitmap, (int) (roughBitmap.getWidth() * values[0]), (int) (roughBitmap.getHeight() * values[4]), true);
|
Bitmap resizedBitmap = Bitmap.createScaledBitmap(roughBitmap, (int) (roughBitmap.getWidth() * values[0]), (int) (roughBitmap.getHeight() * values[4]), true);
|
||||||
// save image
|
// save image
|
||||||
|
if (resizedBitmap == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
FileOutputStream out = new FileOutputStream(file2);
|
FileOutputStream out = new FileOutputStream(file2);
|
||||||
resizedBitmap.compress(Bitmap.CompressFormat.JPEG, 80, out);
|
resizedBitmap.compress(Bitmap.CompressFormat.JPEG, 80, out);
|
||||||
|
|
||||||
@@ -386,9 +358,6 @@ public class UploadImageWithRetrofit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void showAlert(final Context context, String str, final boolean flag) {
|
public void showAlert(final Context context, String str, final boolean flag) {
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
@@ -396,8 +365,8 @@ public class UploadImageWithRetrofit {
|
|||||||
builder.setMessage(str).setCancelable(false)
|
builder.setMessage(str).setCancelable(false)
|
||||||
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
Activity activity =(Activity) context;
|
Activity activity = (Activity) context;
|
||||||
if(flag){
|
if (flag) {
|
||||||
Intent i = new Intent(activity, MainActivity.class);
|
Intent i = new Intent(activity, MainActivity.class);
|
||||||
activity.startActivity(i);
|
activity.startActivity(i);
|
||||||
activity.finish();
|
activity.finish();
|
||||||
@@ -427,7 +396,7 @@ public class UploadImageWithRetrofit {
|
|||||||
String onXML = "";
|
String onXML = "";
|
||||||
onXML = "[COVERAGE_STATUS]"
|
onXML = "[COVERAGE_STATUS]"
|
||||||
+ "[STORE_ID]" + storeList.get(i).getSTORE_ID() + "[/STORE_ID]"
|
+ "[STORE_ID]" + storeList.get(i).getSTORE_ID() + "[/STORE_ID]"
|
||||||
+ "[VISIT_DATE]" + storeList.get(i).getVISIT_DATE()+ "[/VISIT_DATE]"
|
+ "[VISIT_DATE]" + storeList.get(i).getVISIT_DATE() + "[/VISIT_DATE]"
|
||||||
+ "[USER_ID]" + userID + "[/USER_ID]"
|
+ "[USER_ID]" + userID + "[/USER_ID]"
|
||||||
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
||||||
+ "[/COVERAGE_STATUS]";
|
+ "[/COVERAGE_STATUS]";
|
||||||
@@ -456,10 +425,9 @@ public class UploadImageWithRetrofit {
|
|||||||
final CoverageBean coverageObj = db.getCoverageSpecificData(storeList.get(i).getVISIT_DATE(), storeList.get(i).getSTORE_ID());
|
final CoverageBean coverageObj = db.getCoverageSpecificData(storeList.get(i).getVISIT_DATE(), storeList.get(i).getSTORE_ID());
|
||||||
|
|
||||||
String uploadStatus;
|
String uploadStatus;
|
||||||
if(coverageObj.getReasonid().equalsIgnoreCase("0")){
|
if (coverageObj.getReasonid().equalsIgnoreCase("0")) {
|
||||||
uploadStatus = CommonString.KEY_U;
|
uploadStatus = CommonString.KEY_U;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
uploadStatus = CommonString.KEY_UN;
|
uploadStatus = CommonString.KEY_UN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -482,7 +450,7 @@ public class UploadImageWithRetrofit {
|
|||||||
String onXML = "";
|
String onXML = "";
|
||||||
onXML = "[COVERAGE_STATUS]"
|
onXML = "[COVERAGE_STATUS]"
|
||||||
+ "[STORE_ID]" + storeList_deviation.get(i).getSTORE_ID() + "[/STORE_ID]"
|
+ "[STORE_ID]" + storeList_deviation.get(i).getSTORE_ID() + "[/STORE_ID]"
|
||||||
+ "[VISIT_DATE]" + storeList_deviation.get(i).getVISIT_DATE()+ "[/VISIT_DATE]"
|
+ "[VISIT_DATE]" + storeList_deviation.get(i).getVISIT_DATE() + "[/VISIT_DATE]"
|
||||||
+ "[USER_ID]" + userID + "[/USER_ID]"
|
+ "[USER_ID]" + userID + "[/USER_ID]"
|
||||||
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
||||||
+ "[/COVERAGE_STATUS]";
|
+ "[/COVERAGE_STATUS]";
|
||||||
@@ -526,7 +494,7 @@ public class UploadImageWithRetrofit {
|
|||||||
String onXML = "";
|
String onXML = "";
|
||||||
onXML = "[COVERAGE_STATUS]"
|
onXML = "[COVERAGE_STATUS]"
|
||||||
+ "[STORE_ID]" + storeListPharma.get(i).getSTORE_ID() + "[/STORE_ID]"
|
+ "[STORE_ID]" + storeListPharma.get(i).getSTORE_ID() + "[/STORE_ID]"
|
||||||
+ "[VISIT_DATE]" + storeListPharma.get(i).getVISIT_DATE()+ "[/VISIT_DATE]"
|
+ "[VISIT_DATE]" + storeListPharma.get(i).getVISIT_DATE() + "[/VISIT_DATE]"
|
||||||
+ "[USER_ID]" + userID + "[/USER_ID]"
|
+ "[USER_ID]" + userID + "[/USER_ID]"
|
||||||
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
||||||
+ "[/COVERAGE_STATUS]";
|
+ "[/COVERAGE_STATUS]";
|
||||||
@@ -555,10 +523,9 @@ public class UploadImageWithRetrofit {
|
|||||||
final CoverageBean coverageObj = db.getCoverageSpecificData(storeListPharma.get(i).getVISIT_DATE(), storeListPharma.get(i).getSTORE_ID());
|
final CoverageBean coverageObj = db.getCoverageSpecificData(storeListPharma.get(i).getVISIT_DATE(), storeListPharma.get(i).getSTORE_ID());
|
||||||
|
|
||||||
String uploadStatus;
|
String uploadStatus;
|
||||||
if(coverageObj.getReasonid().equalsIgnoreCase("0")){
|
if (coverageObj.getReasonid().equalsIgnoreCase("0")) {
|
||||||
uploadStatus = CommonString.KEY_U;
|
uploadStatus = CommonString.KEY_U;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
uploadStatus = CommonString.KEY_UN;
|
uploadStatus = CommonString.KEY_UN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -581,7 +548,7 @@ public class UploadImageWithRetrofit {
|
|||||||
String onXML = "";
|
String onXML = "";
|
||||||
onXML = "[COVERAGE_STATUS]"
|
onXML = "[COVERAGE_STATUS]"
|
||||||
+ "[STORE_ID]" + storeListAdditional.get(i).getSTORE_ID() + "[/STORE_ID]"
|
+ "[STORE_ID]" + storeListAdditional.get(i).getSTORE_ID() + "[/STORE_ID]"
|
||||||
+ "[VISIT_DATE]" + storeListAdditional.get(i).getVISIT_DATE()+ "[/VISIT_DATE]"
|
+ "[VISIT_DATE]" + storeListAdditional.get(i).getVISIT_DATE() + "[/VISIT_DATE]"
|
||||||
+ "[USER_ID]" + userID + "[/USER_ID]"
|
+ "[USER_ID]" + userID + "[/USER_ID]"
|
||||||
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
||||||
+ "[/COVERAGE_STATUS]";
|
+ "[/COVERAGE_STATUS]";
|
||||||
@@ -610,17 +577,15 @@ public class UploadImageWithRetrofit {
|
|||||||
final CoverageBean coverageObj = db.getCoverageSpecificData(storeListAdditional.get(i).getVISIT_DATE(), storeListAdditional.get(i).getSTORE_ID());
|
final CoverageBean coverageObj = db.getCoverageSpecificData(storeListAdditional.get(i).getVISIT_DATE(), storeListAdditional.get(i).getSTORE_ID());
|
||||||
|
|
||||||
String uploadStatus;
|
String uploadStatus;
|
||||||
if(coverageObj.getReasonid().equalsIgnoreCase("0")){
|
if (coverageObj.getReasonid().equalsIgnoreCase("0")) {
|
||||||
uploadStatus = CommonString.KEY_U;
|
uploadStatus = CommonString.KEY_U;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
uploadStatus = CommonString.KEY_UN;
|
uploadStatus = CommonString.KEY_UN;
|
||||||
}
|
}
|
||||||
|
|
||||||
db.updateCoverageStatus(storeListAdditional.get(i).getSTORE_ID(), uploadStatus);
|
db.updateCoverageStatus(storeListAdditional.get(i).getSTORE_ID(), uploadStatus);
|
||||||
db.updateStoreStatusOnLeave(storeListAdditional.get(i).getSTORE_ID(), storeListAdditional.get(i).getVISIT_DATE(),
|
db.updateStoreStatusOnLeave(storeListAdditional.get(i).getSTORE_ID(), storeListAdditional.get(i).getVISIT_DATE(),
|
||||||
uploadStatus, CommonString.FROM_ADDITIONAL);
|
uploadStatus, CommonString.FROM_ADDITIONAL);
|
||||||
|
|
||||||
db.deleteTableWithStoreID(storeListAdditional.get(i).getSTORE_ID());
|
db.deleteTableWithStoreID(storeListAdditional.get(i).getSTORE_ID());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -636,7 +601,7 @@ public class UploadImageWithRetrofit {
|
|||||||
String onXML = "";
|
String onXML = "";
|
||||||
onXML = "[COVERAGE_STATUS]"
|
onXML = "[COVERAGE_STATUS]"
|
||||||
+ "[STORE_ID]" + storeListAdditional.get(i).getSTORE_ID() + "[/STORE_ID]"
|
+ "[STORE_ID]" + storeListAdditional.get(i).getSTORE_ID() + "[/STORE_ID]"
|
||||||
+ "[VISIT_DATE]" + storeListAdditional.get(i).getVISIT_DATE()+ "[/VISIT_DATE]"
|
+ "[VISIT_DATE]" + storeListAdditional.get(i).getVISIT_DATE() + "[/VISIT_DATE]"
|
||||||
+ "[USER_ID]" + userID + "[/USER_ID]"
|
+ "[USER_ID]" + userID + "[/USER_ID]"
|
||||||
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
||||||
+ "[/COVERAGE_STATUS]";
|
+ "[/COVERAGE_STATUS]";
|
||||||
@@ -665,10 +630,9 @@ public class UploadImageWithRetrofit {
|
|||||||
final CoverageBean coverageObj = db.getCoverageSpecificData(storeListAdditional.get(i).getVISIT_DATE(), storeListAdditional.get(i).getSTORE_ID());
|
final CoverageBean coverageObj = db.getCoverageSpecificData(storeListAdditional.get(i).getVISIT_DATE(), storeListAdditional.get(i).getSTORE_ID());
|
||||||
|
|
||||||
String uploadStatus;
|
String uploadStatus;
|
||||||
if(coverageObj.getReasonid().equalsIgnoreCase("0")){
|
if (coverageObj.getReasonid().equalsIgnoreCase("0")) {
|
||||||
uploadStatus = CommonString.KEY_U;
|
uploadStatus = CommonString.KEY_U;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
uploadStatus = CommonString.KEY_UN;
|
uploadStatus = CommonString.KEY_UN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -710,10 +674,9 @@ public class UploadImageWithRetrofit {
|
|||||||
pd.dismiss();
|
pd.dismiss();
|
||||||
if (s.equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
if (s.equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
if (totalFiles == uploadedFiles) {
|
if (totalFiles == uploadedFiles) {
|
||||||
//AlertandMessages.showAlert((Activity) context, "All images uploaded Successfully", true);
|
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully), true);
|
||||||
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
|
||||||
} else {
|
} else {
|
||||||
showAlert((Activity) context, context.getString(R.string.DataNot),true);
|
showAlert((Activity) context, context.getString(R.string.DataNot), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,115 @@
|
|||||||
|
package cpm.com.gskmtorange.utils;
|
||||||
|
|
||||||
|
import com.squareup.okhttp.ConnectionSpec;
|
||||||
|
import com.squareup.okhttp.MediaType;
|
||||||
|
import com.squareup.okhttp.OkHttpClient;
|
||||||
|
import com.squareup.okhttp.Request;
|
||||||
|
import com.squareup.okhttp.RequestBody;
|
||||||
|
import com.squareup.okhttp.Response;
|
||||||
|
import com.squareup.okhttp.TlsVersion;
|
||||||
|
|
||||||
|
import org.ksoap2.HeaderProperty;
|
||||||
|
import org.ksoap2.SoapEnvelope;
|
||||||
|
import org.ksoap2.transport.ServiceConnection;
|
||||||
|
import org.ksoap2.transport.Transport;
|
||||||
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
public class OkHttpTransportSE extends Transport {
|
||||||
|
|
||||||
|
private final String url;
|
||||||
|
private final OkHttpClient client;
|
||||||
|
|
||||||
|
public OkHttpTransportSE(String url) {
|
||||||
|
this(url, 60000); // default 60s timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
public OkHttpTransportSE(String url, int timeout) {
|
||||||
|
super(url, timeout);
|
||||||
|
this.url = url;
|
||||||
|
|
||||||
|
client = new OkHttpClient();
|
||||||
|
|
||||||
|
// Force TLS 1.2
|
||||||
|
ConnectionSpec spec = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
|
||||||
|
.tlsVersions(TlsVersion.TLS_1_2,
|
||||||
|
TlsVersion.TLS_1_1,
|
||||||
|
TlsVersion.TLS_1_0)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
client.setConnectionSpecs(Collections.singletonList(spec));
|
||||||
|
client.setConnectTimeout(timeout, TimeUnit.MILLISECONDS);
|
||||||
|
client.setReadTimeout(timeout, TimeUnit.MILLISECONDS);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List call(String soapAction, SoapEnvelope envelope, List headers)
|
||||||
|
throws IOException, XmlPullParserException {
|
||||||
|
return call(soapAction, envelope, headers, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ServiceConnection getServiceConnection() throws IOException {
|
||||||
|
return null; // not used with OkHttp
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<HeaderProperty> call(String soapAction, SoapEnvelope envelope, List headers, File outputFile)
|
||||||
|
throws IOException, XmlPullParserException {
|
||||||
|
|
||||||
|
if (soapAction == null) {
|
||||||
|
soapAction = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] requestData = this.createRequestData(envelope, "UTF-8");
|
||||||
|
this.requestDump = this.debug ? new String(requestData) : null;
|
||||||
|
this.responseDump = null;
|
||||||
|
|
||||||
|
// Build request
|
||||||
|
Request.Builder builder = new Request.Builder()
|
||||||
|
.url(url)
|
||||||
|
.addHeader("User-Agent", "ksoap2-android/2.6.0+");
|
||||||
|
|
||||||
|
if (envelope.version == SoapEnvelope.VER12) {
|
||||||
|
builder.addHeader("Content-Type", "application/soap+xml;charset=utf-8");
|
||||||
|
} else {
|
||||||
|
builder.addHeader("Content-Type", "text/xml;charset=utf-8");
|
||||||
|
builder.addHeader("SOAPAction", soapAction); // Match HttpTransportSE
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add custom headers if any
|
||||||
|
if (headers != null) {
|
||||||
|
for (Object h : headers) {
|
||||||
|
HeaderProperty hp = (HeaderProperty) h;
|
||||||
|
if (hp.getKey() != null && hp.getValue() != null) {
|
||||||
|
builder.addHeader(hp.getKey(), hp.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
builder.post(RequestBody.create(MediaType.parse("text/xml; charset=utf-8"), requestData));
|
||||||
|
|
||||||
|
// Execute request
|
||||||
|
Response response = client.newCall(builder.build()).execute();
|
||||||
|
|
||||||
|
if (!response.isSuccessful()) {
|
||||||
|
throw new IOException("HTTP request failed, code: " + response.code());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Collect response headers
|
||||||
|
List<HeaderProperty> retHeaders = new ArrayList<>();
|
||||||
|
for (String name : response.headers().names()) {
|
||||||
|
retHeaders.add(new HeaderProperty(name, response.header(name)));
|
||||||
|
}
|
||||||
|
// Parse SOAP response
|
||||||
|
parseResponse(envelope, response.body().byteStream());
|
||||||
|
return retHeaders;
|
||||||
|
}
|
||||||
|
}
|
||||||
+20
@@ -23,6 +23,16 @@ public class AdditionalQuestiongetterSetter {
|
|||||||
ArrayList<String> NO_OF_CAMERA = new ArrayList<>();
|
ArrayList<String> NO_OF_CAMERA = new ArrayList<>();
|
||||||
ArrayList<String> TYPE = new ArrayList<>();
|
ArrayList<String> TYPE = new ArrayList<>();
|
||||||
|
|
||||||
|
ArrayList<String> CAMERA_MANDATORY = new ArrayList<>();
|
||||||
|
|
||||||
|
public ArrayList<String> getCAMERA_MANDATORY() {
|
||||||
|
return CAMERA_MANDATORY;
|
||||||
|
}
|
||||||
|
public void setCAMERA_MANDATORY(String CAMERA_MANDATORY) {
|
||||||
|
this.CAMERA_MANDATORY.add(CAMERA_MANDATORY);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public ArrayList<String> getREMARK_ALLOW() {
|
public ArrayList<String> getREMARK_ALLOW() {
|
||||||
return REMARK_ALLOW;
|
return REMARK_ALLOW;
|
||||||
}
|
}
|
||||||
@@ -42,6 +52,16 @@ public class AdditionalQuestiongetterSetter {
|
|||||||
ArrayList<String> REMARK_ALLOW = new ArrayList<>();
|
ArrayList<String> REMARK_ALLOW = new ArrayList<>();
|
||||||
ArrayList<String> REMARK_LEVEL = new ArrayList<>();
|
ArrayList<String> REMARK_LEVEL = new ArrayList<>();
|
||||||
|
|
||||||
|
public ArrayList<String> getMAX_LENGTH() {
|
||||||
|
return MAX_LENGTH;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMAX_LENGTH(String MAX_LENGTH) {
|
||||||
|
this.MAX_LENGTH.add(MAX_LENGTH);
|
||||||
|
}
|
||||||
|
|
||||||
|
ArrayList<String> MAX_LENGTH = new ArrayList<>();
|
||||||
|
|
||||||
public String getTable_ADDITIONAL_QUESTION() {
|
public String getTable_ADDITIONAL_QUESTION() {
|
||||||
return table_ADDITIONAL_QUESTION;
|
return table_ADDITIONAL_QUESTION;
|
||||||
}
|
}
|
||||||
|
|||||||
+20
-1
@@ -5,7 +5,6 @@ package cpm.com.gskmtorange.xmlGetterSetter;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public class AuditDataGetterSetter {
|
public class AuditDataGetterSetter {
|
||||||
|
|
||||||
String QUESTION_ID;
|
String QUESTION_ID;
|
||||||
String CULTURE_ID;
|
String CULTURE_ID;
|
||||||
String CATEGORY_ID;
|
String CATEGORY_ID;
|
||||||
@@ -15,6 +14,16 @@ public class AuditDataGetterSetter {
|
|||||||
String ANSWER="";
|
String ANSWER="";
|
||||||
String CAM_IMAGE="";
|
String CAM_IMAGE="";
|
||||||
|
|
||||||
|
public String getMaxlength() {
|
||||||
|
return maxlength;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxlength(String maxlength) {
|
||||||
|
this.maxlength = maxlength;
|
||||||
|
}
|
||||||
|
|
||||||
|
String maxlength="0";
|
||||||
|
|
||||||
public String getTXT_REMARK() {
|
public String getTXT_REMARK() {
|
||||||
return TXT_REMARK;
|
return TXT_REMARK;
|
||||||
}
|
}
|
||||||
@@ -29,6 +38,16 @@ public class AuditDataGetterSetter {
|
|||||||
String NO_OF_CAMERA ="1";
|
String NO_OF_CAMERA ="1";
|
||||||
String CAM_IMAGE2="";
|
String CAM_IMAGE2="";
|
||||||
String CHECK_TYPE;
|
String CHECK_TYPE;
|
||||||
|
String CAMERA_MANDATORY="0";
|
||||||
|
|
||||||
|
public String getCAMERA_MANDATORY() {
|
||||||
|
return CAMERA_MANDATORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCAMERA_MANDATORY(String CAMERA_MANDATORY) {
|
||||||
|
this.CAMERA_MANDATORY = CAMERA_MANDATORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getREMARK_ALLOW() {
|
public String getREMARK_ALLOW() {
|
||||||
return REMARK_ALLOW;
|
return REMARK_ALLOW;
|
||||||
|
|||||||
-1
@@ -9,7 +9,6 @@ import java.util.ArrayList;
|
|||||||
public class MAPPING_SKU_PRICING_ENABLEGetterSetter {
|
public class MAPPING_SKU_PRICING_ENABLEGetterSetter {
|
||||||
|
|
||||||
String table_MAPPING_SKU_PRICING_ENABLE;
|
String table_MAPPING_SKU_PRICING_ENABLE;
|
||||||
|
|
||||||
ArrayList<String> STORE_ID = new ArrayList<>();
|
ArrayList<String> STORE_ID = new ArrayList<>();
|
||||||
ArrayList<String> SUB_CATEGORY_ID = new ArrayList<>();
|
ArrayList<String> SUB_CATEGORY_ID = new ArrayList<>();
|
||||||
|
|
||||||
|
|||||||
+92
@@ -20,9 +20,32 @@ public class MSL_AvailabilityStockFacingGetterSetter implements Serializable{
|
|||||||
String category_id;
|
String category_id;
|
||||||
String facing="";
|
String facing="";
|
||||||
String stock;
|
String stock;
|
||||||
|
String posmStock;
|
||||||
|
String warehouseStock;
|
||||||
String company_id;
|
String company_id;
|
||||||
String must_have;
|
String must_have;
|
||||||
|
|
||||||
|
public String getPOID() {
|
||||||
|
return POID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPOID(String POID) {
|
||||||
|
this.POID = POID;
|
||||||
|
}
|
||||||
|
|
||||||
|
String POID;
|
||||||
|
|
||||||
|
|
||||||
|
public String getOrderqty() {
|
||||||
|
return orderqty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderqty(String orderqty) {
|
||||||
|
this.orderqty = orderqty;
|
||||||
|
}
|
||||||
|
|
||||||
|
String orderqty = "";
|
||||||
|
|
||||||
public String getPricing() {
|
public String getPricing() {
|
||||||
return pricing;
|
return pricing;
|
||||||
}
|
}
|
||||||
@@ -181,4 +204,73 @@ public class MSL_AvailabilityStockFacingGetterSetter implements Serializable{
|
|||||||
public void setMust_have(String must_have) {
|
public void setMust_have(String must_have) {
|
||||||
this.must_have = must_have;
|
this.must_have = must_have;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int IsExist = -1;
|
||||||
|
|
||||||
|
public int getIsExist() {
|
||||||
|
return IsExist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsExist(int isExist) {
|
||||||
|
IsExist = isExist;
|
||||||
|
}
|
||||||
|
String Sys_PO_No = "";
|
||||||
|
String Store_PO_No = "";
|
||||||
|
String PO_Date = "";
|
||||||
|
|
||||||
|
public String getPO_Img() {
|
||||||
|
return PO_Img;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPO_Img(String PO_Img) {
|
||||||
|
this.PO_Img = PO_Img;
|
||||||
|
}
|
||||||
|
|
||||||
|
String PO_Img = "";
|
||||||
|
|
||||||
|
public String getSys_PO_No() {
|
||||||
|
return Sys_PO_No;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSys_PO_No(String sys_PO_No) {
|
||||||
|
Sys_PO_No = sys_PO_No;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStore_PO_No() {
|
||||||
|
return Store_PO_No;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStore_PO_No(String store_PO_No) {
|
||||||
|
Store_PO_No = store_PO_No;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPO_Date() {
|
||||||
|
return PO_Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPO_Date(String PO_Date) {
|
||||||
|
this.PO_Date = PO_Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPosmStock() {
|
||||||
|
return posmStock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPosmStock(String posmStock) {
|
||||||
|
this.posmStock = posmStock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWarehouseStock() {
|
||||||
|
return warehouseStock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWarehouseStock(String warehouseStock) {
|
||||||
|
this.warehouseStock = warehouseStock;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*@Override
|
||||||
|
public String toString() {
|
||||||
|
return getSku();
|
||||||
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+100
@@ -0,0 +1,100 @@
|
|||||||
|
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class Order_Received_Status_GetterSetter {
|
||||||
|
|
||||||
|
String table_Order_Received_Status;
|
||||||
|
|
||||||
|
ArrayList<String> STORE_ID = new ArrayList<>();
|
||||||
|
ArrayList<String> APP_PONUMBER = new ArrayList<>();
|
||||||
|
ArrayList<String> STORE_PONUMBER = new ArrayList<>();
|
||||||
|
ArrayList<String> PO_DATE = new ArrayList<>();
|
||||||
|
ArrayList<String> CATEGORY_ID = new ArrayList<>();
|
||||||
|
ArrayList<String> SKU_ID = new ArrayList<>();
|
||||||
|
ArrayList<String> ORDERQTY = new ArrayList<>();
|
||||||
|
ArrayList<String> STATUS = new ArrayList<>();
|
||||||
|
ArrayList<String> POID = new ArrayList<>();
|
||||||
|
|
||||||
|
public ArrayList<String> getPOID() {
|
||||||
|
return POID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPOID(String POID) {
|
||||||
|
this.POID.add(POID);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getTable_Order_Received_Status() {
|
||||||
|
return table_Order_Received_Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTable_Order_Received_Status(String table_Order_Received_Status) {
|
||||||
|
this.table_Order_Received_Status = table_Order_Received_Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getSTORE_ID() {
|
||||||
|
return STORE_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSTORE_ID(String STORE_ID) {
|
||||||
|
this.STORE_ID.add(STORE_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getAPP_PONUMBER() {
|
||||||
|
return APP_PONUMBER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAPP_PONUMBER(String APP_PONUMBER) {
|
||||||
|
this.APP_PONUMBER.add(APP_PONUMBER);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getSTORE_PONUMBER() {
|
||||||
|
return STORE_PONUMBER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSTORE_PONUMBER(String STORE_PONUMBER) {
|
||||||
|
this.STORE_PONUMBER.add(STORE_PONUMBER);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getPO_DATE() {
|
||||||
|
return PO_DATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPO_DATE(String PO_DATE) {
|
||||||
|
this.PO_DATE.add(PO_DATE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getCATEGORY_ID() {
|
||||||
|
return CATEGORY_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCATEGORY_ID(String CATEGORY_ID) {
|
||||||
|
this.CATEGORY_ID.add(CATEGORY_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getSKU_ID() {
|
||||||
|
return SKU_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSKU_ID(String SKU_ID) {
|
||||||
|
this.SKU_ID.add(SKU_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getORDERQTY() {
|
||||||
|
return ORDERQTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setORDERQTY(String ORDERQTY) {
|
||||||
|
this.ORDERQTY.add(ORDERQTY);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getSTATUS() {
|
||||||
|
return STATUS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSTATUS(String STATUS) {
|
||||||
|
this.STATUS.add(STATUS);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+9
@@ -25,6 +25,15 @@ public class SubCategoryMasterGetterSetter {
|
|||||||
|
|
||||||
ArrayList<String> SUB_CATEGORY_SEQUENCE_SA = new ArrayList<>();
|
ArrayList<String> SUB_CATEGORY_SEQUENCE_SA = new ArrayList<>();
|
||||||
|
|
||||||
|
ArrayList<String> PD_SUB_CATEGORY_CODE = new ArrayList<>();
|
||||||
|
|
||||||
|
public ArrayList<String> getPD_SUB_CATEGORY_CODE() {
|
||||||
|
return PD_SUB_CATEGORY_CODE;
|
||||||
|
}
|
||||||
|
public void setPD_SUB_CATEGORY_CODE(String PD_SUB_CATEGORY_CODE ) {
|
||||||
|
this.PD_SUB_CATEGORY_CODE.add(PD_SUB_CATEGORY_CODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getTable_SUB_CATEGORY_MASTER() {
|
public String getTable_SUB_CATEGORY_MASTER() {
|
||||||
return table_SUB_CATEGORY_MASTER;
|
return table_SUB_CATEGORY_MASTER;
|
||||||
|
|||||||
+19
@@ -10,6 +10,25 @@ public class SupervisorListGetterSetter {
|
|||||||
ArrayList<String> SUPERVISOR = new ArrayList<>();
|
ArrayList<String> SUPERVISOR = new ArrayList<>();
|
||||||
ArrayList<String> COUNTRY_ID = new ArrayList<>();
|
ArrayList<String> COUNTRY_ID = new ArrayList<>();
|
||||||
|
|
||||||
|
public ArrayList<String> getCOACHING_VISIT() {
|
||||||
|
return COACHING_VISIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCOACHING_VISIT(String COACHING_VISIT) {
|
||||||
|
this.COACHING_VISIT.add(COACHING_VISIT);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getCHECK_VISIT() {
|
||||||
|
return CHECK_VISIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCHECK_VISIT(String CHECK_VISIT) {
|
||||||
|
this.CHECK_VISIT.add(CHECK_VISIT);
|
||||||
|
}
|
||||||
|
|
||||||
|
ArrayList<String> COACHING_VISIT = new ArrayList<>();
|
||||||
|
ArrayList<String> CHECK_VISIT = new ArrayList<>();
|
||||||
|
|
||||||
public String getTable_SUPERVISOR_LIST() {
|
public String getTable_SUPERVISOR_LIST() {
|
||||||
return table_SUPERVISOR_LIST;
|
return table_SUPERVISOR_LIST;
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user