Compare commits
10 Commits
b8f41ecf21
...
3c049099f1
| 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"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="1.8" />
|
||||
<bytecodeTargetLevel target="17" />
|
||||
</component>
|
||||
</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">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="delegatedBuild" value="false" />
|
||||
<option name="testRunner" value="PLATFORM" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="jbr-21" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
@@ -15,8 +14,6 @@
|
||||
<option value="$PROJECT_DIR$/library" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="useQualifiedModuleNames" value="true" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
Generated
+5
-10
@@ -11,25 +11,20 @@
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</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>
|
||||
<option name="id" value="BintrayJCenter" />
|
||||
<option name="name" value="BintrayJCenter" />
|
||||
<option name="url" value="https://jcenter.bintray.com/" />
|
||||
</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>
|
||||
<option name="id" value="maven" />
|
||||
<option name="name" value="maven" />
|
||||
<option name="url" value="https://jitpack.io" />
|
||||
</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>
|
||||
</project>
|
||||
Generated
+2
-2
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Kotlin2JsCompilerArguments">
|
||||
<option name="sourceMapEmbedSources" />
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="1.9.22" />
|
||||
</component>
|
||||
</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">
|
||||
<component name="MavenImportPreferences">
|
||||
<option name="generalSettings">
|
||||
<MavenGeneralSettings>
|
||||
<option name="mavenHome" value="Bundled (Maven 3)" />
|
||||
</MavenGeneralSettings>
|
||||
<component name="DesignSurface">
|
||||
<option name="filePathToZoomLevelMap">
|
||||
<map>
|
||||
<entry key="..\:/Jeevan_Sir_Projects/GSKORANGEV2-JORDANTTTTT/GSKORANGEV2-JORDAN/GSKMTOrange/src/main/res/layout/activity_daily_data_menu.xml" value="0.11277173913043478" />
|
||||
<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>
|
||||
</component>
|
||||
<component name="NullableNotNullManager">
|
||||
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
|
||||
<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">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
Generated
+6
-3
@@ -2,9 +2,12 @@
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<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-TURKEY.GSKMTOrange.iml" filepath="$PROJECT_DIR$/.idea/modules/GSKMTOrange/GSKORANGEV2-TURKEY.GSKMTOrange.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.iml" filepath="$PROJECT_DIR$/.idea/modules/GSKMTOrange/GSKORANGEV2-JORDAN.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/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>
|
||||
</component>
|
||||
</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">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||
<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>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
+106
-55
@@ -2,71 +2,121 @@ apply plugin: 'com.android.application'
|
||||
//apply plugin: 'io.fabric'
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
apply plugin: 'com.google.firebase.crashlytics'
|
||||
apply plugin: 'org.jetbrains.kotlin.android'
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
buildToolsVersion '29.0.3'
|
||||
compileSdk(35)
|
||||
useLibrary 'org.apache.http.legacy'
|
||||
|
||||
namespace "cpm.com.gskmtorange"
|
||||
lintOptions {
|
||||
checkReleaseBuilds false
|
||||
disable 'MissingTranslation'
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
configurations {
|
||||
all*.exclude module: 'okio'
|
||||
all*.exclude group: 'com.squareup.okhttp3', module: 'okhttp'
|
||||
// all*.exclude module: 'okio'
|
||||
// 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.
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId "cpm.com.gskmtorange"
|
||||
minSdkVersion 20
|
||||
targetSdkVersion 29
|
||||
minSdkVersion 24
|
||||
targetSdk(34)
|
||||
|
||||
/*//For Egypt
|
||||
versionCode 31
|
||||
versionName "4.3"*/
|
||||
// For Lebanon
|
||||
/* versionCode 1
|
||||
versionName "1.0"*/
|
||||
|
||||
//For Egypt
|
||||
/*versionCode 35
|
||||
versionName "4.6"*/
|
||||
|
||||
//For UAE
|
||||
/* versionCode 29
|
||||
versionName "4.1"*/
|
||||
/* versionCode 30
|
||||
versionName "4.2"*/
|
||||
|
||||
//For Turkey
|
||||
versionCode 27
|
||||
versionName "3.9"
|
||||
/* versionCode 34
|
||||
versionName "4.6"*/
|
||||
|
||||
//For Turkey
|
||||
/*versionCode 32
|
||||
versionName "4.4"*/
|
||||
|
||||
//For KSA
|
||||
/* versionCode 28
|
||||
versionName "4.0"*/
|
||||
/* versionCode 31
|
||||
versionName "4.3"*/
|
||||
|
||||
// aading price facing
|
||||
/* versionCode 27
|
||||
versionName "3.8"*/
|
||||
|
||||
|
||||
//sa
|
||||
|
||||
|
||||
/* versionCode 28
|
||||
/* versionCode 28
|
||||
versionName "3.9"*/
|
||||
|
||||
//Kenya
|
||||
/* versionCode 2
|
||||
/* versionCode 2
|
||||
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"
|
||||
}
|
||||
signingConfigs {
|
||||
config {
|
||||
keyAlias 'hp'
|
||||
keyPassword 'android'
|
||||
storeFile file('D:\\jeevanp_cpm_projects\\keystore\\hp.dat')
|
||||
storePassword 'android'
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
debuggable true
|
||||
signingConfig signingConfigs.config
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
kotlin {
|
||||
jvmToolchain(17)
|
||||
}
|
||||
firebaseCrashlytics {
|
||||
nativeSymbolUploadEnabled true
|
||||
@@ -75,40 +125,41 @@ android {
|
||||
|
||||
dependencies {
|
||||
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 'com.google.android.material:material:1.2.1'
|
||||
implementation 'com.google.android.material:material:1.12.0'
|
||||
implementation project(path: ':library')
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.google.firebase:firebase-auth:20.0.3'
|
||||
testImplementation 'junit:junit:4.13.1'
|
||||
implementation 'android.arch.navigation:navigation-fragment:1.0.0'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
implementation 'com.google.code.gson:gson:2.8.6'
|
||||
implementation 'com.github.bumptech.glide:glide:4.11.0'
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:26.7.0')
|
||||
// implementation 'com.google.firebase:firebase-analytics'
|
||||
implementation 'com.google.firebase:firebase-crashlytics-ndk'
|
||||
implementation 'androidx.activity:activity:1.10.1'
|
||||
implementation 'androidx.appcompat:appcompat:1.7.1'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
implementation "androidx.navigation:navigation-fragment-ktx:2.9.0"
|
||||
androidTestImplementation "androidx.test:core:1.6.1"
|
||||
androidTestImplementation "androidx.test:espresso:espresso-core:3.5.1"
|
||||
androidTestImplementation "androidx.test.ext:junit:1.2.1"
|
||||
androidTestImplementation "androidx.test:annotation:1.0.1"
|
||||
implementation 'com.google.code.gson:gson:2.11.0'
|
||||
implementation 'com.github.bumptech.glide:glide:4.16.0'
|
||||
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.android.gms:play-services-location:17.1.0'
|
||||
implementation 'com.google.android.gms:play-services-maps:17.0.0'
|
||||
|
||||
implementation 'com.kyanogen.signatureview:signature-view:1.0'
|
||||
implementation 'com.android.support:multidex:1.0.3'
|
||||
implementation files('libs/ksoap2-android-assembly-3.6.2-jar-with-dependencies.jar')
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.0.2'
|
||||
implementation 'com.google.android.gms:play-services-location:21.3.0'
|
||||
implementation 'com.google.android.gms:play-services-maps:19.2.0'
|
||||
implementation 'com.google.firebase:firebase-analytics:22.4.0'
|
||||
implementation 'com.google.firebase:firebase-appindexing:20.0.0'
|
||||
// implementation 'com.google.firebase:firebase-crashlytics:19.4.3'
|
||||
implementation 'com.google.firebase:firebase-auth:23.2.1'
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||
implementation 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
|
||||
implementation 'com.google.android.gms:play-services-appindexing:8.3.0'
|
||||
// Add the Firebase Crashlytics SDK.
|
||||
implementation 'com.google.firebase:firebase-crashlytics:17.3.0'
|
||||
// Recommended: Add the Google Analytics SDK.
|
||||
implementation 'com.google.firebase:firebase-analytics:18.0.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
|
||||
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.22"))
|
||||
implementation 'androidx.multidex:multidex:2.0.1'
|
||||
implementation "androidx.core:core-splashscreen:1.0.1"
|
||||
}
|
||||
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"
|
||||
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>
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="cpm.com.gskmtorange">
|
||||
<!-- 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.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||
<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_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission
|
||||
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.REQUEST_INSTALL_PACKAGES" />
|
||||
|
||||
<meta-data
|
||||
android:name="firebase_crashlytics_collection_enabled"
|
||||
android:value="false" />
|
||||
<uses-permission android:name="an[droid.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
android:supportsRtl="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:supportsRtl="false"
|
||||
android:theme="@style/AppTheme"
|
||||
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
|
||||
android:name=".dailyentry.NewStockDataActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_new_stock_data"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
@@ -42,6 +81,7 @@
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".dailyentry.StockPricingActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_stock_pricing"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
@@ -77,6 +117,8 @@
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".SplashScreenActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:exported="true"
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
@@ -88,11 +130,13 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".LoginActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_login"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/main_menu_activity_name"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
@@ -101,6 +145,7 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".SelectLanguageActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_select_language"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
@@ -110,11 +155,13 @@
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".GeoTag.GeoTagStoreList"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_store_list"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".dailyentry.StoreListActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_store_list"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
@@ -126,6 +173,7 @@
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".GeoTag.GeoTagActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_store_geotag"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
@@ -140,9 +188,9 @@
|
||||
<activity
|
||||
android:name=".dailyentry.T2PComplianceActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" /> <!-- Gagan Start Declaration -->
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan" /> <!-- Gagan Start Declaration -->
|
||||
<activity
|
||||
android:name=".gsk_dailyentry.CategoryListActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
@@ -205,6 +253,7 @@
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".dailyentry.SettingsActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_settings"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
@@ -225,7 +274,9 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".dailyentry.T2pBrand_Avaibility"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_t2p_brand__avaibility"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".gsk_dailyentry.StockFacing_PlanogramTrackerActivity"
|
||||
@@ -285,7 +336,8 @@
|
||||
android:name=".dailyentry.AuditActivity"
|
||||
android:label="@string/audit"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
|
||||
<service
|
||||
android:name=".service.FCMNotificationService"
|
||||
@@ -309,7 +361,12 @@
|
||||
Note that the API key is linked to the encryption key used to sign the APK.
|
||||
You need a different API key for each encryption key, including the release key that is used to
|
||||
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
|
||||
android:name="com.google.android.geo.API_KEY"
|
||||
@@ -352,6 +409,11 @@
|
||||
android:label="@string/title_activity_coaching_visit"
|
||||
android:screenOrientation="portrait"
|
||||
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
|
||||
android:name=".dailyentry.DeliveryCallActivity"
|
||||
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;
|
||||
|
||||
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
@@ -19,6 +21,7 @@ import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Looper;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.provider.MediaStore;
|
||||
import android.provider.Settings;
|
||||
@@ -38,14 +41,19 @@ import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
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.Thing;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.GooglePlayServicesUtil;
|
||||
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.LocationRequest;
|
||||
import com.google.android.gms.location.LocationResult;
|
||||
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.GoogleMap;
|
||||
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.CommonString;
|
||||
import cpm.com.gskmtorange.dailyentry.StoreimageActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.VisitTypeStatusActivity;
|
||||
import cpm.com.gskmtorange.messgae.AlertMessage;
|
||||
import cpm.com.gskmtorange.upload.Base64;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
||||
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 {
|
||||
private Context context;
|
||||
String result, errormsg = "";
|
||||
@@ -98,6 +102,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
private GoogleMap mMap;
|
||||
double latitude = 0.0;
|
||||
double longitude = 0.0;
|
||||
String country_id;
|
||||
protected String diskpath = "", _path, _pathforcheck, img_str = "", status;
|
||||
private Location mLastLocation;
|
||||
private LocationManager locmanager = null;
|
||||
@@ -123,15 +128,14 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
Uri outputFileUri;
|
||||
private int factor, k;
|
||||
ArrayList<GeotaggingBeans> geotaglist = new ArrayList<GeotaggingBeans>();
|
||||
|
||||
ArrayList<GeotaggingBeans> geotaglistImage = new ArrayList<GeotaggingBeans>();
|
||||
Boolean markerflag = true;
|
||||
private TextView percentage, message;
|
||||
private FailureGetterSetter failureGetterSetter = null;
|
||||
/**
|
||||
* ATTENTION: This was auto-generated to implement the App Indexing API.
|
||||
* See https://g.co/AppIndexing/AndroidStudio for more information.
|
||||
*/
|
||||
|
||||
private FusedLocationProviderClient fusedLocationProviderClient;
|
||||
LocationRequest locationRequest;
|
||||
|
||||
private GoogleApiClient client;
|
||||
|
||||
Toolbar toolbar;
|
||||
@@ -142,15 +146,16 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
|
||||
context = this;
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);
|
||||
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||
//storeid = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||
//storename = preferences.getString(CommonString.KEY_STORE_NAME, null);
|
||||
visitData = preferences.getString(CommonString.KEY_DATE, null);
|
||||
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
||||
storeid = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||
|
||||
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
@@ -161,9 +166,9 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
|
||||
db = new GSKOrangeDB(GeoTagActivity.this);
|
||||
db.open();
|
||||
context = this;
|
||||
|
||||
//storeid = getIntent().getStringExtra("Storeid");
|
||||
str = CommonString.FILE_PATH;
|
||||
str = CommonString.getImagesFolder(context);
|
||||
|
||||
mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
|
||||
|
||||
@@ -221,7 +226,6 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// Write your code here to invoke NO event
|
||||
|
||||
dialog.cancel();
|
||||
finish();
|
||||
}
|
||||
@@ -266,31 +270,15 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
fabcarmabtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
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";
|
||||
|
||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||
|
||||
|
||||
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||
startCameraActivity();
|
||||
|
||||
}
|
||||
});
|
||||
// ATTENTION: This was auto-generated to implement the App Indexing API.
|
||||
// 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() {
|
||||
@@ -317,8 +305,6 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
.addOnConnectionFailedListener(this)
|
||||
.addApi(LocationServices.API).build();
|
||||
}
|
||||
|
||||
|
||||
protected void createLocationRequest() {
|
||||
mLocationRequest = new LocationRequest();
|
||||
mLocationRequest.setInterval(UPDATE_INTERVAL);
|
||||
@@ -328,11 +314,8 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -349,7 +332,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
@Override
|
||||
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
|
||||
// ActivityCompat#requestPermissions
|
||||
// here to request the missing permissions, and then overriding
|
||||
@@ -385,10 +368,8 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
|
||||
|
||||
// if (mRequestingLocationUpdates) {
|
||||
startLocationUpdates();
|
||||
// }
|
||||
startLocationUpdates();*/
|
||||
|
||||
// startLocationUpdates();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -414,7 +395,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
protected void onStart() {
|
||||
super.onStart();// ATTENTION: This was auto-generated to implement the App Indexing API.
|
||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
||||
client.connect();
|
||||
// client.connect();
|
||||
if (mGoogleApiClient != null) {
|
||||
mGoogleApiClient.connect();
|
||||
}
|
||||
@@ -429,12 +410,49 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
|
||||
CommonFunctions.updateLangResources(context,preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
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
|
||||
@@ -443,17 +461,12 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
||||
|
||||
|
||||
//usk comment
|
||||
/* if(client!=null && mGoogleApiClient!=null){
|
||||
AppIndex.AppIndexApi.end(client, getIndexApiAction());
|
||||
if (mGoogleApiClient.isConnected()) {
|
||||
mGoogleApiClient.disconnect();
|
||||
}
|
||||
// ATTENTION: This was auto-generated to implement the App Indexing API.
|
||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
||||
client.disconnect();
|
||||
// AppIndex.AppIndexApi.end(client, getIndexApiAction());
|
||||
if (mGoogleApiClient.isConnected()) {
|
||||
mGoogleApiClient.disconnect();
|
||||
}
|
||||
|
||||
}*/
|
||||
// client.disconnect();
|
||||
|
||||
}
|
||||
|
||||
@@ -501,8 +514,23 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
cdate = arabicToenglish(cdate);
|
||||
}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);
|
||||
}
|
||||
|
||||
return cdate;
|
||||
}
|
||||
|
||||
@@ -614,19 +642,6 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
* @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> {
|
||||
|
||||
@@ -779,29 +794,51 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
|
||||
} catch (SocketException ex) {
|
||||
ex.printStackTrace();
|
||||
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);
|
||||
|
||||
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(
|
||||
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();
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
Intent intent = new Intent(
|
||||
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(
|
||||
GeoTagActivity.this,
|
||||
StoreimageActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
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);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);*/
|
||||
|
||||
startActivity(intent);
|
||||
// startActivity(intent);
|
||||
|
||||
GeoTagActivity.this.finish();
|
||||
}
|
||||
@@ -912,17 +949,14 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
&& !geotaglistImage.get(i).getUrl1()
|
||||
.equalsIgnoreCase("")) {
|
||||
|
||||
if (new File(CommonString.FILE_PATH
|
||||
if (new File(CommonString.getImagesFolder(context)
|
||||
+ geotaglistImage.get(i).getUrl1()).exists()) {
|
||||
result = UploadGeoImage(geotaglistImage.get(i).getUrl1(), "GeotagImages");
|
||||
|
||||
|
||||
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
|
||||
return "GeotagImages";
|
||||
}
|
||||
|
||||
|
||||
if (result.toString().equalsIgnoreCase(CommonString.KEY_FALSE)) {
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -964,13 +997,29 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
//Crashlytics.logException(new Exception(e.getCause()));
|
||||
Intent intent = new Intent(
|
||||
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(
|
||||
GeoTagActivity.this,
|
||||
StoreimageActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
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);
|
||||
startActivity(intent);*/
|
||||
|
||||
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();
|
||||
|
||||
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);
|
||||
message.showMessage();*/
|
||||
|
||||
Intent intent = new Intent(
|
||||
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(
|
||||
GeoTagActivity.this,
|
||||
StoreimageActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
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);
|
||||
startActivity(intent);*/
|
||||
|
||||
GeoTagActivity.this.finish();
|
||||
|
||||
@@ -1042,13 +1109,30 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
+ result, getResources().getString(R.string.failure), null);
|
||||
message.showMessage();*/
|
||||
Toast.makeText(context,getResources().getString(R.string.failure),Toast.LENGTH_LONG).show();
|
||||
Intent intent = new Intent(
|
||||
|
||||
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(
|
||||
GeoTagActivity.this,
|
||||
StoreimageActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, storeid);
|
||||
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);
|
||||
startActivity(intent);*/
|
||||
|
||||
GeoTagActivity.this.finish();
|
||||
}
|
||||
@@ -1068,7 +1152,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
errormsg = "";
|
||||
BitmapFactory.Options o = new BitmapFactory.Options();
|
||||
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
|
||||
final int REQUIRED_SIZE = 1024;
|
||||
@@ -1088,7 +1172,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
// Decode with inSampleSize
|
||||
BitmapFactory.Options o2 = new BitmapFactory.Options();
|
||||
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();
|
||||
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)) {
|
||||
|
||||
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)) {
|
||||
return CommonString.KEY_FALSE;
|
||||
} else {
|
||||
@@ -1148,4 +1211,17 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
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.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.Looper;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
@@ -36,6 +38,7 @@ import android.widget.Toast;
|
||||
//import com.crashlytics.android.Crashlytics;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
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.ResultCallback;
|
||||
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.LocationRequest;
|
||||
import com.google.android.gms.location.LocationResult;
|
||||
import com.google.android.gms.location.LocationServices;
|
||||
import com.google.android.gms.location.LocationSettingsRequest;
|
||||
import com.google.android.gms.location.LocationSettingsResult;
|
||||
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.material.snackbar.Snackbar;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
@@ -77,8 +84,10 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import cpm.com.gskmtorange.autoupdate.AutoUpdateActivity;
|
||||
@@ -92,60 +101,48 @@ import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
||||
//import io.fabric.sdk.android.Fabric;
|
||||
|
||||
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_LOCATION = 11;
|
||||
private static final int MY_PERMISSIONS_REQUEST_STORAGE_READ = 12;
|
||||
private static final int MY_PERMISSIONS_REQUEST_STORAGE_WRITE = 14;
|
||||
|
||||
private FirebaseAnalytics mFirebaseAnalytics;
|
||||
|
||||
TextView tv_version;
|
||||
private static final int PERMISSION_ALL = 99;
|
||||
|
||||
String app_ver;
|
||||
|
||||
LoginGetterSetter lgs = null;
|
||||
|
||||
static int counter = 1;
|
||||
|
||||
private SharedPreferences preferences = null;
|
||||
private SharedPreferences.Editor editor = null;
|
||||
|
||||
/**
|
||||
* Id to identity READ_CONTACTS permission request.
|
||||
*/
|
||||
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.
|
||||
* 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 lon = 0.0;
|
||||
|
||||
// UI references.
|
||||
private AutoCompleteTextView museridView;
|
||||
private EditText mPasswordView;
|
||||
private View mProgressView;
|
||||
private View mLoginFormView;
|
||||
|
||||
private String userid, password, p_username, p_password;
|
||||
|
||||
private String userid, password;
|
||||
private int versionCode;
|
||||
|
||||
int eventType;
|
||||
|
||||
Button museridSignInButton;
|
||||
|
||||
// Trace myTrace;
|
||||
CardView museridSignInButton;
|
||||
|
||||
GoogleApiClient mGoogleApiClient;
|
||||
private static int UPDATE_INTERVAL = 200; // 5 sec
|
||||
@@ -160,9 +157,9 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.activity_login);
|
||||
context = this;
|
||||
|
||||
TextView tv_version = (TextView) findViewById(R.id.tv_version_code);
|
||||
try {
|
||||
app_ver = String.valueOf(getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
|
||||
@@ -172,20 +169,24 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
tv_version.setText("Version/Versiyon - " + app_ver);
|
||||
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
tv_version.setText("Version/Versiyon - " + app_ver +"-T4");
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
editor = preferences.edit();
|
||||
|
||||
// Set up the login form.
|
||||
museridView = (AutoCompleteTextView) findViewById(R.id.userid);
|
||||
//populateAutoComplete();
|
||||
mPasswordView = (EditText) findViewById(R.id.password);
|
||||
fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);
|
||||
|
||||
/* museridView.setText("test.egypt");
|
||||
mPasswordView.setText("cpm123");*/
|
||||
/* museridView.setText("egypt.1");
|
||||
//for lebanon
|
||||
// museridView.setText("test.lebanon1");
|
||||
// mPasswordView.setText("cpm@123");
|
||||
// for EGYPT
|
||||
// museridView.setText("test.egypt");
|
||||
// mPasswordView.setText("cpm123");
|
||||
/*museridView.setText("egypt.1");
|
||||
mPasswordView.setText("cpm123");*/
|
||||
|
||||
/* museridView.setText("DSR_Alex_61");
|
||||
mPasswordView.setText("cpm123");*/
|
||||
|
||||
@@ -211,18 +212,22 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
/* museridView.setText("testksa");
|
||||
mPasswordView.setText("cpm123");*/
|
||||
|
||||
|
||||
//turkey
|
||||
/* museridView.setText("testmer");
|
||||
mPasswordView.setText("cpm123");*/
|
||||
/* //turkey
|
||||
museridView.setText("testmer");
|
||||
mPasswordView.setText("cpm123");
|
||||
*/
|
||||
//sa
|
||||
/* museridView.setText("testsa");
|
||||
mPasswordView.setText("cpm123");*/
|
||||
|
||||
//Qatar
|
||||
/* museridView.setText("test.qatar1");
|
||||
mPasswordView.setText("cpm123");*/
|
||||
|
||||
//Kenya
|
||||
// museridView.setText("test.Kenya");
|
||||
// museridView.setText("testkenya");
|
||||
// mPasswordView.setText("cpm123");
|
||||
// museridView.setText("test.Kenya");
|
||||
// museridView.setText("testkenya");
|
||||
// mPasswordView.setText("cpm123");
|
||||
|
||||
/*museridView.setText("rajesh.r");
|
||||
mPasswordView.setText("cpm123");*/
|
||||
@@ -233,6 +238,19 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
// museridView.setText("test.nig");
|
||||
/* museridView.setText("test.nigeria");
|
||||
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() {
|
||||
@Override
|
||||
public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
|
||||
@@ -246,7 +264,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
|
||||
try {
|
||||
app_ver = String.valueOf(getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
|
||||
|
||||
// tv_version.setText("Version " + app_ver);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
// TODO Auto-generated catch block
|
||||
@@ -254,9 +271,10 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
FirebaseCrashlytics.getInstance().recordException(e);
|
||||
}
|
||||
|
||||
checkAndRequestPermissions();
|
||||
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
|
||||
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
|
||||
museridSignInButton = (Button) findViewById(R.id.user_login_button);
|
||||
museridSignInButton = (CardView) findViewById(R.id.user_login_button);
|
||||
museridSignInButton.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
@@ -280,10 +298,137 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
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() {
|
||||
if (!mayRequestContacts()) {
|
||||
return;
|
||||
@@ -505,9 +650,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
|
||||
super.onPreExecute();
|
||||
|
||||
dialog = new ProgressDialog(LoginActivity.this);
|
||||
dialog.setTitle("Login");
|
||||
dialog.setMessage("Authenticating....");
|
||||
@@ -517,17 +660,15 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
|
||||
@Override
|
||||
protected String doInBackground(Void... params) {
|
||||
|
||||
try {
|
||||
|
||||
Log.e("latitudedata",lat + ","+ lon);
|
||||
versionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
|
||||
|
||||
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
|
||||
+ "[/LONGITUDE]" + "[APP_VERSION]" + app_ver +"-T4"
|
||||
+ "[/APP_VERSION]" + "[ATT_MODE]OnLine[/ATT_MODE]"
|
||||
+ "[NETWORK_STATUS]" + "LoginStatus"
|
||||
+ "[/NETWORK_STATUS]" + "[/USER_DATA][/DATA]";
|
||||
@@ -535,17 +676,24 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
SoapObject request = new SoapObject(CommonString.NAMESPACE,
|
||||
CommonString.METHOD_LOGIN);
|
||||
request.addProperty("onXML", userauth_xml);
|
||||
Log.d("loginrequest", String.valueOf(request));
|
||||
|
||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
|
||||
SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(
|
||||
try {
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(
|
||||
CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_LOGIN,
|
||||
envelope);
|
||||
} catch (Exception e){
|
||||
Log.e("httpexception",e.getMessage());
|
||||
}
|
||||
/*HttpTransportSE androidHttpTransport = new HttpTransportSE(
|
||||
CommonString.URL);
|
||||
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_LOGIN,
|
||||
envelope);
|
||||
envelope);*/
|
||||
|
||||
Object result = (Object) envelope.getResponse();
|
||||
|
||||
@@ -563,24 +711,18 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
|
||||
} else if (result.toString().equalsIgnoreCase(
|
||||
CommonString.KEY_FALSE)) {
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
showAlert(CommonString.MESSAGE_FALSE);
|
||||
}
|
||||
});
|
||||
|
||||
} else if (result.toString().equalsIgnoreCase(
|
||||
CommonString.KEY_CHANGED)) {
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
showAlert(CommonString.MESSAGE_CHANGED);
|
||||
}
|
||||
});
|
||||
@@ -628,15 +770,16 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// PUT IN PREFERENCES
|
||||
editor.putString(CommonString.KEY_USERNAME, userid);
|
||||
editor.putString(CommonString.KEY_PASSWORD, password);
|
||||
editor.putString(CommonString.KEY_VERSION, lgs.getAPP_VERSION());
|
||||
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, "01/25/2019");
|
||||
editor.putString(CommonString.KEY_COUNTRY_ID, lgs.getCOUNTRY_ID());
|
||||
Log.e("countryid",lgs.getCOUNTRY_ID());
|
||||
editor.commit();
|
||||
setDataFromSharedPreferences(lgs);
|
||||
|
||||
@@ -686,12 +829,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
});
|
||||
} catch (Exception 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() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -700,7 +837,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
});
|
||||
}
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -712,7 +848,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
if (result.equals(CommonString.KEY_SUCCESS)) {
|
||||
// manually set true for South Africa
|
||||
boolean forSA = false;
|
||||
// database.open();
|
||||
// database.open();
|
||||
if (forSA) {
|
||||
//For SA Only
|
||||
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equals("")) {
|
||||
@@ -745,7 +881,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
finish();
|
||||
//uploadPreviousImages();
|
||||
}
|
||||
|
||||
} else {
|
||||
Intent intent = new Intent(getBaseContext(), AutoUpdateActivity.class);
|
||||
intent.putExtra(CommonString.KEY_PATH, preferences.getString(CommonString.KEY_PATH, ""));
|
||||
@@ -753,11 +888,9 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void showAlert(String str) {
|
||||
@@ -778,15 +911,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
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) {
|
||||
char[] chars = new char[number.length()];
|
||||
@@ -811,85 +935,27 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
cdate = arabicToenglish(cdate);
|
||||
} 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);
|
||||
}
|
||||
|
||||
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) {
|
||||
Gson gson = new Gson();
|
||||
@@ -937,14 +1003,14 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
|
||||
// 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()) {
|
||||
file.mkdir();
|
||||
}
|
||||
File file_planogram = new File(Environment.getExternalStorageDirectory(), "GSK_MT_ORANGE_Planogram_Images");
|
||||
if (!file_planogram.isDirectory()) {
|
||||
file_planogram.mkdir();
|
||||
}
|
||||
}*/
|
||||
|
||||
if (checkPlayServices()) {
|
||||
// Building the GoogleApi client
|
||||
@@ -961,7 +1027,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
.addApi(LocationServices.API)
|
||||
.build();
|
||||
}
|
||||
//attemptLogin();
|
||||
attemptLogin();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1004,32 +1070,44 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
|
||||
}
|
||||
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) {
|
||||
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
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()) {
|
||||
// Building the GoogleApi client
|
||||
buildGoogleApiClient();
|
||||
|
||||
createLocationRequest();
|
||||
}
|
||||
|
||||
@@ -1043,7 +1121,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
private boolean checkPlayServices() {
|
||||
int resultCode = GooglePlayServicesUtil
|
||||
.isGooglePlayServicesAvailable(this);
|
||||
@@ -1123,7 +1201,8 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
||||
|
||||
@Override
|
||||
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
|
||||
// ActivityCompat#requestPermissions
|
||||
// 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();
|
||||
}
|
||||
startLocationUpdates();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -70,15 +70,10 @@ public class MainActivity extends AppCompatActivity
|
||||
String user_name, country_id, user_type;
|
||||
ArrayList<StoreBean> storelist = new ArrayList<StoreBean>();
|
||||
View headerView;
|
||||
|
||||
ArrayList<CoverageBean> coverageList;
|
||||
|
||||
String error_msg;
|
||||
|
||||
Toolbar toolbar;
|
||||
|
||||
NavigationView navigationView;
|
||||
|
||||
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_STORAGE_READ = 12;
|
||||
@@ -101,6 +96,7 @@ public class MainActivity extends AppCompatActivity
|
||||
webView = (WebView) findViewById(R.id.webview);
|
||||
|
||||
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);
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||
|
||||
@@ -111,9 +107,7 @@ public class MainActivity extends AppCompatActivity
|
||||
webView.getSettings().setJavaScriptEnabled(true);
|
||||
|
||||
if (!url.equals("")) {
|
||||
|
||||
webView.loadUrl(url);
|
||||
|
||||
}
|
||||
|
||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||
@@ -158,6 +152,60 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
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
|
||||
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")){
|
||||
Menu nav_Menu = navigationView.getMenu();
|
||||
Menu nav_Menu = navigatsyncStateionView.getMenu();
|
||||
nav_Menu.findItem(R.id.nav_planogram).setVisible(true);
|
||||
}
|
||||
}*/
|
||||
@@ -229,6 +277,7 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
super.onBackPressed();
|
||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||
if (drawer.isDrawerOpen(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")
|
||||
@Override
|
||||
@@ -266,16 +295,15 @@ public class MainActivity extends AppCompatActivity
|
||||
int id = item.getItemId();
|
||||
|
||||
if (id == R.id.nav_route_plan) {
|
||||
|
||||
Intent in_jcp = new Intent(this, StoreListActivity.class);
|
||||
in_jcp.putExtra(CommonString.KEY_STORE_FLAG, CommonString.FROM_JCP);
|
||||
startActivity(in_jcp);
|
||||
|
||||
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) {
|
||||
|
||||
checkAppPermission(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA);
|
||||
downloadMethod();
|
||||
//checkAppPermission(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA);
|
||||
|
||||
} 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)
|
||||
.setAction("Action", null).show();
|
||||
|
||||
// Toast.makeText(getBaseContext(), "Please Download Data First", Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
|
||||
if (coverageList.size() == 0) {
|
||||
Snackbar.make(webView, R.string.no_data_for_upload, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||
|
||||
} else {
|
||||
if (isStoreCheckedIn() && isValid()) {
|
||||
|
||||
@@ -342,7 +367,7 @@ public class MainActivity extends AppCompatActivity
|
||||
Intent startDownload = new Intent(this, GeoTagStoreList.class);
|
||||
startActivity(startDownload);
|
||||
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
} else {
|
||||
Snackbar.make(headerView, R.string.title_store_list_download_data, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
}
|
||||
@@ -380,7 +405,7 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
finish();
|
||||
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
|
||||
//startActivity(new Intent(MainActivity.this, CategoryListActivity.class));
|
||||
|
||||
@@ -389,20 +414,19 @@ public class MainActivity extends AppCompatActivity
|
||||
Intent startservice = new Intent(this, ServiceActivity.class);
|
||||
startActivity(startservice);
|
||||
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
|
||||
} else if (id == R.id.nav_future_jcp) {
|
||||
Intent startDownload = new Intent(this, FutureJCPActivity.class);
|
||||
startActivity(startDownload);
|
||||
|
||||
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) {
|
||||
|
||||
if (checkNetIsAvailable()) {
|
||||
Intent planogram_pdf = new Intent(this, PlanogramPDFActivity.class);
|
||||
startActivity(planogram_pdf);
|
||||
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
} else {
|
||||
|
||||
Snackbar.make(webView, getResources().getString(R.string.nonetwork), Snackbar.LENGTH_SHORT)
|
||||
@@ -420,20 +444,18 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
// Toast.makeText(getBaseContext(), "Please Download Data First", Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
|
||||
Intent in = new Intent(this, StoreListActivity.class);
|
||||
in.putExtra(CommonString.KEY_STORE_FLAG, CommonString.FROM_DEVIATION);
|
||||
|
||||
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) {
|
||||
Intent in = new Intent(this, DeliveryCallActivity.class);
|
||||
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_pharmacy_stores) {
|
||||
/*Intent in = new Intent(this, PharmaActivity.class);
|
||||
startActivity(in);*/
|
||||
@@ -443,7 +465,7 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
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_additional_stores) {
|
||||
db.open();
|
||||
|
||||
@@ -460,9 +482,9 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
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_additional_adhoc_stores) {
|
||||
} else if (id == R.id.nav_additional_adhoc_stores) {
|
||||
db.open();
|
||||
|
||||
if (db.getSKUMasterData(null).size() == 0) {
|
||||
@@ -478,14 +500,14 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
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_counterfeit_indicator) {
|
||||
} else if (id == R.id.nav_counterfeit_indicator) {
|
||||
|
||||
Intent intent = new Intent(this, CounterfeitIndicatorWebActivity.class);
|
||||
startActivity(intent);
|
||||
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
|
||||
}
|
||||
|
||||
@@ -548,7 +570,7 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
public boolean isValid() {
|
||||
boolean flag = false;
|
||||
String storestatus="";
|
||||
String storestatus = "";
|
||||
for (int i = 0; i < coverageList.size(); i++) {
|
||||
|
||||
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
|
||||
|
||||
File file = new File(Environment.getExternalStorageDirectory(), ".GSK_MT_ORANGE_IMAGES");
|
||||
/*File file = new File(Environment.getExternalStorageDirectory(), ".GSK_MT_ORANGE_IMAGES");
|
||||
if (!file.isDirectory()) {
|
||||
file.mkdir();
|
||||
}
|
||||
File file_planogram = new File(Environment.getExternalStorageDirectory(), "GSK_MT_ORANGE_Planogram_Images");
|
||||
if (!file_planogram.isDirectory()) {
|
||||
file_planogram.mkdir();
|
||||
}
|
||||
}*/
|
||||
|
||||
downloadMethod();
|
||||
}
|
||||
@@ -837,7 +859,5 @@ public class MainActivity extends AppCompatActivity
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
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;
|
||||
|
||||
public class SelectLanguageActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
|
||||
Button btn_lang_1, btn_lang_2;
|
||||
private Context context;
|
||||
private SharedPreferences preferences = null;
|
||||
private SharedPreferences.Editor editor = null;
|
||||
|
||||
LoginGetterSetter login_data;
|
||||
ArrayList<String> language, culture_id;
|
||||
|
||||
boolean selected_flag = false;
|
||||
|
||||
@Override
|
||||
@@ -47,36 +44,26 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
||||
context = this;
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
editor = preferences.edit();
|
||||
|
||||
btn_lang_1 = (Button) findViewById(R.id.btn_language_one);
|
||||
btn_lang_2 = (Button) findViewById(R.id.btn_language_two);
|
||||
|
||||
|
||||
login_data = (LoginGetterSetter) getIntent().getSerializableExtra(CommonString.KEY_LOGIN_DATA);
|
||||
language = login_data.getCULTURE_NAME();
|
||||
culture_id = login_data.getCULTURE_ID();
|
||||
|
||||
setDataFromSharedPreferences(login_data);
|
||||
|
||||
if (language.size() > 1) {
|
||||
|
||||
btn_lang_1.setText(language.get(0));
|
||||
btn_lang_2.setText(language.get(1));
|
||||
|
||||
btn_lang_1.setOnClickListener(this);
|
||||
btn_lang_2.setOnClickListener(this);
|
||||
}
|
||||
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
if (selected_flag) {
|
||||
/* Intent intent = new Intent(getBaseContext(),
|
||||
MainActivity.class);
|
||||
|
||||
intent.putExtra(CommonString.KEY_LOGIN_DATA, login_data);
|
||||
startActivity(intent);
|
||||
finish();*/
|
||||
@@ -98,43 +85,37 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
|
||||
switch (id) {
|
||||
case R.id.btn_language_one:
|
||||
selected_flag = true;
|
||||
CommonFunctions.updateLangResources(context, language.get(0));
|
||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
editor.putString(CommonString.KEY_LANGUAGE, language.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.commit();
|
||||
if (id == R.id.btn_language_one) {
|
||||
selected_flag = true;
|
||||
CommonFunctions.updateLangResources(context, language.get(0));
|
||||
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));
|
||||
editor.putString(CommonString.KEY_LANGUAGE, language.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.commit();
|
||||
|
||||
break;
|
||||
|
||||
case R.id.btn_language_two:
|
||||
|
||||
selected_flag = true;
|
||||
|
||||
CommonFunctions.updateLangResources(context, language.get(1));
|
||||
|
||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
|
||||
editor.putString(CommonString.KEY_LANGUAGE, language.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.commit();
|
||||
|
||||
break;
|
||||
} else if (id == R.id.btn_language_two) {
|
||||
selected_flag = true;
|
||||
CommonFunctions.updateLangResources(context, language.get(1));
|
||||
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));
|
||||
editor.putString(CommonString.KEY_LANGUAGE, language.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.commit();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
|
||||
Gson gson = new Gson();
|
||||
String jsonCurProduct = gson.toJson(lgs);
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
|
||||
editor.putString(CommonString.KEY_LOOGIN_PREF, jsonCurProduct);
|
||||
editor.commit();
|
||||
}
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
package cpm.com.gskmtorange;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.ImageView;
|
||||
@@ -36,21 +40,25 @@ public class SplashScreenActivity extends AppCompatActivity {
|
||||
Window window = getWindow();
|
||||
window.setFormat(PixelFormat.RGBA_8888);
|
||||
}
|
||||
/** Called when the activity is first created. */
|
||||
|
||||
/**
|
||||
* Called when the activity is first created.
|
||||
*/
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
setContentView(R.layout.activity_splash_main_layout);
|
||||
|
||||
linearLayout = findViewById(R.id.lin_lay);
|
||||
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
context = this;
|
||||
StartAnimations();
|
||||
//StartAnimations();
|
||||
|
||||
sendToLogin();
|
||||
|
||||
/* File f = new File(CommonString.FILE_PATH_OLD);
|
||||
/* File f = new File(CommonString.getImagesFolder(context)_OLD);
|
||||
if(f!=null){
|
||||
File file[] = f.listFiles();
|
||||
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);
|
||||
anim.reset();
|
||||
LinearLayout l=(LinearLayout) findViewById(R.id.lin_lay);
|
||||
@@ -96,55 +104,26 @@ public class SplashScreenActivity extends AppCompatActivity {
|
||||
iv.clearAnimation();
|
||||
iv.startAnimation(anim);
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
public void sendToLogin(){
|
||||
public void sendToLogin() {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
|
||||
/*
|
||||
* Showing splash screen with a timer. This will be useful when you
|
||||
* want to show case your app logo / company
|
||||
*/
|
||||
/*
|
||||
* Showing splash screen with a timer. This will be useful when you
|
||||
* want to show case your app logo / company
|
||||
*/
|
||||
|
||||
@Override
|
||||
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
|
||||
String mpin = preferences.getString(CommonString.MPIN, null);
|
||||
if(mpin!=null){
|
||||
if (mpin != null) {
|
||||
Intent in = new Intent(context, MPinActivity.class);
|
||||
in.putExtra(CommonString.IS_PASSWORD_CHECK, true);
|
||||
startActivity(in);
|
||||
|
||||
finish();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Intent i = new Intent(context, LoginActivity.class);
|
||||
startActivity(i);
|
||||
finish();
|
||||
@@ -156,7 +135,7 @@ public class SplashScreenActivity extends AppCompatActivity {
|
||||
|
||||
public static String getCalculatedDate(String date, String dateFormat, int days) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
SimpleDateFormat s = new SimpleDateFormat(dateFormat);
|
||||
@SuppressLint("SimpleDateFormat") SimpleDateFormat s = new SimpleDateFormat(dateFormat);
|
||||
cal.add(Calendar.DAY_OF_YEAR, days);
|
||||
try {
|
||||
return s.format(new Date(s.parse(date).getTime()));
|
||||
@@ -167,14 +146,4 @@ public class SplashScreenActivity extends AppCompatActivity {
|
||||
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.preference.PreferenceManager;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -44,12 +45,9 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
||||
private ProgressBar pb;
|
||||
private TextView percentage, message;
|
||||
private Data data;
|
||||
|
||||
String path = "", p, s;
|
||||
|
||||
ProgressBar progressBar;
|
||||
private boolean status;
|
||||
|
||||
private SharedPreferences preferences;
|
||||
|
||||
@Override
|
||||
@@ -144,11 +142,13 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
||||
String size = new DecimalFormat("##.##")
|
||||
.format((double) ((double) length / 1024) / 1024)
|
||||
+ " MB";
|
||||
Log.e("appsize",size);
|
||||
|
||||
String PATH = Environment.getExternalStorageDirectory()
|
||||
+ "/download/";
|
||||
/*String PATH = Environment.getExternalStorageDirectory()
|
||||
+ "/download/";*/
|
||||
String PATH = CommonString.getApkFolder(context);
|
||||
File file = new File(PATH);
|
||||
file.mkdirs();
|
||||
// file.mkdirs();
|
||||
File outputFile = new File(file, "app.apk");
|
||||
FileOutputStream fos = new FileOutputStream(outputFile);
|
||||
|
||||
@@ -187,7 +187,6 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
||||
AutoUpdateActivity.this,
|
||||
AlertMessage.MESSAGE_EXCEPTION, "download", e);*/
|
||||
runOnUiThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// TODO Auto-generated method stub
|
||||
@@ -196,9 +195,6 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
||||
});
|
||||
} catch (MalformedURLException e) {
|
||||
|
||||
/* final AlertMessage message = new AlertMessage(
|
||||
AutoUpdateActivity.this,
|
||||
AlertMessage.MESSAGE_EXCEPTION, "download", e);*/
|
||||
runOnUiThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
@@ -209,9 +205,6 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
||||
});
|
||||
|
||||
} catch (IOException e) {
|
||||
/* final AlertMessage message = new AlertMessage(
|
||||
AutoUpdateActivity.this,
|
||||
AlertMessage.MESSAGE_SOCKETEXCEPTION, "update", e);*/
|
||||
runOnUiThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
@@ -221,9 +214,6 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
/* final AlertMessage message = new AlertMessage(
|
||||
AutoUpdateActivity.this,
|
||||
AlertMessage.MESSAGE_EXCEPTION, "download", e);*/
|
||||
runOnUiThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
@@ -255,9 +245,7 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
||||
|
||||
if (result.equals(CommonString.KEY_SUCCESS)) {
|
||||
|
||||
File toInstall = new File(Environment.getExternalStorageDirectory()
|
||||
+ "/download/"
|
||||
+ "app.apk");
|
||||
File toInstall = new File(CommonString.getApkFolder(context) + "app.apk");
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
Uri apkUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", toInstall);
|
||||
@@ -292,17 +280,10 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
||||
builder.setMessage(str).setCancelable(false)
|
||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
/* Intent i = new Intent(activity, StorelistActivity.class);
|
||||
activity.startActivity(i);
|
||||
activity.finish();*/
|
||||
finish();
|
||||
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -12,9 +12,11 @@ import android.preference.PreferenceManager;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Locale;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
|
||||
import cpm.com.gskmtorange.R;
|
||||
@@ -25,9 +27,7 @@ import cpm.com.gskmtorange.interfaces.DialogCallbackListener;
|
||||
*/
|
||||
|
||||
public class CommonFunctions {
|
||||
|
||||
public static boolean updateLangResources(Context context, String language) {
|
||||
|
||||
String lang;
|
||||
if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ENGLISH)) {
|
||||
lang = CommonString.KEY_RETURE_LANGUAGE_ENGLISH;
|
||||
@@ -37,40 +37,60 @@ public class CommonFunctions {
|
||||
lang = CommonString.KEY_RETURE_LANGUAGE_TURKISH;
|
||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
|
||||
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;
|
||||
}else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_EGYPT)) {
|
||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_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;
|
||||
}
|
||||
|
||||
Locale locale = new Locale(lang);
|
||||
Locale.setDefault(locale);
|
||||
|
||||
Resources resources = context.getResources();
|
||||
|
||||
Configuration configuration = resources.getConfiguration();
|
||||
configuration.locale = locale;
|
||||
|
||||
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static String getCurrentTimeWithLanguage(Context context) {
|
||||
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
|
||||
Calendar m_cal = Calendar.getInstance();
|
||||
|
||||
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)
|
||||
////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_JORDAN)
|
||||
|| preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_EGYPT)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}
|
||||
|
||||
return cdate;
|
||||
}
|
||||
|
||||
@@ -87,6 +107,25 @@ public class CommonFunctions {
|
||||
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) {
|
||||
final ImageView iv = imageView;
|
||||
ViewTreeObserver viewTreeObserver = iv.getViewTreeObserver();
|
||||
@@ -101,8 +140,7 @@ public class CommonFunctions {
|
||||
});
|
||||
}
|
||||
|
||||
private static Bitmap decodeSampledBitmapFromPath(String path,
|
||||
int reqWidth, int reqHeight) {
|
||||
private static Bitmap decodeSampledBitmapFromPath(String path, int reqWidth, int reqHeight) {
|
||||
// First decode with inJustDecodeBounds = true to check dimensions
|
||||
final BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
options.inJustDecodeBounds = true;
|
||||
@@ -136,7 +174,7 @@ public class CommonFunctions {
|
||||
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];
|
||||
|
||||
@@ -171,12 +209,9 @@ public class CommonFunctions {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
|
||||
// create alert dialog
|
||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||
|
||||
// show it
|
||||
alertDialog.show();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
package cpm.com.gskmtorange.constant;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Environment;
|
||||
|
||||
import cpm.com.gskmtorange.AppUtils;
|
||||
|
||||
/**
|
||||
* Created by yadavendras on 19-12-2016.
|
||||
*/
|
||||
|
||||
public class CommonString {
|
||||
|
||||
public static final String BACKUP_PATH = Environment.getExternalStorageDirectory().getPath()+ "/gsk_orange_backup";
|
||||
// String path = Environment.getExternalStorageDirectory().getPath()+ "/gsk_orange_backup";
|
||||
|
||||
public static final String BACKUP_PATH = Environment.getExternalStorageDirectory().getPath() + "/gsk_orange_backup";
|
||||
// webservice constants
|
||||
|
||||
// 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_PASSWORD = "password";
|
||||
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_DOWNLOAD_DONE = "IS_DOWNLOAD_DONE";
|
||||
public static final String KEY_STOCK_MAPPING = "STOCK_MAPPING";
|
||||
|
||||
//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 TABLE_INSERT_STOCK_DIALOG = "STOCK_DIALOG";
|
||||
|
||||
|
||||
public static final String KEY_P = "P";
|
||||
public static final String KEY_D = "D";
|
||||
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_ID = "SUB_CATEGORY_ID";
|
||||
public static final String KEY_FROM = "FROM";
|
||||
public static final String KEY_CHAT_ID= "CHAT_ID";
|
||||
public static final String KEY_MESSAGE= "MESSAGE";
|
||||
public static final String KEY_CHAT_ID = "CHAT_ID";
|
||||
public static final String KEY_MESSAGE = "MESSAGE";
|
||||
|
||||
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_HORIZONTAL = 200;
|
||||
|
||||
public static String URL = "http://gskme.parinaam.in/Gskwebservice.asmx";
|
||||
|
||||
//temp remove
|
||||
//public static String URL = "http://gskmetest.parinaam.in/Gskwebservice.asmx";
|
||||
// public static String URL = "http://gskme.parinaam.in/Gskwebservice.asmx";
|
||||
public static String URL = "https://haleonme.parinaam.in/Gskwebservice.asmx";
|
||||
// public static String URL = "https://gskme1.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 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 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/"
|
||||
+ METHOD_UPLOAD_COVERAGE;
|
||||
@@ -246,7 +250,11 @@ public class CommonString {
|
||||
+ KEY_COVERAGE_REMARK + " VARCHAR,"
|
||||
+ KEY_CHECKOUT_IMAGE + " 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";
|
||||
@@ -266,10 +274,10 @@ public class CommonString {
|
||||
|
||||
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_STORE_NAME+ " NVARCHAR,"
|
||||
+ KEY_STORE_NAME + " NVARCHAR,"
|
||||
+ KEY_ADDRESS + " VARCHAR,"
|
||||
+ KEY_IMAGE + " VARCHAR,"
|
||||
+ KEY_IMAGE1 + " VARCHAR,"
|
||||
@@ -933,16 +941,27 @@ public class CommonString {
|
||||
|
||||
public static final String KEY_LANGUAGE_TURKISH = "TURKISH";
|
||||
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_RETURE_LANGUAGE_OMAN = "EN";
|
||||
|
||||
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_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 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";
|
||||
|
||||
@@ -952,48 +971,78 @@ public class CommonString {
|
||||
+ "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 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";
|
||||
@@ -1057,7 +1106,10 @@ public class CommonString {
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "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"
|
||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||
|
||||
+ KEY_VISIT_DATE
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "Store_Id"
|
||||
+ " INTEGER,"
|
||||
|
||||
@@ -1218,15 +1273,29 @@ public class CommonString {
|
||||
+ "COMPANY_ID"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "FACING"
|
||||
+ " REAL,"
|
||||
|
||||
+ "STOCK"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "PRICING"
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "PRICING_DEFAULT"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ POSM_STOCK
|
||||
+ " INTEGER,"
|
||||
|
||||
+ WAREHOUSE_STOCK
|
||||
+ " INTEGER,"
|
||||
|
||||
+ "TOGGLE_VALUE"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "MUST_HAVE"
|
||||
+ " VARCHAR"
|
||||
|
||||
+ ")";
|
||||
|
||||
public static final String TABLE_INSERT_STORE_PROFILE_DATA = "Store_Profile_Data";
|
||||
@@ -1258,7 +1327,7 @@ public class CommonString {
|
||||
+ KEY_IMAGE4 + " INTEGER)";
|
||||
|
||||
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 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() + "/";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+224
-386
@@ -1,5 +1,6 @@
|
||||
package cpm.com.gskmtorange.dailyentry;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.ActivityNotFoundException;
|
||||
@@ -14,6 +15,7 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.method.DigitsKeyListener;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
@@ -41,6 +43,7 @@ import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
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.SkuMasterGetterSetter;
|
||||
|
||||
public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener, View.OnClickListener{
|
||||
public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener, View.OnClickListener {
|
||||
|
||||
private Context context;
|
||||
GSKOrangeDB db;
|
||||
String store_id, visit_date, username, intime, date;
|
||||
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;
|
||||
Spinner spinner_sub_category_list, spinner_brand_list, spinner_sku_list, sp_flasher;
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list;
|
||||
ArrayList<BrandMasterGetterSetter> brand_list = new ArrayList<>();
|
||||
ArrayList<SkuMasterGetterSetter> sku_list= new ArrayList<>();
|
||||
ArrayList<SkuMasterGetterSetter> sku_list = new ArrayList<>();
|
||||
Toolbar toolbar;
|
||||
FloatingActionButton fab_save, fab_add;
|
||||
|
||||
@@ -108,6 +111,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
img_cam = (ImageView) findViewById(R.id.img_promotion_add);
|
||||
lin_parent = (LinearLayout) findViewById(R.id.lin_parent_promo);
|
||||
btntoggle = (ToggleButton) findViewById(R.id.btntoggle);
|
||||
|
||||
context = this;
|
||||
//preference data
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
@@ -115,6 +119,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
username = preferences.getString(CommonString.KEY_USERNAME, 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, ""));
|
||||
|
||||
@@ -127,32 +132,30 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
|
||||
//Enable camera compulsory According to Configuration
|
||||
ArrayList<ConfigurationMasterGetterSetter> configurationData = db.getConfigurationMasterData(country_id);
|
||||
if(configurationData.size()>0){
|
||||
for(int i=0; i<configurationData.size();i++){
|
||||
if (configurationData.size() > 0) {
|
||||
for (int i = 0; i < configurationData.size(); i++) {
|
||||
|
||||
if(configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("ADDITIONAL_PROMO_SKUWISE_IMAGE_MANDATORY") &&
|
||||
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")){
|
||||
if (configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("ADDITIONAL_PROMO_SKUWISE_IMAGE_MANDATORY") && configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")) {
|
||||
is_camera_compulsory = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(is_camera_compulsory){
|
||||
if (is_camera_compulsory) {
|
||||
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
||||
}
|
||||
|
||||
//Promo SKU List
|
||||
exists_data = db.getPromoComplianceSkuwiseExistsAfterData(store_id, categoryId);
|
||||
|
||||
if(exists_data.size()>0){
|
||||
if (exists_data.size() > 0) {
|
||||
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);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
fab_add.hide();//.setVisibility(View.GONE);
|
||||
added_promo_list.clear();
|
||||
if(promoAdapter!=null){
|
||||
if (promoAdapter != null) {
|
||||
promoAdapter.list.clear();
|
||||
promoAdapter.notifyDataSetChanged();
|
||||
}
|
||||
@@ -163,7 +166,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
|
||||
btntoggle.setChecked(isExists);
|
||||
|
||||
if(added_promo_list.size()>0){
|
||||
if (added_promo_list.size() > 0) {
|
||||
rec_added_promo.setLayoutManager(new LinearLayoutManager(context));
|
||||
promoAdapter = new PromoAdapter(added_promo_list);
|
||||
rec_added_promo.setAdapter(promoAdapter);
|
||||
@@ -211,93 +214,72 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
toolbar.setTitle(getResources().getString(R.string.title_activity_promo_compliance));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
|
||||
switch (parent.getId()) {
|
||||
case R.id.sp_sub_category:
|
||||
if (parent.getId() == R.id.sp_sub_category) {
|
||||
|
||||
if(position!=0){
|
||||
sub_category = sub_category_list.get(position).getSub_category();
|
||||
sub_category_id = sub_category_list.get(position).getSub_category_id();
|
||||
if (position != 0) {
|
||||
sub_category = sub_category_list.get(position).getSub_category();
|
||||
sub_category_id = sub_category_list.get(position).getSub_category_id();
|
||||
|
||||
brand_list = db.getBrandMasterDataBySubCategory(sub_category_id);
|
||||
brand_list = db.getBrandMasterDataBySubCategory(sub_category_id);
|
||||
|
||||
BrandMasterGetterSetter brand_select = new BrandMasterGetterSetter();
|
||||
String str = getResources().getString(R.string.select);
|
||||
brand_select.setBRAND(str);
|
||||
brand_select.setBRAND_ID("0");
|
||||
brand_list.add(0, brand_select);
|
||||
CustomBrandAdapter adapter = new CustomBrandAdapter(AdditionalPromoSKUwiseActivity.this, R.layout.custom_spinner_item, brand_list);
|
||||
BrandMasterGetterSetter brand_select = new BrandMasterGetterSetter();
|
||||
String str = getResources().getString(R.string.select);
|
||||
brand_select.setBRAND(str);
|
||||
brand_select.setBRAND_ID("0");
|
||||
brand_list.add(0, brand_select);
|
||||
|
||||
spinner_brand_list.setAdapter(adapter);
|
||||
spinner_brand_list.setOnItemSelectedListener(this);
|
||||
}
|
||||
else {
|
||||
CustomBrandAdapter adapter = new CustomBrandAdapter(AdditionalPromoSKUwiseActivity.this, R.layout.custom_spinner_item, brand_list);
|
||||
spinner_brand_list.setAdapter(adapter);
|
||||
spinner_brand_list.setOnItemSelectedListener(this);
|
||||
} else {
|
||||
clearBrandSpinner();
|
||||
}
|
||||
|
||||
clearBrandSpinner();
|
||||
}
|
||||
} else if (parent.getId() == R.id.sp_brand) {
|
||||
|
||||
break;
|
||||
if (position != 0) {
|
||||
brand = brand_list.get(position).getBRAND().get(0);
|
||||
brand_id = brand_list.get(position).getBRAND_ID().get(0);
|
||||
|
||||
case R.id.sp_brand:
|
||||
sku_list = db.getSKUMasterNewData(brand_id);
|
||||
|
||||
if(position!=0){
|
||||
brand = brand_list.get(position).getBRAND().get(0);
|
||||
brand_id = brand_list.get(position).getBRAND_ID().get(0);
|
||||
SkuMasterGetterSetter sku_select = new SkuMasterGetterSetter();
|
||||
String str = getResources().getString(R.string.select);
|
||||
sku_select.setSKU(str);
|
||||
sku_select.setSKU_ID("0");
|
||||
sku_list.add(0, sku_select);
|
||||
|
||||
sku_list = db.getSKUMasterNewData(brand_id);
|
||||
CustomSkuAdapter adapter = new CustomSkuAdapter(AdditionalPromoSKUwiseActivity.this, R.layout.custom_spinner_item, sku_list);
|
||||
spinner_sku_list.setAdapter(adapter);
|
||||
spinner_sku_list.setOnItemSelectedListener(this);
|
||||
} else {
|
||||
clearSkuSpinner();
|
||||
}
|
||||
|
||||
SkuMasterGetterSetter sku_select = new SkuMasterGetterSetter();
|
||||
String str = getResources().getString(R.string.select);
|
||||
sku_select.setSKU(str);
|
||||
sku_select.setSKU_ID("0");
|
||||
sku_list.add(0, sku_select);
|
||||
CustomSkuAdapter adapter = new CustomSkuAdapter(AdditionalPromoSKUwiseActivity.this, R.layout.custom_spinner_item, sku_list);
|
||||
} else if (parent.getId() == R.id.sp_sku) {
|
||||
|
||||
spinner_sku_list.setAdapter(adapter);
|
||||
spinner_sku_list.setOnItemSelectedListener(this);
|
||||
}
|
||||
else {
|
||||
if (position != 0) {
|
||||
sku = sku_list.get(position).getSKU().get(0);
|
||||
sku_id = sku_list.get(position).getSKU_ID().get(0);
|
||||
}
|
||||
|
||||
clearSkuSpinner();
|
||||
}
|
||||
} else if (parent.getId() == R.id.sp_flasher) {
|
||||
|
||||
break;
|
||||
|
||||
case R.id.sp_sku:
|
||||
|
||||
if(position!=0) {
|
||||
sku = sku_list.get(position).getSKU().get(0);
|
||||
sku_id = sku_list.get(position).getSKU_ID().get(0);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case R.id.sp_flasher:
|
||||
|
||||
switch (position){
|
||||
|
||||
case 0:
|
||||
|
||||
price_flasher_available = -1;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
price_flasher_available = 1;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
price_flasher_available = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
if (position == 0) {
|
||||
price_flasher_available = -1;
|
||||
} else if (position == 1) {
|
||||
price_flasher_available = 1;
|
||||
} else if (position == 2) {
|
||||
price_flasher_available = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -305,7 +287,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
|
||||
}
|
||||
|
||||
void clearBrandSpinner(){
|
||||
void clearBrandSpinner() {
|
||||
brand_list.clear();
|
||||
|
||||
BrandMasterGetterSetter brand_select = new BrandMasterGetterSetter();
|
||||
@@ -319,7 +301,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
spinner_brand_list.setOnItemSelectedListener(this);
|
||||
}
|
||||
|
||||
void clearSkuSpinner(){
|
||||
void clearSkuSpinner() {
|
||||
sku_list.clear();
|
||||
|
||||
SkuMasterGetterSetter sku_select = new SkuMasterGetterSetter();
|
||||
@@ -337,203 +319,154 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
public void onClick(View v) {
|
||||
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 (added_promo_list.size() == 0) {
|
||||
valid_flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(isExists){
|
||||
if(added_promo_list.size()==0){
|
||||
valid_flag = false;
|
||||
}
|
||||
if (!valid_flag) {
|
||||
Snackbar.make(rec_added_promo, R.string.title_activity_Want_add, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (isdata_added) {
|
||||
db.InsertPromoSKUwiseData(added_promo_list, categoryId, store_id, isExists);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
|
||||
} else if (id == R.id.fab_add) {
|
||||
|
||||
discount = et_discount.getText().toString();
|
||||
price = et_price.getText().toString();
|
||||
|
||||
if (sub_category.equals("")) {
|
||||
Snackbar.make(rec_added_promo, R.string.pls_select_sub_category, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (brand.equals("")) {
|
||||
Snackbar.make(rec_added_promo, R.string.pls_select_brand, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (sku.equals("")) {
|
||||
Snackbar.make(rec_added_promo, R.string.pls_select_sku, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (price.equals("")) {
|
||||
Snackbar.make(rec_added_promo, R.string.pls_enter_price, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (!price.equals("") && price.substring(0, 1).equals(".")) {
|
||||
Snackbar.make(rec_added_promo, R.string.incorrect_price, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (is_camera_compulsory && img_str.equals("")) {
|
||||
Snackbar.make(rec_added_promo, R.string.click_image, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (price_flasher_available == -1) {
|
||||
Snackbar.make(rec_added_promo, R.string.pls_select_price, Snackbar.LENGTH_SHORT).show();
|
||||
} else {
|
||||
PromoComplianceSkuwiseGetterSetter promo = new PromoComplianceSkuwiseGetterSetter();
|
||||
promo.setBrand(brand);
|
||||
promo.setBrand_id(brand_id);
|
||||
promo.setSub_category(sub_category);
|
||||
promo.setSub_category_id(sub_category_id);
|
||||
promo.setSku(sku);
|
||||
promo.setSku_id(sku_id);
|
||||
promo.setImg(img_str);
|
||||
promo.setDiscount_value(discount);
|
||||
promo.setPrice(price);
|
||||
promo.setPrice_flasher(price_flasher_available);
|
||||
added_promo_list.add(promo);
|
||||
|
||||
rec_added_promo.setLayoutManager(new LinearLayoutManager(context));
|
||||
PromoAdapter gapAdapter = new PromoAdapter(added_promo_list);
|
||||
rec_added_promo.setAdapter(gapAdapter);
|
||||
|
||||
sub_category = "";
|
||||
sub_category_id = "0";
|
||||
brand = "";
|
||||
brand_id = "0";
|
||||
sku = "";
|
||||
sku_id = "0";
|
||||
discount = "";
|
||||
price = "";
|
||||
img_str = "";
|
||||
price_flasher_available = -1;
|
||||
|
||||
et_discount.setText("");
|
||||
et_price.setText("");
|
||||
spinner_sub_category_list.setSelection(0);
|
||||
clearBrandSpinner();
|
||||
clearSkuSpinner();
|
||||
sp_flasher.setSelection(0);
|
||||
|
||||
if (is_camera_compulsory) {
|
||||
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
||||
} else {
|
||||
img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
||||
}
|
||||
|
||||
if(!valid_flag){
|
||||
Snackbar.make(rec_added_promo, R.string.title_activity_Want_add,Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
else if(isdata_added){
|
||||
isdata_added = true;
|
||||
}
|
||||
|
||||
db.InsertPromoSKUwiseData(added_promo_list, categoryId, store_id, isExists);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
} else if (id == R.id.img_promotion_add) {
|
||||
|
||||
/*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) {
|
||||
_pathforcheck = "Additional_Promo_Skuwise_Image" + store_id + categoryId + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||
|
||||
startCameraActivity(1);
|
||||
|
||||
} else if (id == R.id.btntoggle) {
|
||||
|
||||
isExists = btntoggle.isChecked();
|
||||
|
||||
if (isExists) {
|
||||
lin_parent.setVisibility(View.VISIBLE);
|
||||
fab_add.show();
|
||||
} 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();
|
||||
added_promo_list.clear();
|
||||
|
||||
rec_added_promo.setLayoutManager(new LinearLayoutManager(context));
|
||||
promoAdapter = new PromoAdapter(added_promo_list);
|
||||
rec_added_promo.setAdapter(promoAdapter);
|
||||
|
||||
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);
|
||||
}
|
||||
})
|
||||
.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();
|
||||
isdata_added = true;
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
btntoggle.setChecked(true);
|
||||
}
|
||||
});
|
||||
|
||||
// show it
|
||||
alertDialog.show();*/
|
||||
|
||||
}else {
|
||||
finish();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case R.id.fab_add:
|
||||
|
||||
discount = et_discount.getText().toString();
|
||||
price = et_price.getText().toString();
|
||||
|
||||
if(sub_category.equals("")){
|
||||
Snackbar.make(rec_added_promo, R.string.pls_select_sub_category,Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
else if(brand.equals("")){
|
||||
Snackbar.make(rec_added_promo, R.string.pls_select_brand,Snackbar.LENGTH_SHORT).show();
|
||||
}else if(sku.equals("")){
|
||||
Snackbar.make(rec_added_promo, R.string.pls_select_sku,Snackbar.LENGTH_SHORT).show();
|
||||
}/*else if(discount.equals("")){
|
||||
Snackbar.make(rec_added_promo, R.string.pls_enter_discount,Snackbar.LENGTH_SHORT).show();
|
||||
}*/else if(price.equals("")){
|
||||
Snackbar.make(rec_added_promo, R.string.pls_enter_price,Snackbar.LENGTH_SHORT).show();
|
||||
}else if(is_camera_compulsory && img_str.equals("")){
|
||||
Snackbar.make(rec_added_promo, R.string.click_image,Snackbar.LENGTH_SHORT).show();
|
||||
}else if(price_flasher_available==-1){
|
||||
Snackbar.make(rec_added_promo, R.string.pls_select_price,Snackbar.LENGTH_SHORT).show();
|
||||
}else {
|
||||
PromoComplianceSkuwiseGetterSetter promo = new PromoComplianceSkuwiseGetterSetter();
|
||||
promo.setBrand(brand);
|
||||
promo.setBrand_id(brand_id);
|
||||
promo.setSub_category(sub_category);
|
||||
promo.setSub_category_id(sub_category_id);
|
||||
promo.setSku(sku);
|
||||
promo.setSku_id(sku_id);
|
||||
promo.setImg(img_str);
|
||||
promo.setDiscount_value(discount);
|
||||
promo.setPrice(price);
|
||||
promo.setPrice_flasher(price_flasher_available);
|
||||
|
||||
added_promo_list.add(promo);
|
||||
|
||||
rec_added_promo.setLayoutManager(new LinearLayoutManager(context));
|
||||
PromoAdapter gapAdapter = new PromoAdapter(added_promo_list);
|
||||
rec_added_promo.setAdapter(gapAdapter);
|
||||
|
||||
sub_category = "";
|
||||
sub_category_id = "0";
|
||||
brand= "";
|
||||
brand_id = "0";
|
||||
sku = "";
|
||||
sku_id = "0";
|
||||
discount = "";
|
||||
price = "";
|
||||
img_str = "";
|
||||
price_flasher_available = -1;
|
||||
|
||||
et_discount.setText("");
|
||||
et_price.setText("");
|
||||
spinner_sub_category_list.setSelection(0);
|
||||
clearBrandSpinner();
|
||||
clearSkuSpinner();
|
||||
sp_flasher.setSelection(0);
|
||||
|
||||
if(is_camera_compulsory){
|
||||
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
||||
}
|
||||
else {
|
||||
img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
||||
}
|
||||
isdata_added = true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case R.id.img_promotion_add:
|
||||
|
||||
_pathforcheck = "Additional_Promo_Skuwise_Image" + store_id + categoryId + visit_date.replace("/", "") + "_" +
|
||||
CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
|
||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||
|
||||
startCameraActivity(1);
|
||||
break;
|
||||
|
||||
case R.id.btntoggle:
|
||||
isExists = btntoggle.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(context));
|
||||
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);
|
||||
btntoggle.setChecked(true);
|
||||
}
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
break;
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -542,7 +475,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
|
||||
Log.i("Stock & Facing ", "startCameraActivity()");
|
||||
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 = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
@@ -607,7 +540,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
case -1:
|
||||
|
||||
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);
|
||||
|
||||
@@ -632,10 +565,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
/*************
|
||||
* CustomBrandAdapter Constructor
|
||||
*****************/
|
||||
public CustomBrandAdapter(
|
||||
AdditionalPromoSKUwiseActivity activitySpinner,
|
||||
int textViewResourceId,
|
||||
ArrayList objects
|
||||
public CustomBrandAdapter(AdditionalPromoSKUwiseActivity activitySpinner, int textViewResourceId, ArrayList objects
|
||||
|
||||
) {
|
||||
super(activitySpinner, textViewResourceId, objects);
|
||||
@@ -694,10 +624,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
/*************
|
||||
* CustomSkuAdapter Constructor
|
||||
*****************/
|
||||
public CustomSkuAdapter(
|
||||
AdditionalPromoSKUwiseActivity activitySpinner,
|
||||
int textViewResourceId,
|
||||
ArrayList objects
|
||||
public CustomSkuAdapter(AdditionalPromoSKUwiseActivity activitySpinner, int textViewResourceId, ArrayList objects
|
||||
|
||||
) {
|
||||
super(activitySpinner, textViewResourceId, objects);
|
||||
@@ -756,10 +683,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
/*************
|
||||
* CustomSubCategoryAdapter Constructor
|
||||
*****************/
|
||||
public CustomSubCategoryAdapter(
|
||||
AdditionalPromoSKUwiseActivity activitySpinner,
|
||||
int textViewResourceId,
|
||||
ArrayList objects
|
||||
public CustomSubCategoryAdapter(AdditionalPromoSKUwiseActivity activitySpinner, int textViewResourceId, ArrayList objects
|
||||
|
||||
) {
|
||||
super(activitySpinner, textViewResourceId, objects);
|
||||
@@ -818,8 +742,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.item_added_promo, parent, false);
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_added_promo, parent, false);
|
||||
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_price.setText(getString(R.string.price) + " - " + mItem.getPrice());
|
||||
String exists = "";
|
||||
if(mItem.getPrice_flasher()==1){
|
||||
if (mItem.getPrice_flasher() == 1) {
|
||||
exists = getString(R.string.yes);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
exists = getString(R.string.no);
|
||||
}
|
||||
holder.tv_promo_flasher_exists.setText(" - " + exists);
|
||||
@@ -870,90 +792,12 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("MissingSuperCall")
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
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
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
@@ -973,28 +817,25 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
void ischanged(){
|
||||
if(isdata_added){
|
||||
void ischanged() {
|
||||
if (isdata_added) {
|
||||
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) {
|
||||
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) {
|
||||
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
}).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
super.onBackPressed();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
@@ -1010,10 +851,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
||||
/*************
|
||||
* CustomAdapter Constructor
|
||||
*****************/
|
||||
public CustomSpinnerAdapter(
|
||||
AdditionalPromoSKUwiseActivity activitySpinner,
|
||||
int textViewResourceId,
|
||||
ArrayList objects
|
||||
public CustomSpinnerAdapter(AdditionalPromoSKUwiseActivity activitySpinner, int textViewResourceId, ArrayList objects
|
||||
|
||||
) {
|
||||
super(activitySpinner, textViewResourceId, objects);
|
||||
|
||||
@@ -183,7 +183,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
|
||||
btntoggle.setChecked(true);
|
||||
|
||||
str = CommonString.FILE_PATH;
|
||||
str = CommonString.getImagesFolder(context);
|
||||
|
||||
///band List
|
||||
|
||||
@@ -194,13 +194,10 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
brand.setBRAND(str);
|
||||
brand_list.add(0, brand);
|
||||
CustomAdapter adapter = new CustomAdapter(AdditionalVisibility.this, R.layout.custom_spinner_item, brand_list);
|
||||
|
||||
spinner_brand_list.setAdapter(adapter);
|
||||
|
||||
///Display List
|
||||
|
||||
DisplayMaster_list = db.getADDITIONAL_DISPLAYData(categoryId);
|
||||
|
||||
ADDITIONAL_DISPLAY_MASTERGetterSetter select = new ADDITIONAL_DISPLAY_MASTERGetterSetter();
|
||||
select.setDISPLAY_ID(str);
|
||||
DisplayMaster_list.add(0, select);
|
||||
@@ -210,9 +207,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
spinner_brand_list.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
|
||||
if (position != 0) {
|
||||
|
||||
brand_list_name = brand_list.get(position).getBRAND().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) {
|
||||
_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);
|
||||
startCameraActivity();
|
||||
|
||||
@@ -811,7 +806,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
public void onClick(View view) {
|
||||
_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);
|
||||
startCameraActivity();
|
||||
|
||||
@@ -823,14 +818,13 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
public void onClick(View view) {
|
||||
_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);
|
||||
startCameraActivity();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
btnimage.setBackgroundResource(R.mipmap.camera_grey);
|
||||
btnimage1.setBackgroundResource(R.mipmap.camera_grey);
|
||||
@@ -928,14 +922,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
webView.getSettings().setAllowFileAccess(true);
|
||||
webView.getSettings().setJavaScriptEnabled(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>";
|
||||
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
||||
@@ -1313,14 +1300,14 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
public void showSkuDialog() {
|
||||
|
||||
final ArrayList<BrandMasterGetterSetter> brandList;
|
||||
/* if(country_id.equals("7")){
|
||||
/* if(country_id.equals("]")){
|
||||
brandList = db.getBrandT2PData(null, null, null, categoryId, store_id);
|
||||
}
|
||||
else {
|
||||
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);
|
||||
} 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);
|
||||
@@ -1438,7 +1425,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Create custom adapter object ( see below CustomAdapter.java )
|
||||
CustomAdapter adapter = new CustomAdapter(AdditionalVisibility.this, R.layout.custom_spinner_item, brandList);
|
||||
// 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_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);
|
||||
}
|
||||
else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
@@ -1872,9 +1858,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
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;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.ActivityNotFoundException;
|
||||
@@ -14,6 +15,9 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.InputFilter;
|
||||
import android.text.InputType;
|
||||
import android.text.Spanned;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
@@ -35,7 +39,6 @@ import androidx.cardview.widget.CardView;
|
||||
import androidx.core.content.FileProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
|
||||
@@ -44,6 +47,8 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
||||
@@ -61,7 +66,7 @@ public class AuditActivity extends AppCompatActivity {
|
||||
boolean checkflag = true;
|
||||
private SharedPreferences preferences;
|
||||
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;
|
||||
ArrayList<AuditDataGetterSetter> question_list = new ArrayList<>(), childListData;
|
||||
HashMap<AuditDataGetterSetter, ArrayList<AuditDataGetterSetter>> hashMapAnsListChildData;
|
||||
@@ -96,11 +101,8 @@ public class AuditActivity extends AppCompatActivity {
|
||||
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||
|
||||
toolbar.setTitle(getResources().getString(R.string.audit));
|
||||
|
||||
str = CommonString.FILE_PATH;
|
||||
|
||||
str = CommonString.getImagesFolder(context);
|
||||
recyclerView = (RecyclerView) findViewById(R.id.list);
|
||||
|
||||
db = new GSKOrangeDB(this);
|
||||
@@ -113,9 +115,7 @@ public class AuditActivity extends AppCompatActivity {
|
||||
//Header
|
||||
question_list = db.getAfterSaveAuditQuestionAnswerData(store_id, categoryId);
|
||||
if (question_list.size() == 0) {
|
||||
|
||||
question_list = getAuditQnsRemoved();
|
||||
|
||||
}
|
||||
|
||||
hashMapAnsListChildData = new HashMap<>();
|
||||
@@ -143,15 +143,39 @@ public class AuditActivity extends AppCompatActivity {
|
||||
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() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
if (question_list.size() > 0) {
|
||||
|
||||
recyclerView.clearFocus();
|
||||
|
||||
if (validateData(question_list)) {
|
||||
db.saveAuditQuestionAnswerData(question_list, store_id, categoryId);
|
||||
finish();
|
||||
@@ -163,7 +187,6 @@ public class AuditActivity extends AppCompatActivity {
|
||||
} else {
|
||||
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 flag_t2p_mapping;
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId,CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
}
|
||||
else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId,CommonString.TABLE_MAPPING_T2P);
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||
} else {
|
||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P);
|
||||
}
|
||||
|
||||
if (flag_t2p_mapping) {
|
||||
@@ -196,7 +218,6 @@ public class AuditActivity extends AppCompatActivity {
|
||||
if (!t2p_flag) {
|
||||
if (db.additionalVisibilitydata(store_id, categoryId)) {
|
||||
ArrayList<AddittionalGetterSetter> additionalList = db.getAdditionalMainStock(store_id, categoryId);
|
||||
|
||||
for (int i = 0; i < additionalList.size(); i++) {
|
||||
if (additionalList.get(i).getBtn_toogle().equals("1")) {
|
||||
t2p_flag = true;
|
||||
@@ -207,7 +228,6 @@ public class AuditActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(categoryId, storeType_id);
|
||||
|
||||
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
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) {
|
||||
iterator.remove();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,9 +258,7 @@ public class AuditActivity extends AppCompatActivity {
|
||||
// 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) {
|
||||
|
||||
if (question_list.size() > 0) {
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AuditActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
@@ -250,15 +267,13 @@ public class AuditActivity extends AppCompatActivity {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
}).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
} else {
|
||||
@@ -272,15 +287,13 @@ public class AuditActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
//super.onBackPressed();
|
||||
|
||||
super.onBackPressed();
|
||||
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.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) {
|
||||
|
||||
finish();
|
||||
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();
|
||||
} else {
|
||||
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> {
|
||||
ArrayList<AuditDataGetterSetter> questionList;
|
||||
HashMap<AuditDataGetterSetter, ArrayList<AuditDataGetterSetter>> answerHashMap;
|
||||
@@ -314,44 +347,92 @@ public class AuditActivity extends AppCompatActivity {
|
||||
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.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);
|
||||
|
||||
if (holder.data.getANSWER_TYPE().equalsIgnoreCase("Dropdown")) {
|
||||
holder.sp_auditAnswer.setVisibility(View.VISIBLE);
|
||||
holder.sp_auditAnswer.setId(position);
|
||||
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);
|
||||
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.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")) {
|
||||
holder.parent_cam_layout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
holder.parent_cam_layout.setId(position);
|
||||
} else {
|
||||
holder.parent_cam_layout.setVisibility(View.GONE);
|
||||
holder.parent_cam_layout.setId(position);
|
||||
}
|
||||
//text
|
||||
if (holder.data.getREMARK_ALLOW().equals("1")) {
|
||||
holder.edt_text.setVisibility(View.VISIBLE);
|
||||
holder.edt_text.setId(position);
|
||||
|
||||
holder.txt_leval.setVisibility(View.VISIBLE);
|
||||
holder.txt_leval.setText(holder.data.getREMARK_LEVEL());
|
||||
|
||||
}
|
||||
else {
|
||||
holder.txt_leval.setId(position);
|
||||
} else {
|
||||
holder.edt_text.setVisibility(View.GONE);
|
||||
holder.edt_text.setId(position);
|
||||
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));
|
||||
|
||||
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.setREMARK_ALLOW(ans.getREMARK_ALLOW());
|
||||
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
|
||||
if (holder.data.getREMARK_ALLOW().equals("1")) {
|
||||
holder.edt_text.setVisibility(View.VISIBLE);
|
||||
holder.txt_leval.setVisibility(View.VISIBLE);
|
||||
holder.txt_leval.setText(holder.data.getREMARK_LEVEL());
|
||||
}else {
|
||||
} else {
|
||||
holder.edt_text.setVisibility(View.GONE);
|
||||
holder.txt_leval.setVisibility(View.GONE);
|
||||
holder.data.setTXT_REMARK("");
|
||||
@@ -401,7 +485,6 @@ public class AuditActivity extends AppCompatActivity {
|
||||
holder.img_cam2.setBackgroundResource(R.mipmap.camera_orange);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
|
||||
@@ -411,9 +494,8 @@ public class AuditActivity extends AppCompatActivity {
|
||||
holder.img_cam.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
pathforcheck = store_id + "AuditAnsPic" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
|
||||
_path = CommonString.FILE_PATH + pathforcheck;
|
||||
pathforcheck = store_id + "AuditAnsPic" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
_path = CommonString.getImagesFolder(context)+ pathforcheck;
|
||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
child_position = position;
|
||||
startCameraActivity(0);
|
||||
@@ -425,7 +507,7 @@ public class AuditActivity extends AppCompatActivity {
|
||||
public void onClick(View v) {
|
||||
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);
|
||||
child_position = position;
|
||||
startCameraActivity(1);
|
||||
@@ -436,8 +518,14 @@ public class AuditActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
if (!hasFocus) {
|
||||
holder.data.setANSWER_ID("0");
|
||||
holder.data.setANSWER(((EditText) v).getText().toString().replaceAll("[&^<>{}'$]", ""));
|
||||
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(((EditText) v).getText().toString().replaceAll("[&^<>{}'$]", ""));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -447,26 +535,30 @@ public class AuditActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
if (!hasFocus) {
|
||||
// holder.data.setANSWER_ID("0");
|
||||
holder.data.setTXT_REMARK(((EditText) v).getText().toString().replaceAll("[&^<>{}'$]", ""));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
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);
|
||||
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.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.setId(position);
|
||||
}
|
||||
|
||||
if (!img_str.equals("")) {
|
||||
@@ -487,22 +579,29 @@ public class AuditActivity extends AppCompatActivity {
|
||||
|
||||
if (holder.data.getCAM_IMAGE().equals("")) {
|
||||
holder.img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
||||
holder.img_cam.setId(position);
|
||||
|
||||
} else {
|
||||
holder.img_cam.setBackgroundResource(R.mipmap.camera_green);
|
||||
holder.img_cam.setId(position);
|
||||
}
|
||||
|
||||
if (holder.data.getCAM_IMAGE2().equals("")) {
|
||||
holder.img_cam2.setBackgroundResource(R.mipmap.camera_orange);
|
||||
holder.img_cam2.setId(position);
|
||||
} else {
|
||||
holder.img_cam2.setBackgroundResource(R.mipmap.camera_green);
|
||||
holder.img_cam2.setId(position);
|
||||
}
|
||||
|
||||
|
||||
if (!checkflag) {
|
||||
if (checkHeaderArray.contains(position)) {
|
||||
holder.card_view.setBackgroundColor(getResources().getColor(R.color.red));
|
||||
holder.card_view.setId(position);
|
||||
} else {
|
||||
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 final View mView;
|
||||
public final TextView txt_question,txt_leval;
|
||||
public final TextView txt_question, txt_leval;
|
||||
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 RelativeLayout parent_cam_layout;
|
||||
CardView card_view;
|
||||
@@ -585,23 +684,26 @@ public class AuditActivity extends AppCompatActivity {
|
||||
checkHeaderArray.clear();
|
||||
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
checkflag = false;
|
||||
//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);
|
||||
checkflag = false;
|
||||
}else {
|
||||
} else {
|
||||
checkflag = true;
|
||||
}
|
||||
|
||||
@@ -620,7 +722,7 @@ public class AuditActivity extends AppCompatActivity {
|
||||
|
||||
Log.i("MakeMachine", "startCameraActivity()");
|
||||
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 = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
|
||||
@@ -37,6 +37,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
||||
@@ -86,25 +87,20 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
categoryName = getIntent().getStringExtra("categoryName");
|
||||
categoryId = getIntent().getStringExtra("categoryId");
|
||||
|
||||
//store_id = "2";
|
||||
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
||||
str = CommonString.FILE_PATH;
|
||||
str = CommonString.getImagesFolder(context);
|
||||
db = new GSKOrangeDB(CategoryPicture.this);
|
||||
db.open();
|
||||
|
||||
im1 = (ImageView) findViewById(R.id.image1);
|
||||
im2 = (ImageView) findViewById(R.id.image2);
|
||||
im3 = (ImageView) findViewById(R.id.image3);
|
||||
im4 = (ImageView) findViewById(R.id.image4);
|
||||
listview = (ListView) findViewById(R.id.listview);
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
|
||||
|
||||
adddata = db.getCategoryPictureData(store_id, categoryId);
|
||||
categoryImagesAllowed = db.getCategoryPictureAllowedData(categoryId);
|
||||
|
||||
if (categoryImagesAllowed.size() > 0) {
|
||||
setCamAllowImage(categoryImagesAllowed.get(0).isImg_cam1(), im1);
|
||||
setCamAllowImage(categoryImagesAllowed.get(0).isImg_cam2(), im2);
|
||||
@@ -124,36 +120,34 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
String image4 = adddata.get(0).getCategoryImage4();
|
||||
|
||||
if (image1 != null && !image1.equals("")) {
|
||||
im1.setBackgroundResource(R.mipmap.camera_green);
|
||||
im1.setImageResource(R.mipmap.camera_green);
|
||||
img_str1 = image1;
|
||||
}
|
||||
|
||||
if (image2 != null && !image2.equals("")) {
|
||||
im2.setBackgroundResource(R.mipmap.camera_green);
|
||||
im2.setImageResource(R.mipmap.camera_green);
|
||||
img_str2 = image2;
|
||||
}
|
||||
|
||||
if (image3 != null && !image3.equals("")) {
|
||||
im3.setBackgroundResource(R.mipmap.camera_green);
|
||||
im3.setImageResource(R.mipmap.camera_green);
|
||||
img_str3 = image3;
|
||||
}
|
||||
|
||||
if (image4 != null && !image4.equals("")) {
|
||||
im4.setBackgroundResource(R.mipmap.camera_green);
|
||||
im4.setImageResource(R.mipmap.camera_green);
|
||||
img_str4 = image4;
|
||||
}
|
||||
|
||||
} 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);
|
||||
} 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);
|
||||
} else {
|
||||
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);
|
||||
listview.setAdapter(adapteradditional);
|
||||
|
||||
@@ -161,9 +155,7 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final View view) {
|
||||
|
||||
final CategoryPictureGetterSetter CP = new CategoryPictureGetterSetter();
|
||||
|
||||
CP.setCategoryImage1(img_str1);
|
||||
CP.setCategoryImage2(img_str2);
|
||||
CP.setCategoryImage3(img_str3);
|
||||
@@ -172,55 +164,23 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
CP.setCamera_allow(camera_allow);
|
||||
|
||||
if (validateData(CP, listdat)) {
|
||||
|
||||
db.open();
|
||||
|
||||
db.InsertCategoryPictureData(CP, listdat, categoryId);
|
||||
finish();
|
||||
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 {
|
||||
Snackbar.make(view, R.string.title_activity_take_image, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
im1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
|
||||
_pathforcheck1 = store_id + "CategoryPicture1" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
|
||||
_path = CommonString.FILE_PATH + _pathforcheck1;
|
||||
_path = CommonString.getImagesFolder(context)+ _pathforcheck1;
|
||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
startCameraActivity();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -230,11 +190,9 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
|
||||
_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);
|
||||
startCameraActivity();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
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";
|
||||
|
||||
_path = CommonString.FILE_PATH + _pathforcheck3;
|
||||
_path = CommonString.getImagesFolder(context)+ _pathforcheck3;
|
||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
startCameraActivity();
|
||||
|
||||
@@ -256,7 +214,7 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
|
||||
_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);
|
||||
startCameraActivity();
|
||||
|
||||
@@ -288,9 +246,9 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
cdate = arabicToenglish(cdate);
|
||||
} 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);
|
||||
}
|
||||
|
||||
|
||||
return cdate;
|
||||
}
|
||||
|
||||
@@ -368,7 +326,7 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
if (_pathforcheck1 != null && !_pathforcheck1.equals("")) {
|
||||
if (new File(str + _pathforcheck1).exists()) {
|
||||
|
||||
im1.setBackgroundResource(R.mipmap.camera_green);
|
||||
im1.setImageResource(R.mipmap.camera_green);
|
||||
|
||||
img_str1 = _pathforcheck1;
|
||||
_pathforcheck1 = "";
|
||||
@@ -377,7 +335,7 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
if (_pathforcheck2 != null && !_pathforcheck2.equals("")) {
|
||||
if (new File(str + _pathforcheck2).exists()) {
|
||||
|
||||
im2.setBackgroundResource(R.mipmap.camera_green);
|
||||
im2.setImageResource(R.mipmap.camera_green);
|
||||
|
||||
img_str2 = _pathforcheck2;
|
||||
_pathforcheck2 = "";
|
||||
@@ -387,7 +345,7 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
if (_pathforcheck3 != null && !_pathforcheck3.equals("")) {
|
||||
if (new File(str + _pathforcheck3).exists()) {
|
||||
|
||||
im3.setBackgroundResource(R.mipmap.camera_green);
|
||||
im3.setImageResource(R.mipmap.camera_green);
|
||||
|
||||
img_str3 = _pathforcheck3;
|
||||
_pathforcheck3 = "";
|
||||
@@ -397,7 +355,7 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
if (_pathforcheck4 != null && !_pathforcheck4.equals("")) {
|
||||
if (new File(str + _pathforcheck4).exists()) {
|
||||
|
||||
im4.setBackgroundResource(R.mipmap.camera_green);
|
||||
im4.setImageResource(R.mipmap.camera_green);
|
||||
|
||||
img_str4 = _pathforcheck4;
|
||||
_pathforcheck4 = "";
|
||||
@@ -479,9 +437,7 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
convertView = mInflater
|
||||
.inflate(R.layout.contentcatgoryadpterlayout, null);
|
||||
holder = new CategoryPicture.CategoryAdapter.ViewHolder();
|
||||
|
||||
holder.brand = (TextView) convertView.findViewById(R.id.textviewname);
|
||||
|
||||
holder.camera1 = (Button) convertView.findViewById(R.id.button3);
|
||||
holder.camera2 = (Button) convertView.findViewById(R.id.cameranew);
|
||||
convertView.setTag(holder);
|
||||
@@ -490,26 +446,29 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
}
|
||||
|
||||
holder.camera1.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
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";
|
||||
/* if(CommonFunctions.getCurrentTimeWithLanguage(mcontext).replace(":", "").contains("????")){
|
||||
Camerapath1 = store_id + "CategoryPicture" + list.get(position1).getSUB_CATEGORY_ID()+ date.replace("/", "") + new Random().nextInt(999999) + ".jpg";
|
||||
}
|
||||
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;
|
||||
|
||||
_path = CommonString.FILE_PATH + Camerapath1;
|
||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
// 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() {
|
||||
|
||||
@Override
|
||||
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();
|
||||
}
|
||||
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;
|
||||
_path = CommonString.FILE_PATH + Camerapath2;
|
||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
_path = CommonString.getImagesFolder(context)+ Camerapath2;
|
||||
intime = CommonFunctions.getCurrentTimeWithLanguage(mcontext);
|
||||
// intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
startCameraActivity();
|
||||
listview.invalidateViews();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
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.brand.setId(position1);
|
||||
|
||||
return convertView;
|
||||
}
|
||||
}
|
||||
@@ -663,8 +621,7 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
//super.onBackPressed();
|
||||
|
||||
super.onBackPressed();
|
||||
showDataLossAlert();
|
||||
}
|
||||
|
||||
@@ -678,9 +635,9 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
public void setCamAllowImage(boolean isAllowed, ImageView img_cam) {
|
||||
|
||||
if (isAllowed) {
|
||||
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
||||
img_cam.setImageResource(R.drawable.camera_orange_star_green);
|
||||
} 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);
|
||||
request.addProperty("onXML", sos_xml);
|
||||
/*request.addProperty("KEYS", "CHECKOUT_STATUS");
|
||||
request.addProperty("USERNAME", username);*/
|
||||
//request.addProperty("MID", mid);
|
||||
|
||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
@@ -232,8 +229,6 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
showAlert(CommonString.MESSAGE_EXCEPTION);
|
||||
}
|
||||
});
|
||||
@@ -246,12 +241,6 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
public void run() {
|
||||
showAlert(CommonString.MESSAGE_SOCKETEXCEPTION);
|
||||
// TODO Auto-generated method stub
|
||||
/*
|
||||
* if (counter < 10) { new
|
||||
* BackgroundTask(CheckOutUploadActivity
|
||||
* .this).execute(); } else { message.showMessage();
|
||||
* counter =1; }
|
||||
*/
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
@@ -288,20 +277,11 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
|
||||
showAlert(getString(R.string.checkout_successful));
|
||||
|
||||
//finish();
|
||||
|
||||
} 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();
|
||||
finish();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Data {
|
||||
@@ -316,15 +296,6 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
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) {
|
||||
char[] chars = new char[number.length()];
|
||||
for (int i = 0; i < number.length(); i++) {
|
||||
@@ -335,39 +306,31 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
ch -= 0x06f0 - '0';
|
||||
chars[i] = ch;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
|
||||
cdate = arabicToenglish(cdate);
|
||||
}
|
||||
return cdate;
|
||||
}
|
||||
|
||||
public void showAlert(String str) {
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(CheckoutActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(str).setCancelable(false)
|
||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
/* Intent i = new Intent(activity, StorelistActivity.class);
|
||||
activity.startActivity(i);
|
||||
activity.finish();*/
|
||||
finish();
|
||||
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
|
||||
+96
-147
@@ -33,6 +33,7 @@ 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.Arrays;
|
||||
@@ -47,7 +48,6 @@ import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;
|
||||
|
||||
public class CoachingVisitActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener, View.OnClickListener {
|
||||
|
||||
private Context context;
|
||||
private GSKOrangeDB database;
|
||||
ArrayList<SupervisorListGetterSetter> supervisorList;
|
||||
@@ -67,7 +67,6 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
||||
ArrayList<CoachingVisitGetterSetter> coachingVisitdata;
|
||||
boolean coaching_visit_camera_flag = false;
|
||||
MultiSpinnerSearch multi_spinner_supervisor;
|
||||
|
||||
ArrayList<String> selectedSupervisorList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
@@ -93,7 +92,7 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
||||
|
||||
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_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
||||
@@ -116,8 +115,7 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
||||
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")) {
|
||||
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;
|
||||
}
|
||||
@@ -133,8 +131,7 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
||||
|
||||
supervisorList = database.getSupervisorListData();
|
||||
|
||||
exist_adapter = new ArrayAdapter<>(this,
|
||||
android.R.layout.simple_spinner_item);
|
||||
exist_adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item);
|
||||
|
||||
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_adapter
|
||||
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
exist_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
|
||||
exist_spinner.setOnItemSelectedListener(this);
|
||||
|
||||
@@ -170,97 +166,61 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
|
||||
switch (parent.getId()) {
|
||||
case R.id.spinner_coaching_visit:
|
||||
if (position != 0) {
|
||||
if (parent.getId() == R.id.spinner_coaching_visit) {
|
||||
|
||||
if (!update_flag) {
|
||||
if (position != 0) {
|
||||
|
||||
fab_save.show();//setVisibility(View.VISIBLE);
|
||||
if (!update_flag) {
|
||||
|
||||
if (position == 1) {
|
||||
fab_save.show(); //setVisibility(View.VISIBLE);
|
||||
|
||||
linear_supervisor.setVisibility(View.VISIBLE);
|
||||
if (position == 1) {
|
||||
|
||||
coaching_visit = 1;
|
||||
linear_supervisor.setVisibility(View.VISIBLE);
|
||||
coaching_visit = 1;
|
||||
|
||||
/*supervisor_adapter = new ArrayAdapter<CharSequence>(this,
|
||||
android.R.layout.simple_spinner_item);
|
||||
final List<KeyPairBoolData> listArray0 = new ArrayList<>();
|
||||
|
||||
String select_str = getResources().getString(R.string.select_promo);
|
||||
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);
|
||||
}
|
||||
|
||||
supervisor_adapter.add(select_str);
|
||||
multi_spinner_supervisor.setItems(listArray0, -1, new SpinnerListener() {
|
||||
@Override
|
||||
public void onItemsSelected(List<KeyPairBoolData> items) {
|
||||
|
||||
for (int i = 0; i < supervisorList.size(); i++) {
|
||||
supervisor_adapter.add(supervisorList.get(i).getSUPERVISOR().get(0));
|
||||
}
|
||||
selectedSupervisorList.clear();
|
||||
|
||||
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<>();
|
||||
|
||||
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());
|
||||
}
|
||||
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 = 0;
|
||||
selectedSupervisorList.clear();
|
||||
linear_supervisor.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
coaching_visit = -1;
|
||||
linear_supervisor.setVisibility(View.GONE);
|
||||
fab_save.hide();//setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
break;
|
||||
} else {
|
||||
coaching_visit = -1;
|
||||
linear_supervisor.setVisibility(View.GONE);
|
||||
fab_save.hide(); //setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
case R.id.multi_spinner_supervisor:
|
||||
|
||||
/* if(position!=0){
|
||||
emp_id = supervisorList.get(position-1).getEMP_ID().get(0);
|
||||
}
|
||||
else {
|
||||
emp_id = "";
|
||||
}*/
|
||||
|
||||
break;
|
||||
} else if (parent.getId() == R.id.multi_spinner_supervisor) {
|
||||
// Commented-out code from original
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -271,80 +231,69 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
switch (v.getId()) {
|
||||
case R.id.img_cam:
|
||||
_pathforcheck = store_id + "CoachingVisit" + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
if (v.getId() == R.id.img_cam) {
|
||||
|
||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||
_pathforcheck = store_id + "CoachingVisit" + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||
startCameraActivity();
|
||||
|
||||
startCameraActivity();
|
||||
break;
|
||||
} else if (v.getId() == R.id.fab_save) {
|
||||
|
||||
case R.id.fab_save:
|
||||
if (coaching_visit == 1) {
|
||||
String error_msg = "";
|
||||
boolean flag = true;
|
||||
|
||||
if (coaching_visit == 1) {
|
||||
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);
|
||||
}
|
||||
|
||||
String error_msg = "";
|
||||
boolean flag = true;
|
||||
//if(emp_id.equals("")){
|
||||
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.insertCoachingVisitData(coachingVisitGetterSetter, store_id);
|
||||
}
|
||||
|
||||
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.insertCoachingVisitData(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.insertCoachingVisitData(coachingVisitGetterSetter, store_id);
|
||||
|
||||
Toast.makeText(context, getString(R.string.save_message), Toast.LENGTH_SHORT).show();
|
||||
saved_flag = true;
|
||||
fab_next.show();//setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case R.id.fab:
|
||||
|
||||
if (saved_flag || update_flag) {
|
||||
|
||||
Intent i = new Intent(CoachingVisitActivity.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);
|
||||
fab_next.show(); // setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
Snackbar.make(linear_supervisor, getString(R.string.please_save_data), Snackbar.LENGTH_SHORT).show();
|
||||
Snackbar.make(linear_supervisor, error_msg, Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
|
||||
} else {
|
||||
CoachingVisitGetterSetter coachingVisitGetterSetter = new CoachingVisitGetterSetter();
|
||||
coachingVisitGetterSetter.setEmp_id("0");
|
||||
coachingVisitGetterSetter.setImg_path(image_name);
|
||||
coachingVisitGetterSetter.setExists(coaching_visit == 1);
|
||||
|
||||
database.insertCoachingVisitData(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(CoachingVisitActivity.this, CoachingVisitStoreActivity.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) {
|
||||
@@ -365,7 +314,7 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
||||
|
||||
Log.i("MakeMachine", "startCameraActivity()");
|
||||
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 = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
@@ -412,8 +361,8 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
||||
startActivityForResult(intent, 0);
|
||||
|
||||
} catch (Exception e) {
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
//Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
+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);
|
||||
}
|
||||
}
|
||||
+144
-162
@@ -197,147 +197,135 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
||||
|
||||
btntoggle.setChecked(isExists);
|
||||
|
||||
str = CommonString.FILE_PATH;
|
||||
str = CommonString.getImagesFolder(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
|
||||
switch (id) {
|
||||
case R.id.btntoggle:
|
||||
isExists = btntoggle.isChecked();
|
||||
if (id == R.id.btntoggle) {
|
||||
isExists = btntoggle.isChecked();
|
||||
|
||||
if (isExists) {
|
||||
lin_parent.setVisibility(View.VISIBLE);
|
||||
isdata_added = true;
|
||||
} else {
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(CompetitionPromoActivity.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) {
|
||||
if (isExists) {
|
||||
lin_parent.setVisibility(View.VISIBLE);
|
||||
isdata_added = true;
|
||||
} else {
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(CompetitionPromoActivity.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) {
|
||||
|
||||
lin_parent.setVisibility(View.GONE);
|
||||
lin_parent.setVisibility(View.GONE);
|
||||
|
||||
brand = "";
|
||||
subcategory = "";
|
||||
promotion = "";
|
||||
brand_id = 0;
|
||||
subcategoryId = 0;
|
||||
promotion_id = 0;
|
||||
skuName = "";
|
||||
img_str = "";
|
||||
img_str1 = "";
|
||||
img_str2 = "";
|
||||
et_sku_name.setText("");
|
||||
sp_subcategory.setSelection(0);
|
||||
spinner_brand_list.setSelection(0);
|
||||
sp_promotion_typ.setSelection(0);
|
||||
brand = "";
|
||||
subcategory = "";
|
||||
promotion = "";
|
||||
brand_id = 0;
|
||||
subcategoryId = 0;
|
||||
promotion_id = 0;
|
||||
skuName = "";
|
||||
img_str = "";
|
||||
img_str1 = "";
|
||||
img_str2 = "";
|
||||
et_sku_name.setText("");
|
||||
sp_subcategory.setSelection(0);
|
||||
spinner_brand_list.setSelection(0);
|
||||
sp_promotion_typ.setSelection(0);
|
||||
|
||||
addedCounterfeitProducts.clear();
|
||||
isdata_added = true;
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
//checkBox.setChecked(true);
|
||||
btntoggle.setChecked(true);
|
||||
}
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
break;
|
||||
addedCounterfeitProducts.clear();
|
||||
isdata_added = true;
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
btntoggle.setChecked(true);
|
||||
}
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
|
||||
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+(?!$)", "");
|
||||
|
||||
if (promotion.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_promo_type, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (subcategory.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_sub_category, Snackbar.LENGTH_SHORT).show();
|
||||
}else if (brand.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_competitor, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (skuName.equals("")) {
|
||||
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("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.click_image, Snackbar.LENGTH_SHORT).show();
|
||||
}*/ else {
|
||||
CompetitonPromoGetterSetter product = new CompetitonPromoGetterSetter();
|
||||
product.setBrand(brand);
|
||||
product.setPromotion(promotion);
|
||||
product.setBrandId(brand_id);
|
||||
product.setPromotion_id(promotion_id);
|
||||
product.setSkuName(skuName);
|
||||
product.setImgStr(img_str);
|
||||
product.setImgStr1(img_str1);
|
||||
product.setImgStr2(img_str2);
|
||||
if (promotion.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_promo_type, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (subcategory.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_sub_category, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (brand.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_competitor, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (skuName.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_enter_comment, Snackbar.LENGTH_SHORT).show();
|
||||
} else {
|
||||
CompetitonPromoGetterSetter product = new CompetitonPromoGetterSetter();
|
||||
product.setBrand(brand);
|
||||
product.setPromotion(promotion);
|
||||
product.setBrandId(brand_id);
|
||||
product.setPromotion_id(promotion_id);
|
||||
product.setSkuName(skuName);
|
||||
product.setImgStr(img_str);
|
||||
product.setImgStr1(img_str1);
|
||||
product.setImgStr2(img_str2);
|
||||
|
||||
addedCounterfeitProducts.add(product);
|
||||
addedCounterfeitProducts.add(product);
|
||||
|
||||
rec_added_counterfeit_product.setLayoutManager(new LinearLayoutManager(context));
|
||||
productAdapter = new ProductAdapter(addedCounterfeitProducts);
|
||||
rec_added_counterfeit_product.setAdapter(productAdapter);
|
||||
rec_added_counterfeit_product.setLayoutManager(new LinearLayoutManager(context));
|
||||
productAdapter = new ProductAdapter(addedCounterfeitProducts);
|
||||
rec_added_counterfeit_product.setAdapter(productAdapter);
|
||||
|
||||
subcategory = "";
|
||||
brand = "";
|
||||
promotion = "";
|
||||
subcategoryId = 0;
|
||||
brand_id = 0;
|
||||
promotion_id = 0;
|
||||
skuName = "";
|
||||
img_str = "";
|
||||
img_str1 = "";
|
||||
img_str2 = "";
|
||||
et_sku_name.setText("");
|
||||
sp_subcategory.setSelection(0);
|
||||
spinner_brand_list.setSelection(0);
|
||||
sp_promotion_typ.setSelection(0);
|
||||
//clearBrandSpinner();
|
||||
subcategory = "";
|
||||
brand = "";
|
||||
promotion = "";
|
||||
subcategoryId = 0;
|
||||
brand_id = 0;
|
||||
promotion_id = 0;
|
||||
skuName = "";
|
||||
img_str = "";
|
||||
img_str1 = "";
|
||||
img_str2 = "";
|
||||
et_sku_name.setText("");
|
||||
sp_subcategory.setSelection(0);
|
||||
spinner_brand_list.setSelection(0);
|
||||
sp_promotion_typ.setSelection(0);
|
||||
|
||||
imgCam.setBackgroundResource(R.mipmap.camera_orange);
|
||||
imgCam1.setBackgroundResource(R.mipmap.camera_orange);
|
||||
imgCam2.setBackgroundResource(R.mipmap.camera_orange);
|
||||
imgCam.setBackgroundResource(R.mipmap.camera_orange);
|
||||
imgCam1.setBackgroundResource(R.mipmap.camera_orange);
|
||||
imgCam2.setBackgroundResource(R.mipmap.camera_orange);
|
||||
|
||||
isdata_added = true;
|
||||
}
|
||||
isdata_added = true;
|
||||
}
|
||||
|
||||
break;
|
||||
} else if (id == R.id.fab) {
|
||||
|
||||
case R.id.fab:
|
||||
if(isExists && addedCounterfeitProducts.size()==0){
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.title_activity_Want_add,Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
else {
|
||||
db.InsertComptionPromotData(addedCounterfeitProducts, categoryId, store_id, isExists);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
if (isExists && addedCounterfeitProducts.size() == 0) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.title_activity_Want_add, Snackbar.LENGTH_SHORT).show();
|
||||
} else {
|
||||
db.InsertComptionPromotData(addedCounterfeitProducts, categoryId, store_id, isExists);
|
||||
finish();
|
||||
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("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||
startCameraActivity();
|
||||
|
||||
case R.id.img_cam:
|
||||
_pathforcheck = store_id + "CounterfeitProductImg1" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||
startCameraActivity();
|
||||
break;
|
||||
} else if (id == R.id.img_cam1) {
|
||||
_pathforcheck1 = store_id + "CounterfeitProductImg2" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
_path = CommonString.getImagesFolder(context) + _pathforcheck1;
|
||||
startCameraActivity();
|
||||
|
||||
case R.id.img_cam1:
|
||||
_pathforcheck1 = store_id + "CounterfeitProductImg2" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
_path = CommonString.FILE_PATH + _pathforcheck1;
|
||||
startCameraActivity();
|
||||
break;
|
||||
|
||||
case R.id.img_cam2:
|
||||
_pathforcheck2 = store_id + "CounterfeitProductImg3" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
_path = CommonString.FILE_PATH + _pathforcheck2;
|
||||
startCameraActivity();
|
||||
break;
|
||||
} else if (id == R.id.img_cam2) {
|
||||
_pathforcheck2 = store_id + "CounterfeitProductImg3" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
_path = CommonString.getImagesFolder(context) + _pathforcheck2;
|
||||
startCameraActivity();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void clearBrandSpinner() {
|
||||
@@ -355,59 +343,52 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
switch (parent.getId()) {
|
||||
case R.id.sp_subcategory:
|
||||
if (position != 0) {
|
||||
subcategory = subcategory_list.get(position).getSUB_CATEGORY().get(0);
|
||||
subcategoryId = Integer.parseInt(subcategory_list.get(position).getSUB_CATEGORY_ID().get(0));
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long _po) {
|
||||
int id = parent.getId();
|
||||
|
||||
brand_list = db.getCompetionData(keyAccount_id, storeType_id,class_id,categoryId,subcategoryId);
|
||||
//brand data
|
||||
BrandMasterGetterSetter brand_select = new BrandMasterGetterSetter();
|
||||
String select = getResources().getString(R.string.select);
|
||||
brand_select.setBRAND(select);
|
||||
brand_select.setBRAND_ID("0");
|
||||
brand_list.add(0, brand_select);
|
||||
CustomBrandAdapter adapter = new CustomBrandAdapter(CompetitionPromoActivity.this, R.layout.custom_spinner_item, brand_list);
|
||||
spinner_brand_list.setAdapter(adapter);
|
||||
spinner_brand_list.setOnItemSelectedListener(this);
|
||||
if (id == R.id.sp_subcategory) {
|
||||
if (position != 0) {
|
||||
subcategory = subcategory_list.get(position).getSUB_CATEGORY().get(0);
|
||||
subcategoryId = Integer.parseInt(subcategory_list.get(position).getSUB_CATEGORY_ID().get(0));
|
||||
|
||||
lay_competitor_name.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
subcategory = "";
|
||||
subcategoryId = 0;
|
||||
lay_competitor_name.setVisibility(View.GONE);
|
||||
}
|
||||
break;
|
||||
brand_list = db.getCompetionData(keyAccount_id, storeType_id, class_id, categoryId, subcategoryId);
|
||||
|
||||
case R.id.sp_brand:
|
||||
|
||||
if (position != 0) {
|
||||
brand = brand_list.get(position).getBRAND().get(0);
|
||||
brand_id = Integer.parseInt(brand_list.get(position).getBRAND_ID().get(0));
|
||||
} else {
|
||||
brand = "";
|
||||
brand_id = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
case R.id.sp_promotion_typ:
|
||||
|
||||
if (position != 0) {
|
||||
promotion = promotion_list.get(position).getPROMOTION_TYPE().get(0);
|
||||
promotion_id = Integer.parseInt(promotion_list.get(position).getPROMOTION_TYPE_ID().get(0));
|
||||
} else {
|
||||
promotion = "";
|
||||
promotion_id = 0;
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
// Prepare brand data with default "Select" option
|
||||
BrandMasterGetterSetter brand_select = new BrandMasterGetterSetter();
|
||||
String select = getResources().getString(R.string.select);
|
||||
brand_select.setBRAND(select);
|
||||
brand_select.setBRAND_ID("0");
|
||||
brand_list.add(0, brand_select);
|
||||
|
||||
CustomBrandAdapter adapter = new CustomBrandAdapter(CompetitionPromoActivity.this, R.layout.custom_spinner_item, brand_list);
|
||||
spinner_brand_list.setAdapter(adapter);
|
||||
spinner_brand_list.setOnItemSelectedListener(this);
|
||||
|
||||
lay_competitor_name.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
subcategory = "";
|
||||
subcategoryId = 0;
|
||||
lay_competitor_name.setVisibility(View.GONE);
|
||||
}
|
||||
} else if (id == R.id.sp_brand) {
|
||||
if (position != 0) {
|
||||
brand = brand_list.get(position).getBRAND().get(0);
|
||||
brand_id = Integer.parseInt(brand_list.get(position).getBRAND_ID().get(0));
|
||||
} else {
|
||||
brand = "";
|
||||
brand_id = 0;
|
||||
}
|
||||
} else if (id == R.id.sp_promotion_typ) {
|
||||
if (position != 0) {
|
||||
promotion = promotion_list.get(position).getPROMOTION_TYPE().get(0);
|
||||
promotion_id = Integer.parseInt(promotion_list.get(position).getPROMOTION_TYPE_ID().get(0));
|
||||
} else {
|
||||
promotion = "";
|
||||
promotion_id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -806,6 +787,7 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
super.onBackPressed();
|
||||
ischanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,17 +58,13 @@ import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
|
||||
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
||||
|
||||
public class ConversationActivity extends AppCompatActivity {
|
||||
|
||||
String userId, culture_id, store_id, chat_id, message_main, visit_date;
|
||||
private SharedPreferences preferences = null;
|
||||
|
||||
GSKOrangeDB db;
|
||||
private Context context;
|
||||
ArrayList<ChatMessageGetterSetter> conversation_list = new ArrayList<>();
|
||||
|
||||
MyRecyclerAdapter adapter;
|
||||
RecyclerView rec;
|
||||
|
||||
EditText et_reply;
|
||||
private Dialog dialog;
|
||||
private ProgressBar pb;
|
||||
|
||||
+110
-121
@@ -125,7 +125,7 @@ public class CounterfeitProductsActivity extends AppCompatActivity implements Ad
|
||||
imgCam1.setOnClickListener(this);
|
||||
imgCam2.setOnClickListener(this);
|
||||
|
||||
// brand_list = db.getBrandMasterData(store_id, categoryId);
|
||||
// brand_list = db.getBrandMasterData(store_id, categoryId);
|
||||
brand_list = db.getBrandMasterData(store_id, categoryId);
|
||||
//brand_list = db.getBrandData(categoryId);
|
||||
|
||||
@@ -161,141 +161,133 @@ public class CounterfeitProductsActivity extends AppCompatActivity implements Ad
|
||||
|
||||
btntoggle.setChecked(isExists);
|
||||
|
||||
str = CommonString.FILE_PATH;
|
||||
str = CommonString.getImagesFolder(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
|
||||
switch (id) {
|
||||
case R.id.btntoggle:
|
||||
isExists = btntoggle.isChecked();
|
||||
if (id == R.id.btntoggle) {
|
||||
isExists = btntoggle.isChecked();
|
||||
|
||||
if (isExists) {
|
||||
lin_parent.setVisibility(View.VISIBLE);
|
||||
isdata_added = true;
|
||||
} else {
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(CounterfeitProductsActivity.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) {
|
||||
if (isExists) {
|
||||
lin_parent.setVisibility(View.VISIBLE);
|
||||
isdata_added = true;
|
||||
} else {
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(CounterfeitProductsActivity.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) {
|
||||
|
||||
lin_parent.setVisibility(View.GONE);
|
||||
lin_parent.setVisibility(View.GONE);
|
||||
|
||||
brand = "";
|
||||
brand_id = 0;
|
||||
brand = "";
|
||||
brand_id = 0;
|
||||
|
||||
stock = "";
|
||||
skuName = "";
|
||||
img_str = "";
|
||||
img_str1 = "";
|
||||
img_str2 = "";
|
||||
stock = "";
|
||||
skuName = "";
|
||||
img_str = "";
|
||||
img_str1 = "";
|
||||
img_str2 = "";
|
||||
|
||||
et_stock.setText("");
|
||||
et_sku_name.setText("");
|
||||
spinner_brand_list.setSelection(0);
|
||||
et_stock.setText("");
|
||||
et_sku_name.setText("");
|
||||
spinner_brand_list.setSelection(0);
|
||||
|
||||
addedCounterfeitProducts.clear();
|
||||
isdata_added = true;
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
//checkBox.setChecked(true);
|
||||
btntoggle.setChecked(true);
|
||||
}
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
break;
|
||||
addedCounterfeitProducts.clear();
|
||||
isdata_added = true;
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
//checkBox.setChecked(true);
|
||||
btntoggle.setChecked(true);
|
||||
}
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
|
||||
case R.id.fab_add:
|
||||
} else if (id == R.id.fab_add) {
|
||||
skuName = et_sku_name.getText().toString().replaceAll("[&^<>{}'$]", "").replaceFirst("^0+(?!$)", "");
|
||||
stock = et_stock.getText().toString();
|
||||
|
||||
skuName = et_sku_name.getText().toString().replaceAll("[&^<>{}'$]", "").replaceFirst("^0+(?!$)", "");
|
||||
stock = et_stock.getText().toString();
|
||||
if (brand.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_brand, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (stock.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_enter_stock, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (skuName.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_enter_sku, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (img_str.equals("") && img_str1.equals("") && img_str2.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.click_image, Snackbar.LENGTH_SHORT).show();
|
||||
} else {
|
||||
CounterfeitProductGetterSetter product = new CounterfeitProductGetterSetter();
|
||||
product.setBrand(brand);
|
||||
product.setBrandId(brand_id);
|
||||
product.setStock(Integer.parseInt(stock));
|
||||
product.setSkuName(skuName);
|
||||
product.setImgStr(img_str);
|
||||
product.setImgStr1(img_str1);
|
||||
product.setImgStr2(img_str2);
|
||||
|
||||
if (brand.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_brand, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (stock.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_enter_stock, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (skuName.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_enter_sku, Snackbar.LENGTH_SHORT).show();
|
||||
} else if (img_str.equals("") && img_str1.equals("") && img_str2.equals("")) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.click_image, Snackbar.LENGTH_SHORT).show();
|
||||
} else {
|
||||
CounterfeitProductGetterSetter product = new CounterfeitProductGetterSetter();
|
||||
product.setBrand(brand);
|
||||
product.setBrandId(brand_id);
|
||||
product.setStock(Integer.parseInt(stock));
|
||||
product.setSkuName(skuName);
|
||||
product.setImgStr(img_str);
|
||||
product.setImgStr1(img_str1);
|
||||
product.setImgStr2(img_str2);
|
||||
addedCounterfeitProducts.add(product);
|
||||
|
||||
addedCounterfeitProducts.add(product);
|
||||
rec_added_counterfeit_product.setLayoutManager(new LinearLayoutManager(context));
|
||||
productAdapter = new ProductAdapter(addedCounterfeitProducts);
|
||||
rec_added_counterfeit_product.setAdapter(productAdapter);
|
||||
|
||||
rec_added_counterfeit_product.setLayoutManager(new LinearLayoutManager(context));
|
||||
productAdapter = new ProductAdapter(addedCounterfeitProducts);
|
||||
rec_added_counterfeit_product.setAdapter(productAdapter);
|
||||
brand = "";
|
||||
brand_id = 0;
|
||||
|
||||
brand = "";
|
||||
brand_id = 0;
|
||||
stock = "";
|
||||
skuName = "";
|
||||
img_str = "";
|
||||
img_str1 = "";
|
||||
img_str2 = "";
|
||||
|
||||
stock = "";
|
||||
skuName = "";
|
||||
img_str = "";
|
||||
img_str1 = "";
|
||||
img_str2 = "";
|
||||
et_stock.setText("");
|
||||
et_sku_name.setText("");
|
||||
spinner_brand_list.setSelection(0);
|
||||
|
||||
et_stock.setText("");
|
||||
et_sku_name.setText("");
|
||||
spinner_brand_list.setSelection(0);
|
||||
//clearBrandSpinner();
|
||||
imgCam.setBackgroundResource(R.mipmap.camera_orange);
|
||||
imgCam1.setBackgroundResource(R.mipmap.camera_orange);
|
||||
imgCam2.setBackgroundResource(R.mipmap.camera_orange);
|
||||
|
||||
imgCam.setBackgroundResource(R.mipmap.camera_orange);
|
||||
imgCam1.setBackgroundResource(R.mipmap.camera_orange);
|
||||
imgCam2.setBackgroundResource(R.mipmap.camera_orange);
|
||||
isdata_added = true;
|
||||
}
|
||||
|
||||
isdata_added = true;
|
||||
}
|
||||
} else if (id == R.id.fab) {
|
||||
if (isExists && addedCounterfeitProducts.size() == 0) {
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.title_activity_Want_add, Snackbar.LENGTH_SHORT).show();
|
||||
} else {
|
||||
db.InsertCounterfeitProductData(addedCounterfeitProducts, categoryId, store_id, isExists);
|
||||
finish();
|
||||
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("/", "") +
|
||||
CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||
startCameraActivity();
|
||||
|
||||
case R.id.fab:
|
||||
if(isExists && addedCounterfeitProducts.size()==0){
|
||||
Snackbar.make(rec_added_counterfeit_product, R.string.title_activity_Want_add,Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
else {
|
||||
db.InsertCounterfeitProductData(addedCounterfeitProducts, categoryId, store_id, isExists);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
} else if (id == R.id.img_cam1) {
|
||||
_pathforcheck1 = store_id + "CounterfeitProductImg2" + categoryId + visit_date.replace("/", "") +
|
||||
CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
_path = CommonString.getImagesFolder(context) + _pathforcheck1;
|
||||
startCameraActivity();
|
||||
|
||||
break;
|
||||
|
||||
case R.id.img_cam:
|
||||
_pathforcheck = store_id + "CounterfeitProductImg1" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||
startCameraActivity();
|
||||
break;
|
||||
|
||||
case R.id.img_cam1:
|
||||
_pathforcheck1 = store_id + "CounterfeitProductImg2" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
_path = CommonString.FILE_PATH + _pathforcheck1;
|
||||
startCameraActivity();
|
||||
break;
|
||||
|
||||
case R.id.img_cam2:
|
||||
_pathforcheck2 = store_id + "CounterfeitProductImg3" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
_path = CommonString.FILE_PATH + _pathforcheck2;
|
||||
startCameraActivity();
|
||||
break;
|
||||
} else if (id == R.id.img_cam2) {
|
||||
_pathforcheck2 = store_id + "CounterfeitProductImg3" + categoryId + visit_date.replace("/", "") +
|
||||
CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
_path = CommonString.getImagesFolder(context) + _pathforcheck2;
|
||||
startCameraActivity();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void clearBrandSpinner() {
|
||||
@@ -314,20 +306,17 @@ public class CounterfeitProductsActivity extends AppCompatActivity implements Ad
|
||||
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
switch (parent.getId()) {
|
||||
case R.id.sp_brand:
|
||||
|
||||
if (position != 0) {
|
||||
brand = brand_list.get(position).getBRAND().get(0);
|
||||
brand_id = Integer.parseInt(brand_list.get(position).getBRAND_ID().get(0));
|
||||
} else {
|
||||
brand = "";
|
||||
brand_id = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
if (parent.getId() == R.id.sp_brand) {
|
||||
if (position != 0) {
|
||||
brand = brand_list.get(position).getBRAND().get(0);
|
||||
brand_id = Integer.parseInt(brand_list.get(position).getBRAND_ID().get(0));
|
||||
} else {
|
||||
brand = "";
|
||||
brand_id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -46,10 +46,10 @@ public class CreateSelfActivity extends AppCompatActivity {
|
||||
|
||||
GSKOrangeDB db;
|
||||
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;
|
||||
MSL_AvailabilityStockFacingGetterSetter brand_selected;
|
||||
int number_of_rows=0;
|
||||
int number_of_rows = 0;
|
||||
RecyclerView rec_sub_category;
|
||||
static int FROM_DIALOG = 0;
|
||||
static int FROM_CLICK = 1;
|
||||
@@ -98,35 +98,28 @@ public class CreateSelfActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
number_of_rows=0;
|
||||
number_of_rows = 0;
|
||||
brand_selected = null;
|
||||
|
||||
db.open();
|
||||
|
||||
added_sub_category_list = new ArrayList<>();
|
||||
|
||||
//kenya use
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(categoryId,store_id,country_id);
|
||||
|
||||
for(int i=0; i<sub_category_list.size(); i++){
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(categoryId, store_id, country_id);
|
||||
|
||||
for (int i = 0; i < sub_category_list.size(); i++) {
|
||||
ArrayList<NoCameraDataGetterSetter> noCameraLastVisitData;
|
||||
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
||||
noCameraLastVisitData = db.getNoCameraLastVisitCategoryData(store_id, categoryId, sub_category_list.get(i).getSub_category_id(), CommonString.TABLE_NO_CAMERA_LAST_VISIT_DATA_ADHOC);
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
noCameraLastVisitData = db.getNoCameraLastVisitCategoryData(store_id, categoryId,
|
||||
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 {
|
||||
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){
|
||||
|
||||
if (db.getNoCameraCategoryDataInserted(store_id, categoryId, sub_category_list.get(i).getSub_category_id()).size() > 0) {
|
||||
MSL_AvailabilityStockFacingGetterSetter subCategory = new MSL_AvailabilityStockFacingGetterSetter();
|
||||
subCategory.setSub_category(sub_category_list.get(i).getSub_category());
|
||||
subCategory.setSub_category_id(sub_category_list.get(i).getSub_category_id());
|
||||
added_sub_category_list.add(subCategory);
|
||||
}
|
||||
else if(noCameraLastVisitData.size()>0){
|
||||
} else if (noCameraLastVisitData.size() > 0) {
|
||||
MSL_AvailabilityStockFacingGetterSetter subCategory = new MSL_AvailabilityStockFacingGetterSetter();
|
||||
subCategory.setSub_category(sub_category_list.get(i).getSub_category());
|
||||
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));
|
||||
SubcategoryAdapter skuAdapter = new SubcategoryAdapter(added_sub_category_list);
|
||||
rec_sub_category.setAdapter(skuAdapter);
|
||||
@@ -151,13 +144,11 @@ public class CreateSelfActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
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();
|
||||
brand.setSub_category("select");
|
||||
sub_category_list.add(0, brand);
|
||||
// ArrayList<SkuMasterGetterSetter> skuMasterGetterSetterArrayList = db.getSkuT2PData("1", "1", "1",)
|
||||
|
||||
final Dialog dialog = new Dialog(CreateSelfActivity.this);
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
@@ -173,28 +164,25 @@ public class CreateSelfActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
if(brand_selected==null){
|
||||
Snackbar.make(btn_create,"Please select Sub Category",Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
else if(number_of_rows==0){
|
||||
Snackbar.make(btn_create,"Please select number of rows",Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
else {
|
||||
if (brand_selected == null) {
|
||||
Snackbar.make(btn_create, "Please select Sub Category", Snackbar.LENGTH_SHORT).show();
|
||||
} else if (number_of_rows == 0) {
|
||||
Snackbar.make(btn_create, "Please select number of rows", Snackbar.LENGTH_SHORT).show();
|
||||
} else {
|
||||
|
||||
boolean sub_category_already_filled = false;
|
||||
if(added_sub_category_list.size()>0){
|
||||
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.size() > 0) {
|
||||
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())) {
|
||||
sub_category_already_filled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(sub_category_already_filled){
|
||||
Snackbar.make(btn_create,"Sub Category already added",Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
else {
|
||||
if (sub_category_already_filled) {
|
||||
Snackbar.make(btn_create, "Sub Category already added", Snackbar.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Intent in = new Intent(context, NoCameraActivity.class);
|
||||
in.putExtra("categoryName", categoryName);
|
||||
in.putExtra("categoryId", categoryId);
|
||||
@@ -228,7 +216,7 @@ public class CreateSelfActivity extends AppCompatActivity {
|
||||
|
||||
final ArrayList<String> no_of_rows = new ArrayList<>();
|
||||
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 + "");
|
||||
}
|
||||
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) {
|
||||
brand_selected = sub_category_list.get(position);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
brand_selected = null;
|
||||
}
|
||||
|
||||
@@ -260,8 +247,7 @@ public class CreateSelfActivity extends AppCompatActivity {
|
||||
|
||||
if (position != 0) {
|
||||
number_of_rows = Integer.parseInt(no_of_rows.get(position));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
number_of_rows = 0;
|
||||
}
|
||||
|
||||
@@ -493,7 +479,6 @@ public class CreateSelfActivity extends AppCompatActivity {
|
||||
super(view);
|
||||
|
||||
mView = view;
|
||||
|
||||
tv_sub_category = (TextView) mView.findViewById(R.id.tv_sub_category);
|
||||
parentLayout = (LinearLayout) mView.findViewById(R.id.linear_parent);
|
||||
|
||||
|
||||
+37
-79
@@ -1,5 +1,6 @@
|
||||
package cpm.com.gskmtorange.dailyentry;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
@@ -90,27 +91,18 @@ public class DeliveryCallActivity extends AppCompatActivity implements View.OnCl
|
||||
|
||||
int id = v.getId();
|
||||
|
||||
switch (id) {
|
||||
|
||||
case R.id.fab_upload:
|
||||
|
||||
new UploadTask().execute();
|
||||
break;
|
||||
|
||||
case R.id.fab:
|
||||
|
||||
if (isCheckedIn()) {
|
||||
Snackbar.make(recyclerView, getString(R.string.title_store_list_checkout_current), Snackbar.LENGTH_SHORT).show();
|
||||
} else {
|
||||
|
||||
Intent in = new Intent(context, DeliveryCallAddStoreActivity.class);
|
||||
startActivity(in);
|
||||
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
|
||||
break;
|
||||
if (id == R.id.fab_upload) {
|
||||
new UploadTask().execute();
|
||||
} else if (id == R.id.fab) {
|
||||
if (isCheckedIn()) {
|
||||
Snackbar.make(recyclerView, getString(R.string.title_store_list_checkout_current), Snackbar.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Intent in = new Intent(context, DeliveryCallAddStoreActivity.class);
|
||||
startActivity(in);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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.setBackgroundResource(R.mipmap.tick);
|
||||
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.setBackgroundResource(R.mipmap.exclamation);
|
||||
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.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (current.getUPLOAD_STATUS().equals(CommonString.KEY_CHECK_IN)) {
|
||||
|
||||
holder.cardView.setOnClickListener(v -> {
|
||||
switch (current.getUPLOAD_STATUS()) {
|
||||
case CommonString.KEY_CHECK_IN:
|
||||
Intent in = new Intent(context, DeliveryCallAddStoreActivity.class);
|
||||
in.putExtra(CommonString.KEY_STORE_ID, current);
|
||||
in.putExtra(CommonString.KEY_STORE_FLAG, false);
|
||||
startActivity(in);
|
||||
|
||||
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();
|
||||
} 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();
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -202,18 +194,13 @@ public class DeliveryCallActivity extends AppCompatActivity implements View.OnCl
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
toolbar.setTitle(getString(R.string.delivery_call));
|
||||
|
||||
deliveryCallsList = database.getDeliveryCallsData(visit_date);
|
||||
|
||||
if (deliveryCallsList.size() > 0) {
|
||||
//list.setAdapter(new MyAdaptor());
|
||||
if (!deliveryCallsList.isEmpty()) {
|
||||
deliveryAdapter = new DeliveryAdapter(context, deliveryCallsList);
|
||||
recyclerView.setAdapter(deliveryAdapter);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
|
||||
if (isCheckedIn()) {
|
||||
fab_upload.hide();//setVisibility(View.GONE);
|
||||
} 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));
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
protected void onProgressUpdate(Data... values) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
pb.setProgress(values[0].value);
|
||||
percentage.setText(values[0].value + "%");
|
||||
message.setText(values[0].name);
|
||||
@@ -262,18 +249,14 @@ public class DeliveryCallActivity extends AppCompatActivity implements View.OnCl
|
||||
protected String doInBackground(Void... voids) {
|
||||
try {
|
||||
Data data = new Data();
|
||||
ArrayList<DeliveryCallsGetterSetter> _deliveryCallsList = database.getDeliveryCallsData(null);
|
||||
ArrayList<DeliveryCallsGetterSetter> _deliveryCallsList = database.getDeliveryCallsData(null);
|
||||
for (int i = 0; i < _deliveryCallsList.size(); i++) {
|
||||
|
||||
if (_deliveryCallsList.get(i).getUPLOAD_STATUS().equals(CommonString.KEY_C)) {
|
||||
|
||||
data.value = 50;
|
||||
data.name = getString(R.string.delivery_call);
|
||||
publishProgress(data);
|
||||
|
||||
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_name = URLEncoder.encode(_deliveryCallsList.get(i).getSTORE_NAME(), "utf-8");
|
||||
String store_address = URLEncoder.encode(_deliveryCallsList.get(i).getADDRESS(), "utf-8");
|
||||
String onXML = "[DELIVERY_CALLS_DATA]"
|
||||
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||
+ "[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]"
|
||||
+ "[OUT_TIME]" + _deliveryCallsList.get(i).getOut_time() + "[/OUT_TIME]"
|
||||
+ "[IN_TIME_IMAGE]" + _deliveryCallsList.get(i).getIN_TIME_IMAGE() + "[/IN_TIME_IMAGE]"
|
||||
+ "[OUT_TIME_IMAGE]" + _deliveryCallsList.get(i).getOUT_TIME_IMAGE()+ "[/OUT_TIME_IMAGE]"
|
||||
+ "[LATITUDE]" + _deliveryCallsList.get(i).getLATITUDE()+ "[/LATITUDE]"
|
||||
+ "[LONGITUDE]" + _deliveryCallsList.get(i).getLONGITUDE()+ "[/LONGITUDE]"
|
||||
+ "[OUT_TIME_IMAGE]" + _deliveryCallsList.get(i).getOUT_TIME_IMAGE() + "[/OUT_TIME_IMAGE]"
|
||||
+ "[LATITUDE]" + _deliveryCallsList.get(i).getLATITUDE() + "[/LATITUDE]"
|
||||
+ "[LONGITUDE]" + _deliveryCallsList.get(i).getLONGITUDE() + "[/LONGITUDE]"
|
||||
+ "[/DELIVERY_CALLS_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("USERNAME", userId);
|
||||
request.addProperty("MID", 0);
|
||||
|
||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(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;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
database.open();
|
||||
database.updateDeliveryCallsUploadStatus(_deliveryCallsList.get(i).getId());
|
||||
}
|
||||
@@ -314,50 +294,36 @@ public class DeliveryCallActivity extends AppCompatActivity implements View.OnCl
|
||||
|
||||
return result.toString();
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
//Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
//Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
e.fillInStackTrace();
|
||||
} catch (XmlPullParserException e) {
|
||||
e.printStackTrace();
|
||||
e.fillInStackTrace();
|
||||
} catch (Exception e) {
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
e.fillInStackTrace();
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(String result) {
|
||||
super.onPostExecute(result);
|
||||
|
||||
dialog.dismiss();
|
||||
if (result.contains(CommonString.KEY_SUCCESS)) {
|
||||
//db.deleteAllTables();
|
||||
|
||||
File f = new File(CommonString.FILE_PATH);
|
||||
File f = new File(CommonString.getImagesFolder(context));
|
||||
File fileAll[] = f.listFiles();
|
||||
ArrayList<String> file_list = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < fileAll.length; i++) {
|
||||
String name = fileAll[i].getName();
|
||||
if(name.contains("DeliveryCalls")){
|
||||
if (name.contains("DeliveryCalls")) {
|
||||
file_list.add(name);
|
||||
}
|
||||
}
|
||||
|
||||
UploadImageWithRetrofit.uploadedFiles = 0;
|
||||
UploadImageWithRetrofit.totalFiles = file_list.size();
|
||||
UploadImageWithRetrofit uploadImg = new UploadImageWithRetrofit(visit_date, userId, DeliveryCallActivity.this);
|
||||
uploadImg.UploadDeliveryImageRecursive(DeliveryCallActivity.this, file_list, 0);
|
||||
|
||||
} else {
|
||||
showAlert(getString(R.string.error) + result.toString());
|
||||
}
|
||||
@@ -365,19 +331,11 @@ public class DeliveryCallActivity extends AppCompatActivity implements View.OnCl
|
||||
}
|
||||
|
||||
public void showAlert(String str) {
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(DeliveryCallActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(str).setCancelable(false)
|
||||
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
/* Intent i = new Intent(activity, StorelistActivity.class);
|
||||
activity.startActivity(i);
|
||||
activity.finish();*/
|
||||
finish();
|
||||
|
||||
}
|
||||
.setPositiveButton(R.string.ok, (dialog, id) -> {
|
||||
finish();
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
|
||||
+19
-18
@@ -160,7 +160,7 @@ public class DeliveryCallAddStoreActivity extends AppCompatActivity implements V
|
||||
}
|
||||
});
|
||||
|
||||
str = CommonString.FILE_PATH;
|
||||
str = CommonString.getImagesFolder(context);
|
||||
|
||||
if (checkPlayServices()) {
|
||||
|
||||
@@ -315,29 +315,30 @@ public class DeliveryCallAddStoreActivity extends AppCompatActivity implements V
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.img_checkin:
|
||||
int viewId = v.getId();
|
||||
|
||||
in_time = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
if (viewId == R.id.img_checkin) {
|
||||
|
||||
_pathforcheck = "DeliveryCalls" + visit_date.replace("/", "") + "InTime" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
in_time = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
|
||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||
_pathforcheck = "DeliveryCalls" + visit_date.replace("/", "") + "InTime" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
|
||||
startCameraActivity(0);
|
||||
break;
|
||||
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||
|
||||
case R.id.img_checkout:
|
||||
startCameraActivity(0);
|
||||
|
||||
out_time = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
} else if (viewId == R.id.img_checkout) {
|
||||
|
||||
_pathforcheck = "DeliveryCalls" + visit_date.replace("/", "") + "OutTime" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
out_time = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
|
||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||
_pathforcheck = "DeliveryCalls" + visit_date.replace("/", "") + "OutTime" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
|
||||
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||
|
||||
startCameraActivity(1);
|
||||
|
||||
startCameraActivity(1);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void startCameraActivity(int request_code) {
|
||||
@@ -392,9 +393,9 @@ public class DeliveryCallAddStoreActivity extends AppCompatActivity implements V
|
||||
startActivityForResult(intent, request_code);
|
||||
|
||||
} catch (Exception e) {
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -440,7 +441,7 @@ public class DeliveryCallAddStoreActivity extends AppCompatActivity implements V
|
||||
PLAY_SERVICES_RESOLUTION_REQUEST).show();
|
||||
} else {
|
||||
Toast.makeText(context, getResources().getString(R.string.notsuppoted)
|
||||
, Toast.LENGTH_LONG)
|
||||
, Toast.LENGTH_LONG)
|
||||
.show();
|
||||
finish();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.content.res.Resources;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
@@ -79,25 +80,24 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.iconCalender:
|
||||
c = Calendar.getInstance();
|
||||
year = c.get(Calendar.YEAR);
|
||||
month = c.get(Calendar.MONTH);
|
||||
day = c.get(Calendar.DAY_OF_MONTH);
|
||||
showDatePickerDialog(year, month, day);
|
||||
break;
|
||||
case R.id.fab:
|
||||
Snackbar.make(v, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
break;
|
||||
int viewId = v.getId();
|
||||
|
||||
if (viewId == R.id.iconCalender) {
|
||||
c = Calendar.getInstance();
|
||||
year = c.get(Calendar.YEAR);
|
||||
month = c.get(Calendar.MONTH);
|
||||
day = c.get(Calendar.DAY_OF_MONTH);
|
||||
showDatePickerDialog(year, month, day);
|
||||
|
||||
} else if (viewId == R.id.fab) {
|
||||
Snackbar.make(v, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected void showDatePickerDialog(int year, int month, int day) {
|
||||
|
||||
DatePickerDialog datePickerDialog = new DatePickerDialog(this, pickerListener, year, month, day);
|
||||
// ((ViewGroup) datePickerDialog.getDatePicker()).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.setOutputSoapObject(request);
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
Log.d("requestdata",request.toString());
|
||||
|
||||
androidHttpTransport.call(
|
||||
CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
Object resultFuturedata = (Object) envelope.getResponse();
|
||||
|
||||
if (resultFuturedata.toString() != null) {
|
||||
|
||||
xpp.setInput(new StringReader(resultFuturedata.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
|
||||
journeyPlanPreviousGetterSetter = XMLHandlers.JCPXMLHandler(xpp, eventType);
|
||||
|
||||
}
|
||||
return "Success";
|
||||
} catch (XmlPullParserException e) {
|
||||
@@ -236,7 +234,6 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
||||
MyListAdapter adapter = new MyListAdapter(context, journeyPlanPreviousGetterSetter);
|
||||
futureJcpList.setLayoutManager(new LinearLayoutManager(context));
|
||||
futureJcpList.setAdapter(adapter);
|
||||
|
||||
} else {
|
||||
|
||||
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);
|
||||
finish();
|
||||
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@@ -302,7 +296,6 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(ViewHolder holder, int position) {
|
||||
|
||||
if (holder != null) {
|
||||
holder.txt_store_cd.setText(journeyPlanPreviousGetterSetter.getSTORE_ID().get(position));
|
||||
holder.txt_keyacct.setText(journeyPlanPreviousGetterSetter.getKEYACCOUNT().get(position));
|
||||
@@ -313,10 +306,8 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
|
||||
return journeyPlanPreviousGetterSetter.getSTORE_ID().size();
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
||||
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
||||
|
||||
public class MessageActivity extends AppCompatActivity {
|
||||
|
||||
//ArrayList<MessageGetterSetter> messages;
|
||||
private Context context;
|
||||
String categoryName = "", categoryId;
|
||||
@@ -121,10 +120,8 @@ public class MessageActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
toolbar.setTitle(getString(R.string.title_activity_message));
|
||||
|
||||
new DowloadAsync(MessageActivity.this).execute();
|
||||
}
|
||||
|
||||
|
||||
+52
-86
@@ -1,5 +1,4 @@
|
||||
package cpm.com.gskmtorange.dailyentry;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlertDialog;
|
||||
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.MSL_AvailabilityStockFacingGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
|
||||
|
||||
public class NewStockDataActivity extends AppCompatActivity implements DialogCallbackListener{
|
||||
|
||||
public class NewStockDataActivity extends AppCompatActivity implements DialogCallbackListener {
|
||||
private Context context;
|
||||
ExpandableListView expandableListView;
|
||||
TextView txt_mslAvailabilityName;
|
||||
@@ -84,7 +81,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
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;
|
||||
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;
|
||||
@@ -95,7 +92,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
boolean editFlag = false;
|
||||
|
||||
//temp
|
||||
public static final String FILE_PATH = Environment.getExternalStorageDirectory() + "/";
|
||||
// public static final String FILE_PATH = Environment.getExternalStorageDirectory() + "/";
|
||||
//ImageView bmImage;
|
||||
RelativeLayout view;
|
||||
|
||||
@@ -150,7 +147,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
str_planogram = CommonString.FILE_PATH_PLANOGRAM;
|
||||
str_planogram = CommonString.getDownloadedImageFolder(context);
|
||||
|
||||
prepareList();
|
||||
|
||||
@@ -171,12 +168,19 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
|
||||
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);
|
||||
Snackbar.make(view, getResources().getString(R.string.update_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
} else {
|
||||
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();
|
||||
}*/
|
||||
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();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
@@ -303,50 +307,6 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
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
|
||||
@@ -438,7 +398,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
//img_planogram.setImageBitmap(bmp);
|
||||
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>";
|
||||
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
||||
|
||||
@@ -670,28 +630,37 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
|
||||
//Header
|
||||
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)) {
|
||||
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 {
|
||||
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) {
|
||||
for (int i = 0; i < headerDataList.size(); i++) {
|
||||
hashMapListHeaderData.add(headerDataList.get(i));
|
||||
|
||||
//childDataList = new ArrayList<>();
|
||||
childDataList = db.getMSL_Availability_StockFacingSKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||
if (!(childDataList.size() > 0)) {
|
||||
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);
|
||||
} 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);
|
||||
} 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_StockFacingSKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||
if (country_id.equals("7")) {
|
||||
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)) {
|
||||
// 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 {
|
||||
// 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);
|
||||
@@ -938,7 +907,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
txt_categoryHeader.setTypeface(null, Typeface.BOLD);
|
||||
|
||||
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 {
|
||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.black));
|
||||
}
|
||||
@@ -948,6 +917,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
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));
|
||||
}
|
||||
@@ -1001,7 +971,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
|
||||
if (convertView == null) {
|
||||
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.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.setFilters(new InputFilter[]{new NewStockDataActivity.DecimalDigitsInputFilter(3, 1)});
|
||||
holder.stock = (EditText) convertView.findViewById(R.id.ed_stock);
|
||||
|
||||
holder.stock_view = convertView.findViewById(R.id.stock_view);
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
@@ -1025,12 +994,13 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
holder.txt_mbq.setText(childData.getMbq());
|
||||
|
||||
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.toggle_available.setVisibility(View.VISIBLE);
|
||||
holder.facing.setVisibility(View.VISIBLE);
|
||||
|
||||
|
||||
if (country_id.equals("6")) {
|
||||
holder.stock.setVisibility(View.VISIBLE);
|
||||
holder.stock_view.setVisibility(View.VISIBLE);
|
||||
@@ -1115,18 +1085,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
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();
|
||||
}
|
||||
@@ -1523,11 +1482,13 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
|
||||
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));
|
||||
// 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 {
|
||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||
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 {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
}
|
||||
@@ -1543,11 +1504,12 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
|
||||
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));
|
||||
//holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.lin_category.setBackgroundResource(R.drawable.cardview_error_border);
|
||||
} else {
|
||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||
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 {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
}
|
||||
@@ -1575,6 +1537,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
ToggleButton toggle_available;
|
||||
LinearLayout lin_category;
|
||||
EditText facing, stock;
|
||||
|
||||
View stock_view;
|
||||
}
|
||||
|
||||
@@ -1641,6 +1604,9 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
return "";
|
||||
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, "");
|
||||
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
||||
|
||||
str = CommonString.FILE_PATH;
|
||||
str = CommonString.getImagesFolder(context);
|
||||
|
||||
//Intent data
|
||||
categoryName = getIntent().getStringExtra("categoryName");
|
||||
@@ -321,7 +321,6 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
||||
@Override
|
||||
public boolean onLongClick(View tvView) {
|
||||
showDeleteDialog(tvView);
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
@@ -1063,7 +1062,7 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
||||
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);
|
||||
} else if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
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();
|
||||
}
|
||||
if (!planogram_image.equals("")) {
|
||||
if (new File(CommonString.FILE_PATH_PLANOGRAM + planogram_image).exists()) {
|
||||
Bitmap bmp = BitmapFactory.decodeFile(CommonString.FILE_PATH_PLANOGRAM + planogram_image);
|
||||
if (new File(CommonString.getDownloadedImageFolder(context) + planogram_image).exists()) {
|
||||
Bitmap bmp = BitmapFactory.decodeFile(CommonString.getDownloadedImageFolder(context) + planogram_image);
|
||||
// img_planogram.setRotation(90);
|
||||
//img_planogram.setImageBitmap(bmp);
|
||||
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>";
|
||||
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
||||
|
||||
@@ -1147,7 +1146,7 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
// super.onBackPressed();
|
||||
super.onBackPressed();
|
||||
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(NoCameraActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
@@ -1202,12 +1201,10 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
||||
|
||||
void addRow(){
|
||||
DynamycIdsGetterSetter dynamic_ids = new DynamycIdsGetterSetter();
|
||||
|
||||
// first Button
|
||||
RelativeLayout rLayout = new RelativeLayout(context);
|
||||
RelativeLayout.LayoutParams lprams = new RelativeLayout.LayoutParams(
|
||||
RelativeLayout.LayoutParams.MATCH_PARENT,
|
||||
RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||
RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||
TextView tv = new TextView(context);
|
||||
//tv.setHeight(60);
|
||||
tv.setTextSize(20);
|
||||
@@ -1217,21 +1214,15 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
||||
tv.setLayoutParams(lprams);
|
||||
int tv_id = View.generateViewId();
|
||||
tv.setId(tv_id);
|
||||
|
||||
//set dynamic textview id to object
|
||||
dynamic_ids.setTextview_id(tv_id);
|
||||
|
||||
RecyclerView rec_bottom = new RecyclerView(context);
|
||||
int rec_id = View.generateViewId();
|
||||
|
||||
//set dynamic recycler id to object
|
||||
dynamic_ids.setRecycler_id(rec_id);
|
||||
|
||||
rec_bottom.setLayoutParams(lprams);
|
||||
rec_bottom.setPadding(0, 0, 0, 0);
|
||||
|
||||
rec_bottom.setVisibility(View.GONE);
|
||||
|
||||
rec_bottom.setId(rec_id);
|
||||
rec_bottom.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
private ProgressBar pb;
|
||||
private FailureGetterSetter failureGetterSetter = null;
|
||||
boolean nonflag=true;
|
||||
String store_flag_str;
|
||||
String store_flag_str,country_id, keyAccount_id, class_id, storeType_id;
|
||||
|
||||
TextView tv_remark;
|
||||
|
||||
@@ -117,7 +117,6 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
// TODO Auto-generated method stub
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.nonworkingmainlayout);
|
||||
|
||||
reasonspinner = (Spinner) findViewById(R.id.spinner_reason);
|
||||
camera = (ImageButton) findViewById(R.id.imgcam);
|
||||
save = (Button) findViewById(R.id.save);
|
||||
@@ -126,28 +125,25 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
reason_lay = (RelativeLayout) findViewById(R.id.layout_reason);
|
||||
rel_cam = (RelativeLayout) findViewById(R.id.relimgcam);
|
||||
subreason_spinner = (Spinner) findViewById(R.id.spinner_sub_reason);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
context = this;
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
||||
|
||||
_UserId = preferences.getString(CommonString.KEY_USERNAME, "");
|
||||
visit_date = preferences.getString(CommonString.KEY_DATE, 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 = preferences.getString(CommonString.KEY_STORE_ID, "");
|
||||
|
||||
database = new GSKOrangeDB(this);
|
||||
database.open();
|
||||
str = CommonString.FILE_PATH;
|
||||
str = CommonString.getImagesFolder(context);
|
||||
|
||||
//storelist = database.getStoreData(visit_date,CommonString.KEY_JOURNEY_PLAN );
|
||||
|
||||
@@ -215,9 +211,8 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
super.onBackPressed();
|
||||
finish();
|
||||
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
|
||||
@@ -226,77 +221,72 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
long arg3) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
switch (arg0.getId()) {
|
||||
case R.id.spinner_reason:
|
||||
if (position != 0) {
|
||||
reasonname = reasondata.get(position - 1).getREASON().get(0);
|
||||
reasonid = reasondata.get(position - 1).getREASON_ID().get(0);
|
||||
entry_allow = reasondata.get(position - 1).getENTRY_ALLOW().get(0);
|
||||
int id = arg0.getId();
|
||||
|
||||
image_allow = reasondata.get(position - 1).getIMAGE_ALLOW().get(0);
|
||||
remark_allow = reasondata.get(position - 1).getREMARK_REQUIRED().get(0);
|
||||
remark_type = reasondata.get(position - 1).getREMARK_TYPE().get(0);
|
||||
if (id == R.id.spinner_reason) {
|
||||
if (position != 0) {
|
||||
reasonname = reasondata.get(position - 1).getREASON().get(0);
|
||||
reasonid = reasondata.get(position - 1).getREASON_ID().get(0);
|
||||
entry_allow = reasondata.get(position - 1).getENTRY_ALLOW().get(0);
|
||||
|
||||
if (image_allow.equalsIgnoreCase("1")) {
|
||||
rel_cam.setVisibility(View.VISIBLE);
|
||||
image = "true";
|
||||
} else {
|
||||
rel_cam.setVisibility(View.GONE);
|
||||
image = "false";
|
||||
}
|
||||
//reason_reamrk = "true";
|
||||
if (remark_allow.equalsIgnoreCase("1")) {
|
||||
reason_lay.setVisibility(View.VISIBLE);
|
||||
if(remark_type.equalsIgnoreCase("Text")){
|
||||
text.setVisibility(View.VISIBLE);
|
||||
subreason_spinner.setVisibility(View.GONE);
|
||||
}
|
||||
else {
|
||||
text.setVisibility(View.GONE);
|
||||
subreason_spinner.setVisibility(View.VISIBLE);
|
||||
image_allow = reasondata.get(position - 1).getIMAGE_ALLOW().get(0);
|
||||
remark_allow = reasondata.get(position - 1).getREMARK_REQUIRED().get(0);
|
||||
remark_type = reasondata.get(position - 1).getREMARK_TYPE().get(0);
|
||||
|
||||
sub_reasondata = database.getNonWorkingSubReasonData(reasonid);
|
||||
|
||||
sub_reason_adapter = new ArrayAdapter<CharSequence>(this,
|
||||
android.R.layout.simple_spinner_item);
|
||||
|
||||
String select_str = getResources().getString(R.string.select_promo) + " " +reasondata.get(position - 1).getREMARK_LABEL().get(0);
|
||||
|
||||
sub_reason_adapter.add(select_str);
|
||||
|
||||
for (int i = 0; i < sub_reasondata.size(); i++) {
|
||||
sub_reason_adapter.add(sub_reasondata.get(i).getSUB_REASON().get(0));
|
||||
}
|
||||
|
||||
subreason_spinner.setAdapter(sub_reason_adapter);
|
||||
|
||||
sub_reason_adapter
|
||||
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
|
||||
subreason_spinner.setOnItemSelectedListener(this);
|
||||
}
|
||||
tv_remark.setText(reasondata.get(position - 1).getREMARK_LABEL().get(0));
|
||||
} else {
|
||||
reason_lay.setVisibility(View.GONE);
|
||||
}
|
||||
if (image_allow.equalsIgnoreCase("1")) {
|
||||
rel_cam.setVisibility(View.VISIBLE);
|
||||
image = "true";
|
||||
} else {
|
||||
rel_cam.setVisibility(View.GONE);
|
||||
image = "false";
|
||||
}
|
||||
|
||||
if (remark_allow.equalsIgnoreCase("1")) {
|
||||
reason_lay.setVisibility(View.VISIBLE);
|
||||
if (remark_type.equalsIgnoreCase("Text")) {
|
||||
text.setVisibility(View.VISIBLE);
|
||||
subreason_spinner.setVisibility(View.GONE);
|
||||
} else {
|
||||
text.setVisibility(View.GONE);
|
||||
subreason_spinner.setVisibility(View.VISIBLE);
|
||||
|
||||
sub_reasondata = database.getNonWorkingSubReasonData(reasonid);
|
||||
|
||||
sub_reason_adapter = new ArrayAdapter<CharSequence>(this,
|
||||
android.R.layout.simple_spinner_item);
|
||||
|
||||
String select_str = getResources().getString(R.string.select_promo) + " " + reasondata.get(position - 1).getREMARK_LABEL().get(0);
|
||||
|
||||
sub_reason_adapter.add(select_str);
|
||||
|
||||
for (int i = 0; i < sub_reasondata.size(); i++) {
|
||||
sub_reason_adapter.add(sub_reasondata.get(i).getSUB_REASON().get(0));
|
||||
}
|
||||
|
||||
subreason_spinner.setAdapter(sub_reason_adapter);
|
||||
|
||||
sub_reason_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
|
||||
subreason_spinner.setOnItemSelectedListener(this);
|
||||
}
|
||||
tv_remark.setText(reasondata.get(position - 1).getREMARK_LABEL().get(0));
|
||||
} else {
|
||||
reasonname = "";
|
||||
reasonid = "";
|
||||
reason_lay.setVisibility(View.GONE);
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.spinner_sub_reason:
|
||||
|
||||
if (position != 0) {
|
||||
sub_reason_id = sub_reasondata.get(position-1).getSUB_REASON_ID().get(0);
|
||||
}
|
||||
else {
|
||||
sub_reason_id = "";
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
reasonname = "";
|
||||
reasonid = "";
|
||||
reason_lay.setVisibility(View.GONE);
|
||||
}
|
||||
} else if (id == R.id.spinner_sub_reason) {
|
||||
if (position != 0) {
|
||||
sub_reason_id = sub_reasondata.get(position - 1).getSUB_REASON_ID().get(0);
|
||||
} else {
|
||||
sub_reason_id = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -430,7 +420,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
|
||||
_pathforcheck = store_id + "NonWorking" + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
|
||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||
|
||||
startCameraActivity();
|
||||
}
|
||||
@@ -471,7 +461,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
int id) {
|
||||
|
||||
alert.getButton(
|
||||
AlertDialog.BUTTON_POSITIVE)
|
||||
AlertDialog.BUTTON_POSITIVE)
|
||||
.setEnabled(false);
|
||||
|
||||
if (entry_allow.equals("0")) {
|
||||
@@ -496,13 +486,22 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
cdata.setLongitude("0.0");
|
||||
cdata.setImage(image1);
|
||||
cdata.setSub_reasonId(sub_reason_id);
|
||||
|
||||
cdata.setRemark(text.getText().toString().replaceAll("[&^<>{}'$]", " "));
|
||||
cdata.setStatus(CommonString.STORE_STATUS_LEAVE);
|
||||
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);
|
||||
|
||||
|
||||
@@ -541,34 +540,27 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
cdata.setStatus(CommonString.STORE_STATUS_LEAVE);
|
||||
cdata.setFlag_from(store_flag_str);
|
||||
|
||||
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, CommonString.FROM_JCP);
|
||||
database.updateStoreStatusOnLeave(store_id, visit_date, CommonString.STORE_STATUS_LEAVE, store_flag_str);
|
||||
|
||||
SharedPreferences.Editor editor = preferences
|
||||
.edit();
|
||||
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
editor.putString(CommonString.KEY_STOREVISITED_STATUS + store_id, "No");
|
||||
editor.putString(
|
||||
CommonString.KEY_STOREVISITED_STATUS,
|
||||
"");
|
||||
editor.putString(
|
||||
CommonString.KEY_STORE_IN_TIME,
|
||||
"");
|
||||
editor.putString(
|
||||
CommonString.KEY_LATITUDE,
|
||||
"");
|
||||
editor.putString(
|
||||
CommonString.KEY_LONGITUDE,
|
||||
"");
|
||||
editor.putString(CommonString.KEY_STOREVISITED_STATUS, "");
|
||||
editor.putString(CommonString.KEY_STORE_IN_TIME, "");
|
||||
editor.putString(CommonString.KEY_LATITUDE, "");
|
||||
editor.putString(CommonString.KEY_LONGITUDE, "");
|
||||
editor.commit();
|
||||
|
||||
}
|
||||
|
||||
new NonWorkingReason.GeoTagUpload(NonWorkingReason.this).execute();
|
||||
|
||||
// finish();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.closed,
|
||||
@@ -643,6 +635,8 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
cdate = arabicToenglish(cdate);
|
||||
}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);
|
||||
}
|
||||
|
||||
|
||||
@@ -847,9 +841,9 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
|
||||
ResultFlag = false;
|
||||
strflag = CommonString.MESSAGE_EXCEPTION;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -59,6 +59,8 @@ public class POGQuestionsActivity extends AppCompatActivity {
|
||||
private SharedPreferences preferences;
|
||||
int scrollPosition = 0;
|
||||
|
||||
|
||||
|
||||
GSKOrangeDB db;
|
||||
|
||||
List<MSL_AvailabilityStockFacingGetterSetter> headerDataList = new ArrayList<>();
|
||||
@@ -146,13 +148,12 @@ public class POGQuestionsActivity extends AppCompatActivity {
|
||||
adapter.notifyDataSetChanged();
|
||||
expandableListView.invalidateViews();
|
||||
}
|
||||
|
||||
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);
|
||||
final ArrayAdapter planogramTypeAdapter = new ArrayAdapter<CharSequence>(this,
|
||||
android.R.layout.simple_spinner_item);
|
||||
|
||||
@@ -28,16 +28,14 @@ import cpm.com.gskmtorange.fragment.SelectLanguageFragment;
|
||||
import cpm.com.gskmtorange.fragment.SettingsActivityFragment;
|
||||
|
||||
public class SettingsActivity extends AppCompatActivity implements SelectLanguageFragment.OnFragmentInteractionListener {
|
||||
|
||||
String selected_lang = "", culture_id, notice_url;
|
||||
private Context context;
|
||||
FloatingActionButton fab;
|
||||
|
||||
private SharedPreferences preferences;
|
||||
|
||||
private SharedPreferences.Editor editor = null;
|
||||
|
||||
Toolbar toolbar;
|
||||
private static final String SELECTED_ITEM_POSITION = "ItemPosition";
|
||||
private int mPosition;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -47,11 +45,9 @@ public class SettingsActivity extends AppCompatActivity implements SelectLanguag
|
||||
setSupportActionBar(toolbar);
|
||||
context = this;
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
//preference data
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
editor = preferences.edit();
|
||||
|
||||
CommonFunctions.updateLangResources(context,preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
/* SettingsActivityFragment fragment = new SettingsActivityFragment();
|
||||
@@ -61,37 +57,27 @@ public class SettingsActivity extends AppCompatActivity implements SelectLanguag
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
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 {
|
||||
|
||||
CommonFunctions.updateLangResources(context,selected_lang);
|
||||
|
||||
editor.putString(CommonString.KEY_LANGUAGE, selected_lang);
|
||||
editor.putString(CommonString.KEY_CULTURE_ID, culture_id);
|
||||
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, notice_url);
|
||||
editor.commit();
|
||||
|
||||
Intent startDownload = new Intent(context, MainActivity.class);
|
||||
startActivity(startDownload);
|
||||
finish();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFragmentInteraction(String selected_lang, String culture_id, String notice_url) {
|
||||
|
||||
this.selected_lang = selected_lang;
|
||||
this.culture_id = culture_id;
|
||||
this.notice_url = notice_url;
|
||||
|
||||
if (!selected_lang.equals("")) {
|
||||
fab.show();
|
||||
}
|
||||
@@ -110,7 +96,7 @@ public class SettingsActivity extends AppCompatActivity implements SelectLanguag
|
||||
startActivity(startDownload);
|
||||
|
||||
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
|
||||
@@ -129,7 +115,7 @@ public class SettingsActivity extends AppCompatActivity implements SelectLanguag
|
||||
|
||||
finish();
|
||||
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
// overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -139,5 +125,18 @@ public class SettingsActivity extends AppCompatActivity implements SelectLanguag
|
||||
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();*/
|
||||
|
||||
db.open();
|
||||
|
||||
if (db.checkStockData(store_id, categoryId)) {
|
||||
db.updateStockData(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||
if (db.checkStockData(store_id, categoryId, visit_date)) {
|
||||
db.updateStockData(store_id, categoryId, visit_date, hashMapListHeaderData, hashMapListChildData);
|
||||
Snackbar.make(expandableListView, getResources().getString(R.string.update_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
} 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();
|
||||
}
|
||||
finish();
|
||||
@@ -234,45 +233,45 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
db.open();
|
||||
}
|
||||
|
||||
private void prepareList() {
|
||||
try {
|
||||
hashMapListHeaderData = new ArrayList<>();
|
||||
hashMapListChildData = new HashMap<>();
|
||||
|
||||
//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);
|
||||
} 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) {
|
||||
for (int i = 0; i < headerDataList.size(); i++) {
|
||||
hashMapListHeaderData.add(headerDataList.get(i));
|
||||
|
||||
//childDataList = new ArrayList<>();
|
||||
childDataList = db.getStockAfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||
if (!(childDataList.size() > 0)) {
|
||||
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");
|
||||
} 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");
|
||||
} 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");
|
||||
} 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.getStockAfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||
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_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)) {
|
||||
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)) {
|
||||
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 {
|
||||
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);
|
||||
@@ -330,7 +329,7 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
||||
txt_categoryHeader.setTypeface(null, Typeface.BOLD);
|
||||
|
||||
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 {
|
||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.black));
|
||||
}
|
||||
@@ -339,7 +338,10 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
||||
|
||||
if (!checkflag) {
|
||||
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 {
|
||||
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());
|
||||
|
||||
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 {
|
||||
|
||||
@@ -465,11 +467,12 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
||||
|
||||
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));
|
||||
// holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.lin_category.setBackgroundResource(R.drawable.cardview_error_border);
|
||||
} else {
|
||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||
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 {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
}
|
||||
@@ -491,11 +494,13 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
||||
|
||||
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));
|
||||
// holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.lin_category.setBackgroundResource(R.drawable.cardview_error_border);
|
||||
|
||||
} else {
|
||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||
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 {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
}
|
||||
@@ -593,6 +598,7 @@ public class StockActivity extends AppCompatActivity implements DialogCallbackLi
|
||||
|
||||
return all_flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (editFlag) {
|
||||
|
||||
@@ -135,12 +135,19 @@ public class StockDataActivity extends AppCompatActivity implements DialogCallba
|
||||
|
||||
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);
|
||||
Snackbar.make(expandableListView, getResources().getString(R.string.update_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
} else {
|
||||
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();
|
||||
}*/
|
||||
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();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
@@ -276,6 +283,7 @@ public class StockDataActivity extends AppCompatActivity implements DialogCallba
|
||||
}
|
||||
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");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+18
-14
@@ -46,11 +46,11 @@ public class StockPricingActivity extends AppCompatActivity {
|
||||
private SharedPreferences preferences;
|
||||
|
||||
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;
|
||||
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> headerDataList;
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> childDataList= new ArrayList<>();
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> childDataList = new ArrayList<>();
|
||||
List<MSL_AvailabilityStockFacingGetterSetter> hashMapListHeaderData;
|
||||
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> hashMapListChildData;
|
||||
ExpandableListAdapter adapter;
|
||||
@@ -59,7 +59,7 @@ public class StockPricingActivity extends AppCompatActivity {
|
||||
boolean checkflag = true;
|
||||
|
||||
FloatingActionButton fab;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -116,17 +116,18 @@ public class StockPricingActivity extends AppCompatActivity {
|
||||
hashMapListChildData = new HashMap<>();
|
||||
|
||||
//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) {
|
||||
for (int i = 0; i < headerDataList.size(); i++) {
|
||||
hashMapListHeaderData.add(headerDataList.get(i));
|
||||
|
||||
childDataList = new ArrayList<>();
|
||||
//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);
|
||||
}
|
||||
@@ -263,7 +264,7 @@ public class StockPricingActivity extends AppCompatActivity {
|
||||
txt_categoryHeader.setTypeface(null, Typeface.BOLD);
|
||||
|
||||
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 {
|
||||
txt_categoryHeader.setTextColor(getResources().getColor(R.color.black));
|
||||
}
|
||||
@@ -273,6 +274,7 @@ public class StockPricingActivity extends AppCompatActivity {
|
||||
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));
|
||||
}
|
||||
@@ -359,7 +361,7 @@ public class StockPricingActivity extends AppCompatActivity {
|
||||
holder.et_price.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
if(!hasFocus){
|
||||
if (!hasFocus) {
|
||||
final EditText caption = (EditText) v;
|
||||
String edStock = caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
||||
|
||||
@@ -383,11 +385,12 @@ public class StockPricingActivity extends AppCompatActivity {
|
||||
|
||||
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));
|
||||
//holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.lin_category.setBackgroundResource(R.drawable.cardview_error_border);
|
||||
} else {
|
||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||
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 {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
}
|
||||
@@ -403,11 +406,12 @@ public class StockPricingActivity extends AppCompatActivity {
|
||||
|
||||
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));
|
||||
//holder.lin_category.setBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.lin_category.setBackgroundResource(R.drawable.cardview_error_border);
|
||||
} else {
|
||||
//holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||
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 {
|
||||
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
}
|
||||
|
||||
+83
-84
@@ -1,5 +1,7 @@
|
||||
package cpm.com.gskmtorange.dailyentry;
|
||||
|
||||
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
@@ -19,6 +21,7 @@ import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Looper;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.provider.MediaStore;
|
||||
import android.util.Log;
|
||||
@@ -32,12 +35,18 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.FileProvider;
|
||||
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
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.Priority;
|
||||
|
||||
import org.ksoap2.SoapEnvelope;
|
||||
import org.ksoap2.serialization.SoapObject;
|
||||
@@ -58,6 +67,7 @@ import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.xml.parsers.SAXParser;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
@@ -93,7 +103,8 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
||||
AlertDialog alert;
|
||||
String img_str, strflag;
|
||||
private GSKOrangeDB database;
|
||||
|
||||
private FusedLocationProviderClient fusedLocationProviderClient;
|
||||
LocationRequest locationRequest;
|
||||
String lat = "0.0", lon = "0.0";
|
||||
GoogleApiClient mGoogleApiClient;
|
||||
ArrayList<CoverageBean> coverage_list;
|
||||
@@ -108,34 +119,25 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
||||
context = this;
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
|
||||
img_cam = (ImageView) findViewById(R.id.img_selfie);
|
||||
img_clicked = (ImageView) findViewById(R.id.img_cam_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);
|
||||
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||
_UserId = preferences.getString(CommonString.KEY_USERNAME, "");
|
||||
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
||||
|
||||
checkOutStore_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
||||
|
||||
str = CommonString.FILE_PATH;
|
||||
|
||||
str = CommonString.getImagesFolder(context);
|
||||
fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);
|
||||
database = new GSKOrangeDB(this);
|
||||
database.open();
|
||||
|
||||
coverage_list = database.getCoverageData(date, store_flag_str);
|
||||
|
||||
img_cam.setOnClickListener(this);
|
||||
img_clicked.setOnClickListener(this);
|
||||
btn_save.setOnClickListener(this);
|
||||
@@ -174,80 +176,57 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
/*Intent i = new Intent(this, DailyEntryScreen.class);
|
||||
startActivity(i);*/
|
||||
|
||||
super.onBackPressed();
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
|
||||
@SuppressLint("NonConstantResourceId")
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
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) {
|
||||
case R.id.img_cam_selfie:
|
||||
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
startCameraActivity();
|
||||
|
||||
_pathforcheck = checkOutStore_id + "CHK_SI_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
} else if (id == R.id.btn_save_selfie) {
|
||||
if (img_str != null) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(StoreCheckoutImageActivity.this);
|
||||
builder.setMessage(getResources().getString(R.string.title_activity_save_data))
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(getResources().getString(R.string.ok), (dialog, id1) -> {
|
||||
alert.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
|
||||
Intent i = new Intent(StoreCheckoutImageActivity.this, CheckoutActivity.class);
|
||||
i.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
i.putExtra(CommonString.KEY_STORE_ID, checkOutStore_id);
|
||||
i.putExtra(CommonString.KEY_CHECKOUT_IMAGE, img_str);
|
||||
i.putExtra(CommonString.KEY_LATITUDE, lat);
|
||||
i.putExtra(CommonString.KEY_LONGITUDE, lon);
|
||||
startActivity(i);
|
||||
finish();
|
||||
})
|
||||
.setNegativeButton(getResources().getString(R.string.cancel), (dialog, id12) -> dialog.cancel());
|
||||
|
||||
startCameraActivity();
|
||||
break;
|
||||
alert = builder.create();
|
||||
alert.show();
|
||||
|
||||
case R.id.btn_save_selfie:
|
||||
|
||||
if (img_str != null) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(StoreCheckoutImageActivity.this);
|
||||
builder.setMessage(getResources().getString(R.string.title_activity_save_data))
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
alert.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
|
||||
|
||||
Intent i = new Intent(StoreCheckoutImageActivity.this, CheckoutActivity.class);
|
||||
i.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
i.putExtra(CommonString.KEY_STORE_ID, checkOutStore_id);
|
||||
i.putExtra(CommonString.KEY_CHECKOUT_IMAGE, img_str);
|
||||
i.putExtra(CommonString.KEY_LATITUDE, lat);
|
||||
i.putExtra(CommonString.KEY_LONGITUDE, lon);
|
||||
startActivity(i);
|
||||
finish();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
|
||||
alert = builder.create();
|
||||
alert.show();
|
||||
} else {
|
||||
Toast.makeText(context, getResources().getString(R.string.clickimage), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
break;
|
||||
} else {
|
||||
Toast.makeText(context, getResources().getString(R.string.clickimage), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void startCameraActivity() {
|
||||
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()");
|
||||
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 = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
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("الاستوديو")) {
|
||||
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;
|
||||
}
|
||||
@@ -279,19 +255,16 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
||||
}
|
||||
|
||||
//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) {
|
||||
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)) {
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -346,11 +321,11 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
||||
|
||||
@Override
|
||||
public void onConnected(Bundle bundle) {
|
||||
@SuppressLint("MissingPermission") Location mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
|
||||
/* @SuppressLint("MissingPermission") Location mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
|
||||
if (mLastLocation != null) {
|
||||
lat = String.valueOf(mLastLocation.getLatitude());
|
||||
lon = String.valueOf(mLastLocation.getLongitude());
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -368,6 +343,36 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
||||
super.onResume();
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
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() {
|
||||
@@ -461,9 +466,6 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
||||
|
||||
SoapObject request = new SoapObject(CommonString.NAMESPACE,
|
||||
CommonString.METHOD_UPLOAD_CURRENT_DATA);
|
||||
//request.addProperty("MID", "0");
|
||||
// request.addProperty("KEYS", "CURRENT_DATA");
|
||||
// request.addProperty("USERNAME", username);
|
||||
|
||||
request.addProperty("onXML", current_xml);
|
||||
|
||||
@@ -572,13 +574,10 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
||||
|
||||
//showAlert(getString(R.string.data_downloaded_successfully));
|
||||
} else {
|
||||
|
||||
GSKOrangeDB db = new GSKOrangeDB(StoreCheckoutImageActivity.this);
|
||||
db.open();
|
||||
|
||||
dialog.dismiss();
|
||||
db.deleteTableWithStoreID(store_id);
|
||||
|
||||
showAlert(getString(R.string.datanotfound) + " " + result);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+227
-224
@@ -1,5 +1,7 @@
|
||||
package cpm.com.gskmtorange.dailyentry;
|
||||
|
||||
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
@@ -20,6 +22,8 @@ import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.Looper;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.provider.MediaStore;
|
||||
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.GooglePlayServicesUtil;
|
||||
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.LocationRequest;
|
||||
import com.google.android.gms.location.LocationResult;
|
||||
import com.google.android.gms.location.LocationServices;
|
||||
import com.google.android.gms.location.Priority;
|
||||
|
||||
import org.ksoap2.SoapEnvelope;
|
||||
import org.ksoap2.serialization.SoapObject;
|
||||
@@ -98,7 +106,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
private FailureGetterSetter failureGetterSetter = null;
|
||||
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;
|
||||
AlertDialog alert;
|
||||
String img_str, strflag;
|
||||
@@ -110,11 +118,10 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
Toolbar toolbar;
|
||||
boolean ResultFlag = true;
|
||||
ArrayList<CoverageBean> coverage = new ArrayList<CoverageBean>();
|
||||
|
||||
String VISIT_TYPE_ID = "";
|
||||
LocationManager locationManager;
|
||||
boolean enabled;
|
||||
private final static int PLAY_SERVICES_RESOLUTION_REQUEST = 1000;
|
||||
|
||||
private LocationRequest mLocationRequest;
|
||||
private static int UPDATE_INTERVAL = 500; // 5 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();
|
||||
|
||||
//New Changes
|
||||
private FusedLocationProviderClient fusedLocationProviderClient;
|
||||
LocationRequest locationRequest;
|
||||
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_storeimage);
|
||||
context = this;
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
img_cam = (ImageView) findViewById(R.id.img_selfie);
|
||||
img_clicked = (ImageView) findViewById(R.id.img_cam_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);
|
||||
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||
_UserId = preferences.getString(CommonString.KEY_USERNAME, "");
|
||||
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
||||
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_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.open();
|
||||
|
||||
@@ -164,10 +173,8 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
btn_save.setOnClickListener(this);
|
||||
|
||||
if (checkPlayServices()) {
|
||||
|
||||
// Building the GoogleApi client
|
||||
buildGoogleApiClient();
|
||||
|
||||
createLocationRequest();
|
||||
}
|
||||
|
||||
@@ -297,33 +304,6 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
@Override
|
||||
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
|
||||
@@ -375,6 +355,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
/*Intent i = new Intent(this, DailyEntryScreen.class);
|
||||
startActivity(i);*/
|
||||
|
||||
super.onBackPressed();
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
@@ -474,125 +455,112 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
|
||||
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 = str + _pathforcheck;
|
||||
|
||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
|
||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||
startCameraActivity();
|
||||
|
||||
startCameraActivity();
|
||||
} else if (id == R.id.btn_save_selfie) {
|
||||
|
||||
break;
|
||||
if (img_str != null) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(StoreimageActivity.this);
|
||||
builder.setMessage(getResources().getString(R.string.title_activity_save_data))
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
alert.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
|
||||
String status;
|
||||
|
||||
case R.id.btn_save_selfie:
|
||||
|
||||
if (img_str != null) {
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(StoreimageActivity.this);
|
||||
builder.setMessage(getResources().getString(R.string.title_activity_save_data))
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
alert.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
|
||||
|
||||
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) || country_id.equalsIgnoreCase("5")
|
||||
|| store_flag_str.equals(CommonString.FROM_PHARMA)) {
|
||||
status = CommonString.KEY_INVALID;
|
||||
if (store_flag_str.equals(CommonString.FROM_JCP)
|
||||
|| country_id.equalsIgnoreCase("5")
|
||||
|| country_id.equalsIgnoreCase("15")
|
||||
|| store_flag_str.equals(CommonString.FROM_PHARMA)) {
|
||||
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 {
|
||||
status = CommonString.KEY_VALID;
|
||||
}
|
||||
} else {
|
||||
status = CommonString.KEY_VALID;
|
||||
}
|
||||
|
||||
CoverageBean cdata = new CoverageBean();
|
||||
cdata.setStoreId(store_id);
|
||||
cdata.setVisitDate(visit_date);
|
||||
cdata.setUserId(username);
|
||||
cdata.setInTime(intime);
|
||||
cdata.setReason("");
|
||||
cdata.setReasonid("0");
|
||||
cdata.setLatitude(lat + "");
|
||||
cdata.setLongitude(lon + "");
|
||||
cdata.setImage(img_str);
|
||||
cdata.setSub_reasonId("0");
|
||||
cdata.setRemark("");
|
||||
|
||||
cdata.setStatus(status);
|
||||
|
||||
cdata.setCheckOut_Image("");
|
||||
cdata.setFlag_from(store_flag_str);
|
||||
|
||||
database.InsertCoverageData(cdata);
|
||||
|
||||
String table;
|
||||
if (store_flag_str.equals(CommonString.FROM_JCP)) {
|
||||
table = CommonString.KEY_JOURNEY_PLAN;
|
||||
} else if (store_flag_str.equals(CommonString.FROM_ADDITIONAL)) {
|
||||
table = CommonString.KEY_JOURNEY_PLAN_ADDITIONAL;
|
||||
} else if (store_flag_str.equals(CommonString.FROM_PHARMA)) {
|
||||
table = CommonString.KEY_JOURNEY_PLAN_PHARMA;
|
||||
}else if (store_flag_str.equals(CommonString.FROM_ADDITIONAL_ADHOC)) {
|
||||
table = CommonString.KEY_ADHOC_JOURNEYPLAN_ADDITIONAL;
|
||||
} else{
|
||||
table = CommonString.KEY_ADHOC_JOURNEY_PLAN;
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
|
||||
CoverageBean cdata = new CoverageBean();
|
||||
cdata.setStoreId(store_id);
|
||||
cdata.setVisitDate(visit_date);
|
||||
cdata.setUserId(username);
|
||||
cdata.setInTime(intime);
|
||||
cdata.setReason("");
|
||||
cdata.setReasonid("0");
|
||||
cdata.setLatitude(lat + "");
|
||||
cdata.setLongitude(lon + "");
|
||||
cdata.setImage(img_str);
|
||||
cdata.setSub_reasonId("0");
|
||||
cdata.setRemark("");
|
||||
cdata.setStatus(status);
|
||||
cdata.setCheckOut_Image("");
|
||||
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);
|
||||
}
|
||||
});
|
||||
|
||||
alert = builder.create();
|
||||
alert.show();
|
||||
database.open();
|
||||
database.InsertCoverageData(cdata);
|
||||
|
||||
} else {
|
||||
Toast.makeText(context, getResources().getString(R.string.clickimage), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
String table;
|
||||
if (store_flag_str.equals(CommonString.FROM_JCP)) {
|
||||
table = CommonString.KEY_JOURNEY_PLAN;
|
||||
} else if (store_flag_str.equals(CommonString.FROM_ADDITIONAL)) {
|
||||
table = CommonString.KEY_JOURNEY_PLAN_ADDITIONAL;
|
||||
} else if (store_flag_str.equals(CommonString.FROM_PHARMA)) {
|
||||
table = CommonString.KEY_JOURNEY_PLAN_PHARMA;
|
||||
} else if (store_flag_str.equals(CommonString.FROM_ADDITIONAL_ADHOC)) {
|
||||
table = CommonString.KEY_ADHOC_JOURNEYPLAN_ADDITIONAL;
|
||||
} else {
|
||||
table = CommonString.KEY_ADHOC_JOURNEY_PLAN;
|
||||
}
|
||||
|
||||
database.updateCheckoutStatus(store_id, status, table);
|
||||
|
||||
new GeoTagUpload(StoreimageActivity.this).execute();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
|
||||
alert = builder.create();
|
||||
alert.show();
|
||||
|
||||
} else {
|
||||
Toast.makeText(context, getResources().getString(R.string.clickimage), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void startCameraActivity() {
|
||||
/*protected void startCameraActivity() {
|
||||
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()");
|
||||
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 = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
@@ -640,9 +608,49 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
|
||||
} catch (Exception e) {
|
||||
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:
|
||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||
if (new File(str + _pathforcheck).exists()) {
|
||||
|
||||
//temp check--------
|
||||
/*File file = new File(str + _pathforcheck);
|
||||
saveBitmapToFileSmaller(file);*/
|
||||
//saveBitmapToFile(file);
|
||||
//-------------------
|
||||
|
||||
try {
|
||||
|
||||
Bitmap bmp = BitmapFactory.decodeFile(str + _pathforcheck);
|
||||
img_cam.setImageBitmap(bmp);
|
||||
} catch (OutOfMemoryError ex) {
|
||||
@@ -711,26 +711,41 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
if (mGoogleApiClient.isConnected()) {
|
||||
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);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, Looper.getMainLooper());
|
||||
}
|
||||
|
||||
/*protected void onStart() {
|
||||
mGoogleApiClient.connect();
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
protected void onStop() {
|
||||
mGoogleApiClient.disconnect();
|
||||
super.onStop();
|
||||
}*/
|
||||
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(Location location) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class GeoTagUpload extends AsyncTask<Void, Void, String> {
|
||||
|
||||
private Context context;
|
||||
@@ -770,56 +785,50 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
service = CommonString.METHOD_UPLOAD_CURRENT_DATA;
|
||||
|
||||
}
|
||||
|
||||
String current_xml = "";
|
||||
|
||||
if (coverage.size() > 0) {
|
||||
|
||||
//for (int i = 0; i < coverage.size(); i++) {
|
||||
|
||||
String onXML = "[Coverage_Intime][USER_ID]"
|
||||
+ _UserId
|
||||
+ "[/USER_ID]"
|
||||
+ "[STORE_ID]"
|
||||
+ coverage.get(0).getStoreId()
|
||||
+ "[/STORE_ID]"
|
||||
+ "[VISIT_DATE]"
|
||||
+ coverage.get(0).getVisitDate()
|
||||
+ "[/VISIT_DATE]"
|
||||
+ "[IN_TIME]"
|
||||
+ coverage.get(0).getInTime()
|
||||
+ "[/IN_TIME]"
|
||||
+ "[LATITUDE]"
|
||||
+ coverage.get(0).getLatitude()
|
||||
+ "[/LATITUDE]"
|
||||
+ "[LONGITUDE ]"
|
||||
+ coverage.get(0).getLongitude()
|
||||
+ "[/LONGITUDE ]"
|
||||
+ "[REASON_ID]"
|
||||
+ coverage.get(0).getReasonid()
|
||||
+ "[/REASON_ID]"
|
||||
+ "[REMARK]"
|
||||
+ coverage.get(0).getReason()
|
||||
+ "[/REMARK][/Coverage_Intime]";
|
||||
|
||||
String onXML = "[Coverage_Intime][USER_ID]"
|
||||
+ _UserId
|
||||
+ "[/USER_ID]"
|
||||
+ "[STORE_ID]"
|
||||
+ coverage.get(0).getStoreId()
|
||||
+ "[/STORE_ID]"
|
||||
+ "[VISIT_DATE]"
|
||||
+ coverage.get(0).getVisitDate()
|
||||
+ "[/VISIT_DATE]"
|
||||
+ "[IN_TIME]"
|
||||
+ coverage.get(0).getInTime()
|
||||
+ "[/IN_TIME]"
|
||||
+ "[LATITUDE]"
|
||||
+ coverage.get(0).getLatitude()
|
||||
+ "[/LATITUDE]"
|
||||
+ "[LONGITUDE ]"
|
||||
+ coverage.get(0).getLongitude()
|
||||
+ "[/LONGITUDE ]"
|
||||
+ "[REASON_ID]"
|
||||
+ coverage.get(0).getReasonid()
|
||||
+ "[/REASON_ID]"
|
||||
+ "[REMARK]"
|
||||
+ coverage.get(0).getReason()
|
||||
+ "[/REMARK][/Coverage_Intime]";
|
||||
|
||||
//current_xml = current_xml + onXML;
|
||||
|
||||
|
||||
//current_xml = current_xml + onXML;
|
||||
//}
|
||||
|
||||
current_xml = "[DATA]" + onXML
|
||||
+ "[/DATA]";
|
||||
Log.d("currentdata",current_xml);
|
||||
|
||||
SoapObject request = new SoapObject(CommonString.NAMESPACE,
|
||||
service);
|
||||
@@ -888,43 +897,26 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
ResultFlag = false;
|
||||
strflag = CommonString.MESSAGE_EXCEPTION;
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
|
||||
ResultFlag = false;
|
||||
strflag = CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||
|
||||
} catch (XmlPullParserException e) {
|
||||
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
//Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
|
||||
ResultFlag = false;
|
||||
strflag = CommonString.MESSAGE_XmlPull;
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
|
||||
ResultFlag = false;
|
||||
strflag = CommonString.MESSAGE_EXCEPTION;
|
||||
|
||||
}
|
||||
|
||||
if (ResultFlag) {
|
||||
return CommonString.KEY_SUCCESS;
|
||||
|
||||
} else {
|
||||
|
||||
return strflag;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(String 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")
|
||||
||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);
|
||||
startActivity(in);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
@@ -950,12 +941,27 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
startActivity(in);
|
||||
finish();
|
||||
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();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
|
||||
|
||||
//showAlert(getString(R.string.data_downloaded_successfully));
|
||||
} else {
|
||||
|
||||
@@ -978,10 +984,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
builder.setMessage(str).setCancelable(false)
|
||||
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
|
||||
finish();
|
||||
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
|
||||
+20
-44
@@ -83,7 +83,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
MyAdaptorStock adapterData;
|
||||
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 str = CommonString.FILE_PATH,
|
||||
String str = "",
|
||||
path = "", path1 = "", path2 = "",
|
||||
_pathforcheck = "", _pathforcheck1 = "", _pathforcheck2 = "",
|
||||
img = "", img1 = "", img2 = "";
|
||||
@@ -116,6 +116,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
context = this;
|
||||
//preference data
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
str = CommonString.getImagesFolder(this);
|
||||
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
@@ -133,14 +134,14 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
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));
|
||||
}else {
|
||||
} else {
|
||||
toolbar.setTitle(getResources().getString(R.string.title_activity_t2_pcompliance));
|
||||
}
|
||||
setSupportActionBar(toolbar);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
// toolbar.setTitle(R.string.title_activity_t2_pcompliance + " - " + categoryName);
|
||||
// toolbar.setTitle(R.string.title_activity_t2_pcompliance + " - " + categoryName);
|
||||
final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -200,10 +201,8 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
t2PGetterSetters = db.getT2PDefaultData(store_id, categoryId, "MAPPING_T2P");
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
for (int i = 0; i < t2PGetterSetters.size(); i++) {
|
||||
|
||||
ArrayList<GapsChecklistGetterSetter> gapsList = db.getGapsData(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());
|
||||
@@ -212,9 +211,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
//
|
||||
t2PGetterSetters.get(i).setSkulist(skuList);
|
||||
t2PGetterSetters.get(i).setBrandlist(brandList);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (int i = 0; i < t2PGetterSetters.size(); i++) {
|
||||
@@ -856,13 +853,12 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
public void showSkuDialog(final ArrayList<SkuGetterSetter> skuAddedList) {
|
||||
|
||||
final SkuGetterSetter[] sku_selected = new SkuGetterSetter[1];
|
||||
final BrandMasterGetterSetter[] brand_selected = new BrandMasterGetterSetter[1];
|
||||
|
||||
final ArrayList<BrandMasterGetterSetter> brandList;
|
||||
//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);
|
||||
} 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);
|
||||
@@ -875,7 +871,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
brand.setBRAND("select");
|
||||
brandList.add(0, brand);
|
||||
// ArrayList<SkuMasterGetterSetter> skuMasterGetterSetterArrayList = db.getSkuT2PData("1", "1", "1",)
|
||||
|
||||
final Dialog dialog = new Dialog(T2PComplianceActivity.this);
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
@@ -967,17 +962,12 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
spinner_brand.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
|
||||
if (position != 0) {
|
||||
|
||||
sku_list.clear();
|
||||
|
||||
brand_selected[0] = brandList.get(position);
|
||||
|
||||
String brand_id = brandList.get(position).getBRAND_ID().get(0);
|
||||
|
||||
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);
|
||||
} 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);
|
||||
@@ -1081,21 +1071,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
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) {
|
||||
try {
|
||||
|
||||
@@ -1270,7 +1245,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
//super.onBackPressed();
|
||||
super.onBackPressed();
|
||||
|
||||
if (editFlag) {
|
||||
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);
|
||||
|
||||
//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.FILE_PATH + "/" + "image_ref.png";
|
||||
String imagePath = "file://" + CommonString.getDownloadedImageFolder(this) + "/" + planogram_image;
|
||||
//String imagePath = "file://" + CommonString.getImagesFolder(context)+ "/" + "image_ref.png";
|
||||
String html = "<html><head></head><body><img src=\"" + imagePath + "\"></body></html>";
|
||||
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
||||
|
||||
@@ -1660,15 +1635,16 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
public void showBrandAvabilitydialog(final ArrayList<BrandAvabilityGetterSetter> brandGetdata) {
|
||||
|
||||
final ArrayList<BrandAvabilityGetterSetter> brandList;
|
||||
|
||||
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)) {
|
||||
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 {
|
||||
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();
|
||||
@@ -1692,7 +1668,8 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
// cardlay = (CardView) dialog.findViewById(R.id.cardId);
|
||||
|
||||
// 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);
|
||||
|
||||
@@ -1761,8 +1738,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
brand_id = "";
|
||||
|
||||
} else {
|
||||
Snackbar.make(v, "Please select dropdown", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
Snackbar.make(v, "Please select dropdown", Snackbar.LENGTH_LONG).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);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+27
-29
@@ -116,10 +116,12 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
||||
if(lang.equals(language.get(0))){
|
||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
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))){
|
||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
btn_lang_2.setTextColor(getResources().getColor(R.color.white));
|
||||
}
|
||||
|
||||
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
|
||||
public void onButtonPressed(String selected_lang, String culture_id, String notice_url) {
|
||||
if (mListener != null) {
|
||||
|
||||
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) {
|
||||
int id = view.getId();
|
||||
|
||||
switch (id) {
|
||||
case R.id.btn_language_one:
|
||||
if (id == R.id.btn_language_one) {
|
||||
//selected_flag = true;
|
||||
onButtonPressed(language.get(0), culture_id.get(0), login_data.getNOTICE_URL().get(0));
|
||||
|
||||
//selected_flag = true;
|
||||
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_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));
|
||||
|
||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
editor.putString(CommonString.KEY_LANGUAGE, language.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.commit();
|
||||
|
||||
editor.putString(CommonString.KEY_LANGUAGE, language.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.commit();
|
||||
} else if (id == R.id.btn_language_two) {
|
||||
//selected_flag = true;
|
||||
onButtonPressed(language.get(1), culture_id.get(1), login_data.getNOTICE_URL().get(1));
|
||||
|
||||
break;
|
||||
CommonFunctions.updateLangResources(getActivity(), language.get(1));
|
||||
|
||||
case R.id.btn_language_two:
|
||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
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));
|
||||
|
||||
//selected_flag = true;
|
||||
|
||||
onButtonPressed(language.get(1),culture_id.get(1),login_data.getNOTICE_URL().get(1));
|
||||
|
||||
CommonFunctions.updateLangResources(getActivity(), language.get(1));
|
||||
|
||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
|
||||
editor.putString(CommonString.KEY_LANGUAGE, language.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.commit();
|
||||
|
||||
break;
|
||||
editor.putString(CommonString.KEY_LANGUAGE, language.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.commit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+21
-13
@@ -51,6 +51,7 @@ import retrofit.Retrofit;
|
||||
public class ServiceActivityFragment extends Fragment {
|
||||
String result = "";
|
||||
boolean isvalid = false;
|
||||
Context context;
|
||||
|
||||
public ServiceActivityFragment() {
|
||||
}
|
||||
@@ -67,6 +68,7 @@ public class ServiceActivityFragment extends Fragment {
|
||||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_service, container, false);
|
||||
|
||||
context = view.getContext();
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
||||
username = preferences.getString(CommonString.KEY_USERNAME, "");
|
||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
@@ -119,11 +121,11 @@ public class ServiceActivityFragment extends Fragment {
|
||||
|
||||
if(position==0){
|
||||
showExportDialog();
|
||||
//restoreBackup();
|
||||
// restoreBackup();
|
||||
}
|
||||
/* else if(position==1){
|
||||
|
||||
File f = new File(CommonString.FILE_PATH);
|
||||
File f = new File(CommonString.getImagesFolder(context));
|
||||
if(f!=null){
|
||||
File file[] = f.listFiles();
|
||||
if(file.length>0){
|
||||
@@ -196,12 +198,15 @@ public class ServiceActivityFragment extends Fragment {
|
||||
public void restoreBackup(){
|
||||
|
||||
try {
|
||||
File sd = Environment.getExternalStorageDirectory();
|
||||
/* File sd = Environment.getExternalStorageDirectory();
|
||||
File data = Environment.getDataDirectory();*/
|
||||
|
||||
File sd = context.getExternalFilesDir("");
|
||||
File data = Environment.getDataDirectory();
|
||||
|
||||
if (sd.canWrite()) {
|
||||
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 backupDB = new File(sd, backupDBPath);
|
||||
|
||||
@@ -229,14 +234,17 @@ public class ServiceActivityFragment extends Fragment {
|
||||
@SuppressWarnings("resource")
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
try {
|
||||
File file = new File(Environment
|
||||
/*File file = new File(Environment
|
||||
.getExternalStorageDirectory(),
|
||||
"gsk_orange_backup");
|
||||
if (!file.isDirectory()) {
|
||||
file.mkdir();
|
||||
}
|
||||
}*/
|
||||
|
||||
File sd = Environment.getExternalStorageDirectory();
|
||||
/* File sd = Environment.getExternalStorageDirectory();
|
||||
File data = Environment.getDataDirectory();*/
|
||||
|
||||
File sd = context.getExternalFilesDir("");
|
||||
File data = Environment.getDataDirectory();
|
||||
|
||||
if (sd.canWrite()) {
|
||||
@@ -249,8 +257,9 @@ public class ServiceActivityFragment extends Fragment {
|
||||
String backupDBPath = "GSKMT_ORANGE_Database_backup" + "_"+username+"_"+ visit_date.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 backupDB = new File(path, backupDBPath);
|
||||
|
||||
@@ -269,8 +278,7 @@ public class ServiceActivityFragment extends Fragment {
|
||||
|
||||
//usk
|
||||
// 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();
|
||||
list = getFileNames(dir.listFiles());
|
||||
if (list.size() > 0) {
|
||||
@@ -278,9 +286,9 @@ public class ServiceActivityFragment extends Fragment {
|
||||
if (list.get(i1).contains("GSKMT_ORANGE_Database_backup")) {
|
||||
// File originalFile = new File(CommonString.BACKUP_PATH + list.get(i1));
|
||||
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();
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -317,7 +325,7 @@ public class ServiceActivityFragment extends Fragment {
|
||||
RequestBody body1;
|
||||
result = "";
|
||||
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);
|
||||
body1 = new MultipartBuilder().type(MultipartBuilder.FORM)
|
||||
.addFormDataPart("file", originalFile.getName(), photo)
|
||||
|
||||
@@ -238,4 +238,43 @@ public class CoverageBean {
|
||||
public void setFlag_from(String 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="";
|
||||
}
|
||||
|
||||
+490
-297
File diff suppressed because it is too large
Load Diff
+204
-157
@@ -7,6 +7,7 @@ import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
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.CreateSelfActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.NewStockDataActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.OrderTakingActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.POGQuestionsActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.StockActivity;
|
||||
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.DailyDataMenuGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
||||
|
||||
public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
RecyclerView recyclerView;
|
||||
@@ -56,33 +59,28 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
DailyDataMenuAdapter adapter;
|
||||
TextView txt_categoryName;
|
||||
private Context context;
|
||||
|
||||
GSKOrangeDB db;
|
||||
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;
|
||||
private SharedPreferences preferences;
|
||||
|
||||
ArrayList<CategoryPictureGetterSetter> category_camera_list;
|
||||
ArrayList<Visit_Type_Master_GetterSetter> visittypelist = new ArrayList<Visit_Type_Master_GetterSetter>();
|
||||
String visit_type_id = "";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
try {
|
||||
setContentView(R.layout.activity_daily_data_menu);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
|
||||
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
||||
//txt_categoryName = (TextView) findViewById(R.id.txt_categoryName);
|
||||
|
||||
db = new GSKOrangeDB(this);
|
||||
db.open();
|
||||
context = this;
|
||||
//preference data
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||
visit_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, "");
|
||||
pog_type_id = preferences.getString(CommonString.KEY_POG_TYPE_ID, "");
|
||||
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
|
||||
categoryName = getIntent().getStringExtra("categoryName");
|
||||
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);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
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) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -121,20 +117,16 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
try {
|
||||
categoryList = new ArrayList<>();
|
||||
|
||||
DailyDataMenuGetterSetter data = new DailyDataMenuGetterSetter();
|
||||
|
||||
//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.setCategory_name(getResources().getString(R.string.stock));
|
||||
if (isMappingStockData()) {
|
||||
if (db.checkStockData(store_id, categoryId)) {
|
||||
if (db.checkStockData(store_id, categoryId, visit_date)) {
|
||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.msl_availability);
|
||||
@@ -143,13 +135,21 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
data.setCategory_img(R.mipmap.msl_availability_grey);
|
||||
}
|
||||
categoryList.add(data);
|
||||
}
|
||||
else {
|
||||
if (country_id.equals(CommonString.COUNTRY_ID_EGYPT+"") && categoryId.equals("3")) {
|
||||
} 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);
|
||||
}
|
||||
categoryList.add(data);
|
||||
} else {
|
||||
if (country_id.equals(CommonString.COUNTRY_ID_EGYPT + "") && categoryId.equals("3")) {
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_stock_facing));
|
||||
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);
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.msl_availability);
|
||||
@@ -162,7 +162,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_msl_availability));
|
||||
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);
|
||||
} else {
|
||||
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
|
||||
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));
|
||||
}else {
|
||||
} else {
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_t2p));
|
||||
}
|
||||
|
||||
@@ -230,7 +203,13 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
|
||||
//T2p added
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_additional_visibility));
|
||||
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));
|
||||
if (db.additionalVisibilitydata(store_id, categoryId)) {
|
||||
data.setCategory_img(R.mipmap.additional_visibility_done);
|
||||
} else {
|
||||
@@ -238,7 +217,6 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
categoryList.add(data);
|
||||
|
||||
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_promo_compliance));
|
||||
if (country_id.equals("7")) {
|
||||
@@ -263,8 +241,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
if (isMappingPromotion_Flag || isMappingAdditionalPromotion_Flag) {
|
||||
if (db.checkPromoComplianceData(store_id, categoryId) ||
|
||||
db.checkAdditionalPromoComplianceData(store_id, categoryId)) {
|
||||
if (db.checkPromoComplianceData(store_id, categoryId) || db.checkAdditionalPromoComplianceData(store_id, categoryId)) {
|
||||
data.setCategory_img(R.mipmap.promo_compliance_done);
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.promo_compliance);
|
||||
@@ -273,7 +250,6 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
data.setCategory_img(R.mipmap.promocompliance_grey);
|
||||
}
|
||||
}
|
||||
|
||||
categoryList.add(data);
|
||||
|
||||
//Category Pictures
|
||||
@@ -290,17 +266,51 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
} /*else {
|
||||
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) {
|
||||
data.setCategory_img(R.mipmap.picturecatogory_done);
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.picturecatogory);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
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
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
|
||||
@@ -335,8 +345,8 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}*/
|
||||
//new add UAE Pharma
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
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.getAfterSavePOGUploadQuestionAnswerData(store_id, categoryId).size() > 0) {
|
||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||
@@ -347,10 +357,10 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.msl_availability_grey);
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.msl_availability_grey);
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, categoryId).size() > 0) {
|
||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||
@@ -365,8 +375,24 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
data.setCategory_name(getString(R.string.pog));
|
||||
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
|
||||
if(country_id.equals("6")){
|
||||
if (country_id.equals("6")) {
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
|
||||
if (db.getCounterfeitProductExistsAfterData(store_id, categoryId).size() > 0) {
|
||||
@@ -381,8 +407,8 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
|
||||
//usk
|
||||
//Cometition promo Option - Egypt
|
||||
if (categoryId.equals("2")){
|
||||
if(country_id.equals("6")){
|
||||
if (categoryId.equals("2")) {
|
||||
if (country_id.equals("6")) {
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
|
||||
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
|
||||
/*if(country_id.equals("4")){
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
@@ -463,7 +509,6 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
ArrayList<AuditDataGetterSetter> getAuditQnsRemoved() {
|
||||
|
||||
boolean t2p_flag = false;
|
||||
boolean flag_t2p_mapping;
|
||||
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);
|
||||
Log.e("catid", categoryId + "," + storeType_id + "," + question_list.size());
|
||||
|
||||
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -507,14 +553,12 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
if (!item.getKEYACCOUNT_ID().equals("0") && !item.getKEYACCOUNT_ID().equals(keyAccount_id)) {
|
||||
iterator.remove();
|
||||
} else if (!item.getCHECK_TYPE().equals("NA") && item.getCHECK_TYPE().equals("T2P")) {
|
||||
|
||||
if (!t2p_flag) {
|
||||
iterator.remove();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Log.e("questionlistsize", String.valueOf(question_list));
|
||||
return question_list;
|
||||
}
|
||||
|
||||
@@ -543,23 +587,13 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
holder.categoryName.setText(dailyData.getCategory_name());
|
||||
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")) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||
} else {
|
||||
boolean isMappingPromotion_Flag;
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
@@ -576,12 +610,12 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
if (isMappingPromotion_Flag || isMappingAdditionalPromotion_Flag) {
|
||||
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_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 flag_t2p_mapping;
|
||||
@@ -592,85 +626,80 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
if (flag_t2p_mapping) {
|
||||
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_category_picture)))) {
|
||||
}
|
||||
else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_category_picture)))) {
|
||||
if (camera_allow.equalsIgnoreCase("1")) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
} /*else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.black));
|
||||
}
|
||||
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));
|
||||
}*/
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
||||
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))) {
|
||||
}
|
||||
else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.stock_entry))) {
|
||||
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 {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.audit))) {
|
||||
if (getAuditQnsRemoved().size() > 0) {
|
||||
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.pog))) {
|
||||
//new add UAE pharma
|
||||
|
||||
/*if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id, null).size() > 0) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
} else {
|
||||
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) {
|
||||
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 {
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
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 {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
holder.lay_menu.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
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 (country_id.equals("7")) {
|
||||
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 flag_t2p_mapping;
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
@@ -716,30 +744,48 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
startActivity(intent);
|
||||
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.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_category_picture)))) {
|
||||
}
|
||||
else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.daily_data_menu_category_picture)))) {
|
||||
if (camera_allow.equalsIgnoreCase("1")) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, CategoryPicture.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
startActivity(intent);
|
||||
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.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))) {
|
||||
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()) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, MSL_Availability_StockFacingActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
@@ -747,10 +793,20 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
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.stock_entry))) {
|
||||
if (isMappingStockData()) {
|
||||
// Intent intent = new Intent(DailyDataMenuActivity.this, StockDataActivity.class);
|
||||
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))) {
|
||||
if (isMappingStockData()) {
|
||||
// Intent intent = new Intent(DailyDataMenuActivity.this, StockDataActivity.class);
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, NewStockDataActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
@@ -760,7 +816,6 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.audit))) {
|
||||
//if (db.getAuditCategoryWise(categoryId, storeType_id).size()>0) {
|
||||
|
||||
if (getAuditQnsRemoved().size() > 0) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, AuditActivity.class);
|
||||
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))) {
|
||||
|
||||
//add uae pharma
|
||||
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) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, POGQuestionsActivity.class);
|
||||
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) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, POGQuestionsActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
@@ -800,7 +855,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
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.stock))) {
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.stock))) {
|
||||
if (isMappingStockData()) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, StockActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
@@ -809,10 +864,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
|
||||
}else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.title_activity_stock_pricing))) {
|
||||
/*if (isMappingStockData()) {
|
||||
|
||||
}*/
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.title_activity_stock_pricing))) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, StockPricingActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
@@ -825,11 +877,9 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -853,19 +903,16 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
|
||||
boolean isMappingStockData() {
|
||||
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);
|
||||
} 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);
|
||||
} 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);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
flag = db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK);
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -300,7 +300,8 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
||||
public void 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.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||
.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();
|
||||
}
|
||||
|
||||
|
||||
+373
-585
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);
|
||||
}
|
||||
}
|
||||
+25
-14
@@ -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;
|
||||
private SharedPreferences preferences;
|
||||
|
||||
String str = CommonString.FILE_PATH,
|
||||
path = "", _pathforcheck = "", img = "";
|
||||
String str ="",path = "", _pathforcheck = "", img = "";
|
||||
int child_position = -1;
|
||||
Uri outputFileUri;
|
||||
String gallery_package = "";
|
||||
@@ -100,6 +99,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
context = this;
|
||||
str = CommonString.getImagesFolder(context);
|
||||
lin_promo_sku = (LinearLayout) findViewById(R.id.lin_promo_sku);
|
||||
lin_addtional_promo = (LinearLayout) findViewById(R.id.lin_addtional_promo);
|
||||
view_promo_sku = findViewById(R.id.view_promo_sku);
|
||||
@@ -196,8 +196,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
||||
img_addPromotion.setClickable(false);
|
||||
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()) {
|
||||
//img = _pathforcheck;
|
||||
new File(str + cd.getImage_promotion()).delete();
|
||||
@@ -210,8 +209,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
||||
cd.setIn_stock("-1");
|
||||
img_addPromotion.setClickable(false);
|
||||
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()) {
|
||||
//img = _pathforcheck;
|
||||
new File(str + cd.getImage_promotion()).delete();
|
||||
@@ -456,20 +454,17 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
||||
promoSkuListData = db.getPromoComplianceSkuAfterData(store_id, categoryId);
|
||||
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);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
promoSkuListData = db.getPromoComplianceSkuData(store_id, categoryId, CommonString.TABLE_MAPPING_PROMOTION);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//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);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
promoSpinnerListData = db.getPromoSpinnerData(store_id, categoryId, CommonString.TABLE_MAPPING_ADDITIONAL_PROMOTION);
|
||||
}
|
||||
|
||||
@@ -986,7 +981,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
||||
|
||||
Log.i("Stock & Facing ", "startCameraActivity()");
|
||||
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 = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
@@ -1095,6 +1090,22 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
||||
cdate = arabicToenglish(cdate);
|
||||
} 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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
+29
-230
@@ -161,7 +161,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
//Stock Facing List
|
||||
prepareList();
|
||||
|
||||
str = CommonString.FILE_PATH + _pathforcheck;
|
||||
str = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||
|
||||
prepareDefaultList();
|
||||
|
||||
@@ -552,15 +552,6 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
Error_Message = getResources().getString(R.string.fill_data);
|
||||
break;
|
||||
}
|
||||
/*} else {
|
||||
if (!checkHeaderArray.contains(i)) {
|
||||
checkHeaderArray.add(i);
|
||||
}
|
||||
|
||||
flag = false;
|
||||
Error_Message = getResources().getString(R.string.click_image);
|
||||
break;
|
||||
}*/
|
||||
} else {
|
||||
if (stock.equals("")) {
|
||||
if (!checkHeaderArray.contains(i)) {
|
||||
@@ -730,7 +721,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
try {
|
||||
Log.e("MakeMachine", "startCameraActivity()");
|
||||
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 = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
@@ -777,47 +768,10 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
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 {
|
||||
Log.e("MakeMachine", "startCameraActivity()");
|
||||
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 = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
@@ -863,45 +817,11 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
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 {
|
||||
Log.e("MakeMachine", "startCameraActivity()");
|
||||
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 = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
@@ -949,144 +869,8 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
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) {
|
||||
/*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:
|
||||
//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)) {
|
||||
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);
|
||||
}
|
||||
|
||||
return cdate;
|
||||
}
|
||||
|
||||
@@ -1192,9 +991,9 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> mappingPlanogramList;
|
||||
|
||||
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 {
|
||||
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);
|
||||
@@ -1210,13 +1009,13 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
planogram_image = mappingPlanogramList.get(0).getPLANOGRAM_IMAGE();
|
||||
}
|
||||
if (!planogram_image.equals("")) {
|
||||
if (new File(CommonString.FILE_PATH_PLANOGRAM + planogram_image).exists()) {
|
||||
Bitmap bmp = BitmapFactory.decodeFile(CommonString.FILE_PATH_PLANOGRAM + planogram_image);
|
||||
if (new File(CommonString.getDownloadedImageFolder(context) + planogram_image).exists()) {
|
||||
Bitmap bmp = BitmapFactory.decodeFile(CommonString.getDownloadedImageFolder(context) + planogram_image);
|
||||
// img_planogram.setRotation(90);
|
||||
//img_planogram.setImageBitmap(bmp);
|
||||
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>";
|
||||
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
||||
|
||||
@@ -1267,9 +1066,9 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
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.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||
.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) {
|
||||
}
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
|
||||
|
||||
+5
-25
@@ -31,10 +31,7 @@ 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.CoachingVisitActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.MessageActivity;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.StoreWisePerformaceGetterSetter;
|
||||
|
||||
public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||
@@ -64,7 +61,7 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||
context = this;
|
||||
//preference data
|
||||
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);
|
||||
visit_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, "");
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
||||
|
||||
|
||||
toolbar.setTitle(getResources().getString(R.string.title_activity_store_wise_performance));
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
@@ -116,12 +111,10 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}*/
|
||||
|
||||
Intent intent = new Intent(StoreWisePerformanceActivity.this, MessageActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
|
||||
}
|
||||
});
|
||||
} catch (Resources.NotFoundException e) {
|
||||
@@ -134,17 +127,12 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
try {
|
||||
CommonFunctions.updateLangResources(context,preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
if(store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||
storeWisePerformanceList = db.getStoreWisePerformance(store_id, CommonString.TABLE_STORE_PERFORMANCE_NEW_ADHOC);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
storeWisePerformanceList = db.getStoreWisePerformance(store_id, "STORE_PERFORMANCE_REVISED");
|
||||
|
||||
|
||||
}
|
||||
|
||||
adapter = new StoreWisePerformaceAdapter(StoreWisePerformanceActivity.this, storeWisePerformanceList);
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||
@@ -155,21 +143,15 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (id == R.id.action_settings) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@@ -201,7 +183,6 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onBindViewHolder(StoreWisePerformaceAdapter.MyViewHolder holder, int position) {
|
||||
final StoreWisePerformaceGetterSetter categoryData = list.get(position);
|
||||
|
||||
if (categoryData.getPeriod().equalsIgnoreCase("LTM")) {
|
||||
holder.txt_period.setText(getResources().getString(R.string.category_performance_ltm));
|
||||
} else if (categoryData.getPeriod().equalsIgnoreCase("MTD")) {
|
||||
@@ -223,7 +204,7 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
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_planogram = (TextView) itemView.findViewById(R.id.txt_planogram);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+14
-17
@@ -138,25 +138,22 @@ public class ChangePasswordActivity extends AppCompatActivity implements View.On
|
||||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
|
||||
switch (id){
|
||||
case R.id.img_info:
|
||||
if (id == R.id.img_info) {
|
||||
|
||||
Dialog dialog = new Dialog(ChangePasswordActivity.this);
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
|
||||
dialog.setContentView(R.layout.password_rule_dialog);
|
||||
dialog.show();
|
||||
Dialog dialog = new Dialog(ChangePasswordActivity.this);
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
|
||||
dialog.setContentView(R.layout.password_rule_dialog);
|
||||
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(){
|
||||
@@ -167,7 +164,7 @@ public class ChangePasswordActivity extends AppCompatActivity implements View.On
|
||||
|
||||
|
||||
//New Password
|
||||
new_pw = et_new_password.getText().toString();
|
||||
new_pw = et_new_password.getText().toString();
|
||||
|
||||
if(new_pw.equals("")){
|
||||
et_new_password.setError(getString(R.string.error_field_required));
|
||||
@@ -244,7 +241,7 @@ public class ChangePasswordActivity extends AppCompatActivity implements View.On
|
||||
}
|
||||
|
||||
|
||||
return !cancel;
|
||||
return !cancel;
|
||||
}
|
||||
|
||||
private class AuthenticateTask extends AsyncTask<Void, Void, String> {
|
||||
@@ -352,7 +349,7 @@ public class ChangePasswordActivity extends AppCompatActivity implements View.On
|
||||
});*/
|
||||
|
||||
} catch (IOException e) {
|
||||
final AlertMessage message = new AlertMessage(
|
||||
final AlertMessage message = new AlertMessage(
|
||||
ChangePasswordActivity.this,
|
||||
AlertMessage.MESSAGE_SOCKETEXCEPTION, "socket_login", e);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package cpm.com.gskmtorange.password;
|
||||
|
||||
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
@@ -21,8 +22,9 @@ import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.Trace;
|
||||
import android.os.Looper;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
@@ -30,7 +32,6 @@ import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
//import com.crashlytics.android.Crashlytics;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
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.ResultCallback;
|
||||
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.LocationRequest;
|
||||
import com.google.android.gms.location.LocationResult;
|
||||
import com.google.android.gms.location.LocationServices;
|
||||
import com.google.android.gms.location.LocationSettingsRequest;
|
||||
import com.google.android.gms.location.LocationSettingsResult;
|
||||
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.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
@@ -69,7 +74,9 @@ import java.io.StringReader;
|
||||
import java.lang.reflect.Type;
|
||||
import java.net.MalformedURLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import cpm.com.gskmtorange.LoginActivity;
|
||||
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.xmlHandlers.XMLHandlers;
|
||||
|
||||
public class MPinActivity extends AppCompatActivity implements
|
||||
View.OnClickListener,
|
||||
BlurLockView.OnPasswordInputListener,
|
||||
BlurLockView.OnLeftButtonClickListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
||||
public class MPinActivity extends AppCompatActivity implements View.OnClickListener, BlurLockView.OnPasswordInputListener, BlurLockView.OnLeftButtonClickListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
||||
|
||||
BlurLockView blurLockView;
|
||||
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_WRITE = 14;
|
||||
|
||||
private static final int PERMISSION_ALL = 99;
|
||||
|
||||
GoogleApiClient mGoogleApiClient;
|
||||
private static int UPDATE_INTERVAL = 200; // 5 sec
|
||||
private static int FATEST_INTERVAL = 100; // 1 sec
|
||||
@@ -125,6 +131,10 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
private LocationRequest mLocationRequest;
|
||||
private Context context;
|
||||
|
||||
//New Location Changes
|
||||
private FusedLocationProviderClient fusedLocationProviderClient;
|
||||
LocationRequest locationRequest;
|
||||
|
||||
double lat = 0.0;
|
||||
double lon = 0.0;
|
||||
|
||||
@@ -137,13 +147,7 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
setContentView(R.layout.activity_mpin);
|
||||
|
||||
context = this;
|
||||
/*Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);*/
|
||||
|
||||
// Obtain the FirebaseAnalytics instance.
|
||||
// mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
|
||||
// myTrace = FirebasePerformance.getInstance().newTrace("test_trace");
|
||||
// myTrace.start();
|
||||
fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);
|
||||
|
||||
IS_PASSWORD_CHECK = getIntent().getBooleanExtra(CommonString.IS_PASSWORD_CHECK, false);
|
||||
|
||||
@@ -153,6 +157,8 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
editor = preferences.edit();
|
||||
//USK
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
try {
|
||||
app_ver = String.valueOf(getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
|
||||
@@ -186,26 +192,124 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
blurLockView.setTypeface(getTypeface());
|
||||
blurLockView.setOnLeftButtonClickListener(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);
|
||||
|
||||
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();
|
||||
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG).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
|
||||
@@ -217,6 +321,32 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
|
||||
}
|
||||
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() {
|
||||
@@ -230,8 +360,7 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
private Typeface getTypeface() {
|
||||
if ("SAN".equals(getIntent().getStringExtra("TYPEFACE")))
|
||||
return Typeface.createFromAsset(getAssets(), "fonts/San Francisco Regular.ttf");
|
||||
else if ("DEFAULT".equals(getIntent().getStringExtra("TYPEFACE")))
|
||||
return Typeface.DEFAULT;
|
||||
else if ("DEFAULT".equals(getIntent().getStringExtra("TYPEFACE"))) return Typeface.DEFAULT;
|
||||
return Typeface.DEFAULT;
|
||||
}
|
||||
|
||||
@@ -244,16 +373,8 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
|
||||
new AuthenticateTask().execute();
|
||||
} else {
|
||||
Toast.makeText(this,
|
||||
"Correct",
|
||||
Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(this, "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
|
||||
@@ -269,27 +390,16 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
|
||||
Snackbar snackbar = Snackbar.make(blurLockView, R.string.incorrect_mpin_limit_reached, Snackbar.LENGTH_INDEFINITE);
|
||||
View view = snackbar.getView();
|
||||
/*TextView tv = (TextView)view.findViewById(android.support.design.R.id.snackbar_text);
|
||||
tv.setTextColor(Color.RED);*/
|
||||
snackbar.setAction(R.string.reset, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
editor.putString(CommonString.MPIN, null);
|
||||
|
||||
editor.commit();
|
||||
|
||||
finish();
|
||||
|
||||
Intent in = new Intent(context , LoginActivity.class);
|
||||
startActivity(in);
|
||||
|
||||
}
|
||||
snackbar.setAction(R.string.reset, v -> {
|
||||
editor.putString(CommonString.MPIN, null);
|
||||
editor.commit();
|
||||
Intent in = new Intent(context, LoginActivity.class);
|
||||
startActivity(in);
|
||||
finish();
|
||||
});
|
||||
snackbar.setActionTextColor(Color.GREEN);
|
||||
snackbar.show();
|
||||
} else {
|
||||
|
||||
int count = 3 - incorrect_times;
|
||||
String attemt_str;
|
||||
if (count == 1) {
|
||||
@@ -299,12 +409,8 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
}
|
||||
|
||||
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 {
|
||||
pin = inputPassword;
|
||||
}
|
||||
@@ -324,13 +430,7 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
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;
|
||||
}
|
||||
|
||||
/*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 Dialog dialog;
|
||||
|
||||
@@ -590,15 +659,7 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
|
||||
versionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
|
||||
|
||||
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
|
||||
+ "[/APP_VERSION]" + "[ATT_MODE]OnLine[/ATT_MODE]"
|
||||
+ "[NETWORK_STATUS]" + "LoginStatus"
|
||||
+ "[/NETWORK_STATUS]" + "[/USER_DATA][/DATA]";
|
||||
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]";
|
||||
|
||||
SoapObject request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_LOGIN);
|
||||
request.addProperty("onXML", userauth_xml);
|
||||
@@ -654,10 +715,6 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
final FailureGetterSetter failureGetterSetter = XMLHandlers.failureXMLHandler(xpp, eventType);
|
||||
|
||||
if (failureGetterSetter.getStatus().equalsIgnoreCase(CommonString.KEY_FAILURE)) {
|
||||
/* final AlertMessage message = new AlertMessage(
|
||||
MPinActivity.this, CommonString.METHOD_LOGIN
|
||||
+ failureGetterSetter.getErrorMsg(),
|
||||
"login", null);*/
|
||||
runOnUiThread(new Runnable() {
|
||||
|
||||
@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.CONTENT_TYPE, "Data");
|
||||
bundle.putString(CommonString.KEY_LANGUAGE, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
// mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
|
||||
|
||||
// Crashlytics.setUserIdentifier(userId);
|
||||
|
||||
return CommonString.KEY_SUCCESS;
|
||||
|
||||
}
|
||||
@@ -711,10 +764,6 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
|
||||
/* final AlertMessage message = new AlertMessage(
|
||||
MPinActivity.this, AlertMessage.MESSAGE_EXCEPTION,
|
||||
"acra_login", e);*/
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
@@ -744,12 +793,6 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
}
|
||||
});
|
||||
} 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() {
|
||||
|
||||
@Override
|
||||
@@ -770,8 +813,8 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
//Stop performance trace
|
||||
// myTrace.stop();
|
||||
|
||||
if (result.equals(CommonString.KEY_SUCCESS)) {
|
||||
|
||||
if (result.equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
// initializePDSDK(context, userId);
|
||||
//set true for South Africa
|
||||
boolean forSA = false;
|
||||
|
||||
@@ -779,8 +822,7 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
//For SA Only
|
||||
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equals("")) {
|
||||
|
||||
Intent intent = new Intent(getBaseContext(),
|
||||
SelectLanguageActivity.class);
|
||||
Intent intent = new Intent(getBaseContext(), SelectLanguageActivity.class);
|
||||
|
||||
intent.putExtra(CommonString.KEY_LOGIN_DATA, lgs);
|
||||
startActivity(intent);
|
||||
@@ -792,8 +834,7 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
Intent intent = new Intent(getBaseContext(),
|
||||
MainActivity.class);
|
||||
Intent intent = new Intent(getBaseContext(), MainActivity.class);
|
||||
startActivity(intent);
|
||||
|
||||
finish();
|
||||
@@ -803,8 +844,7 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
} else {
|
||||
//for other than SA
|
||||
//database.open();
|
||||
if (preferences.getString(CommonString.KEY_VERSION, "").equals(
|
||||
Integer.toString(versionCode))) {
|
||||
if (preferences.getString(CommonString.KEY_VERSION, "").equals(Integer.toString(versionCode))) {
|
||||
|
||||
setLanguageDataFromSharedPreferences();
|
||||
|
||||
@@ -816,11 +856,9 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
|
||||
} 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, ""));
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
@@ -833,19 +871,15 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
}
|
||||
|
||||
ArrayList<String> language, culture_id, notice_url;
|
||||
|
||||
LoginGetterSetter login_data;
|
||||
|
||||
private void setLanguageDataFromSharedPreferences() {
|
||||
Gson gson = new Gson();
|
||||
login_data = new LoginGetterSetter();
|
||||
|
||||
String jsonPreferences = preferences.getString(CommonString.KEY_LOOGIN_PREF, "");
|
||||
|
||||
Type type = new TypeToken<LoginGetterSetter>() {
|
||||
}.getType();
|
||||
login_data = gson.fromJson(jsonPreferences, type);
|
||||
|
||||
language = login_data.getCULTURE_NAME();
|
||||
culture_id = login_data.getCULTURE_ID();
|
||||
notice_url = login_data.getNOTICE_URL();
|
||||
@@ -871,17 +905,16 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(MPinActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(str).setCancelable(false)
|
||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
builder.setMessage(str).setCancelable(false).setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
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();
|
||||
alert.show();
|
||||
}
|
||||
@@ -900,10 +933,8 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
char[] chars = new char[number.length()];
|
||||
for (int i = 0; i < number.length(); i++) {
|
||||
char ch = number.charAt(i);
|
||||
if (ch >= 0x0660 && ch <= 0x0669)
|
||||
ch -= 0x0660 - '0';
|
||||
else if (ch >= 0x06f0 && ch <= 0x06F9)
|
||||
ch -= 0x06f0 - '0';
|
||||
if (ch >= 0x0660 && ch <= 0x0669) ch -= 0x0660 - '0';
|
||||
else if (ch >= 0x06f0 && ch <= 0x06F9) ch -= 0x06f0 - '0';
|
||||
chars[i] = ch;
|
||||
}
|
||||
return new String(chars);
|
||||
@@ -912,7 +943,6 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
|
||||
Gson gson = new Gson();
|
||||
String jsonCurProduct = gson.toJson(lgs);
|
||||
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
editor.putString(CommonString.KEY_LOOGIN_PREF, jsonCurProduct);
|
||||
editor.commit();
|
||||
@@ -920,26 +950,20 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
|
||||
//permission and location related
|
||||
void checkAppPermission(String permission, int requestCode) {
|
||||
|
||||
boolean permission_flag = false;
|
||||
// Here, thisActivity is the current activity
|
||||
if (ContextCompat.checkSelfPermission(MPinActivity.this,
|
||||
permission)
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
if (ContextCompat.checkSelfPermission(MPinActivity.this, permission) != PackageManager.PERMISSION_GRANTED) {
|
||||
|
||||
// Permission is not granted
|
||||
// Should we show an explanation?
|
||||
if (ActivityCompat.shouldShowRequestPermissionRationale(MPinActivity.this,
|
||||
permission)) {
|
||||
if (ActivityCompat.shouldShowRequestPermissionRationale(MPinActivity.this, permission)) {
|
||||
// Show an explanation to the user *asynchronously* -- don't block
|
||||
// this thread waiting for the user's response! After the user
|
||||
// sees the explanation, try again to request the permission.
|
||||
showOnPermissiondenied(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA, 1);
|
||||
} else {
|
||||
// No explanation needed; request the permission
|
||||
ActivityCompat.requestPermissions(MPinActivity.this,
|
||||
new String[]{permission},
|
||||
requestCode);
|
||||
ActivityCompat.requestPermissions(MPinActivity.this, new String[]{permission}, requestCode);
|
||||
|
||||
// MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
|
||||
// app-defined int constant. The callback method gets the
|
||||
@@ -966,10 +990,7 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
file_planogram.mkdir();
|
||||
}
|
||||
|
||||
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) {
|
||||
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) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -982,11 +1003,7 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
|
||||
// Create an instance of GoogleAPIClient.
|
||||
if (mGoogleApiClient == null) {
|
||||
mGoogleApiClient = new GoogleApiClient.Builder(this)
|
||||
.addConnectionCallbacks(this)
|
||||
.addOnConnectionFailedListener(this)
|
||||
.addApi(LocationServices.API)
|
||||
.build();
|
||||
mGoogleApiClient = new GoogleApiClient.Builder(this).addConnectionCallbacks(this).addOnConnectionFailedListener(this).addApi(LocationServices.API).build();
|
||||
}
|
||||
|
||||
//attemptLogin();
|
||||
@@ -1006,9 +1023,7 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
if (check == 0) {
|
||||
checkAppPermission(permissionsRequired, request_code);
|
||||
} else {
|
||||
ActivityCompat.requestPermissions(MPinActivity.this,
|
||||
new String[]{permissionsRequired},
|
||||
request_code);
|
||||
ActivityCompat.requestPermissions(MPinActivity.this, new String[]{permissionsRequired}, request_code);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1023,18 +1038,18 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
builder.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
/* @Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
checkAppPermission(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA);
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
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) {
|
||||
imeiNumbers = imei.getDeviceImei();
|
||||
}
|
||||
|
||||
*/
|
||||
*//*
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 23 && ContextCompat.checkSelfPermission(context,
|
||||
Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&
|
||||
@@ -1060,18 +1075,14 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
private boolean checkPlayServices() {
|
||||
int resultCode = GooglePlayServicesUtil
|
||||
.isGooglePlayServicesAvailable(this);
|
||||
int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
|
||||
if (resultCode != ConnectionResult.SUCCESS) {
|
||||
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
|
||||
GooglePlayServicesUtil.getErrorDialog(resultCode, this,
|
||||
PLAY_SERVICES_RESOLUTION_REQUEST).show();
|
||||
GooglePlayServicesUtil.getErrorDialog(resultCode, this, PLAY_SERVICES_RESOLUTION_REQUEST).show();
|
||||
} else {
|
||||
Toast.makeText(context, getResources().getString(R.string.notsuppoted)
|
||||
, Toast.LENGTH_LONG)
|
||||
.show();
|
||||
Toast.makeText(context, getResources().getString(R.string.notsuppoted), Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
}
|
||||
return false;
|
||||
@@ -1081,11 +1092,7 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
|
||||
protected synchronized void buildGoogleApiClient() {
|
||||
if (mGoogleApiClient == null) {
|
||||
mGoogleApiClient = new GoogleApiClient.Builder(context)
|
||||
.addConnectionCallbacks(this)
|
||||
.addOnConnectionFailedListener(this)
|
||||
.addApi(LocationServices.API)
|
||||
.build();
|
||||
mGoogleApiClient = new GoogleApiClient.Builder(context).addConnectionCallbacks(this).addOnConnectionFailedListener(this).addApi(LocationServices.API).build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1117,8 +1124,7 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
@SuppressLint("MissingPermission")
|
||||
protected void startLocationUpdates() {
|
||||
|
||||
if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
||||
|| ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_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) {
|
||||
if (mGoogleApiClient != null) {
|
||||
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
|
||||
}
|
||||
@@ -1130,9 +1136,7 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
double earthRadius = 6371000; //meters
|
||||
double dLat = Math.toRadians(lat2 - lat1);
|
||||
double dLng = Math.toRadians(lng2 - lng1);
|
||||
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);
|
||||
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);
|
||||
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
||||
int dist = (int) (earthRadius * c);
|
||||
|
||||
@@ -1141,7 +1145,7 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
|
||||
@Override
|
||||
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
|
||||
// ActivityCompat#requestPermissions
|
||||
// here to request the missing permissions, and then overriding
|
||||
@@ -1159,7 +1163,7 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
lon = mLastLocation.getLongitude();
|
||||
}
|
||||
startLocationUpdates();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1193,11 +1197,9 @@ public class MPinActivity extends AppCompatActivity implements
|
||||
|
||||
private boolean hasGPSDevice(Context context) {
|
||||
final LocationManager mgr = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||
if (mgr == null)
|
||||
return false;
|
||||
if (mgr == null) return false;
|
||||
final List<String> providers = mgr.getAllProviders();
|
||||
if (providers == null)
|
||||
return false;
|
||||
if (providers == null) return false;
|
||||
return providers.contains(LocationManager.GPS_PROVIDER);
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ public class MSLFragment extends Fragment {
|
||||
String gallery_package = "";
|
||||
Uri outputFileUri;
|
||||
|
||||
String str = CommonString.FILE_PATH, path = "", _pathforcheck = "";
|
||||
String str = CommonString.getImagesFolder(getContext()), path = "", _pathforcheck = "";
|
||||
|
||||
int child_position = -1;
|
||||
int group_position = -1;
|
||||
@@ -153,6 +153,7 @@ public class MSLFragment extends Fragment {
|
||||
|
||||
getActivity().setTitle(R.string.msl_availability_availability);
|
||||
|
||||
|
||||
db = new GSKOrangeDB(getActivity());
|
||||
db.open();
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@ import com.google.android.material.snackbar.Snackbar;
|
||||
import cpm.com.gskmtorange.R;
|
||||
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 preferences;
|
||||
FloatingActionButton fab;
|
||||
|
||||
+22
-28
@@ -95,7 +95,7 @@ public class StoreDetailFragment extends Fragment implements View.OnClickListene
|
||||
String gallery_package = "";
|
||||
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 group_position = -1;
|
||||
@@ -253,40 +253,35 @@ public class StoreDetailFragment extends Fragment implements View.OnClickListene
|
||||
public void onClick(View v) {
|
||||
|
||||
int id = v.getId();
|
||||
switch (id) {
|
||||
if (id == R.id.img_camera1) {
|
||||
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
||||
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
||||
path = str + _pathforcheck;
|
||||
|
||||
case R.id.img_camera1:
|
||||
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
||||
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
||||
path = str + _pathforcheck;
|
||||
startCameraActivity(1);
|
||||
|
||||
startCameraActivity(1);
|
||||
break;
|
||||
} else if (id == R.id.img_camera2) {
|
||||
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
||||
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
||||
path = str + _pathforcheck;
|
||||
|
||||
case R.id.img_camera2:
|
||||
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
||||
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
||||
path = str + _pathforcheck;
|
||||
startCameraActivity(2);
|
||||
|
||||
startCameraActivity(2);
|
||||
break;
|
||||
} else if (id == R.id.img_camera3) {
|
||||
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
||||
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
||||
path = str + _pathforcheck;
|
||||
|
||||
case R.id.img_camera3:
|
||||
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
||||
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
||||
path = str + _pathforcheck;
|
||||
startCameraActivity(3);
|
||||
|
||||
startCameraActivity(3);
|
||||
break;
|
||||
} else if (id == R.id.img_camera4) {
|
||||
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
||||
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
||||
path = str + _pathforcheck;
|
||||
|
||||
case R.id.img_camera4:
|
||||
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
||||
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
||||
path = str + _pathforcheck;
|
||||
|
||||
startCameraActivity(4);
|
||||
break;
|
||||
startCameraActivity(4);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -688,7 +683,6 @@ public class StoreDetailFragment extends Fragment implements View.OnClickListene
|
||||
|
||||
private void startCameraActivity(int pos) {
|
||||
try {
|
||||
|
||||
Log.i("Stock & Facing ", "startCameraActivity()");
|
||||
File file = new File(path);
|
||||
outputFileUri = FileProvider.getUriForFile(getActivity(), "cpm.com.gskmtorange.fileprovider", file);
|
||||
|
||||
@@ -7,10 +7,6 @@ import retrofit.Call;
|
||||
import retrofit.http.Body;
|
||||
import retrofit.http.POST;
|
||||
|
||||
/**
|
||||
* Created by jeevanp on 05-10-2017.
|
||||
*/
|
||||
|
||||
public interface PostApiForFile {
|
||||
@POST("Uploadimages")
|
||||
Call<String> getUploadImage(@Body RequestBody reqesBody);
|
||||
|
||||
@@ -25,6 +25,7 @@ public class FCMNotificationService extends FirebaseMessagingService {
|
||||
String TAG ="FCM Notification";
|
||||
|
||||
public FCMNotificationService() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+146
-322
@@ -6,7 +6,6 @@ import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.location.Location;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
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.AppIndex;
|
||||
import com.google.android.gms.appindexing.Thing;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.GooglePlayServicesUtil;
|
||||
import com.google.android.gms.common.api.GoogleApiClient;
|
||||
import com.google.android.gms.location.LocationListener;
|
||||
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.maps.CameraUpdateFactory;
|
||||
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.PolylineOptions;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@@ -57,122 +53,135 @@ import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||
import cpm.com.gskmtorange.R;
|
||||
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 GoogleMap mMap;
|
||||
StoreBean store;
|
||||
LatLng origin, destination;
|
||||
private final static int PLAY_SERVICES_RESOLUTION_REQUEST = 1000;
|
||||
private GoogleApiClient mGoogleApiClient;
|
||||
private LocationRequest mLocationRequest;
|
||||
private static int UPDATE_INTERVAL = 500; // 5 sec
|
||||
private static int FATEST_INTERVAL = 100; // 1 sec
|
||||
private static int DISPLACEMENT = 5; // 10 meters
|
||||
private Location mLastLocation;
|
||||
double latitude = 0.0;
|
||||
double longitude = 0.0;
|
||||
Boolean markerflag = true;
|
||||
private StoreBean store;
|
||||
private LatLng origin, destination;
|
||||
private FusedLocationProviderClient fusedLocationClient;
|
||||
private LocationRequest locationRequest;
|
||||
private LocationCallback locationCallback;
|
||||
|
||||
private static final int LOCATION_PERMISSION_REQUEST = 1001;
|
||||
|
||||
FloatingActionButton fab_cancel;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_store_route);
|
||||
fab_cancel = (FloatingActionButton) findViewById(R.id.fab_cancel);
|
||||
context = this;
|
||||
fab_cancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
|
||||
fab_cancel = findViewById(R.id.fab_cancel);
|
||||
fab_cancel.setOnClickListener(v -> {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
});
|
||||
|
||||
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()
|
||||
.findFragmentById(R.id.map);
|
||||
mapFragment.getMapAsync(this);
|
||||
|
||||
if (checkPlayServices()) {
|
||||
|
||||
// Building the GoogleApi client
|
||||
buildGoogleApiClient();
|
||||
|
||||
createLocationRequest();
|
||||
if (mapFragment != null) {
|
||||
mapFragment.getMapAsync(this);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkPlayServices() {
|
||||
int resultCode = GooglePlayServicesUtil
|
||||
.isGooglePlayServicesAvailable(this);
|
||||
if (resultCode != ConnectionResult.SUCCESS) {
|
||||
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
|
||||
GooglePlayServicesUtil.getErrorDialog(resultCode, this,
|
||||
PLAY_SERVICES_RESOLUTION_REQUEST).show();
|
||||
} else {
|
||||
Toast.makeText(context, getResources().getString(R.string.notsuppoted)
|
||||
, Toast.LENGTH_LONG)
|
||||
.show();
|
||||
finish();
|
||||
}
|
||||
@Override
|
||||
public void onMapReady(GoogleMap googleMap) {
|
||||
mMap = googleMap;
|
||||
|
||||
// Enable zoom controls for user
|
||||
mMap.getUiSettings().setZoomControlsEnabled(true);
|
||||
|
||||
// Request permissions
|
||||
if (checkLocationPermission()) {
|
||||
startLocationUpdates();
|
||||
fusedLocationClient.getLastLocation()
|
||||
.addOnSuccessListener(this, location -> {
|
||||
if (location != null) {
|
||||
updateMapWithCurrentLocation(location); // show instantly with last known location
|
||||
} else {
|
||||
Toast.makeText(this, "Waiting for current location...", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
/* 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 true;
|
||||
}
|
||||
|
||||
protected synchronized void buildGoogleApiClient() {
|
||||
mGoogleApiClient = new GoogleApiClient.Builder(this)
|
||||
.addConnectionCallbacks(this)
|
||||
.addOnConnectionFailedListener(this)
|
||||
.addApi(LocationServices.API).build();
|
||||
}
|
||||
|
||||
|
||||
protected void createLocationRequest() {
|
||||
mLocationRequest = new LocationRequest();
|
||||
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);
|
||||
|
||||
private void startLocationUpdates() {
|
||||
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
||||
fusedLocationClient.requestLocationUpdates(locationRequest, locationCallback, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
private void updateMapWithCurrentLocation(Location location) {
|
||||
double latitude = location.getLatitude();
|
||||
double longitude = location.getLongitude();
|
||||
|
||||
origin = new LatLng(latitude, longitude);
|
||||
destination = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
||||
|
||||
// Show markers
|
||||
StoreBean currentStore = new StoreBean();
|
||||
currentStore.setLATITUDE(latitude + "");
|
||||
currentStore.setLONGITUDE(longitude + "");
|
||||
currentStore.setSTORE_NAME("Current Location");
|
||||
showMarker(currentStore, R.layout.current_marker_view);
|
||||
|
||||
showMarker(store, R.layout.marker_view);
|
||||
|
||||
// Move camera to fit both points
|
||||
LatLngBounds.Builder builder = new LatLngBounds.Builder();
|
||||
builder.include(origin);
|
||||
builder.include(destination);
|
||||
mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 100));
|
||||
|
||||
// Fetch and draw route
|
||||
String url = getUrl(origin, destination);
|
||||
new FetchUrl().execute(url);
|
||||
|
||||
// Stop updates once we get location
|
||||
fusedLocationClient.removeLocationUpdates(locationCallback);
|
||||
}
|
||||
|
||||
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);
|
||||
public void showMarker(StoreBean store, int layout_resource) {
|
||||
LinearLayout tv = (LinearLayout) this.getLayoutInflater().inflate(layout_resource, null, false);
|
||||
TextView desc = tv.findViewById(R.id.tv_desc);
|
||||
desc.setText(store.getSTORE_NAME());
|
||||
|
||||
tv.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
|
||||
@@ -180,302 +189,117 @@ public class StoreRouteActivity extends FragmentActivity implements OnMapReadyCa
|
||||
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)));
|
||||
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 parameters = str_origin + "&" + str_dest + "&sensor=false";
|
||||
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;
|
||||
return "https://maps.googleapis.com/maps/api/directions/" + output + "?" + parameters + "&key=AIzaSyCPo-giwVv5h8AzsbE1IDRsFsPHjVlCm5A";
|
||||
}
|
||||
|
||||
/**
|
||||
* A method to download json data from url
|
||||
*/
|
||||
private String downloadUrl(String strUrl) throws IOException {
|
||||
String data = "";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
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 = "";
|
||||
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());
|
||||
Log.e("Exception", e.toString());
|
||||
} finally {
|
||||
iStream.close();
|
||||
urlConnection.disconnect();
|
||||
if (iStream != null) iStream.close();
|
||||
if (urlConnection != null) urlConnection.disconnect();
|
||||
}
|
||||
return data;
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@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);
|
||||
destination = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
||||
|
||||
StoreBean store1 = new StoreBean();
|
||||
store1.setLATITUDE(latitude+"");
|
||||
store1.setLONGITUDE(longitude+"");
|
||||
store1.setSTORE_NAME("Current Location");
|
||||
showMarker(store1, R.layout.current_marker_view);
|
||||
|
||||
showMarker(store, R.layout.marker_view);
|
||||
|
||||
LatLngBounds.Builder builder = new LatLngBounds.Builder();
|
||||
builder.include(new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE())));
|
||||
builder.include(new LatLng(latitude, longitude));
|
||||
//mMap.moveCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 48));
|
||||
mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 48));
|
||||
|
||||
//destination = new LatLng(mapLat[1], mapLon[1]);
|
||||
/*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);
|
||||
Log.d("onMapClick", url.toString());
|
||||
FetchUrl FetchUrl = new FetchUrl();
|
||||
|
||||
// Start downloading json data from Google Directions API
|
||||
FetchUrl.execute(url);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 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);
|
||||
|
||||
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)));
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected void onStart() {
|
||||
super.onStart();// ATTENTION: This was auto-generated to implement the App Indexing API.
|
||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
||||
mGoogleApiClient.connect();
|
||||
if (mGoogleApiClient != null) {
|
||||
mGoogleApiClient.connect();
|
||||
}
|
||||
// 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());
|
||||
}
|
||||
|
||||
/**
|
||||
* ATTENTION: This was auto-generated to implement the App Indexing API.
|
||||
* See https://g.co/AppIndexing/AndroidStudio for more information.
|
||||
*/
|
||||
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();
|
||||
}
|
||||
|
||||
// Fetches data from url passed
|
||||
// AsyncTask to fetch directions
|
||||
private class FetchUrl extends AsyncTask<String, Void, String> {
|
||||
|
||||
@Override
|
||||
protected String doInBackground(String... url) {
|
||||
|
||||
// For storing data from web service
|
||||
String data = "";
|
||||
|
||||
try {
|
||||
// Fetching the data from web service
|
||||
data = downloadUrl(url[0]);
|
||||
Log.d("Background Task data", data.toString());
|
||||
} catch (Exception e) {
|
||||
Log.d("Background Task", e.toString());
|
||||
return downloadUrl(url[0]);
|
||||
} catch (IOException e) {
|
||||
Log.e("Background Task", e.toString());
|
||||
return "";
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(String result) {
|
||||
super.onPostExecute(result);
|
||||
|
||||
ParserTask parserTask = new ParserTask();
|
||||
|
||||
// Invokes the thread for parsing the JSON data
|
||||
parserTask.execute(result);
|
||||
|
||||
Log.d("DirectionsResponse", result);
|
||||
new 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>>>> {
|
||||
|
||||
// Parsing the data in non-ui thread
|
||||
@Override
|
||||
protected List<List<HashMap<String, String>>> doInBackground(String... jsonData) {
|
||||
|
||||
JSONObject jObject;
|
||||
List<List<HashMap<String, String>>> routes = null;
|
||||
|
||||
try {
|
||||
jObject = new JSONObject(jsonData[0]);
|
||||
Log.d("ParserTask",jsonData[0].toString());
|
||||
JSONObject jObject = new JSONObject(jsonData[0]);
|
||||
DataParser parser = new DataParser();
|
||||
Log.d("ParserTask", parser.toString());
|
||||
|
||||
// Starts parsing data
|
||||
routes = parser.parse(jObject);
|
||||
Log.d("ParserTask","Executing routes");
|
||||
Log.d("ParserTask",routes.toString());
|
||||
|
||||
return parser.parse(jObject);
|
||||
} catch (Exception e) {
|
||||
Log.d("ParserTask",e.toString());
|
||||
e.printStackTrace();
|
||||
Log.e("ParserTask", e.toString());
|
||||
return null;
|
||||
}
|
||||
return routes;
|
||||
}
|
||||
|
||||
// Executes in UI thread, after the parsing process
|
||||
@Override
|
||||
protected void onPostExecute(List<List<HashMap<String, String>>> result) {
|
||||
if (result == null) return;
|
||||
|
||||
ArrayList<LatLng> points;
|
||||
PolylineOptions lineOptions = null;
|
||||
|
||||
// Traversing through all the routes
|
||||
for (int i = 0; i < result.size(); i++) {
|
||||
for (List<HashMap<String, String>> path : result) {
|
||||
points = new ArrayList<>();
|
||||
lineOptions = new PolylineOptions();
|
||||
|
||||
// Fetching i-th route
|
||||
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);
|
||||
|
||||
for (HashMap<String, String> point : path) {
|
||||
double lat = Double.parseDouble(point.get("lat"));
|
||||
double lng = Double.parseDouble(point.get("lng"));
|
||||
LatLng position = new LatLng(lat, lng);
|
||||
|
||||
points.add(position);
|
||||
points.add(new LatLng(lat, lng));
|
||||
}
|
||||
|
||||
// Adding all the points in the route to LineOptions
|
||||
lineOptions.addAll(points);
|
||||
lineOptions.width(12);
|
||||
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);
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+341
-76
@@ -10,6 +10,7 @@ import android.graphics.BitmapFactory;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
@@ -21,7 +22,6 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import org.ksoap2.SoapEnvelope;
|
||||
import org.ksoap2.serialization.SoapObject;
|
||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||
import org.ksoap2.transport.HttpTransportSE;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
@@ -47,6 +47,7 @@ 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.utils.OkHttpTransportSE;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CompetitonPromoGetterSetter;
|
||||
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.Store_wise_camera_DataGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
||||
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
||||
|
||||
public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
private Context context;
|
||||
|
||||
GSKOrangeDB db;
|
||||
ArrayList<CoverageBean> coverageList;
|
||||
String date, userId, app_version;
|
||||
@@ -89,7 +90,6 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
ArrayList<AddittionalGetterSetter> additionalVisibilityList;
|
||||
ArrayList<AdditionalDialogGetterSetter> additionalVisibilitySkuList;
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> msl_availabilityStockFacingList;
|
||||
|
||||
private Dialog dialog;
|
||||
private ProgressBar pb;
|
||||
private TextView percentage, message;
|
||||
@@ -99,14 +99,10 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
ArrayList<CategoryPictureGetterSetter> adddata = new ArrayList<CategoryPictureGetterSetter>();
|
||||
ArrayList<CategoryPictureGetterSetter> listdat = new ArrayList<CategoryPictureGetterSetter>();
|
||||
ArrayList<CoachingVisitGetterSetter> coachingVisitData;
|
||||
|
||||
Object result = "";
|
||||
|
||||
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> stockFacingPlanogramDataList;
|
||||
ArrayList<Store_wise_camera_DataGetterSetter> storeWiseCameraDataGetterSetters;
|
||||
|
||||
ArrayList<PromoComplianceSkuwiseGetterSetter> promoComplianceSkuwiseGetterSetters, promoComplianceSkuwiseExistsGetterSetters;
|
||||
|
||||
ArrayList<CounterfeitProductGetterSetter> counterfeitProductGetterSetters, counterfeitProductExistsGetterSetters;
|
||||
ArrayList<CompetitonPromoGetterSetter> competitonGetterSetters, competitonExistsGetterSetters;
|
||||
|
||||
@@ -122,7 +118,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
db = new GSKOrangeDB(this);
|
||||
db.open();
|
||||
context = this;
|
||||
Path = CommonString.FILE_PATH;
|
||||
Path = CommonString.getImagesFolder(context);
|
||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
//start upload
|
||||
new UploadTask(this).execute();
|
||||
@@ -172,7 +168,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UPLOAD_IMAGE, envelope);
|
||||
|
||||
Object result = envelope.getResponse();
|
||||
@@ -271,7 +267,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -294,18 +290,18 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
for (int i = 0; i < coverageList.size(); i++) {
|
||||
|
||||
storeData = db.getSpecificStoreData(coverageList.get(i).getVisitDate(), coverageList.get(i).getStoreId(), coverageList.get(i).getFlag_from());
|
||||
storeData = db.getSpecificStoreData(coverageList.get(i).getVisitDate(), coverageList.get(i).getStoreId(), coverageList.get(i).getFlag_from());
|
||||
if (storeData.getSTORE_ID() != null) {
|
||||
|
||||
if (storeData.getCHECKOUT_STATUS().equals(CommonString.KEY_Y) ||
|
||||
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)) {
|
||||
|
||||
String camera_allow = storeData.getCAMERA_ALLOW();
|
||||
|
||||
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";
|
||||
} else {
|
||||
adhoc = "0";
|
||||
@@ -313,20 +309,18 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
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;
|
||||
coverage_service = CommonString.METHOD_UPLOAD_COVERAGE_NEW_ADDITIONAL;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
status_service = CommonString.METHOD_UPLOAD_COVERAGE_STATUS;
|
||||
coverage_service = CommonString.METHOD_UPLOAD_COVERAGE_NEW;
|
||||
}
|
||||
|
||||
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";
|
||||
}
|
||||
|
||||
String onXML = "[DATA]"
|
||||
+ "[USER_DATA]"
|
||||
+ "[STORE_CD]" + coverageList.get(i).getStoreId() + "[/STORE_CD]"
|
||||
@@ -355,7 +349,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + coverage_service, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -418,7 +412,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -468,7 +462,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
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.addProperty("XMLDATA", sos_xml);
|
||||
@@ -480,7 +474,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -527,7 +521,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -554,7 +548,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
+ "[USERID]" + userId + "[/USERID]"
|
||||
+ "[BID]" + Integer.parseInt(pharmaMSLList.get(j).getBrandId()) + "[/BID]"
|
||||
+ "[SKID]" + Integer.parseInt(pharmaMSLList.get(j).getSkuId()) + "[/SKID]"
|
||||
+ "[PRESENT]" + pharmaMSLList.get(j).getPresent() + "[/PRESENT]"+
|
||||
+ "[PRESENT]" + pharmaMSLList.get(j).getPresent() + "[/PRESENT]" +
|
||||
"[/ST]";
|
||||
|
||||
pharma_msl_xml = pharma_msl_xml + onXML;
|
||||
@@ -572,7 +566,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -591,13 +585,16 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
String mslAvailability_stockFacing_xml = "";
|
||||
onXML = "";
|
||||
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) {
|
||||
for (int j = 0; j < msl_availabilityStockFacingList.size(); j++) {
|
||||
if (!msl_availabilityStockFacingList.get(j).getSku_id().equals("0")) {
|
||||
|
||||
String stock,pricing;
|
||||
String stock, pricing;
|
||||
if (!msl_availabilityStockFacingList.get(j).getStock().equals("")) {
|
||||
stock = msl_availabilityStockFacingList.get(j).getStock();
|
||||
} else {
|
||||
@@ -616,7 +613,8 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
+ "[AVL]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getToggleValue()) + "[/AVL]"
|
||||
+ "[FC]" + Double.parseDouble(msl_availabilityStockFacingList.get(j).getFacing()) + "[/FC]"
|
||||
+ "[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]" +
|
||||
"[/ST]";
|
||||
|
||||
@@ -625,18 +623,72 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
final String sos_xml = "[DATA]" + mslAvailability_stockFacing_xml + "[/DATA]";
|
||||
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||
request.addProperty("XMLDATA", sos_xml);
|
||||
request.addProperty("KEYS", "STOCK_AVAILABILITY_WITH_PRICING");
|
||||
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 = 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.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -645,11 +697,12 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
}*/
|
||||
}
|
||||
data.value = 15;
|
||||
data.name = getString(R.string.availability_data_uploading);
|
||||
data.value = 16;
|
||||
data.name = getString(R.string.stock_entry_data_uploading);
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
|
||||
//Promo Compliance - Promotion Data
|
||||
String promoition_data_xml = "";
|
||||
onXML = "";
|
||||
@@ -689,7 +742,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -767,7 +820,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -822,7 +875,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -922,7 +975,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1007,8 +1060,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
present = "1";
|
||||
} else {
|
||||
present = "0";
|
||||
}*/String qty = t2PGetterSetters.get(i1).getQty();
|
||||
if(qty.equals("")){
|
||||
}*/
|
||||
String qty = t2PGetterSetters.get(i1).getQty();
|
||||
if (qty.equals("")) {
|
||||
qty = "0";
|
||||
}
|
||||
|
||||
@@ -1051,7 +1105,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1102,7 +1156,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1200,7 +1254,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1252,7 +1306,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1299,7 +1353,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1342,7 +1396,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1391,7 +1445,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1401,6 +1455,55 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
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)
|
||||
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.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1521,7 +1624,6 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
+ "[/COMPETITION_PROMOTION_DATA]";
|
||||
|
||||
competiton_data_xml = competiton_data_xml + competiton_exists_xml;
|
||||
|
||||
}
|
||||
|
||||
final String sos_xml = "[DATA]" + competiton_data_xml + "[/DATA]";
|
||||
@@ -1536,7 +1638,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1545,6 +1647,169 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
data.value = 68;
|
||||
data.name = getString(R.string.title_activity_competition_promo);
|
||||
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++) {
|
||||
|
||||
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 {
|
||||
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 (new File(CommonString.FILE_PATH + additionalVisibilityList.get(i1).getImage2()).exists()) {
|
||||
if (new File(CommonString.getImagesFolder(context) + additionalVisibilityList.get(i1).getImage2()).exists()) {
|
||||
|
||||
try {
|
||||
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 (new File(CommonString.FILE_PATH + additionalVisibilityList.get(i1).getImage3()).exists()) {
|
||||
if (new File(CommonString.getImagesFolder(context) + additionalVisibilityList.get(i1).getImage3()).exists()) {
|
||||
|
||||
try {
|
||||
result = UploadImage(additionalVisibilityList.get(i1).getImage3(), "AdditionalVisibilityImages");
|
||||
@@ -1635,7 +1900,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
for (int i1 = 0; i1 < listdat.size(); i1++) {
|
||||
|
||||
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 {
|
||||
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 (new File(CommonString.FILE_PATH + listdat.get(i1).getSubCategoryCamera2()).exists()) {
|
||||
if (new File(CommonString.getImagesFolder(context) + listdat.get(i1).getSubCategoryCamera2()).exists()) {
|
||||
|
||||
try {
|
||||
result = UploadImage(listdat.get(i1).getSubCategoryCamera2(), "CategoryImages");
|
||||
@@ -1687,7 +1952,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
for (int i1 = 0; i1 < adddata.size(); i1++) {
|
||||
|
||||
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 {
|
||||
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 (new File(CommonString.FILE_PATH + adddata.get(i1).getCategoryImage2()).exists()) {
|
||||
if (new File(CommonString.getImagesFolder(context) + adddata.get(i1).getCategoryImage2()).exists()) {
|
||||
|
||||
try {
|
||||
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 (new File(CommonString.FILE_PATH + adddata.get(i1).getCategoryImage3()).exists()) {
|
||||
if (new File(CommonString.getImagesFolder(context) + adddata.get(i1).getCategoryImage3()).exists()) {
|
||||
|
||||
try {
|
||||
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 (new File(CommonString.FILE_PATH + adddata.get(i1).getCategoryImage4()).exists()) {
|
||||
if (new File(CommonString.getImagesFolder(context) + adddata.get(i1).getCategoryImage4()).exists()) {
|
||||
|
||||
try {
|
||||
result = UploadImage(adddata.get(i1).getCategoryImage4(), "CategoryImages");
|
||||
@@ -1775,7 +2040,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
for (int i1 = 0; i1 < adddata.size(); i1++) {
|
||||
|
||||
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 {
|
||||
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 (new File(CommonString.FILE_PATH + adddata.get(i1).getCategoryImage2()).exists()) {
|
||||
if (new File(CommonString.getImagesFolder(context) + adddata.get(i1).getCategoryImage2()).exists()) {
|
||||
|
||||
try {
|
||||
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 (new File(CommonString.FILE_PATH + adddata.get(i1).getCategoryImage3()).exists()) {
|
||||
if (new File(CommonString.getImagesFolder(context) + adddata.get(i1).getCategoryImage3()).exists()) {
|
||||
|
||||
try {
|
||||
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 (new File(CommonString.FILE_PATH + adddata.get(i1).getCategoryImage4()).exists()) {
|
||||
if (new File(CommonString.getImagesFolder(context) + adddata.get(i1).getCategoryImage4()).exists()) {
|
||||
|
||||
try {
|
||||
result = UploadImage(adddata.get(i1).getCategoryImage4(), "CategoryImages");
|
||||
@@ -1863,7 +2128,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
for (int i1 = 0; i1 < coverageList.size(); i1++) {
|
||||
|
||||
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 {
|
||||
result = UploadImage(coverageList.get(i1).getImage(), "StoreImages");
|
||||
@@ -1892,7 +2157,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
for (int i1 = 0; i1 < promotionSkuList.size(); i1++) {
|
||||
|
||||
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 {
|
||||
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++) {
|
||||
|
||||
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 {
|
||||
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++) {
|
||||
|
||||
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 {
|
||||
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++) {
|
||||
|
||||
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 {
|
||||
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 (new File(CommonString.FILE_PATH + t2PGetterSetters.get(m).getImage1()).exists()) {
|
||||
if (new File(CommonString.getImagesFolder(context) + t2PGetterSetters.get(m).getImage1()).exists()) {
|
||||
|
||||
try {
|
||||
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 (new File(CommonString.FILE_PATH + t2PGetterSetters.get(m).getImage2()).exists()) {
|
||||
if (new File(CommonString.getImagesFolder(context) + t2PGetterSetters.get(m).getImage2()).exists()) {
|
||||
|
||||
try {
|
||||
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++) {
|
||||
|
||||
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 {
|
||||
result = UploadImage(audit_data.get(m).getCAM_IMAGE(), "AuditImages");
|
||||
@@ -2085,7 +2350,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + status_service, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -2121,11 +2386,11 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
e.printStackTrace();
|
||||
} catch (XmlPullParserException e) {
|
||||
//Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
} 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(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
@@ -2149,7 +2414,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
if (result.contains(CommonString.KEY_SUCCESS)) {
|
||||
//db.deleteAllTables();
|
||||
|
||||
File f = new File(CommonString.FILE_PATH);
|
||||
File f = new File(CommonString.getImagesFolder(context));
|
||||
//if (f != null && f.listFiles().length > 0) {
|
||||
File file[] = f.listFiles();
|
||||
UploadImageWithRetrofit.uploadedFiles = 0;
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.squareup.okhttp.RequestBody;
|
||||
import org.ksoap2.SoapEnvelope;
|
||||
import org.ksoap2.serialization.SoapObject;
|
||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||
import org.ksoap2.transport.HttpTransportSE;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.XMLReader;
|
||||
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.retrofit.PostApiForFile;
|
||||
import cpm.com.gskmtorange.retrofit.StringConverterFactory;
|
||||
import cpm.com.gskmtorange.utils.OkHttpTransportSE;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CompetitonPromoGetterSetter;
|
||||
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.Store_wise_camera_DataGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
||||
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
||||
import retrofit.Retrofit;
|
||||
|
||||
@@ -96,8 +97,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
String[] words;
|
||||
String validity;
|
||||
int mid;
|
||||
String errormsg = "", Path;
|
||||
Data data;
|
||||
String errormsg = "", Path; Data data;
|
||||
ArrayList<MSL_AvailabilityGetterSetter> msl_availabilityList;
|
||||
ArrayList<Stock_FacingGetterSetter> stock_facingHeaderList, stock_facingChildList;
|
||||
ArrayList<Promo_Compliance_DataGetterSetter> promotionSkuList, additionalPromotionList;
|
||||
@@ -123,14 +123,6 @@ public class UploadActivity extends AppCompatActivity {
|
||||
ArrayList<PromoComplianceSkuwiseGetterSetter> promoComplianceSkuwiseGetterSetters, promoComplianceSkuwiseExistsGetterSetters;
|
||||
ArrayList<CounterfeitProductGetterSetter> counterfeitProductGetterSetters, counterfeitProductExistsGetterSetters;
|
||||
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
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -150,7 +142,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
db = new GSKOrangeDB(this);
|
||||
db.open();
|
||||
|
||||
Path = CommonString.FILE_PATH;
|
||||
Path = CommonString.getImagesFolder(context);
|
||||
|
||||
//start upload
|
||||
new UploadTask(this).execute();
|
||||
@@ -202,7 +194,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UPLOAD_IMAGE, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -303,7 +295,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -337,7 +329,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -375,7 +367,6 @@ public class UploadActivity extends AppCompatActivity {
|
||||
adhoc = "0";
|
||||
}
|
||||
|
||||
|
||||
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)) {
|
||||
@@ -425,7 +416,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + coverage_service, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -481,7 +472,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -537,7 +528,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -559,7 +550,6 @@ public class UploadActivity extends AppCompatActivity {
|
||||
publishProgress(data);*/
|
||||
|
||||
if (coverageList.get(i).getFlag_from().equals(CommonString.FROM_ADDITIONAL)) {
|
||||
|
||||
//MSL_Availability_StockFacing
|
||||
String mslAvailability_stockFacing_xml = "";
|
||||
onXML = "";
|
||||
@@ -583,7 +573,6 @@ public class UploadActivity extends AppCompatActivity {
|
||||
+ "[STK]" + Integer.parseInt(stock) + "[/STK]"
|
||||
+ "[MBQ]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMbq()) + "[/MBQ]"
|
||||
+ "[MSL]" + Integer.parseInt(msl_availabilityStockFacingList.get(j).getMust_have()) + "[/MSL]" +
|
||||
|
||||
"[/ST]";
|
||||
|
||||
mslAvailability_stockFacing_xml = mslAvailability_stockFacing_xml + onXML;
|
||||
@@ -602,14 +591,11 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
}*/
|
||||
}
|
||||
data.value = 15;
|
||||
data.name = getString(R.string.availability_data_uploading);
|
||||
@@ -655,7 +641,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -664,6 +650,54 @@ public class UploadActivity extends AppCompatActivity {
|
||||
data.name = getString(R.string.coaching_visit);
|
||||
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
|
||||
@@ -717,7 +751,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -764,7 +798,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -809,7 +843,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -828,7 +862,12 @@ public class UploadActivity extends AppCompatActivity {
|
||||
String mslAvailability_stockFacing_xml = "";
|
||||
onXML = "";
|
||||
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) {
|
||||
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]"
|
||||
+ "[FC]" + Double.parseDouble(msl_availabilityStockFacingList.get(j).getFacing()) + "[/FC]"
|
||||
+ "[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]" +
|
||||
"[/ST]";
|
||||
|
||||
@@ -862,7 +902,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
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.addProperty("XMLDATA", sos_xml);
|
||||
request.addProperty("KEYS", "STOCK_AVAILABILITY_WITH_PRICING");
|
||||
@@ -873,7 +913,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -886,6 +926,69 @@ public class UploadActivity extends AppCompatActivity {
|
||||
data.name = getString(R.string.availability_data_uploading);
|
||||
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
|
||||
String promoition_data_xml = "";
|
||||
@@ -926,7 +1029,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -970,7 +1073,6 @@ public class UploadActivity extends AppCompatActivity {
|
||||
+ "[PROMO_IMAGE]" + promoComplianceSkuwiseGetterSetters.get(i1).getImg() + "[/PROMO_IMAGE]"
|
||||
+ "[PRICE_FLASHER_AVAILABLE]" + promoComplianceSkuwiseGetterSetters.get(i1).getPrice_flasher() + "[/PRICE_FLASHER_AVAILABLE]"
|
||||
+ "[/PROMOTION_DATA]";
|
||||
|
||||
add_promotion_data_xml = add_promotion_data_xml + add_xml;
|
||||
}
|
||||
}
|
||||
@@ -1004,7 +1106,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1059,7 +1161,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1159,7 +1261,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1289,7 +1391,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1340,7 +1442,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1438,7 +1540,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1490,7 +1592,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1506,7 +1608,6 @@ public class UploadActivity extends AppCompatActivity {
|
||||
ArrayList<AuditDataGetterSetter> audit_data = db.getAuditDataForUpload(coverageList.get(i).getStoreId());
|
||||
|
||||
if (audit_data.size() > 0) {
|
||||
|
||||
String onXml_audit_data = "", Audit_data = "";
|
||||
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]";
|
||||
|
||||
Log.d("sos_xml_audit",sos_xml);
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||
request.addProperty("XMLDATA", sos_xml);
|
||||
request.addProperty("KEYS", "AUDIT_DATA_NEW_REMARK");
|
||||
@@ -1537,7 +1638,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1580,7 +1681,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1629,7 +1730,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1639,6 +1740,55 @@ public class UploadActivity extends AppCompatActivity {
|
||||
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)
|
||||
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.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1757,9 +1907,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
+ "[IS_EXISTS]" + exists + "[/IS_EXISTS]"
|
||||
+ "[COMPETITION_DATA]" + add_competiton_data_xml + "[/COMPETITION_DATA]"
|
||||
+ "[/COMPETITION_PROMOTION_DATA]";
|
||||
|
||||
competiton_data_xml = competiton_data_xml + competiton_exists_xml;
|
||||
|
||||
}
|
||||
|
||||
final String sos_xml = "[DATA]" + competiton_data_xml + "[/DATA]";
|
||||
@@ -1774,7 +1922,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.dotNet = true;
|
||||
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);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1783,6 +1931,167 @@ public class UploadActivity extends AppCompatActivity {
|
||||
data.value = 68;
|
||||
data.name = getString(R.string.title_activity_competition_promo);
|
||||
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.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + status_service, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
@@ -1850,10 +2159,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onPostExecute(String result) {
|
||||
super.onPostExecute(result);
|
||||
|
||||
dialog.dismiss();
|
||||
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) {
|
||||
File file[] = f.listFiles();
|
||||
UploadImageWithRetrofit.uploadedFiles = 0;
|
||||
@@ -1894,5 +2202,4 @@ public class UploadActivity extends AppCompatActivity {
|
||||
alert.show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+121
-158
@@ -12,14 +12,11 @@ import android.graphics.Matrix;
|
||||
import android.graphics.RectF;
|
||||
import android.os.AsyncTask;
|
||||
import android.util.Log;
|
||||
|
||||
//import com.crashlytics.android.Crashlytics;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.squareup.okhttp.MediaType;
|
||||
import com.squareup.okhttp.MultipartBuilder;
|
||||
import com.squareup.okhttp.OkHttpClient;
|
||||
import com.squareup.okhttp.RequestBody;
|
||||
|
||||
import org.json.JSONObject;
|
||||
import org.ksoap2.SoapEnvelope;
|
||||
import org.ksoap2.serialization.SoapObject;
|
||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||
@@ -35,6 +32,7 @@ import java.net.MalformedURLException;
|
||||
import java.net.SocketException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
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.StringConverterFactory;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
||||
import retrofit.GsonConverterFactory;
|
||||
import retrofit.Retrofit;
|
||||
|
||||
/**
|
||||
* Created by yadavendras on 4/5/2018.
|
||||
*/
|
||||
|
||||
public class UploadImageWithRetrofit {
|
||||
RequestBody body1;
|
||||
@@ -86,15 +82,15 @@ public class UploadImageWithRetrofit {
|
||||
status = 0;
|
||||
String filename = null, foldername = null;
|
||||
int totalfiles = 0;
|
||||
File f = new File(CommonString.FILE_PATH);
|
||||
File f = new File(CommonString.getImagesFolder(context));
|
||||
File file[] = f.listFiles();
|
||||
count = file.length;
|
||||
if (file.length > 0) {
|
||||
filename = "";
|
||||
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++) {
|
||||
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")) {
|
||||
foldername = "StoreImages";
|
||||
} else if (file[i].getName().contains("GeoTag")) {
|
||||
@@ -103,7 +99,7 @@ public class UploadImageWithRetrofit {
|
||||
foldername = "T2PImages";
|
||||
} else if (file[i].getName().contains("AddPromo_Image") || file[i].getName().contains("Additional_Promo_Skuwise_Image")) {
|
||||
foldername = "AdditionalPromotionImages";
|
||||
}else if (file[i].getName().contains("AdditionalImage")) {
|
||||
} else if (file[i].getName().contains("AdditionalImage")) {
|
||||
foldername = "AdditionalVisibilityImages";
|
||||
} else if (file[i].getName().contains("Promo_Image")) {
|
||||
foldername = "PromotionImages";
|
||||
@@ -111,13 +107,17 @@ public class UploadImageWithRetrofit {
|
||||
foldername = "CategoryImages";
|
||||
} else if (file[i].getName().contains("AuditAnsPic")) {
|
||||
foldername = "AuditImages";
|
||||
} else if (file[i].getName().contains("CoachingVisit")) {
|
||||
} else if (file[i].getName().contains("CoachingVisit") || file[i].getName().contains("CheckVisit")) {
|
||||
foldername = "CoachingVisits";
|
||||
} else if (file[i].getName().contains("DeliveryCalls")) {
|
||||
} else if (file[i].getName().contains("DeliveryCalls")) {
|
||||
foldername = "DeliveryCallsImages";
|
||||
} else if (file[i].getName().contains("CounterfeitProduct")) {//added 15.04.2019
|
||||
foldername = "CounterFeitImages";
|
||||
} else{
|
||||
}
|
||||
else if (file[i].getName().contains("POImage")) {//added 15.04.2019
|
||||
foldername = "POImages";
|
||||
}
|
||||
else {
|
||||
foldername = "Bulkimages";
|
||||
}
|
||||
|
||||
@@ -125,35 +125,37 @@ public class UploadImageWithRetrofit {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
File originalFile = new File(CommonString.FILE_PATH+ filename);
|
||||
final File finalFile = saveBitmapToFileSmaller(originalFile);
|
||||
File originalFile = new File(CommonString.getImagesFolder(context) + filename);
|
||||
File finalFile = saveBitmapToFileSmaller(originalFile);
|
||||
if (finalFile == null) {
|
||||
finalFile = originalFile;
|
||||
}
|
||||
|
||||
OkHttpClient okHttpClient = new OkHttpClient();
|
||||
okHttpClient.setConnectTimeout(20, TimeUnit.SECONDS);
|
||||
okHttpClient.setWriteTimeout(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()
|
||||
.type(MultipartBuilder.FORM)
|
||||
.addFormDataPart("file", finalFile.getName(), photo)
|
||||
.addFormDataPart("FolderName", foldername)
|
||||
.build();
|
||||
|
||||
adapter = new retrofit.Retrofit.Builder()
|
||||
adapter = new Retrofit.Builder()
|
||||
.baseUrl(CommonString.URL + "/")
|
||||
.addConverterFactory(new StringConverterFactory())
|
||||
.build();
|
||||
PostApiForFile api = adapter.create(PostApiForFile.class);
|
||||
|
||||
PostApiForFile api = adapter.create(PostApiForFile.class);
|
||||
retrofit.Call<String> call = api.getUploadImage(body1);
|
||||
File finalFile1 = finalFile;
|
||||
call.enqueue(new retrofit.Callback<String>() {
|
||||
@Override
|
||||
public void onResponse(retrofit.Response<String> response) {
|
||||
if (response.isSuccess() && response.body().contains("Success")) {
|
||||
finalFile.delete();
|
||||
if (response.isSuccess() && response.body().contains("Success")) {
|
||||
finalFile1.delete();
|
||||
status = 1;
|
||||
uploadedFiles++;
|
||||
} else {
|
||||
@@ -163,53 +165,45 @@ public class UploadImageWithRetrofit {
|
||||
if (status == 0) {
|
||||
pd.dismiss();
|
||||
if (!((Activity) context).isFinishing()) {
|
||||
showAlert((Activity) context, context.getString(R.string.DataNot),false);
|
||||
showAlert((Activity) context, context.getString(R.string.DataNot), false);
|
||||
}
|
||||
} else {
|
||||
UploadImageRecursiveNew(context);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable t) {
|
||||
if (t instanceof IOException || t instanceof SocketTimeoutException || t instanceof SocketException) {
|
||||
status = -1;
|
||||
//uploadedFiles = 0;
|
||||
pd.dismiss();
|
||||
// Log.e("Errormsg :",t.toString());
|
||||
// AlertandMessages.showAlert((Activity) context, "Network Error in upload", false);
|
||||
if (!((Activity) context).isFinishing()) {
|
||||
showAlert((Activity) context, context.getString(R.string.NetworkError),false);
|
||||
showAlert((Activity) context, context.getString(R.string.NetworkError), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
if (totalFiles == uploadedFiles) {
|
||||
//region Coverage upload status Data
|
||||
new StatusUpload().execute();
|
||||
//endregion
|
||||
//pd.cancel();
|
||||
//showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
||||
}
|
||||
|
||||
}
|
||||
} catch (JsonSyntaxException e) {
|
||||
e.printStackTrace();
|
||||
showAlert((Activity) context, "Invalid Json",false);
|
||||
showAlert((Activity) context, "Invalid Json", false);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
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 {
|
||||
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) {
|
||||
try {
|
||||
final int[] _index = {index};
|
||||
status = 0;
|
||||
@@ -218,17 +212,21 @@ public class UploadImageWithRetrofit {
|
||||
if (_index[0] < file_list.size()) {
|
||||
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);
|
||||
final File finalFile = saveBitmapToFileSmaller(originalFile);
|
||||
File originalFile = new File(CommonString.getImagesFolder(context) + filename);
|
||||
File finalFile = saveBitmapToFileSmaller(originalFile);
|
||||
|
||||
if (finalFile == null) {
|
||||
finalFile = originalFile;
|
||||
}
|
||||
|
||||
OkHttpClient okHttpClient = new OkHttpClient();
|
||||
okHttpClient.setConnectTimeout(20, TimeUnit.SECONDS);
|
||||
okHttpClient.setWriteTimeout(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()
|
||||
.type(MultipartBuilder.FORM)
|
||||
.addFormDataPart("file", finalFile.getName(), photo)
|
||||
@@ -242,11 +240,12 @@ public class UploadImageWithRetrofit {
|
||||
PostApiForFile api = adapter.create(PostApiForFile.class);
|
||||
|
||||
retrofit.Call<String> call = api.getUploadImage(body1);
|
||||
File finalFile1 = finalFile;
|
||||
call.enqueue(new retrofit.Callback<String>() {
|
||||
@Override
|
||||
public void onResponse(retrofit.Response<String> response) {
|
||||
if (response.isSuccess() && response.body().contains("Success")) {
|
||||
finalFile.delete();
|
||||
finalFile1.delete();
|
||||
status = 1;
|
||||
uploadedFiles++;
|
||||
} else {
|
||||
@@ -256,7 +255,7 @@ public class UploadImageWithRetrofit {
|
||||
if (status == 0) {
|
||||
pd.dismiss();
|
||||
if (!((Activity) context).isFinishing()) {
|
||||
showAlert((Activity) context, context.getString(R.string.DataNot),false);
|
||||
showAlert((Activity) context, context.getString(R.string.DataNot), false);
|
||||
}
|
||||
} else {
|
||||
UploadDeliveryImageRecursive(context, file_list, ++_index[0]);
|
||||
@@ -271,7 +270,7 @@ public class UploadImageWithRetrofit {
|
||||
pd.dismiss();
|
||||
// AlertandMessages.showAlert((Activity) context, "Network Error in upload", false);
|
||||
if (!((Activity) context).isFinishing()) {
|
||||
showAlert((Activity) context, context.getString(R.string.NetworkError),false);
|
||||
showAlert((Activity) context, context.getString(R.string.NetworkError), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -290,103 +289,73 @@ public class UploadImageWithRetrofit {
|
||||
//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);
|
||||
}
|
||||
} catch (JsonSyntaxException e) {
|
||||
e.printStackTrace();
|
||||
showAlert((Activity) context, "Invalid Json",false);
|
||||
showAlert((Activity) context, "Invalid Json", false);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
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 {
|
||||
showAlert((Activity) context, CommonString.KEY_FAILURE,false);
|
||||
showAlert((Activity) context, CommonString.KEY_FAILURE, false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
public File saveBitmapToFileSmaller(File file) {
|
||||
File file2 = file;
|
||||
try {
|
||||
public File saveBitmapToFileSmaller(File file) {
|
||||
File file2 = file;
|
||||
try {
|
||||
int inWidth = 0;
|
||||
int inHeight = 0;
|
||||
|
||||
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();
|
||||
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();
|
||||
in = null;
|
||||
|
||||
// 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) {
|
||||
File file2 = file;
|
||||
try {
|
||||
int inWidth = 0;
|
||||
int inHeight = 0;
|
||||
|
||||
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();
|
||||
in = null;
|
||||
|
||||
// save width and height
|
||||
inWidth = options.outWidth;
|
||||
inHeight = options.outHeight;
|
||||
|
||||
// decode full image pre-resized
|
||||
in = new FileInputStream(file2);
|
||||
options = new BitmapFactory.Options();
|
||||
// calc rough re-size (this is no exact resize)
|
||||
options.inSampleSize = Math.max(inWidth / 1632, inHeight / 1224);
|
||||
// decode full image
|
||||
Bitmap roughBitmap = BitmapFactory.decodeStream(in, null, options);
|
||||
|
||||
// calc exact destination size
|
||||
Matrix m = new Matrix();
|
||||
RectF inRect = new RectF(0, 0, roughBitmap.getWidth(), roughBitmap.getHeight());
|
||||
RectF outRect = new RectF(0, 0, 1632, 1224);
|
||||
m.setRectToRect(inRect, outRect, Matrix.ScaleToFit.CENTER);
|
||||
float[] values = new float[9];
|
||||
m.getValues(values);
|
||||
// resize bitmap
|
||||
Bitmap resizedBitmap = Bitmap.createScaledBitmap(roughBitmap, (int) (roughBitmap.getWidth() * values[0]), (int) (roughBitmap.getHeight() * values[4]), true);
|
||||
// save image
|
||||
FileOutputStream out = new FileOutputStream(file2);
|
||||
resizedBitmap.compress(Bitmap.CompressFormat.JPEG, 80, out);
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.e("Image", e.toString(), e);
|
||||
return file;
|
||||
}
|
||||
return file2;
|
||||
}
|
||||
// save width and height
|
||||
inWidth = options.outWidth;
|
||||
inHeight = options.outHeight;
|
||||
|
||||
// decode full image pre-resized
|
||||
in = new FileInputStream(file2);
|
||||
options = new BitmapFactory.Options();
|
||||
// calc rough re-size (this is no exact resize)
|
||||
options.inSampleSize = Math.max(inWidth / 1632, inHeight / 1224);
|
||||
// decode full image
|
||||
Bitmap roughBitmap = BitmapFactory.decodeStream(in, null, options);
|
||||
if (roughBitmap == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// calc exact destination size
|
||||
Matrix m = new Matrix();
|
||||
RectF inRect = new RectF(0, 0, roughBitmap.getWidth(), roughBitmap.getHeight());
|
||||
RectF outRect = new RectF(0, 0, 1632, 1224);
|
||||
m.setRectToRect(inRect, outRect, Matrix.ScaleToFit.CENTER);
|
||||
float[] values = new float[9];
|
||||
m.getValues(values);
|
||||
// resize bitmap
|
||||
Bitmap resizedBitmap = Bitmap.createScaledBitmap(roughBitmap, (int) (roughBitmap.getWidth() * values[0]), (int) (roughBitmap.getHeight() * values[4]), true);
|
||||
// save image
|
||||
if (resizedBitmap == null) {
|
||||
return null;
|
||||
}
|
||||
FileOutputStream out = new FileOutputStream(file2);
|
||||
resizedBitmap.compress(Bitmap.CompressFormat.JPEG, 80, out);
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.e("Image", e.toString(), e);
|
||||
return file;
|
||||
}
|
||||
return file2;
|
||||
}
|
||||
|
||||
|
||||
public void showAlert(final Context context, String str, final boolean flag) {
|
||||
@@ -396,13 +365,13 @@ public class UploadImageWithRetrofit {
|
||||
builder.setMessage(str).setCancelable(false)
|
||||
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
Activity activity =(Activity) context;
|
||||
if(flag){
|
||||
Intent i = new Intent(activity, MainActivity.class);
|
||||
activity.startActivity(i);
|
||||
activity.finish();
|
||||
Activity activity = (Activity) context;
|
||||
if (flag) {
|
||||
Intent i = new Intent(activity, MainActivity.class);
|
||||
activity.startActivity(i);
|
||||
activity.finish();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
@@ -427,7 +396,7 @@ public class UploadImageWithRetrofit {
|
||||
String onXML = "";
|
||||
onXML = "[COVERAGE_STATUS]"
|
||||
+ "[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]"
|
||||
+ "[STATUS]" + CommonString.KEY_U + "[/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());
|
||||
|
||||
String uploadStatus;
|
||||
if(coverageObj.getReasonid().equalsIgnoreCase("0")){
|
||||
if (coverageObj.getReasonid().equalsIgnoreCase("0")) {
|
||||
uploadStatus = CommonString.KEY_U;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
uploadStatus = CommonString.KEY_UN;
|
||||
}
|
||||
|
||||
@@ -482,7 +450,7 @@ public class UploadImageWithRetrofit {
|
||||
String onXML = "";
|
||||
onXML = "[COVERAGE_STATUS]"
|
||||
+ "[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]"
|
||||
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
||||
+ "[/COVERAGE_STATUS]";
|
||||
@@ -526,7 +494,7 @@ public class UploadImageWithRetrofit {
|
||||
String onXML = "";
|
||||
onXML = "[COVERAGE_STATUS]"
|
||||
+ "[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]"
|
||||
+ "[STATUS]" + CommonString.KEY_U + "[/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());
|
||||
|
||||
String uploadStatus;
|
||||
if(coverageObj.getReasonid().equalsIgnoreCase("0")){
|
||||
if (coverageObj.getReasonid().equalsIgnoreCase("0")) {
|
||||
uploadStatus = CommonString.KEY_U;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
uploadStatus = CommonString.KEY_UN;
|
||||
}
|
||||
|
||||
@@ -581,7 +548,7 @@ public class UploadImageWithRetrofit {
|
||||
String onXML = "";
|
||||
onXML = "[COVERAGE_STATUS]"
|
||||
+ "[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]"
|
||||
+ "[STATUS]" + CommonString.KEY_U + "[/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());
|
||||
|
||||
String uploadStatus;
|
||||
if(coverageObj.getReasonid().equalsIgnoreCase("0")){
|
||||
if (coverageObj.getReasonid().equalsIgnoreCase("0")) {
|
||||
uploadStatus = CommonString.KEY_U;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
uploadStatus = CommonString.KEY_UN;
|
||||
}
|
||||
|
||||
db.updateCoverageStatus(storeListAdditional.get(i).getSTORE_ID(), uploadStatus);
|
||||
db.updateStoreStatusOnLeave(storeListAdditional.get(i).getSTORE_ID(), storeListAdditional.get(i).getVISIT_DATE(),
|
||||
uploadStatus, CommonString.FROM_ADDITIONAL);
|
||||
|
||||
db.deleteTableWithStoreID(storeListAdditional.get(i).getSTORE_ID());
|
||||
}
|
||||
|
||||
@@ -636,7 +601,7 @@ public class UploadImageWithRetrofit {
|
||||
String onXML = "";
|
||||
onXML = "[COVERAGE_STATUS]"
|
||||
+ "[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]"
|
||||
+ "[STATUS]" + CommonString.KEY_U + "[/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());
|
||||
|
||||
String uploadStatus;
|
||||
if(coverageObj.getReasonid().equalsIgnoreCase("0")){
|
||||
if (coverageObj.getReasonid().equalsIgnoreCase("0")) {
|
||||
uploadStatus = CommonString.KEY_U;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
uploadStatus = CommonString.KEY_UN;
|
||||
}
|
||||
|
||||
@@ -685,16 +649,16 @@ public class UploadImageWithRetrofit {
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
} catch (XmlPullParserException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
// Crashlytics.logException(e.getCause());
|
||||
// Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (statusUpdated) {
|
||||
@@ -710,10 +674,9 @@ public class UploadImageWithRetrofit {
|
||||
pd.dismiss();
|
||||
if (s.equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
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 {
|
||||
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> 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() {
|
||||
return REMARK_ALLOW;
|
||||
}
|
||||
@@ -42,6 +52,16 @@ public class AdditionalQuestiongetterSetter {
|
||||
ArrayList<String> REMARK_ALLOW = 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() {
|
||||
return table_ADDITIONAL_QUESTION;
|
||||
}
|
||||
|
||||
+20
-1
@@ -5,7 +5,6 @@ package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
*/
|
||||
|
||||
public class AuditDataGetterSetter {
|
||||
|
||||
String QUESTION_ID;
|
||||
String CULTURE_ID;
|
||||
String CATEGORY_ID;
|
||||
@@ -15,6 +14,16 @@ public class AuditDataGetterSetter {
|
||||
String ANSWER="";
|
||||
String CAM_IMAGE="";
|
||||
|
||||
public String getMaxlength() {
|
||||
return maxlength;
|
||||
}
|
||||
|
||||
public void setMaxlength(String maxlength) {
|
||||
this.maxlength = maxlength;
|
||||
}
|
||||
|
||||
String maxlength="0";
|
||||
|
||||
public String getTXT_REMARK() {
|
||||
return TXT_REMARK;
|
||||
}
|
||||
@@ -29,6 +38,16 @@ public class AuditDataGetterSetter {
|
||||
String NO_OF_CAMERA ="1";
|
||||
String CAM_IMAGE2="";
|
||||
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() {
|
||||
return REMARK_ALLOW;
|
||||
|
||||
-1
@@ -9,7 +9,6 @@ import java.util.ArrayList;
|
||||
public class MAPPING_SKU_PRICING_ENABLEGetterSetter {
|
||||
|
||||
String table_MAPPING_SKU_PRICING_ENABLE;
|
||||
|
||||
ArrayList<String> STORE_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 facing="";
|
||||
String stock;
|
||||
String posmStock;
|
||||
String warehouseStock;
|
||||
String company_id;
|
||||
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() {
|
||||
return pricing;
|
||||
}
|
||||
@@ -181,4 +204,73 @@ public class MSL_AvailabilityStockFacingGetterSetter implements Serializable{
|
||||
public void setMust_have(String 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> 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() {
|
||||
return table_SUB_CATEGORY_MASTER;
|
||||
|
||||
+19
@@ -10,6 +10,25 @@ public class SupervisorListGetterSetter {
|
||||
ArrayList<String> SUPERVISOR = 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() {
|
||||
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