Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| de5f4f881f | |||
| 0d1e462563 | |||
| 1fbb7ebadf | |||
| aaec7b4768 | |||
| 903b281f8c | |||
| 564797c2c9 | |||
| 42c1685176 | |||
| d52ce68cf5 | |||
| 6f260fd0b0 | |||
| e3dd446623 | |||
| 0f5fabea00 | |||
| ffd20ef524 |
Generated
+3
@@ -0,0 +1,3 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
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
+14
File diff suppressed because one or more lines are too long
Generated
+1
@@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="AppInsightsSettings">
|
<component name="AppInsightsSettings">
|
||||||
|
<option name="selectedTabId" value="Firebase Crashlytics" />
|
||||||
<option name="tabSettings">
|
<option name="tabSettings">
|
||||||
<map>
|
<map>
|
||||||
<entry key="Android Vitals">
|
<entry key="Android Vitals">
|
||||||
|
|||||||
Generated
+32
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="WizardSettings">
|
||||||
|
<option name="children">
|
||||||
|
<map>
|
||||||
|
<entry key="vectorWizard">
|
||||||
|
<value>
|
||||||
|
<PersistentState>
|
||||||
|
<option name="children">
|
||||||
|
<map>
|
||||||
|
<entry key="vectorAssetStep">
|
||||||
|
<value>
|
||||||
|
<PersistentState>
|
||||||
|
<option name="values">
|
||||||
|
<map>
|
||||||
|
<entry key="assetSourceType" value="FILE" />
|
||||||
|
<entry key="outputName" value="social_media" />
|
||||||
|
<entry key="sourceFile" value="C:\Users\ravik\Downloads\social-media (1).svg" />
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</PersistentState>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</PersistentState>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+1870
File diff suppressed because it is too large
Load Diff
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="CompilerConfiguration">
|
<component name="CompilerConfiguration">
|
||||||
<bytecodeTargetLevel target="11" />
|
<bytecodeTargetLevel target="17" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
Generated
+8
@@ -4,6 +4,14 @@
|
|||||||
<selectionStates>
|
<selectionStates>
|
||||||
<SelectionState runConfigName="GSKMTOrange">
|
<SelectionState runConfigName="GSKMTOrange">
|
||||||
<option name="selectionMode" value="DROPDOWN" />
|
<option name="selectionMode" value="DROPDOWN" />
|
||||||
|
<DropdownSelection timestamp="2026-04-28T11:27:59.892971400Z">
|
||||||
|
<Target type="DEFAULT_BOOT">
|
||||||
|
<handle>
|
||||||
|
<DeviceId pluginId="PhysicalDevice" identifier="serial=HA1712TP" />
|
||||||
|
</handle>
|
||||||
|
</Target>
|
||||||
|
</DropdownSelection>
|
||||||
|
<DialogSelection />
|
||||||
</SelectionState>
|
</SelectionState>
|
||||||
</selectionStates>
|
</selectionStates>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
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
+2
-2
@@ -4,8 +4,9 @@
|
|||||||
<component name="GradleSettings">
|
<component name="GradleSettings">
|
||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
|
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
<option name="gradleJvm" value="11" />
|
<option name="gradleJvm" value="jbr-21" />
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
<set>
|
<set>
|
||||||
<option value="$PROJECT_DIR$" />
|
<option value="$PROJECT_DIR$" />
|
||||||
@@ -13,7 +14,6 @@
|
|||||||
<option value="$PROJECT_DIR$/library" />
|
<option value="$PROJECT_DIR$/library" />
|
||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
<option name="resolveExternalAnnotations" value="false" />
|
|
||||||
</GradleProjectSettings>
|
</GradleProjectSettings>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
Generated
+9
-1
@@ -42,10 +42,18 @@
|
|||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" 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" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
<option name="id" value="Android" />
|
<option name="id" value="Android" />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="VisualizationToolProject">
|
||||||
|
<option name="state">
|
||||||
|
<ProjectState>
|
||||||
|
<option name="scale" value="0.097802734375" />
|
||||||
|
</ProjectState>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
</project>
|
</project>
|
||||||
Generated
-16
@@ -1,16 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/HALEON_KENYA_PD.iml" filepath="$PROJECT_DIR$/.idea/modules/HALEON_KENYA_PD.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/GSKMTOrange/HALEON_KENYA_PD.GSKMTOrange.iml" filepath="$PROJECT_DIR$/.idea/modules/GSKMTOrange/HALEON_KENYA_PD.GSKMTOrange.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/GSKMTOrange/HALEON_KENYA_PD.GSKMTOrange.androidTest.iml" filepath="$PROJECT_DIR$/.idea/modules/GSKMTOrange/HALEON_KENYA_PD.GSKMTOrange.androidTest.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/GSKMTOrange/HALEON_KENYA_PD.GSKMTOrange.main.iml" filepath="$PROJECT_DIR$/.idea/modules/GSKMTOrange/HALEON_KENYA_PD.GSKMTOrange.main.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/GSKMTOrange/HALEON_KENYA_PD.GSKMTOrange.unitTest.iml" filepath="$PROJECT_DIR$/.idea/modules/GSKMTOrange/HALEON_KENYA_PD.GSKMTOrange.unitTest.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/library/HALEON_KENYA_PD.library.iml" filepath="$PROJECT_DIR$/.idea/modules/library/HALEON_KENYA_PD.library.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/library/HALEON_KENYA_PD.library.androidTest.iml" filepath="$PROJECT_DIR$/.idea/modules/library/HALEON_KENYA_PD.library.androidTest.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/library/HALEON_KENYA_PD.library.main.iml" filepath="$PROJECT_DIR$/.idea/modules/library/HALEON_KENYA_PD.library.main.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/library/HALEON_KENYA_PD.library.unitTest.iml" filepath="$PROJECT_DIR$/.idea/modules/library/HALEON_KENYA_PD.library.unitTest.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
Generated
-527
@@ -1,527 +0,0 @@
|
|||||||
<?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="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="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="Lenovo" />
|
|
||||||
<option name="codename" value="TB370FU" />
|
|
||||||
<option name="id" value="TB370FU" />
|
|
||||||
<option name="manufacturer" value="Lenovo" />
|
|
||||||
<option name="name" value="Tab P12" />
|
|
||||||
<option name="screenDensity" value="340" />
|
|
||||||
<option name="screenX" value="1840" />
|
|
||||||
<option name="screenY" value="2944" />
|
|
||||||
</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="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="31" />
|
|
||||||
<option name="brand" value="samsung" />
|
|
||||||
<option name="codename" value="a51" />
|
|
||||||
<option name="id" value="a51" />
|
|
||||||
<option name="manufacturer" value="Samsung" />
|
|
||||||
<option name="name" value="Galaxy A51" />
|
|
||||||
<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="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="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="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="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="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="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="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="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="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="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="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="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="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>
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
Generated
+17
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RunConfigurationProducerService">
|
||||||
|
<option name="ignoredProducers">
|
||||||
|
<set>
|
||||||
|
<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>
|
||||||
|
</project>
|
||||||
Generated
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="StudioBotProjectSettings">
|
||||||
|
<option name="shareContext" value="OptedIn" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
+77
-68
@@ -1,18 +1,18 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
//apply plugin: 'io.fabric'
|
|
||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
apply plugin: 'com.google.firebase.crashlytics'
|
apply plugin: 'com.google.firebase.crashlytics'
|
||||||
apply plugin: 'org.jetbrains.kotlin.android'
|
apply plugin: 'org.jetbrains.kotlin.android'
|
||||||
android {
|
android {
|
||||||
compileSdk(34)
|
namespace("cpm.com.gskmtorange")
|
||||||
useLibrary 'org.apache.http.legacy'
|
compileSdk 36
|
||||||
namespace "cpm.com.gskmtorange"
|
|
||||||
lintOptions {
|
lintOptions {
|
||||||
checkReleaseBuilds false
|
checkReleaseBuilds false
|
||||||
disable 'MissingTranslation'
|
disable 'MissingTranslation'
|
||||||
abortOnError false
|
abortOnError false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
// all*.exclude module: 'okio'
|
// all*.exclude module: 'okio'
|
||||||
//all*.exclude group: 'com.squareup.okhttp3', module: 'okhttp'
|
//all*.exclude group: 'com.squareup.okhttp3', module: 'okhttp'
|
||||||
@@ -20,92 +20,91 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
|
multiDexEnabled true
|
||||||
|
useLibrary 'org.apache.http.legacy'
|
||||||
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
applicationId "cpm.com.gskmtorange"
|
applicationId "cpm.com.gskmtorange"
|
||||||
minSdkVersion 24
|
minSdkVersion 26
|
||||||
targetSdk(34)
|
targetSdk(34)
|
||||||
|
|
||||||
// For Lebanon
|
// For Lebanon
|
||||||
/*versionCode 1
|
/*versionCode 1
|
||||||
versionName "1.0"*/
|
versionName "1.0"*/
|
||||||
|
|
||||||
//For Egypt
|
//For Egypt
|
||||||
/*versionCode 35
|
versionCode 39
|
||||||
versionName "4.6"*/
|
versionName "5.0"
|
||||||
|
|
||||||
//For UAE
|
//For UAE
|
||||||
/*versionCode 29
|
/*versionCode 29
|
||||||
versionName "4.1"*/
|
versionName "4.1"*/
|
||||||
|
|
||||||
//For Turkey
|
//For Turkey
|
||||||
/* versionCode 34
|
/* versionCode 34
|
||||||
versionName "4.6"*/
|
versionName "4.6"*/
|
||||||
|
|
||||||
//For Turkey
|
//For Turkey
|
||||||
/*versionCode 32
|
/*versionCode 32
|
||||||
versionName "4.4"*/
|
versionName "4.4"*/
|
||||||
|
|
||||||
//For KSA
|
//For KSA
|
||||||
/*versionCode 28
|
/*versionCode 28
|
||||||
versionName "4.0"*/
|
versionName "4.0"*/
|
||||||
|
|
||||||
// aading price facing
|
// adding price facing
|
||||||
/* versionCode 27
|
/* versionCode 27
|
||||||
versionName "3.8"*/
|
versionName "3.8"*/
|
||||||
|
|
||||||
//sa
|
//sa
|
||||||
/* versionCode 28
|
/* versionCode 28
|
||||||
versionName "3.9"*/
|
versionName "3.9"*/
|
||||||
|
/* //Kenya
|
||||||
//Kenya
|
|
||||||
versionCode 2
|
versionCode 2
|
||||||
versionName "1.1"
|
versionName "1.1"*/
|
||||||
|
|
||||||
//kenya-lite
|
//kenya-lite
|
||||||
/* versionCode 2
|
/* versionCode 2
|
||||||
versionName "1.1"*/
|
versionName "1.1"*/
|
||||||
|
|
||||||
//nigeria
|
//nigeria
|
||||||
/*versionCode 1
|
/*versionCode 1
|
||||||
versionName "1.0"*/
|
versionName "1.0"*/
|
||||||
|
|
||||||
//For jordan
|
//For jordan
|
||||||
/* versionCode 7
|
/* versionCode 7
|
||||||
versionName "1.6"*/
|
versionName "1.6"*/
|
||||||
|
|
||||||
//For Kuwait
|
//For Kuwait
|
||||||
/*versionCode 1
|
/*versionCode 1
|
||||||
versionName "1.0"*/
|
versionName "1.0"*/
|
||||||
|
|
||||||
//For Bahrain
|
//For Bahrain
|
||||||
/*versionCode 1
|
/*versionCode 1
|
||||||
versionName "1.0"*/
|
versionName "1.0"*/
|
||||||
|
|
||||||
//For QATAR
|
//For QATAR
|
||||||
/*versionCode 1
|
/*versionCode 1
|
||||||
versionName "1.0"*/
|
versionName "1.0"*/
|
||||||
|
|
||||||
//For Libya
|
//For Libya
|
||||||
/*versionCode 3
|
/*versionCode 3
|
||||||
versionName "1.2"*/
|
versionName "1.2"*/
|
||||||
|
|
||||||
//For Oman
|
//For Oman
|
||||||
/*versionCode 1
|
/*versionCode 1
|
||||||
versionName "1.0"*/
|
versionName "1.0"*/
|
||||||
|
ndk {abiFilters "armeabi-v7a", "arm64-v8a"}
|
||||||
|
}
|
||||||
|
|
||||||
multiDexEnabled true
|
signingConfigs {
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
config {
|
||||||
|
keyAlias 'hp'
|
||||||
|
keyPassword 'android'
|
||||||
|
storeFile file('D:\\jeevanp_cpm_projects\\keystore\\hp.dat')
|
||||||
|
storePassword 'android'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
debuggable true
|
||||||
|
signingConfig signingConfigs.config
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'proguard-camera-lib.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_17
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_17
|
||||||
}
|
}
|
||||||
|
|
||||||
firebaseCrashlytics {
|
firebaseCrashlytics {
|
||||||
nativeSymbolUploadEnabled true
|
nativeSymbolUploadEnabled true
|
||||||
}
|
}
|
||||||
@@ -113,59 +112,69 @@ android {
|
|||||||
buildFeatures {
|
buildFeatures {
|
||||||
viewBinding = true
|
viewBinding = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
packagingOptions {
|
||||||
|
exclude 'META-INF/LICENSE'
|
||||||
|
exclude 'META-INF/NOTICE'
|
||||||
|
exclude 'META-INF/gradle/incremental.annotation.processors'
|
||||||
|
exclude 'META-INF/AL2.0'
|
||||||
|
exclude 'META-INF/LGPL2.1'
|
||||||
|
}
|
||||||
|
kotlin {
|
||||||
|
jvmToolchain(17)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation 'androidx.activity:activity-ktx:1.13.0'
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
implementation files('libs/ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar')
|
implementation files('libs/ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar')
|
||||||
|
// implementation files('libs/ksoap2-android-assembly-3.6.4.jar')
|
||||||
|
// implementation files('libs/ksoap2-android-3.3.0.jar')
|
||||||
implementation 'androidx.cardview:cardview:1.0.0'
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
implementation 'com.google.android.material:material:1.2.1'
|
implementation 'com.google.android.material:material:1.12.0'
|
||||||
implementation project(path: ':library')
|
implementation project(path: ':library')
|
||||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation 'com.google.firebase:firebase-auth:20.0.3'
|
implementation 'androidx.activity:activity:1.10.1'
|
||||||
implementation 'androidx.activity:activity:1.9.3'
|
implementation 'androidx.appcompat:appcompat:1.7.1'
|
||||||
testImplementation 'junit:junit:4.13.1'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
implementation 'android.arch.navigation:navigation-fragment:1.0.0'
|
testImplementation 'org.mockito:mockito-core:4.11.0'
|
||||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
testImplementation 'org.mockito:mockito-android:4.11.0'
|
||||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
testImplementation 'org.robolectric:robolectric:4.10.3'
|
||||||
implementation 'com.google.code.gson:gson:2.10.1'
|
implementation "androidx.navigation:navigation-fragment-ktx:2.9.0"
|
||||||
implementation 'com.github.bumptech.glide:glide:4.15.1'
|
androidTestImplementation "androidx.test:core:1.6.1"
|
||||||
//implementation 'com.google.code.ksoap2-android:ksoap2-android:3.6.2'
|
androidTestImplementation "androidx.test:espresso:espresso-core:3.5.1"
|
||||||
// implementation 'com.github.leocadiotine:ksoap2-android:3.6.2'
|
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:26.7.0')
|
implementation platform('com.google.firebase:firebase-bom:33.14.0')
|
||||||
// implementation 'com.google.firebase:firebase-analytics'
|
implementation 'com.google.firebase:firebase-crashlytics'
|
||||||
implementation 'com.google.firebase:firebase-crashlytics-ndk'
|
|
||||||
implementation 'com.google.firebase:firebase-messaging'
|
implementation 'com.google.firebase:firebase-messaging'
|
||||||
|
implementation 'com.google.android.gms:play-services-location:21.3.0'
|
||||||
implementation 'com.google.android.gms:play-services-location:17.1.0'
|
implementation 'com.google.android.gms:play-services-maps:19.2.0'
|
||||||
implementation 'com.google.android.gms:play-services-maps:17.0.0'
|
implementation 'com.google.firebase:firebase-analytics:22.4.0'
|
||||||
//implementation 'com.kyanogen.signatureview:signature-view:1.0'
|
implementation 'com.google.firebase:firebase-appindexing:20.0.0'
|
||||||
// implementation 'com.squareup.okhttp3:okhttp:4.12.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.retrofit2:retrofit:2.9.0'
|
||||||
implementation 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
|
implementation 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
implementation 'com.google.firebase:firebase-appindexing:10.2.1'
|
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
|
||||||
// Add the Firebase Crashlytics SDK.
|
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.22"))
|
||||||
implementation 'com.google.firebase:firebase-crashlytics:17.3.0'
|
|
||||||
// Recommended: Add the Google Analytics SDK.
|
|
||||||
implementation 'com.google.firebase:firebase-analytics:18.0.0'
|
|
||||||
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
|
|
||||||
implementation 'androidx.multidex:multidex:2.0.1'
|
implementation 'androidx.multidex:multidex:2.0.1'
|
||||||
//using stable version
|
|
||||||
// implementation 'com.github.pratham-PDots:camera_lib:1.5.1'
|
|
||||||
// implementation 'com.github.pratham-PDots:camera_lib:1.5.0-external-2'
|
|
||||||
// implementation 'com.github.pratham-PDots:camera_lib:1.5.1.0'
|
|
||||||
// Main SDK dependency
|
// Main SDK dependency
|
||||||
implementation("com.github.pratham-PDots:camera_lib:1.5.1.1")
|
// implementation("com.github.pratham-PDots:camera_lib:1.5.1.1")
|
||||||
/*implementation 'androidx.activity:activity-ktx:1.9.0'
|
// implementation("com.github.pratham-PDots:camera_lib:1.5.3.2")
|
||||||
implementation 'androidx.fragment:fragment-ktx:1.6.2'*/
|
// implementation("com.github.pratham-PDots:camera_lib:1.5.4.5")
|
||||||
|
//latest
|
||||||
|
implementation("com.github.pratham-PDots:camera_lib:1.5.4.9")
|
||||||
|
implementation 'com.github.miteshpithadiya:SearchableSpinner:master'
|
||||||
|
implementation "androidx.core:core-splashscreen:1.0.1"
|
||||||
|
implementation "androidx.media3:media3-exoplayer:1.3.1"
|
||||||
|
implementation "androidx.media3:media3-ui:1.3.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
apply plugin: 'com.google.gms.google-services'
|
|
||||||
apply plugin: 'org.jetbrains.kotlin.android'
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Vendored
+3
@@ -15,3 +15,6 @@
|
|||||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
# public *;
|
# public *;
|
||||||
#}
|
#}
|
||||||
|
-keep class com.github.pratham_pdots.camera_lib. { *; }
|
||||||
|
-keep class com.github.pratham_pdots. { *; }
|
||||||
|
-dontwarn com.github.pratham_pdots.**
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -11,10 +11,11 @@
|
|||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 7,
|
"versionCode": 39,
|
||||||
"versionName": "1.6",
|
"versionName": "5.0",
|
||||||
"outputFile": "GSKMTOrange-release.apk"
|
"outputFile": "GSKMTOrange-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"elementType": "File"
|
"elementType": "File",
|
||||||
|
"minSdkVersionForDexing": 26
|
||||||
}
|
}
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
|
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
|
||||||
string in this file.
|
string in this file.
|
||||||
-->
|
-->
|
||||||
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyDdgvyAY0_pb-k7PLPJoG6wR-KN0xnhkRE</string>
|
<!--<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyDdgvyAY0_pb-k7PLPJoG6wR-KN0xnhkRE</string>-->
|
||||||
|
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyCs2VZqLl4OgStAraUHr8012cUc7vf3Uo8</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -8,17 +8,15 @@
|
|||||||
android:required="false" />
|
android:required="false" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||||
<uses-permission android:name="android.permission.READ_PROFILE" />
|
<uses-permission android:name="android.permission.READ_PROFILE" />
|
||||||
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
|
|
||||||
<uses-permission
|
<uses-permission
|
||||||
android:name="android.permission.READ_EXTERNAL_STORAGE"
|
android:name="android.permission.READ_EXTERNAL_STORAGE"
|
||||||
android:maxSdkVersion="32" />
|
android:maxSdkVersion="32" />
|
||||||
@@ -48,11 +46,54 @@
|
|||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:largeHeap="true"
|
android:largeHeap="true"
|
||||||
|
android:networkSecurityConfig="@xml/network_security_config"
|
||||||
android:requestLegacyExternalStorage="true"
|
android:requestLegacyExternalStorage="true"
|
||||||
android:supportsRtl="false"
|
android:supportsRtl="false"
|
||||||
android:theme="@style/AppTheme"
|
android:theme="@style/AppTheme"
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true"
|
||||||
tools:replace="android:supportsRtl">
|
tools:replace="android:supportsRtl">
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.BannerActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
android:exported="false" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.PD_Realtime_Report_Detail"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.PD_Realtime_Report"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.WebViewActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.PD_Pog_Activity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.PDVisibilityActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".Paralleldots.PdJavaImageActivity"
|
android:name=".Paralleldots.PdJavaImageActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
@@ -61,90 +102,105 @@
|
|||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gsk_dailyentry.StockEntryActivity"
|
android:name=".gsk_dailyentry.StockEntryActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.VisitTypeStatusActivity"
|
android:name=".dailyentry.VisitTypeStatusActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="Ad hoc - Visit Type"
|
android:label="Ad hoc - Visit Type"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gsk_dailyentry.OrderStatusDetailActivity"
|
android:name=".gsk_dailyentry.OrderStatusDetailActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gsk_dailyentry.OrderConfirmActivity"
|
android:name=".gsk_dailyentry.OrderConfirmActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.OrderTakingActivity"
|
android:name=".dailyentry.OrderTakingActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.NewStockDataActivity"
|
android:name=".dailyentry.NewStockDataActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_new_stock_data"
|
android:label="@string/title_activity_new_stock_data"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.CounterfeitIndicatorWebActivity"
|
android:name=".dailyentry.CounterfeitIndicatorWebActivity"
|
||||||
android:label="@string/title_activity_counterfeit_indicator_web"
|
android:label="@string/title_activity_counterfeit_indicator_web"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.StockPricingActivity"
|
android:name=".dailyentry.StockPricingActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_stock_pricing"
|
android:label="@string/title_activity_stock_pricing"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".pharma_stores.PharmaActivity"
|
android:name=".pharma_stores.PharmaActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_paharma"
|
android:label="@string/title_activity_paharma"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.StockActivity"
|
android:name=".dailyentry.StockActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/stock"
|
android:label="@string/stock"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.CounterfeitProductsActivity"
|
android:name=".dailyentry.CounterfeitProductsActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_counterfeit_products"
|
android:label="@string/title_activity_counterfeit_products"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".password.MPinActivity"
|
android:name=".password.MPinActivity"
|
||||||
android:label="@string/title_activity_mpin"
|
android:label="@string/title_activity_mpin"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".password.ChangePasswordActivity"
|
android:name=".password.ChangePasswordActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_change_password"
|
android:label="@string/title_activity_change_password"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".SplashScreenActivity"
|
android:name=".SplashScreenActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
@@ -156,50 +212,59 @@
|
|||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_login"
|
android:label="@string/title_activity_login"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/main_menu_activity_name"
|
android:label="@string/main_menu_activity_name"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".autoupdate.AutoUpdateActivity"
|
android:name=".autoupdate.AutoUpdateActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".SelectLanguageActivity"
|
android:name=".SelectLanguageActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_select_language"
|
android:label="@string/title_activity_select_language"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".download.DownloadActivity"
|
android:name=".download.DownloadActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".GeoTag.GeoTagStoreList"
|
android:name=".GeoTag.GeoTagStoreList"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_store_list"
|
android:label="@string/title_activity_store_list"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.StoreListActivity"
|
android:name=".dailyentry.StoreListActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_store_list"
|
android:label="@string/title_activity_store_list"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.StoreimageActivity"
|
android:name=".dailyentry.StoreimageActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_store_image"
|
android:label="@string/title_activity_store_image"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".GeoTag.GeoTagActivity"
|
android:name=".GeoTag.GeoTagActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_store_geotag"
|
android:label="@string/title_activity_store_geotag"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<!--
|
<!--
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.google.android.maps.v2.API_KEY"
|
android:name="com.google.android.maps.v2.API_KEY"
|
||||||
@@ -213,137 +278,160 @@
|
|||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" /> <!-- Gagan Start Declaration -->
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> <!-- Gagan Start Declaration -->
|
||||||
<activity
|
<activity
|
||||||
android:name=".gsk_dailyentry.CategoryListActivity"
|
android:name=".gsk_dailyentry.CategoryListActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gsk_dailyentry.CategoryWisePerformanceActivity"
|
android:name=".gsk_dailyentry.CategoryWisePerformanceActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gsk_dailyentry.DailyDataMenuActivity"
|
android:name=".gsk_dailyentry.DailyDataMenuActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gsk_dailyentry.MSL_AvailabilityActivity"
|
android:name=".gsk_dailyentry.MSL_AvailabilityActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gsk_dailyentry.Stock_FacingActivity"
|
android:name=".gsk_dailyentry.Stock_FacingActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gsk_dailyentry.PromoComplianceActivity"
|
android:name=".gsk_dailyentry.PromoComplianceActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gsk_dailyentry.StoreWisePerformanceActivity"
|
android:name=".gsk_dailyentry.StoreWisePerformanceActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" /> <!-- Gagan End Declaration -->
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> <!-- Gagan End Declaration -->
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.NonWorkingReason"
|
android:name=".dailyentry.NonWorkingReason"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_Non_Work"
|
android:label="@string/title_activity_Non_Work"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.AdditionalVisibility"
|
android:name=".dailyentry.AdditionalVisibility"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_Additional_visibility"
|
android:label="@string/title_activity_Additional_visibility"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".upload.UploadActivity"
|
android:name=".upload.UploadActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_upload"
|
android:label="@string/title_activity_upload"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.SettingsActivity"
|
android:name=".dailyentry.SettingsActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_settings"
|
android:label="@string/title_activity_settings"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.CheckoutActivity"
|
android:name=".dailyentry.CheckoutActivity"
|
||||||
android:label="@string/title_activity_checkout"
|
android:label="@string/title_activity_checkout"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.ServiceActivity"
|
android:name=".dailyentry.ServiceActivity"
|
||||||
android:label="@string/title_activity_service"
|
android:label="@string/title_activity_service"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".upload.PreviousDataUploadActivity"
|
android:name=".upload.PreviousDataUploadActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_upload"
|
android:label="@string/title_activity_upload"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.T2pBrand_Avaibility"
|
android:name=".dailyentry.T2pBrand_Avaibility"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_t2p_brand__avaibility"
|
android:label="@string/title_activity_t2p_brand__avaibility"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gsk_dailyentry.StockFacing_PlanogramTrackerActivity"
|
android:name=".gsk_dailyentry.StockFacing_PlanogramTrackerActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_stock_facing__planogram_tracker"
|
android:label="@string/title_activity_stock_facing__planogram_tracker"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.CategoryPicture"
|
android:name=".dailyentry.CategoryPicture"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_category_picture"
|
android:label="@string/title_activity_category_picture"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.StoreCheckoutImageActivity"
|
android:name=".dailyentry.StoreCheckoutImageActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_store_checkout_image"
|
android:label="@string/title_activity_store_checkout_image"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gsk_dailyentry.MSL_Availability_StockFacingActivity"
|
android:name=".gsk_dailyentry.MSL_Availability_StockFacingActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.FutureJCPActivity"
|
android:name=".dailyentry.FutureJCPActivity"
|
||||||
android:label=""
|
android:label=""
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.CreateSelfActivity"
|
android:name=".dailyentry.CreateSelfActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_create_self"
|
android:label="@string/title_activity_create_self"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.NoCameraActivity"
|
android:name=".dailyentry.NoCameraActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
android:label="@string/title_activity_create_self"
|
android:label="@string/title_activity_create_self"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.PlanogramPDFActivity"
|
android:name=".dailyentry.PlanogramPDFActivity"
|
||||||
android:label="@string/category_performance_PLANOGRAM"
|
android:label="@string/category_performance_PLANOGRAM"
|
||||||
@@ -354,13 +442,15 @@
|
|||||||
android:label="@string/title_activity_stock_data"
|
android:label="@string/title_activity_stock_data"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.AuditActivity"
|
android:name=".dailyentry.AuditActivity"
|
||||||
android:label="@string/audit"
|
android:label="@string/audit"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".service.FCMNotificationService"
|
android:name=".service.FCMNotificationService"
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
{
|
||||||
|
"Mer_NoticeBoard": [
|
||||||
|
{
|
||||||
|
"NoticeBoardId": 1,
|
||||||
|
"NoticThumnail_Path": "https:\/\/bigm1.parinaam.in\/notice\/ThumbnailImages\/",
|
||||||
|
"NoticeLink_Thumbnail": "https:\/\/dle.parinaam.in\/Parinaam\/BM_th1.png",
|
||||||
|
"NoticeLink_FullPage": "https:\/\/dle.parinaam.in\/testdb\/share3.html?e=CPD03388&p=58678&en=test%20mer",
|
||||||
|
"FullPageTarget": "html-webview"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"NoticeBoardId": 4,
|
||||||
|
"NoticThumnail_Path": "https:\/\/bigm1.parinaam.in\/notice\/ThumbnailImages\/",
|
||||||
|
"NoticeLink_Thumbnail": "https:\/\/dle.parinaam.in\/app\/Content\/Test\/video.png",
|
||||||
|
"NoticeLink_FullPage": "https:\/\/dle.parinaam.in\/Trainings\/Data_security_video-final_eng.mp4?e=CPD03388&p=58678&en=test%20mer",
|
||||||
|
"FullPageTarget": "video"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"NoticeBoardId": 5,
|
||||||
|
"NoticThumnail_Path": "https:\/\/bigm1.parinaam.in\/notice\/ThumbnailImages\/",
|
||||||
|
"NoticeLink_Thumbnail": "https:\/\/dle.parinaam.in\/app\/Content\/Test\/image.png",
|
||||||
|
"NoticeLink_FullPage": "https:\/\/dle.parinaam.in\/Trainings\/datasec_training_th.png?e=CPD03388&p=58678&en=test%20mer",
|
||||||
|
"FullPageTarget": "image"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"NoticeBoardId": 6,
|
||||||
|
"NoticThumnail_Path": "https:\/\/bigm1.parinaam.in\/notice\/ThumbnailImages\/",
|
||||||
|
"NoticeLink_Thumbnail": "https:\/\/dle.parinaam.in\/app\/Content\/Test\/html-webview.png",
|
||||||
|
"NoticeLink_FullPage": "https:\/\/dle.parinaam.in\/testdb\/image.html?e=CPD03388&p=58678&en=test%20mer",
|
||||||
|
"FullPageTarget": "html-webview"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"NoticeBoardId": 7,
|
||||||
|
"NoticThumnail_Path": "https:\/\/bigm1.parinaam.in\/notice\/ThumbnailImages\/",
|
||||||
|
"NoticeLink_Thumbnail": "https:\/\/dle.parinaam.in\/app\/Content\/Test\/html-browser.png",
|
||||||
|
"NoticeLink_FullPage": "https:\/\/cd.parinaam.in?e=CPD03388&p=58678&en=test%20mer",
|
||||||
|
"FullPageTarget": "html-webbrowser"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"NoticeBoardId": 8,
|
||||||
|
"NoticThumnail_Path": "https:\/\/bigm1.parinaam.in\/notice\/ThumbnailImages\/",
|
||||||
|
"NoticeLink_Thumbnail": "https:\/\/dle.parinaam.in\/app\/Content\/Test\/Frame.png",
|
||||||
|
"NoticeLink_FullPage": "https:\/\/dle.parinaam.in\/testdb\/share1.html?e=CPD03388&p=58678&en=test%20mer",
|
||||||
|
"FullPageTarget": "html-webview"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"NoticeBoardId": 9,
|
||||||
|
"NoticThumnail_Path": "https:\/\/bigm1.parinaam.in\/notice\/ThumbnailImages\/",
|
||||||
|
"NoticeLink_Thumbnail": "https:\/\/dle.parinaam.in\/app\/Content\/Test\/deeplink.png",
|
||||||
|
"NoticeLink_FullPage": "reports?e=CPD03388&p=58678&en=test%20mer",
|
||||||
|
"FullPageTarget": "deeplink"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"NoticeBoardId": 10,
|
||||||
|
"NoticThumnail_Path": "https:\/\/bigm1.parinaam.in\/notice\/ThumbnailImages\/",
|
||||||
|
"NoticeLink_Thumbnail": "https:\/\/dle.parinaam.in\/app\/Content\/Test\/contact.png",
|
||||||
|
"NoticeLink_FullPage": "{\"Name\":\"CPMHelpline\",\"Label\":\"Mobile\",\"Value\":\"9898989898\"}?e=CPD03388&p=58678&en=test%20mer",
|
||||||
|
"FullPageTarget": "contact"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,8 @@ package cpm.com.gskmtorange.GeoTag;
|
|||||||
|
|
||||||
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
||||||
|
|
||||||
|
import static cpm.com.gskmtorange.constant.CommonFunctions.isInternetAvailable;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@@ -92,6 +94,7 @@ import cpm.com.gskmtorange.dailyentry.StoreimageActivity;
|
|||||||
import cpm.com.gskmtorange.dailyentry.VisitTypeStatusActivity;
|
import cpm.com.gskmtorange.dailyentry.VisitTypeStatusActivity;
|
||||||
import cpm.com.gskmtorange.messgae.AlertMessage;
|
import cpm.com.gskmtorange.messgae.AlertMessage;
|
||||||
import cpm.com.gskmtorange.upload.Base64;
|
import cpm.com.gskmtorange.upload.Base64;
|
||||||
|
import cpm.com.gskmtorange.upload.PreviousDataUploadActivity;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
||||||
|
|
||||||
@@ -258,11 +261,16 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
else{
|
else{
|
||||||
db.updateStatus(storeid, status, latitude, longitude, CommonString.KEY_JOURNEY_PLAN);
|
db.updateStatus(storeid, status, latitude, longitude, CommonString.KEY_JOURNEY_PLAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
db.InsertSTOREgeotag(storeid, latitude, longitude, img_str, status);
|
db.InsertSTOREgeotag(storeid, latitude, longitude, img_str, status);
|
||||||
img_str = "";
|
img_str = "";
|
||||||
|
|
||||||
|
if(isInternetAvailable(context)){
|
||||||
new GeoTagUpload(GeoTagActivity.this).execute();
|
new GeoTagUpload(GeoTagActivity.this).execute();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -648,12 +656,6 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ATTENTION: This was auto-generated to implement the App Indexing API.
|
|
||||||
* See https://g.co/AppIndexing/AndroidStudio for more information.
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
public class GeoTagUpload extends AsyncTask<Void, Void, String> {
|
public class GeoTagUpload extends AsyncTask<Void, Void, String> {
|
||||||
|
|
||||||
|
|||||||
+26
-1
@@ -3,7 +3,32 @@ package cpm.com.gskmtorange.GetterSetter;
|
|||||||
public class AdditionalDialogGetterSetter {
|
public class AdditionalDialogGetterSetter {
|
||||||
public String Display_id,display,brand_id,brand, trg_quantity, image1, image2, category_id,
|
public String Display_id,display,brand_id,brand, trg_quantity, image1, image2, category_id,
|
||||||
image3, BEFORE_QTY, camera1, camera2, camera3, AFTER_QTY, store_id, stock_count, question_id, question, answer, type,
|
image3, BEFORE_QTY, camera1, camera2, camera3, AFTER_QTY, store_id, stock_count, question_id, question, answer, type,
|
||||||
KEY_ID, unique_id,image_url, sku_id,quantity, process_id, sku_name, stock_flag;
|
KEY_ID, unique_id,image_url, sku_id,quantity, process_id, sku_name, stock_flag,subcatid,subcat,subcatEng;
|
||||||
|
|
||||||
|
|
||||||
|
public String getSubcatid() {
|
||||||
|
return subcatid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubcatid(String subcatid) {
|
||||||
|
this.subcatid = subcatid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubcat() {
|
||||||
|
return subcat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubcat(String subcat) {
|
||||||
|
this.subcat = subcat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubcatEng() {
|
||||||
|
return subcatEng;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubcatEng(String subcatEng) {
|
||||||
|
this.subcatEng = subcatEng;
|
||||||
|
}
|
||||||
|
|
||||||
public String getCOMMON_ID() {
|
public String getCOMMON_ID() {
|
||||||
return COMMON_ID;
|
return COMMON_ID;
|
||||||
|
|||||||
+27
@@ -59,6 +59,33 @@ public class AddittionalGetterSetter {
|
|||||||
|
|
||||||
String Brand,Brand_id,Sku,Sku_id,Store_id,Image="";
|
String Brand,Brand_id,Sku,Sku_id,Store_id,Image="";
|
||||||
|
|
||||||
|
String SubCatId,SubCat="";
|
||||||
|
|
||||||
|
public String getSubCatId() {
|
||||||
|
return SubCatId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubCatId(String subCatId) {
|
||||||
|
SubCatId = subCatId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubCat() {
|
||||||
|
return SubCat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubCat(String subCat) {
|
||||||
|
SubCat = subCat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubCatEng() {
|
||||||
|
return SubCatEng;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubCatEng(String subCatEng) {
|
||||||
|
SubCatEng = subCatEng;
|
||||||
|
}
|
||||||
|
|
||||||
|
String SubCatEng="";
|
||||||
|
|
||||||
String Image2="";
|
String Image2="";
|
||||||
|
|
||||||
|
|||||||
+12
@@ -90,6 +90,18 @@ public class CategoryPictureGetterSetter {
|
|||||||
|
|
||||||
String SubCategoryCamera1;
|
String SubCategoryCamera1;
|
||||||
|
|
||||||
|
String Toggle_value="1";
|
||||||
|
|
||||||
|
public String getToggle_value() {
|
||||||
|
return Toggle_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToggle_value(String toggle_value) {
|
||||||
|
Toggle_value = toggle_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String SUB_CATEGORY_ID;
|
String SUB_CATEGORY_ID;
|
||||||
|
|
||||||
public String getSUB_CATEGORY() {
|
public String getSUB_CATEGORY() {
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class NoticeboardItem implements Serializable {
|
||||||
|
String NoticeBoardId;
|
||||||
|
String NoticThumnail_Path;
|
||||||
|
String NoticeLink_Thumbnail;
|
||||||
|
String NoticeLink_FullPage;
|
||||||
|
String FullPageTarget;
|
||||||
|
|
||||||
|
public String getNoticeBoardId() {
|
||||||
|
return NoticeBoardId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoticeBoardId(String noticeBoardId) {
|
||||||
|
this.NoticeBoardId = noticeBoardId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNoticThumnail_Path() {
|
||||||
|
return NoticThumnail_Path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoticThumnail_Path(String noticThumnail_Path) {
|
||||||
|
this.NoticThumnail_Path = noticThumnail_Path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNoticeLink_Thumbnail() {
|
||||||
|
return NoticeLink_Thumbnail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoticeLink_Thumbnail(String noticeLink_Thumbnail) {
|
||||||
|
this.NoticeLink_Thumbnail = noticeLink_Thumbnail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNoticeLink_FullPage() {
|
||||||
|
return NoticeLink_FullPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoticeLink_FullPage(String noticeLink_FullPage) {
|
||||||
|
this.NoticeLink_FullPage = noticeLink_FullPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFullPageTarget() {
|
||||||
|
return FullPageTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFullPageTarget(String fullPageTarget) {
|
||||||
|
this.FullPageTarget = fullPageTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class PD_CONFIGURATION {
|
||||||
|
ArrayList<String> PROJECT_ID = new ArrayList<>();
|
||||||
|
ArrayList<String> USER_ID = new ArrayList<>();
|
||||||
|
public ArrayList<String> getUSER_ID() {
|
||||||
|
return USER_ID;
|
||||||
|
}
|
||||||
|
public void setUSER_ID(String USER_ID) {
|
||||||
|
this.USER_ID.add(USER_ID);
|
||||||
|
}
|
||||||
|
public ArrayList<String> getPROJECT_ID() {
|
||||||
|
return PROJECT_ID;
|
||||||
|
}
|
||||||
|
public void setPROJECT_ID(String PROJECT_ID) {
|
||||||
|
this.PROJECT_ID.add(PROJECT_ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,7 +7,6 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public class StoreBean implements Serializable{
|
public class StoreBean implements Serializable{
|
||||||
|
|
||||||
String STORE_ID;
|
String STORE_ID;
|
||||||
String EMP_ID;
|
String EMP_ID;
|
||||||
String KEYACCOUNT;
|
String KEYACCOUNT;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import android.animation.AnimatorListenerAdapter;
|
|||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
|
import android.app.Dialog;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
@@ -13,6 +14,7 @@ import android.content.Intent;
|
|||||||
import android.content.IntentSender;
|
import android.content.IntentSender;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
import android.location.LocationManager;
|
import android.location.LocationManager;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
@@ -25,12 +27,15 @@ import android.util.Log;
|
|||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
|
import android.view.Window;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.AutoCompleteTextView;
|
import android.widget.AutoCompleteTextView;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.cardview.widget.CardView;
|
import androidx.cardview.widget.CardView;
|
||||||
@@ -59,6 +64,7 @@ import com.google.firebase.analytics.FirebaseAnalytics;
|
|||||||
|
|
||||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.GsonBuilder;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
@@ -70,9 +76,11 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||||||
import org.xmlpull.v1.XmlPullParserFactory;
|
import org.xmlpull.v1.XmlPullParserFactory;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.InterruptedIOException;
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.SocketTimeoutException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
@@ -80,18 +88,22 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.PD_CONFIGURATION;
|
||||||
import cpm.com.gskmtorange.autoupdate.AutoUpdateActivity;
|
import cpm.com.gskmtorange.autoupdate.AutoUpdateActivity;
|
||||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.password.MPinActivity;
|
import cpm.com.gskmtorange.password.MPinActivity;
|
||||||
|
import cpm.com.gskmtorange.utils.OkHttpTransportSE;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.NoticeItem;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.NoticeboardGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
||||||
//import io.fabric.sdk.android.Fabric;
|
//import io.fabric.sdk.android.Fabric;
|
||||||
|
|
||||||
import static android.Manifest.permission.READ_CONTACTS;
|
|
||||||
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
||||||
|
import static cpm.com.gskmtorange.constant.CommonFunctions.isInternetAvailable;
|
||||||
|
|
||||||
public class LoginActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks,
|
public class LoginActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks,
|
||||||
GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
||||||
@@ -99,6 +111,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
private static final int MY_PERMISSIONS_REQUEST_LOCATION = 11;
|
private static final int MY_PERMISSIONS_REQUEST_LOCATION = 11;
|
||||||
private static final int MY_PERMISSIONS_REQUEST_STORAGE_READ = 12;
|
private static final int MY_PERMISSIONS_REQUEST_STORAGE_READ = 12;
|
||||||
private static final int MY_PERMISSIONS_REQUEST_STORAGE_WRITE = 14;
|
private static final int MY_PERMISSIONS_REQUEST_STORAGE_WRITE = 14;
|
||||||
|
int eventType;
|
||||||
private FirebaseAnalytics mFirebaseAnalytics;
|
private FirebaseAnalytics mFirebaseAnalytics;
|
||||||
|
|
||||||
private static final int PERMISSION_ALL = 99;
|
private static final int PERMISSION_ALL = 99;
|
||||||
@@ -130,7 +143,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
private View mLoginFormView;
|
private View mLoginFormView;
|
||||||
private String userid, password;
|
private String userid, password;
|
||||||
private int versionCode;
|
private int versionCode;
|
||||||
int eventType;
|
|
||||||
CardView museridSignInButton;
|
CardView museridSignInButton;
|
||||||
|
|
||||||
GoogleApiClient mGoogleApiClient;
|
GoogleApiClient mGoogleApiClient;
|
||||||
@@ -142,12 +154,22 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
private Location mLastLocation;
|
private Location mLastLocation;
|
||||||
private LocationRequest mLocationRequest;
|
private LocationRequest mLocationRequest;
|
||||||
private Context context;
|
private Context context;
|
||||||
|
GSKOrangeDB db;
|
||||||
|
private Dialog dialog;
|
||||||
|
boolean ResultFlag = true;
|
||||||
|
NoticeboardGetterSetter noticeboardGetterSetter;
|
||||||
|
String str;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_login);
|
setContentView(R.layout.activity_login);
|
||||||
context = this;
|
context = this;
|
||||||
|
db = new GSKOrangeDB(this);
|
||||||
|
db.open();
|
||||||
|
|
||||||
|
|
||||||
TextView tv_version = (TextView) findViewById(R.id.tv_version_code);
|
TextView tv_version = (TextView) findViewById(R.id.tv_version_code);
|
||||||
try {
|
try {
|
||||||
@@ -158,7 +180,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
tv_version.setText("Version/Versiyon - " + app_ver);
|
tv_version.setText("Version/Versiyon - " + app_ver + "-T3");
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
editor = preferences.edit();
|
editor = preferences.edit();
|
||||||
// Set up the login form.
|
// Set up the login form.
|
||||||
@@ -448,40 +470,35 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
} else if (!isPasswordValid(password)) {
|
} else if (!isPasswordValid(password)) {
|
||||||
Snackbar.make(museridView, getString(R.string.error_incorrect_password), Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(museridView, getString(R.string.error_incorrect_password), Snackbar.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
|
if(isInternetAvailable(context)){
|
||||||
new AuthenticateTask().execute();
|
new AuthenticateTask().execute();
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isuseridValid(String userid) {
|
private boolean isuseridValid(String userid) {
|
||||||
//TODO: Replace this with your own logic
|
|
||||||
|
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
|
|
||||||
String u_id = preferences.getString(CommonString.KEY_USERNAME, "");
|
String u_id = preferences.getString(CommonString.KEY_USERNAME, "");
|
||||||
|
|
||||||
if (!u_id.equals("") && !userid.equalsIgnoreCase(u_id)) {
|
if (!u_id.equals("") && !userid.equalsIgnoreCase(u_id)) {
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isPasswordValid(String password) {
|
private boolean isPasswordValid(String password) {
|
||||||
//TODO: Replace this with your own logic
|
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
|
|
||||||
String pw = preferences.getString(CommonString.KEY_PASSWORD, "");
|
String pw = preferences.getString(CommonString.KEY_PASSWORD, "");
|
||||||
|
|
||||||
if (!pw.equals("") && !password.equals(pw)) {
|
if (!pw.equals("") && !password.equals(pw)) {
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Shows the progress UI and hides the login form.
|
|
||||||
*/
|
|
||||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
|
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
|
||||||
private void showProgress(final boolean show) {
|
private void showProgress(final boolean show) {
|
||||||
// On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow
|
// On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow
|
||||||
@@ -515,39 +532,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* @Override
|
|
||||||
public Loader<Cursor> onCreateLoader(int i, Bundle bundle) {
|
|
||||||
return new CursorLoader(this,
|
|
||||||
// Retrieve data rows for the device user's 'profile' contact.
|
|
||||||
Uri.withAppendedPath(ContactsContract.Profile.CONTENT_URI,
|
|
||||||
ContactsContract.Contacts.Data.CONTENT_DIRECTORY), ProfileQuery.PROJECTION,
|
|
||||||
|
|
||||||
// Select only userid addresses.
|
|
||||||
ContactsContract.Contacts.Data.MIMETYPE +
|
|
||||||
" = ?", new String[]{ContactsContract.CommonDataKinds.userid
|
|
||||||
.CONTENT_ITEM_TYPE},
|
|
||||||
|
|
||||||
// Show primary userid addresses first. Note that there won't be
|
|
||||||
// a primary userid address if the user hasn't specified one.
|
|
||||||
ContactsContract.Contacts.Data.IS_PRIMARY + " DESC");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) {
|
|
||||||
List<String> userids = new ArrayList<>();
|
|
||||||
cursor.moveToFirst();
|
|
||||||
while (!cursor.isAfterLast()) {
|
|
||||||
userids.add(cursor.getString(ProfileQuery.ADDRESS));
|
|
||||||
cursor.moveToNext();
|
|
||||||
}
|
|
||||||
|
|
||||||
adduseridsToAutoComplete(userids);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoaderReset(Loader<Cursor> cursorLoader) {
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
private void adduseridsToAutoComplete(List<String> useridAddressCollection) {
|
private void adduseridsToAutoComplete(List<String> useridAddressCollection) {
|
||||||
//Create adapter to tell the AutoCompleteTextView what to show in its dropdown list.
|
//Create adapter to tell the AutoCompleteTextView what to show in its dropdown list.
|
||||||
@@ -559,21 +543,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* private interface ProfileQuery {
|
|
||||||
String[] PROJECTION = {
|
|
||||||
ContactsContract.CommonDataKinds.userid.ADDRESS,
|
|
||||||
ContactsContract.CommonDataKinds.userid.IS_PRIMARY,
|
|
||||||
};
|
|
||||||
|
|
||||||
int ADDRESS = 0;
|
|
||||||
int IS_PRIMARY = 1;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents an asynchronous login/registration task used to authenticate
|
|
||||||
* the user.
|
|
||||||
*/
|
|
||||||
|
|
||||||
private class AuthenticateTask extends AsyncTask<Void, Void, String> {
|
private class AuthenticateTask extends AsyncTask<Void, Void, String> {
|
||||||
private ProgressDialog dialog = null;
|
private ProgressDialog dialog = null;
|
||||||
|
|
||||||
@@ -597,7 +566,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
+ "[/PASSWORD]" + "[IN_TIME]" + CommonFunctions.getCurrentTimeWithLanguage(context)
|
+ "[/PASSWORD]" + "[IN_TIME]" + CommonFunctions.getCurrentTimeWithLanguage(context)
|
||||||
+ "[/IN_TIME]" + "[LATITUDE]" + lat
|
+ "[/IN_TIME]" + "[LATITUDE]" + lat
|
||||||
+ "[/LATITUDE]" + "[LONGITUDE]" + lon
|
+ "[/LATITUDE]" + "[LONGITUDE]" + lon
|
||||||
+ "[/LONGITUDE]" + "[APP_VERSION]" + app_ver
|
+ "[/LONGITUDE]" + "[APP_VERSION]" + app_ver + "-T3"
|
||||||
+ "[/APP_VERSION]" + "[ATT_MODE]OnLine[/ATT_MODE]"
|
+ "[/APP_VERSION]" + "[ATT_MODE]OnLine[/ATT_MODE]"
|
||||||
+ "[NETWORK_STATUS]" + "LoginStatus"
|
+ "[NETWORK_STATUS]" + "LoginStatus"
|
||||||
+ "[/NETWORK_STATUS]" + "[/USER_DATA][/DATA]";
|
+ "[/NETWORK_STATUS]" + "[/USER_DATA][/DATA]";
|
||||||
@@ -607,8 +576,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
request.addProperty("onXML", userauth_xml);
|
request.addProperty("onXML", userauth_xml);
|
||||||
Log.d("loginrequest", String.valueOf(request));
|
Log.d("loginrequest", String.valueOf(request));
|
||||||
|
|
||||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
|
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
SoapEnvelope.VER11);
|
|
||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
try {
|
try {
|
||||||
@@ -619,43 +587,17 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("httpexception", e.getMessage());
|
Log.e("httpexception", e.getMessage());
|
||||||
}
|
}
|
||||||
/*HttpTransportSE androidHttpTransport = new HttpTransportSE(
|
|
||||||
CommonString.URL);
|
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_LOGIN,
|
|
||||||
envelope);*/
|
|
||||||
|
|
||||||
Object result = (Object) envelope.getResponse();
|
Object result = (Object) envelope.getResponse();
|
||||||
|
if (result.toString().equalsIgnoreCase(CommonString.KEY_FAILURE)) {
|
||||||
if (result.toString()
|
runOnUiThread(() -> showAlert(CommonString.MESSAGE_FAILURE));
|
||||||
.equalsIgnoreCase(CommonString.KEY_FAILURE)) {
|
|
||||||
|
|
||||||
runOnUiThread(new Runnable() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
|
|
||||||
showAlert(CommonString.MESSAGE_FAILURE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
} else if (result.toString().equalsIgnoreCase(
|
} else if (result.toString().equalsIgnoreCase(
|
||||||
CommonString.KEY_FALSE)) {
|
CommonString.KEY_FALSE)) {
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(() -> showAlert(CommonString.MESSAGE_FALSE));
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
showAlert(CommonString.MESSAGE_FALSE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
} else if (result.toString().equalsIgnoreCase(
|
} else if (result.toString().equalsIgnoreCase(
|
||||||
CommonString.KEY_CHANGED)) {
|
CommonString.KEY_CHANGED)) {
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(() -> showAlert(CommonString.MESSAGE_CHANGED));
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
showAlert(CommonString.MESSAGE_CHANGED);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
XmlPullParserFactory factory = XmlPullParserFactory
|
XmlPullParserFactory factory = XmlPullParserFactory
|
||||||
@@ -671,47 +613,109 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
|
|
||||||
if (failureGetterSetter.getStatus().equalsIgnoreCase(
|
if (failureGetterSetter.getStatus().equalsIgnoreCase(
|
||||||
CommonString.KEY_FAILURE)) {
|
CommonString.KEY_FAILURE)) {
|
||||||
/* final AlertMessage message = new AlertMessage(
|
runOnUiThread(() -> {
|
||||||
LoginActivity.this, CommonString.METHOD_LOGIN
|
|
||||||
+ failureGetterSetter.getErrorMsg(),
|
|
||||||
"login", null);*/
|
|
||||||
runOnUiThread(new Runnable() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
showAlert(CommonString.METHOD_LOGIN
|
showAlert(CommonString.METHOD_LOGIN
|
||||||
+ failureGetterSetter.getErrorMsg());
|
+ failureGetterSetter.getErrorMsg());
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
try {
|
|
||||||
// For String source
|
// For String source
|
||||||
|
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
xpp.next();
|
xpp.next();
|
||||||
eventType = xpp.getEventType();
|
eventType = xpp.getEventType();
|
||||||
lgs = XMLHandlers.loginXMLHandler(xpp, eventType);
|
lgs = XMLHandlers.loginXMLHandler(xpp, eventType);
|
||||||
|
|
||||||
} catch (XmlPullParserException e) {
|
//PD_CONFIGURATION
|
||||||
e.printStackTrace();
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
} catch (IOException e) {
|
request.addProperty("UserName", userid);
|
||||||
e.printStackTrace();
|
request.addProperty("Type", "PD_CONFIGURATION");
|
||||||
}
|
request.addProperty("cultureid", "1");
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
result = envelope.getResponse();
|
||||||
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
|
xpp.next();
|
||||||
|
eventType = xpp.getEventType();
|
||||||
|
PD_CONFIGURATION pdConfiguration = XMLHandlers.PDConfigXMLHandler(xpp);
|
||||||
|
Log.e("PD_CONFIGURATION_RESULT", result.toString());
|
||||||
// PUT IN PREFERENCES
|
// PUT IN PREFERENCES
|
||||||
|
if (pdConfiguration.getPROJECT_ID() != null && !pdConfiguration.getPROJECT_ID().isEmpty()) {
|
||||||
|
editor.putString(CommonString.KEY_PD_PROJECT_Id, pdConfiguration.getPROJECT_ID().get(0));
|
||||||
|
editor.putString(CommonString.KEY_PD_USER_Id, pdConfiguration.getUSER_ID().get(0));
|
||||||
|
} else {
|
||||||
|
return CommonString.KEY_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Mer_NoticeBoard
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
|
request.addProperty("UserName", userid);
|
||||||
|
request.addProperty("Type", "Mer_NoticeBoard");
|
||||||
|
request.addProperty("cultureid", "1");
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
result = envelope.getResponse();
|
||||||
|
|
||||||
|
factory = XmlPullParserFactory.newInstance();
|
||||||
|
factory.setNamespaceAware(false);
|
||||||
|
|
||||||
|
Log.e("Noticeboard_Result", result.toString());
|
||||||
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
|
xpp.next();
|
||||||
|
eventType = xpp.getEventType();
|
||||||
|
NoticeboardGetterSetter noticeboardGetterSetter1 = XMLHandlers.Noticeboard_XMLHandler(xpp,eventType);
|
||||||
|
Log.e("noticeboardGetterSetter1", noticeboardGetterSetter1.toString());
|
||||||
|
// PUT IN PREFERENCES
|
||||||
|
if (noticeboardGetterSetter1.getNoticeBoardId() != null && !noticeboardGetterSetter1.getNoticeBoardId().isEmpty()) {
|
||||||
|
List<NoticeItem> list = new ArrayList<>();
|
||||||
|
|
||||||
|
for (int i = 0; i < noticeboardGetterSetter1.getNoticeBoardId().size(); i++) {
|
||||||
|
|
||||||
|
NoticeItem item = new NoticeItem(
|
||||||
|
safe(noticeboardGetterSetter1.getNoticeBoardId(), i),
|
||||||
|
safe(noticeboardGetterSetter1.getNoticThumnail_Path(), i),
|
||||||
|
safe(noticeboardGetterSetter1.getNoticeLink_Thumbnail(), i),
|
||||||
|
safe(noticeboardGetterSetter1.getNoticeLink_FullPage(), i),
|
||||||
|
safe(noticeboardGetterSetter1.getFullPageTarget(), i)
|
||||||
|
);
|
||||||
|
|
||||||
|
list.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
NoticeResponse response = new NoticeResponse(list);
|
||||||
|
|
||||||
|
Gson gson = new GsonBuilder()
|
||||||
|
.disableHtmlEscaping()
|
||||||
|
.setPrettyPrinting()
|
||||||
|
.create();
|
||||||
|
|
||||||
|
String noticeJson = gson.toJson(response);
|
||||||
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
SharedPreferences.Editor editor = prefs.edit();
|
||||||
|
editor.putString("NOTICEBOARD_DATA", noticeJson);
|
||||||
|
editor.apply();
|
||||||
|
|
||||||
|
} /*else {
|
||||||
|
return CommonString.KEY_FAILURE;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
editor.putString(CommonString.KEY_USERNAME, userid);
|
editor.putString(CommonString.KEY_USERNAME, userid);
|
||||||
editor.putString(CommonString.KEY_PASSWORD, password);
|
editor.putString(CommonString.KEY_PASSWORD, password);
|
||||||
editor.putString(CommonString.KEY_VERSION, lgs.getAPP_VERSION());
|
editor.putString(CommonString.KEY_VERSION, lgs.getAPP_VERSION());
|
||||||
editor.putString(CommonString.KEY_PATH, lgs.getAPP_PATH());
|
editor.putString(CommonString.KEY_PATH, lgs.getAPP_PATH());
|
||||||
//editor.putString(CommonString.KEY_DATE, "12/05/2022");
|
|
||||||
editor.putString(CommonString.KEY_DATE, lgs.getCURRENTDATE());
|
editor.putString(CommonString.KEY_DATE, lgs.getCURRENTDATE());
|
||||||
//editor.putString(CommonString.KEY_DATE, "01/25/2019");
|
|
||||||
editor.putString(CommonString.KEY_COUNTRY_ID, lgs.getCOUNTRY_ID());
|
editor.putString(CommonString.KEY_COUNTRY_ID, lgs.getCOUNTRY_ID());
|
||||||
Log.e("countryid", lgs.getCOUNTRY_ID());
|
Log.e("countryid", lgs.getCOUNTRY_ID());
|
||||||
editor.commit();
|
editor.commit();
|
||||||
setDataFromSharedPreferences(lgs);
|
setDataFromSharedPreferences(lgs);
|
||||||
|
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, userid);
|
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, userid);
|
||||||
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, CommonString.KEY_LOGIN_DATA);
|
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, CommonString.KEY_LOGIN_DATA);
|
||||||
@@ -722,9 +726,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
return CommonString.KEY_SUCCESS;
|
return CommonString.KEY_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
FirebaseCrashlytics.getInstance().recordException(e);
|
FirebaseCrashlytics.getInstance().recordException(e);
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
@@ -738,38 +740,24 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
FirebaseCrashlytics.getInstance().recordException(e);
|
FirebaseCrashlytics.getInstance().recordException(e);
|
||||||
/* final AlertMessage message = new AlertMessage(
|
|
||||||
LoginActivity.this,
|
|
||||||
AlertMessage.MESSAGE_SOCKETEXCEPTION, "socket_login", e);*/
|
|
||||||
|
|
||||||
counter++;
|
counter++;
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(() -> {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
if (counter < 3) {
|
if (counter < 3) {
|
||||||
|
if(isInternetAvailable(context)){
|
||||||
new AuthenticateTask().execute();
|
new AuthenticateTask().execute();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
showAlert(getString(R.string.nonetwork));
|
showAlert(getString(R.string.nonetwork));
|
||||||
counter = 1;
|
counter = 1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
FirebaseCrashlytics.getInstance().recordException(e);
|
FirebaseCrashlytics.getInstance().recordException(e);
|
||||||
/* final AlertMessage message = new AlertMessage(
|
runOnUiThread(() -> showAlert(CommonString.MESSAGE_EXCEPTION));
|
||||||
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() {
|
|
||||||
showAlert(CommonString.MESSAGE_EXCEPTION);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -777,16 +765,15 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(String result) {
|
protected void onPostExecute(String result) {
|
||||||
super.onPostExecute(result);
|
super.onPostExecute(result);
|
||||||
//Stop performance trace
|
if (result.equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
/// myTrace.stop();
|
|
||||||
|
|
||||||
if (result.equals(CommonString.KEY_SUCCESS)) {
|
|
||||||
// manually set true for South Africa
|
// manually set true for South Africa
|
||||||
|
|
||||||
|
// new UploadTask(LoginActivity.this).execute();
|
||||||
boolean forSA = false;
|
boolean forSA = false;
|
||||||
// database.open();
|
|
||||||
if (forSA) {
|
if (forSA) {
|
||||||
//For SA Only
|
//For SA Only
|
||||||
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equals("")) {
|
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equals("")) {
|
||||||
|
// new NoticeboardTask().execute();
|
||||||
Intent intent = new Intent(getBaseContext(), SelectLanguageActivity.class);
|
Intent intent = new Intent(getBaseContext(), SelectLanguageActivity.class);
|
||||||
intent.putExtra(CommonString.KEY_LOGIN_DATA, lgs);
|
intent.putExtra(CommonString.KEY_LOGIN_DATA, lgs);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
@@ -827,6 +814,12 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private String safe(ArrayList<String> list, int index) {
|
||||||
|
if (list == null || list.size() <= index || list.get(index) == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return list.get(index).trim();
|
||||||
|
}
|
||||||
|
|
||||||
public void showAlert(String str) {
|
public void showAlert(String str) {
|
||||||
|
|
||||||
@@ -836,62 +829,12 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
/* Intent i = new Intent(activity, StorelistActivity.class);
|
|
||||||
activity.startActivity(i);
|
|
||||||
activity.finish();*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
AlertDialog alert = builder.create();
|
AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static String arabicToenglish(String number) {
|
|
||||||
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';
|
|
||||||
chars[i] = ch;
|
|
||||||
}
|
|
||||||
return new String(chars);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCurrentTimeNotUsed() {
|
|
||||||
Calendar m_cal = Calendar.getInstance();
|
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
|
|
||||||
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);
|
|
||||||
}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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
|
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
String jsonCurProduct = gson.toJson(lgs);
|
String jsonCurProduct = gson.toJson(lgs);
|
||||||
@@ -902,7 +845,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
|
|
||||||
void checkAppPermission(String permission, int requestCode) {
|
void checkAppPermission(String permission, int requestCode) {
|
||||||
|
|
||||||
boolean permission_flag = false;
|
|
||||||
// Here, thisActivity is the current activity
|
// Here, thisActivity is the current activity
|
||||||
if (ContextCompat.checkSelfPermission(LoginActivity.this,
|
if (ContextCompat.checkSelfPermission(LoginActivity.this,
|
||||||
permission)
|
permission)
|
||||||
@@ -912,19 +854,12 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
// Should we show an explanation?
|
// Should we show an explanation?
|
||||||
if (ActivityCompat.shouldShowRequestPermissionRationale(LoginActivity.this,
|
if (ActivityCompat.shouldShowRequestPermissionRationale(LoginActivity.this,
|
||||||
permission)) {
|
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);
|
showOnPermissiondenied(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA, 1);
|
||||||
} else {
|
} else {
|
||||||
// No explanation needed; request the permission
|
// No explanation needed; request the permission
|
||||||
ActivityCompat.requestPermissions(LoginActivity.this,
|
ActivityCompat.requestPermissions(LoginActivity.this,
|
||||||
new String[]{permission},
|
new String[]{permission},
|
||||||
requestCode);
|
requestCode);
|
||||||
|
|
||||||
// MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
|
|
||||||
// app-defined int constant. The callback method gets the
|
|
||||||
// result of the request.
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Permission has already been granted
|
// Permission has already been granted
|
||||||
@@ -935,18 +870,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
} else if (requestCode == MY_PERMISSIONS_REQUEST_STORAGE_READ) {
|
} else if (requestCode == MY_PERMISSIONS_REQUEST_STORAGE_READ) {
|
||||||
checkAppPermission(Manifest.permission.ACCESS_FINE_LOCATION, MY_PERMISSIONS_REQUEST_LOCATION);
|
checkAppPermission(Manifest.permission.ACCESS_FINE_LOCATION, MY_PERMISSIONS_REQUEST_LOCATION);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Create a Folder for 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()) {
|
if (checkPlayServices()) {
|
||||||
// Building the GoogleApi client
|
// Building the GoogleApi client
|
||||||
buildGoogleApiClient();
|
buildGoogleApiClient();
|
||||||
@@ -986,13 +909,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
/* builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
|
||||||
dialog.cancel();
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
});*/
|
|
||||||
builder.show();
|
builder.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1002,7 +918,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
|
|
||||||
if (mGoogleApiClient != null) {
|
if (mGoogleApiClient != null) {
|
||||||
mGoogleApiClient.connect();
|
mGoogleApiClient.connect();
|
||||||
|
|
||||||
}
|
}
|
||||||
checkgpsEnableDevice();
|
checkgpsEnableDevice();
|
||||||
locationRequest = new LocationRequest.Builder(Priority.PRIORITY_HIGH_ACCURACY, 100000)
|
locationRequest = new LocationRequest.Builder(Priority.PRIORITY_HIGH_ACCURACY, 100000)
|
||||||
@@ -1026,37 +941,14 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
|
if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
|
||||||
&& ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
&& ContextCompat.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_FINE_LOCATION}, 1);
|
||||||
ActivityCompat.requestPermissions(LoginActivity.this, new String[]{android.Manifest.permission.ACCESS_COARSE_LOCATION}, 2);
|
ActivityCompat.requestPermissions(LoginActivity.this, new String[]{android.Manifest.permission.ACCESS_COARSE_LOCATION}, 2);
|
||||||
}
|
}
|
||||||
fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, Looper.getMainLooper());
|
fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, Looper.getMainLooper());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@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 (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();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
private boolean checkPlayServices() {
|
private boolean checkPlayServices() {
|
||||||
int resultCode = GooglePlayServicesUtil
|
int resultCode = GooglePlayServicesUtil
|
||||||
.isGooglePlayServicesAvailable(this);
|
.isGooglePlayServicesAvailable(this);
|
||||||
@@ -1065,8 +957,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
GooglePlayServicesUtil.getErrorDialog(resultCode, this,
|
GooglePlayServicesUtil.getErrorDialog(resultCode, this,
|
||||||
PLAY_SERVICES_RESOLUTION_REQUEST).show();
|
PLAY_SERVICES_RESOLUTION_REQUEST).show();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(context, getResources().getString(R.string.notsuppoted), Toast.LENGTH_LONG)
|
Toast.makeText(context, getResources().getString(R.string.notsuppoted), Toast.LENGTH_LONG).show();
|
||||||
.show();
|
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -1106,11 +997,9 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
if (mGoogleApiClient != null) {
|
if (mGoogleApiClient != null) {
|
||||||
LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, this);
|
LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void startLocationUpdates() {
|
protected void startLocationUpdates() {
|
||||||
|
|
||||||
if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
||||||
|| ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
|| ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
||||||
if (mGoogleApiClient != null) {
|
if (mGoogleApiClient != null) {
|
||||||
@@ -1118,7 +1007,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
// Toast.makeText(getApplicationContext(), "startLocation - Lat" + lat + "Long" + lon, Toast.LENGTH_LONG).show();
|
// Toast.makeText(getApplicationContext(), "startLocation - Lat" + lat + "Long" + lon, Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int distFrom(double lat1, double lng1, double lat2, double lng2) {
|
public static int distFrom(double lat1, double lng1, double lat2, double lng2) {
|
||||||
@@ -1137,26 +1025,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
@Override
|
@Override
|
||||||
public void onConnected(Bundle bundle) {
|
public void onConnected(Bundle bundle) {
|
||||||
Log.e("onConnectdata", "true" + "," + mGoogleApiClient);
|
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
|
|
||||||
// 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(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
|
||||||
|| ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
if (mLastLocation != null) {
|
|
||||||
lat = mLastLocation.getLatitude();
|
|
||||||
lon = mLastLocation.getLongitude();
|
|
||||||
// Toast.makeText(getApplicationContext(), "onconnected lat-" + lat + " Long-" + lon, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
startLocationUpdates();
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1258,8 +1127,8 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//return ;
|
//return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,43 +1,50 @@
|
|||||||
package cpm.com.gskmtorange;
|
package cpm.com.gskmtorange;
|
||||||
|
|
||||||
import android.Manifest;
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Environment;
|
import android.os.Handler;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.webkit.WebViewClient;
|
import android.webkit.WebViewClient;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
//import com.crashlytics.android.Crashlytics;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.ActionBarDrawerToggle;
|
import androidx.appcompat.app.ActionBarDrawerToggle;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import androidx.core.app.ActivityCompat;
|
import androidx.core.app.ActivityCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.core.view.GravityCompat;
|
import androidx.core.view.GravityCompat;
|
||||||
import androidx.drawerlayout.widget.DrawerLayout;
|
import androidx.drawerlayout.widget.DrawerLayout;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import androidx.viewpager2.widget.ViewPager2;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||||
import com.google.android.material.navigation.NavigationView;
|
import com.google.android.material.navigation.NavigationView;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
import java.io.File;
|
import org.json.JSONObject;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.GeoTag.GeoTagStoreList;
|
import cpm.com.gskmtorange.GeoTag.GeoTagStoreList;
|
||||||
@@ -52,20 +59,26 @@ import cpm.com.gskmtorange.dailyentry.PlanogramPDFActivity;
|
|||||||
import cpm.com.gskmtorange.dailyentry.ServiceActivity;
|
import cpm.com.gskmtorange.dailyentry.ServiceActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.SettingsActivity;
|
import cpm.com.gskmtorange.dailyentry.SettingsActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.StoreListActivity;
|
import cpm.com.gskmtorange.dailyentry.StoreListActivity;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.WebViewActivity;
|
||||||
import cpm.com.gskmtorange.download.DownloadActivity;
|
import cpm.com.gskmtorange.download.DownloadActivity;
|
||||||
import cpm.com.gskmtorange.password.ChangePasswordActivity;
|
import cpm.com.gskmtorange.password.ChangePasswordActivity;
|
||||||
import cpm.com.gskmtorange.pharma_stores.PharmaActivity;
|
|
||||||
import cpm.com.gskmtorange.pharma_stores.PharmaActivityFragment;
|
|
||||||
import cpm.com.gskmtorange.upload.PreviousDataUploadActivity;
|
import cpm.com.gskmtorange.upload.PreviousDataUploadActivity;
|
||||||
import cpm.com.gskmtorange.upload.UploadActivity;
|
import cpm.com.gskmtorange.upload.UploadActivity;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.NoticeItem;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity
|
public class MainActivity extends AppCompatActivity
|
||||||
implements NavigationView.OnNavigationItemSelectedListener {
|
implements NavigationView.OnNavigationItemSelectedListener {
|
||||||
private Context context;
|
private Context context;
|
||||||
WebView webView;
|
WebView webView;
|
||||||
ImageView imageView;
|
ImageView imageView;
|
||||||
|
ViewPager2 viewPager;
|
||||||
|
private Handler sliderHandler = new Handler();
|
||||||
|
private Runnable sliderRunnable;
|
||||||
|
private List<ImageView> dots = new ArrayList<>();
|
||||||
|
List<NoticeItem>bannerlist = null;
|
||||||
String date;
|
String date;
|
||||||
|
String app_ver;
|
||||||
private SharedPreferences preferences = null;
|
private SharedPreferences preferences = null;
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
String user_name, country_id;
|
String user_name, country_id;
|
||||||
@@ -74,6 +87,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
ArrayList<CoverageBean> coverageList;
|
ArrayList<CoverageBean> coverageList;
|
||||||
String error_msg;
|
String error_msg;
|
||||||
Toolbar toolbar;
|
Toolbar toolbar;
|
||||||
|
LinearLayout dotsLayout;
|
||||||
NavigationView navigationView;
|
NavigationView navigationView;
|
||||||
|
|
||||||
@SuppressLint("SetJavaScriptEnabled")
|
@SuppressLint("SetJavaScriptEnabled")
|
||||||
@@ -82,19 +96,64 @@ public class MainActivity extends AppCompatActivity
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
viewPager = findViewById(R.id.viewPager);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
context = this;
|
context = this;
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
date = preferences.getString(CommonString.KEY_DATE, null);
|
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
imageView = (ImageView) findViewById(R.id.img_main);
|
imageView = (ImageView) findViewById(R.id.img_main);
|
||||||
|
dotsLayout = findViewById(R.id.dotsLayout);
|
||||||
webView = (WebView) findViewById(R.id.webview);
|
webView = (WebView) findViewById(R.id.webview);
|
||||||
String url = preferences.getString(CommonString.KEY_NOTICE_BOARD_LINK, "");
|
String url = preferences.getString(CommonString.KEY_NOTICE_BOARD_LINK, "");
|
||||||
|
// String url = "https://dle.parinaam.in/OneApp/Dabur/brand-spiels/dabur-brand-spiels.html";
|
||||||
user_name = preferences.getString(CommonString.KEY_USERNAME, null);
|
user_name = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||||
db = new GSKOrangeDB(MainActivity.this);
|
db = new GSKOrangeDB(MainActivity.this);
|
||||||
|
db.open();
|
||||||
webView.setWebViewClient(new MyWebViewClient());
|
webView.setWebViewClient(new MyWebViewClient());
|
||||||
webView.getSettings().setJavaScriptEnabled(true);
|
webView.getSettings().setJavaScriptEnabled(true);
|
||||||
|
|
||||||
|
String json = preferences.getString("NOTICEBOARD_DATA", null) != null
|
||||||
|
? preferences.getString("NOTICEBOARD_DATA", null)
|
||||||
|
: "";
|
||||||
|
Log.d("noticejsondata",json);
|
||||||
|
if (!json.isEmpty()) {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
NoticeResponse response =
|
||||||
|
gson.fromJson(json, NoticeResponse.class);
|
||||||
|
bannerlist = response.Mer_NoticeBoard;
|
||||||
|
Log.d("SIZE", String.valueOf(bannerlist.size()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(bannerlist!=null && bannerlist.size()>0){
|
||||||
|
setupDots(bannerlist.size());
|
||||||
|
viewPager.setAdapter(new NoticeAdapter(bannerlist, this::handleClick));
|
||||||
|
}
|
||||||
|
viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
|
||||||
|
@Override
|
||||||
|
public void onPageSelected(int position) {
|
||||||
|
super.onPageSelected(position);
|
||||||
|
|
||||||
|
setActiveDot(position); // 👈 your dots logic
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPageScrollStateChanged(int state) {
|
||||||
|
super.onPageScrollStateChanged(state);
|
||||||
|
|
||||||
|
if (state == ViewPager2.SCROLL_STATE_DRAGGING) {
|
||||||
|
sliderHandler.removeCallbacks(sliderRunnable); // stop
|
||||||
|
}
|
||||||
|
else if (state == ViewPager2.SCROLL_STATE_IDLE) {
|
||||||
|
startAutoSlide(); // 🔥 don't call postDelayed directly
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
viewPager.setClipToPadding(false);
|
||||||
|
viewPager.setClipChildren(false);
|
||||||
|
|
||||||
if (!url.isEmpty()) {
|
if (!url.isEmpty()) {
|
||||||
webView.loadUrl(url);
|
webView.loadUrl(url);
|
||||||
}
|
}
|
||||||
@@ -121,6 +180,154 @@ public class MainActivity extends AppCompatActivity
|
|||||||
navigationView.setNavigationItemSelectedListener(this);
|
navigationView.setNavigationItemSelectedListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setupDots(int size) {
|
||||||
|
dotsLayout.removeAllViews();
|
||||||
|
dots.clear();
|
||||||
|
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
ImageView dot = new ImageView(this);
|
||||||
|
|
||||||
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
|
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||||
|
);
|
||||||
|
params.setMargins(8, 0, 8, 0);
|
||||||
|
dot.setLayoutParams(params);
|
||||||
|
|
||||||
|
// default (inactive)
|
||||||
|
dot.setImageResource(R.drawable.dot_inactive);
|
||||||
|
|
||||||
|
dotsLayout.addView(dot);
|
||||||
|
dots.add(dot);
|
||||||
|
}
|
||||||
|
|
||||||
|
// set first dot active
|
||||||
|
if (size > 0) {
|
||||||
|
setActiveDot(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setActiveDot(int position) {
|
||||||
|
|
||||||
|
for (int i = 0; i < dots.size(); i++) {
|
||||||
|
ImageView dot = dots.get(i);
|
||||||
|
|
||||||
|
if (i == position) {
|
||||||
|
// Active dot (bigger + dark)
|
||||||
|
dot.setImageResource(R.drawable.dot_active);
|
||||||
|
|
||||||
|
dot.animate()
|
||||||
|
.scaleX(1f)
|
||||||
|
.scaleY(1f)
|
||||||
|
.setDuration(200)
|
||||||
|
.start();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Inactive dot (small + light)
|
||||||
|
dot.setImageResource(R.drawable.dot_inactive);
|
||||||
|
|
||||||
|
dot.animate()
|
||||||
|
.scaleX(1f)
|
||||||
|
.scaleY(1f)
|
||||||
|
.setDuration(200)
|
||||||
|
.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleClick(NoticeItem item) {
|
||||||
|
|
||||||
|
String url = String.valueOf(item.getNoticeLink_FullPage());
|
||||||
|
String type = String.valueOf(item.getFullPageTarget());
|
||||||
|
// Log.d("clickdata",url + ","+type);
|
||||||
|
Log.e("clickdata", "URL = " + url);
|
||||||
|
System.out.println("FULL URL = " + url);
|
||||||
|
|
||||||
|
if (type == null) return;
|
||||||
|
|
||||||
|
switch (type.toLowerCase()) {
|
||||||
|
case "html-webview":
|
||||||
|
Log.d("itemdata", String.valueOf(item.getFullPageTarget()));
|
||||||
|
Intent webIntent = new Intent(this, WebViewActivity.class);
|
||||||
|
webIntent.putExtra("url", url);
|
||||||
|
webIntent.putExtra("type", item.getFullPageTarget());
|
||||||
|
webIntent.putExtra("dt_level", "");
|
||||||
|
startActivity(webIntent);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "html-webbrowser":
|
||||||
|
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "video":
|
||||||
|
Intent videoIntent = new Intent(this, WebViewActivity.class);
|
||||||
|
videoIntent.putExtra("url", url);
|
||||||
|
videoIntent.putExtra("type", item.getFullPageTarget());
|
||||||
|
videoIntent.putExtra("dt_level", "");
|
||||||
|
startActivity(videoIntent);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "image":
|
||||||
|
Intent imageIntent = new Intent(this, WebViewActivity.class);
|
||||||
|
imageIntent.putExtra("url", url);
|
||||||
|
imageIntent.putExtra("type", item.getFullPageTarget());
|
||||||
|
imageIntent.putExtra("dt_level", "");
|
||||||
|
startActivity(imageIntent);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "deeplink":
|
||||||
|
try {
|
||||||
|
Intent deepIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||||
|
startActivity(deepIntent);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Toast.makeText(this, "Invalid deeplink", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "contact":
|
||||||
|
handleContact(url);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
Toast.makeText(this, "Unsupported type", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleContact(String raw) {
|
||||||
|
try {
|
||||||
|
// remove query params
|
||||||
|
String jsonPart = raw.split("\\?")[0];
|
||||||
|
|
||||||
|
JSONObject obj = new JSONObject(jsonPart);
|
||||||
|
|
||||||
|
String number = obj.getString("Value");
|
||||||
|
|
||||||
|
Intent intent = new Intent(Intent.ACTION_DIAL);
|
||||||
|
intent.setData(Uri.parse("tel:" + number));
|
||||||
|
startActivity(intent);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Toast.makeText(this, "Invalid contact data", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String loadJSONFromAsset() {
|
||||||
|
String json = null;
|
||||||
|
try {
|
||||||
|
InputStream is = getAssets().open("notice.json");
|
||||||
|
int size = is.available();
|
||||||
|
byte[] buffer = new byte[size];
|
||||||
|
is.read(buffer);
|
||||||
|
is.close();
|
||||||
|
json = new String(buffer, "UTF-8");
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
@@ -130,6 +337,14 @@ public class MainActivity extends AppCompatActivity
|
|||||||
db.open();
|
db.open();
|
||||||
//usk
|
//usk
|
||||||
navigationView = (NavigationView) findViewById(R.id.nav_view);
|
navigationView = (NavigationView) findViewById(R.id.nav_view);
|
||||||
|
startAutoSlide();
|
||||||
|
try {
|
||||||
|
app_ver = String.valueOf(getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
|
||||||
|
// login_version.setText("Parinaam Version " + app_ver);
|
||||||
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
// get menu from navigationView
|
// get menu from navigationView
|
||||||
Menu menu = navigationView.getMenu();
|
Menu menu = navigationView.getMenu();
|
||||||
// find MenuItem you want to change
|
// find MenuItem you want to change
|
||||||
@@ -163,6 +378,9 @@ public class MainActivity extends AppCompatActivity
|
|||||||
nav_route_plan13.setTitle(getResources().getString(R.string.menu_setting));
|
nav_route_plan13.setTitle(getResources().getString(R.string.menu_setting));
|
||||||
MenuItem nav_route_plan14 = menu.findItem(R.id.nav_services);
|
MenuItem nav_route_plan14 = menu.findItem(R.id.nav_services);
|
||||||
nav_route_plan14.setTitle(getResources().getString(R.string.menu_services));
|
nav_route_plan14.setTitle(getResources().getString(R.string.menu_services));
|
||||||
|
|
||||||
|
MenuItem nav_route_plan15 = menu.findItem(R.id.nav_version);
|
||||||
|
nav_route_plan15.setTitle("Version/Versiyon - " + app_ver + "-T3");
|
||||||
//Enable disable According to Configuration
|
//Enable disable According to Configuration
|
||||||
ArrayList<ConfigurationMasterGetterSetter> configurationData = db.getConfigurationMasterData(country_id);
|
ArrayList<ConfigurationMasterGetterSetter> configurationData = db.getConfigurationMasterData(country_id);
|
||||||
if (!configurationData.isEmpty()) {
|
if (!configurationData.isEmpty()) {
|
||||||
@@ -212,8 +430,33 @@ public class MainActivity extends AppCompatActivity
|
|||||||
storelist = db.getStoreData(date, CommonString.KEY_JOURNEY_PLAN);
|
storelist = db.getStoreData(date, CommonString.KEY_JOURNEY_PLAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void startAutoSlide() {
|
||||||
|
|
||||||
|
if (sliderRunnable != null) {
|
||||||
|
sliderHandler.removeCallbacks(sliderRunnable); // 🔥 prevent duplicate
|
||||||
|
}
|
||||||
|
|
||||||
|
sliderRunnable = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
if (viewPager.getAdapter() == null) return;
|
||||||
|
|
||||||
|
int nextItem = (viewPager.getCurrentItem() + 1) %
|
||||||
|
viewPager.getAdapter().getItemCount();
|
||||||
|
|
||||||
|
viewPager.setCurrentItem(nextItem, true);
|
||||||
|
|
||||||
|
sliderHandler.postDelayed(this, 3000); // 3 sec
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
sliderHandler.postDelayed(sliderRunnable, 3000);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
|
super.onBackPressed();
|
||||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
if (drawer.isDrawerOpen(GravityCompat.START)) {
|
if (drawer.isDrawerOpen(GravityCompat.START)) {
|
||||||
drawer.closeDrawer(GravityCompat.START);
|
drawer.closeDrawer(GravityCompat.START);
|
||||||
@@ -366,7 +609,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPageFinished(WebView view, String url) {
|
public void onPageFinished(WebView view, String url) {
|
||||||
imageView.setVisibility(View.INVISIBLE);
|
imageView.setVisibility(View.GONE);
|
||||||
webView.setVisibility(View.VISIBLE);
|
webView.setVisibility(View.VISIBLE);
|
||||||
super.onPageFinished(view, url);
|
super.onPageFinished(view, url);
|
||||||
view.clearCache(true);
|
view.clearCache(true);
|
||||||
@@ -491,4 +734,85 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public class NoticeAdapter extends RecyclerView.Adapter<NoticeAdapter.ViewHolder> {
|
||||||
|
|
||||||
|
private List<NoticeItem> list;
|
||||||
|
private OnItemClickListener listener;
|
||||||
|
|
||||||
|
// Interface for click handling
|
||||||
|
public interface OnItemClickListener {
|
||||||
|
void onClick(NoticeItem item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NoticeAdapter(List<NoticeItem> list, OnItemClickListener listener) {
|
||||||
|
this.list = list;
|
||||||
|
this.listener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
ImageView image;
|
||||||
|
|
||||||
|
public ViewHolder(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
image = itemView.findViewById(R.id.bannerImage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NoticeAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
View view = LayoutInflater.from(parent.getContext())
|
||||||
|
.inflate(R.layout.banner_item, parent, false);
|
||||||
|
return new ViewHolder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(NoticeAdapter.ViewHolder holder, int position) {
|
||||||
|
NoticeItem item = list.get(position);
|
||||||
|
|
||||||
|
String url = String.valueOf(item.getNoticeLink_Thumbnail());
|
||||||
|
Glide.with(holder.itemView.getContext())
|
||||||
|
.load(url)
|
||||||
|
.transform(new RoundedCorners(30))
|
||||||
|
.into(holder.image);
|
||||||
|
|
||||||
|
holder.itemView.setOnClickListener(v -> {
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onClick(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return list != null ? list.size() : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Append storeid and merid to the provided URL as query parameters.
|
||||||
|
* If the URL already contains query params, append with '&', otherwise use '?'.
|
||||||
|
*/
|
||||||
|
private String appendStoreMerQuery(String url, String storeId, String merId) {
|
||||||
|
if (url == null) return null;
|
||||||
|
try {
|
||||||
|
StringBuilder sb = new StringBuilder(url);
|
||||||
|
String separator = url.contains("?") ? "&" : "?";
|
||||||
|
boolean appended = false;
|
||||||
|
if (storeId != null && !storeId.isEmpty()) {
|
||||||
|
sb.append(separator).append("storeid=").append(URLEncoder.encode(storeId, "UTF-8"));
|
||||||
|
separator = "&";
|
||||||
|
appended = true;
|
||||||
|
}
|
||||||
|
if (merId != null && !merId.isEmpty()) {
|
||||||
|
sb.append(separator).append("merid=").append(URLEncoder.encode(merId, "UTF-8"));
|
||||||
|
appended = true;
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package cpm.com.gskmtorange;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.NoticeItem;
|
||||||
|
|
||||||
|
public class NoticeResponse implements Serializable {
|
||||||
|
List<NoticeItem> Mer_NoticeBoard;
|
||||||
|
|
||||||
|
public NoticeResponse(List<NoticeItem> list) {
|
||||||
|
this.Mer_NoticeBoard = list;
|
||||||
|
}
|
||||||
|
public List<NoticeItem> getMer_NoticeBoard() {
|
||||||
|
return Mer_NoticeBoard;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -85,8 +85,7 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
|||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
int id = view.getId();
|
int id = view.getId();
|
||||||
|
|
||||||
switch (id) {
|
if (id == R.id.btn_language_one) {
|
||||||
case R.id.btn_language_one:
|
|
||||||
selected_flag = true;
|
selected_flag = true;
|
||||||
CommonFunctions.updateLangResources(context, language.get(0));
|
CommonFunctions.updateLangResources(context, language.get(0));
|
||||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
@@ -97,9 +96,8 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
|||||||
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(0));
|
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(0));
|
||||||
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(0));
|
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(0));
|
||||||
editor.commit();
|
editor.commit();
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.btn_language_two:
|
} else if (id == R.id.btn_language_two) {
|
||||||
selected_flag = true;
|
selected_flag = true;
|
||||||
CommonFunctions.updateLangResources(context, language.get(1));
|
CommonFunctions.updateLangResources(context, language.get(1));
|
||||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
@@ -110,8 +108,8 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
|||||||
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(1));
|
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(1));
|
||||||
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(1));
|
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(1));
|
||||||
editor.commit();
|
editor.commit();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
|
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
|
||||||
|
|||||||
@@ -1,30 +1,16 @@
|
|||||||
package cpm.com.gskmtorange;
|
package cpm.com.gskmtorange;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.PixelFormat;
|
import android.graphics.PixelFormat;
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.View;
|
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;
|
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.password.MPinActivity;
|
import cpm.com.gskmtorange.password.MPinActivity;
|
||||||
|
|
||||||
@@ -35,11 +21,11 @@ public class SplashScreenActivity extends AppCompatActivity {
|
|||||||
private Context context;
|
private Context context;
|
||||||
private SharedPreferences preferences = null;
|
private SharedPreferences preferences = null;
|
||||||
|
|
||||||
public void onAttachedToWindow() {
|
/* public void onAttachedToWindow() {
|
||||||
super.onAttachedToWindow();
|
super.onAttachedToWindow();
|
||||||
Window window = getWindow();
|
Window window = getWindow();
|
||||||
window.setFormat(PixelFormat.RGBA_8888);
|
window.setFormat(PixelFormat.RGBA_8888);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the activity is first created.
|
* Called when the activity is first created.
|
||||||
@@ -47,103 +33,50 @@ public class SplashScreenActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
|
||||||
setContentView(R.layout.activity_splash_main_layout);
|
|
||||||
|
|
||||||
linearLayout = findViewById(R.id.lin_lay);
|
|
||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
|
||||||
context = this;
|
context = this;
|
||||||
//StartAnimations();
|
|
||||||
|
|
||||||
sendToLogin();
|
|
||||||
|
|
||||||
/* File f = new File(CommonString.getImagesFolder(context)_OLD);
|
|
||||||
if(f!=null){
|
|
||||||
File file[] = f.listFiles();
|
|
||||||
if(file!=null){
|
|
||||||
|
|
||||||
for (int i=0;i<file.length;i++){
|
|
||||||
Date lastModDate = new Date(file[0].lastModified());
|
|
||||||
String day = lastModDate.toString();
|
|
||||||
|
|
||||||
*//*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( SplashScreenActivity.this);
|
|
||||||
uploadImg.UploadImageRecursive(SplashScreenActivity.this);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
sendToLogin();
|
|
||||||
}*//*
|
|
||||||
}else {
|
|
||||||
sendToLogin();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
sendToLogin();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
|
||||||
/* private void StartAnimations() {
|
|
||||||
Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);
|
|
||||||
anim.reset();
|
|
||||||
LinearLayout l=(LinearLayout) findViewById(R.id.lin_lay);
|
|
||||||
l.clearAnimation();
|
|
||||||
l.startAnimation(anim);
|
|
||||||
|
|
||||||
anim = AnimationUtils.loadAnimation(this, R.anim.translate);
|
|
||||||
anim.reset();
|
|
||||||
ImageView iv = (ImageView) findViewById(R.id.logo);
|
|
||||||
iv.clearAnimation();
|
|
||||||
iv.startAnimation(anim);
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
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
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
//after Mpin
|
|
||||||
String mpin = preferences.getString(CommonString.MPIN, null);
|
|
||||||
if (mpin != null) {
|
|
||||||
Intent in = new Intent(context, MPinActivity.class);
|
|
||||||
in.putExtra(CommonString.IS_PASSWORD_CHECK, true);
|
|
||||||
startActivity(in);
|
|
||||||
finish();
|
|
||||||
} else {
|
|
||||||
Intent i = new Intent(context, LoginActivity.class);
|
|
||||||
startActivity(i);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}, SPLASH_TIME_OUT);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getCalculatedDate(String date, String dateFormat, int days) {
|
|
||||||
Calendar cal = Calendar.getInstance();
|
|
||||||
@SuppressLint("SimpleDateFormat") SimpleDateFormat s = new SimpleDateFormat(dateFormat);
|
|
||||||
cal.add(Calendar.DAY_OF_YEAR, days);
|
|
||||||
try {
|
try {
|
||||||
return s.format(new Date(s.parse(date).getTime()));
|
// Optional: hide the status bar safely
|
||||||
} catch (ParseException e) {
|
getWindow().getDecorView().setSystemUiVisibility(
|
||||||
// TODO Auto-generated catch block
|
View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||||
Log.e("TAG", "Error in Parsing Date : " + e.getMessage());
|
);
|
||||||
|
}catch (Exception ignored){}
|
||||||
|
setContentView(R.layout.activity_splash_main_layout);
|
||||||
|
linearLayout = findViewById(R.id.lin_lay);
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
startSplashTimer();
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
|
|
||||||
|
private void sendToLogin() {
|
||||||
|
try {
|
||||||
|
String mpin = preferences.getString(CommonString.MPIN, null);
|
||||||
|
Intent intent;
|
||||||
|
if (mpin != null) {
|
||||||
|
intent = new Intent(this, MPinActivity.class);
|
||||||
|
intent.putExtra(CommonString.IS_PASSWORD_CHECK, true);
|
||||||
|
} else {
|
||||||
|
intent = new Intent(this, LoginActivity.class);
|
||||||
|
}
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
} catch (Exception ignored) {} finally {
|
||||||
|
String mpin = preferences.getString(CommonString.MPIN, null);
|
||||||
|
Intent intent;
|
||||||
|
if (mpin != null) {
|
||||||
|
intent = new Intent(this, MPinActivity.class);
|
||||||
|
intent.putExtra(CommonString.IS_PASSWORD_CHECK, true);
|
||||||
|
} else {
|
||||||
|
intent = new Intent(this, LoginActivity.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startSplashTimer() {
|
||||||
|
new Handler(Looper.getMainLooper()).postDelayed(this::sendToLogin, 3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package cpm.com.gskmtorange.adapter
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.Context
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter
|
||||||
|
import cpm.com.gskmtorange.R
|
||||||
|
import cpm.com.gskmtorange.adapter.data.ImageUri
|
||||||
|
import cpm.com.gskmtorange.databinding.ItemRealtimePdBinding
|
||||||
|
|
||||||
|
class RealtimeAdapter(
|
||||||
|
val category: String?,
|
||||||
|
var context: Context,
|
||||||
|
private var subcates: ArrayList<CategoryPictureGetterSetter>?,
|
||||||
|
private val btnlistener: BtnClickListener,
|
||||||
|
) : RecyclerView.Adapter<RealtimeAdapter.CustomViewHolder>() {
|
||||||
|
class CustomViewHolder(view: View) : RecyclerView.ViewHolder(view)
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = CustomViewHolder(
|
||||||
|
ItemRealtimePdBinding.inflate(LayoutInflater.from(context), parent, false).root
|
||||||
|
)
|
||||||
|
|
||||||
|
@SuppressLint(
|
||||||
|
"NotifyDataSetChanged", "ClickableViewAccessibility",
|
||||||
|
"UseCompatLoadingForDrawables", "SetTextI18n"
|
||||||
|
)
|
||||||
|
override fun onBindViewHolder(holder: CustomViewHolder, position: Int) {
|
||||||
|
ItemRealtimePdBinding.bind(holder.itemView).apply {
|
||||||
|
val subcat = subcates!![position]
|
||||||
|
tvSubCategory.text = "$category-${subcat.suB_CATEGORY}"
|
||||||
|
analyticBT.text = context.getString(R.string.view_report_pd)
|
||||||
|
analyticBT.setOnClickListener {
|
||||||
|
btnlistener.onStartSessionClick(position, subcat)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount(): Int {
|
||||||
|
return subcates!!.size
|
||||||
|
}
|
||||||
|
|
||||||
|
interface BtnClickListener {
|
||||||
|
fun onStartSessionClick(_pos: Int, data: CategoryPictureGetterSetter)
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
fun addsubCatItems(langList: ArrayList<CategoryPictureGetterSetter>?) {
|
||||||
|
subcates = langList
|
||||||
|
notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun updateItem(position: Int, uris: List<ImageUri>) {
|
||||||
|
subcates!![position].imageUris = (subcates!![position].imageUris
|
||||||
|
?: ArrayList()).apply { addAll(uris as ArrayList<ImageUri>) }
|
||||||
|
notifyItemChanged(position)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package cpm.com.gskmtorange.adapter
|
package cpm.com.gskmtorange.adapter
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.util.Log
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
@@ -24,6 +25,7 @@ class SavedImagesAdapter(private val context: Context, private val images: List<
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onBindViewHolder(holder: SavedImageViewHolder, position: Int) {
|
override fun onBindViewHolder(holder: SavedImageViewHolder, position: Int) {
|
||||||
|
Log.d("imagedata",images[position].uri)
|
||||||
imgPreviewwithError(
|
imgPreviewwithError(
|
||||||
context = context,
|
context = context,
|
||||||
url = images[position].uri,
|
url = images[position].uri,
|
||||||
|
|||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package cpm.com.gskmtorange.adapter
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.net.Uri
|
||||||
|
import android.util.Log
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.bumptech.glide.Glide
|
||||||
|
import cpm.com.gskmtorange.dailyentry.WebViewActivity
|
||||||
|
import cpm.com.gskmtorange.databinding.ItemCategoryScoreBinding
|
||||||
|
import cpm.com.gskmtorange.databinding.ItemOverallScoreBinding
|
||||||
|
import cpm.com.gskmtorange.databinding.ItemPdImageBinding
|
||||||
|
import cpm.com.gskmtorange.utils.ScoreItem
|
||||||
|
|
||||||
|
class ScoreAdapter(private val items: List<ScoreItem>) :
|
||||||
|
RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||||
|
|
||||||
|
private val TYPE_OVERALL = 0
|
||||||
|
private val TYPE_CATEGORY = 1
|
||||||
|
private val TYPE_IMAGE = 2
|
||||||
|
|
||||||
|
override fun getItemViewType(position: Int): Int {
|
||||||
|
return when (items[position]) {
|
||||||
|
is ScoreItem.OverallScore -> TYPE_OVERALL
|
||||||
|
is ScoreItem.CategoryScore -> TYPE_CATEGORY
|
||||||
|
is ScoreItem.ImageItem -> TYPE_IMAGE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||||
|
val inflater = LayoutInflater.from(parent.context)
|
||||||
|
return when (viewType) {
|
||||||
|
TYPE_OVERALL -> {
|
||||||
|
val binding = ItemOverallScoreBinding.inflate(inflater, parent, false)
|
||||||
|
OverallViewHolder(binding)
|
||||||
|
}
|
||||||
|
TYPE_CATEGORY -> {
|
||||||
|
val binding = ItemCategoryScoreBinding.inflate(inflater, parent, false)
|
||||||
|
CategoryViewHolder(binding)
|
||||||
|
}
|
||||||
|
TYPE_IMAGE -> {
|
||||||
|
val binding = ItemPdImageBinding.inflate(inflater, parent, false)
|
||||||
|
ImageViewHolder(binding)
|
||||||
|
}
|
||||||
|
else -> throw IllegalArgumentException("Invalid view type")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||||
|
when (val item = items[position]) {
|
||||||
|
is ScoreItem.OverallScore -> (holder as OverallViewHolder).bind(item)
|
||||||
|
is ScoreItem.CategoryScore -> (holder as CategoryViewHolder).bind(item)
|
||||||
|
is ScoreItem.ImageItem -> (holder as ImageViewHolder).bind(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount(): Int = items.size
|
||||||
|
|
||||||
|
class OverallViewHolder(private val binding: ItemOverallScoreBinding) :
|
||||||
|
RecyclerView.ViewHolder(binding.root) {
|
||||||
|
|
||||||
|
fun bind(item: ScoreItem.OverallScore) {
|
||||||
|
binding.tvOsa.text = "OSA: ${item.osa}"
|
||||||
|
binding.tvMsl.text = "MSL: ${item.msl}"
|
||||||
|
binding.tvPosm.text = "POSM: ${item.posm}"
|
||||||
|
binding.tvSosSku.text = "SOS (SKU): ${item.sosSku}"
|
||||||
|
binding.tvSosBrand.text = "SOS (Brand): ${item.sosBrand}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CategoryViewHolder(private val binding: ItemCategoryScoreBinding) :
|
||||||
|
RecyclerView.ViewHolder(binding.root) {
|
||||||
|
|
||||||
|
fun bind(item: ScoreItem.CategoryScore) {
|
||||||
|
binding.tvCategory.text = item.categoryName
|
||||||
|
binding.tvMsl.text = "MSL: ${item.msl}"
|
||||||
|
binding.tvPosm.text = "POSM: ${item.posm}"
|
||||||
|
binding.tvSosSku.text = "SOS (SKU): ${item.sosSku}"
|
||||||
|
binding.tvSosBrand.text = "SOS (Brand): ${item.sosBrand}"
|
||||||
|
|
||||||
|
binding.layoutBrands.removeAllViews()
|
||||||
|
for (brand in item.brandDetails) {
|
||||||
|
val tv = TextView(binding.root.context)
|
||||||
|
tv.text = "${brand.first}: ${brand.second}"
|
||||||
|
binding.layoutBrands.addView(tv)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ImageViewHolder(private val binding: ItemPdImageBinding) :
|
||||||
|
RecyclerView.ViewHolder(binding.root) {
|
||||||
|
|
||||||
|
fun bind(item: ScoreItem.ImageItem) {
|
||||||
|
Log.d("itemuri",item.url)
|
||||||
|
/* binding.btnViewImage.setOnClickListener {
|
||||||
|
val context = binding.root.context
|
||||||
|
val intent = Intent(context, WebViewActivity::class.java)
|
||||||
|
intent.putExtra("url", item.url)
|
||||||
|
context.startActivity(intent)
|
||||||
|
}*/
|
||||||
|
val actualUrl = if (item.url.contains("?url=")) {
|
||||||
|
item.url.substringAfter("?url=") // extract the real image link
|
||||||
|
} else item.url
|
||||||
|
|
||||||
|
Glide.with(binding.ivRawImage.context)
|
||||||
|
.load(actualUrl)
|
||||||
|
//.placeholder(R.drawable.ic_placeholder) // optional
|
||||||
|
// .error(R.drawable.ic_broken_image) // fallback if fail
|
||||||
|
.into(binding.ivRawImage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,9 @@ import android.content.res.Configuration;
|
|||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.net.ConnectivityManager;
|
||||||
|
import android.net.Network;
|
||||||
|
import android.net.NetworkCapabilities;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.view.ViewTreeObserver;
|
import android.view.ViewTreeObserver;
|
||||||
@@ -29,10 +32,6 @@ import android.app.AlertDialog;
|
|||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.interfaces.DialogCallbackListener;
|
import cpm.com.gskmtorange.interfaces.DialogCallbackListener;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by yadavendras on 13-11-2017.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class CommonFunctions {
|
public class CommonFunctions {
|
||||||
public static boolean updateLangResources(Context context, String language) {
|
public static boolean updateLangResources(Context context, String language) {
|
||||||
String lang;
|
String lang;
|
||||||
@@ -153,7 +152,6 @@ public class CommonFunctions {
|
|||||||
inSampleSize *= 2;
|
inSampleSize *= 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return inSampleSize;
|
return inSampleSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,4 +208,29 @@ public class CommonFunctions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isInternetAvailable(Context context) {
|
||||||
|
ConnectivityManager connectivityManager =
|
||||||
|
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
|
|
||||||
|
if (connectivityManager == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Network network = connectivityManager.getActiveNetwork();
|
||||||
|
if (network == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
NetworkCapabilities capabilities =
|
||||||
|
connectivityManager.getNetworkCapabilities(network);
|
||||||
|
if (capabilities == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) &&
|
||||||
|
capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,16 +8,20 @@ import cpm.com.gskmtorange.AppUtils;
|
|||||||
/**
|
/**
|
||||||
* Created by yadavendras on 19-12-2016.
|
* Created by yadavendras on 19-12-2016.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class CommonString {
|
public class CommonString {
|
||||||
public static final String BACKUP_PATH = Environment.getExternalStorageDirectory().getPath() + "/gsk_orange_backup";
|
|
||||||
// webservice constants
|
|
||||||
// preferenec keys
|
// preferenec keys
|
||||||
public static final String PD_PROJECT_iD = "4f57635b-6b07-45bf-bfba-c61c2826b6db";
|
public static final String PD_PROJECT_iD = "4f57635b-6b07-45bf-bfba-c61c2826b6db";
|
||||||
|
public static final String KEY_PD_PROJECT_Id = "PD_PROJECT_Id";
|
||||||
|
public static final String KEY_PD_USER_Id = "PD_USER_Id";
|
||||||
public static final String KEY_USERNAME = "username";
|
public static final String KEY_USERNAME = "username";
|
||||||
public static final String KEY_PASSWORD = "password";
|
public static final String KEY_PASSWORD = "password";
|
||||||
public static final String KEY_DATE = "date";
|
public static final String KEY_DATE = "date";
|
||||||
public static final String KEY_COUNTRY_ID = "COUNTRY_ID";
|
public static final String KEY_COUNTRY_ID = "COUNTRY_ID";
|
||||||
public static final String KEY_STOREVISITED_STATUS = "STOREVISITED_STATUS";
|
public static final String KEY_STOREVISITED_STATUS = "STOREVISITED_STATUS";
|
||||||
|
public static final String KEY_SAVE_MODE = "SAVE_MODE";
|
||||||
|
public static final String KEY_DRAFT = "DRAFT";
|
||||||
|
public static final String KEY_COMPELETE = "COMPELETE";
|
||||||
|
|
||||||
|
|
||||||
public static final String KEY_PATH = "path";
|
public static final String KEY_PATH = "path";
|
||||||
@@ -98,6 +102,7 @@ public class CommonString {
|
|||||||
public static final String KEY_NON_T2P_REASON_ID = "TREASON_ID";
|
public static final String KEY_NON_T2P_REASON_ID = "TREASON_ID";
|
||||||
|
|
||||||
public static final String KEY_JOURNEY_PLAN = "JOURNEY_PLAN";
|
public static final String KEY_JOURNEY_PLAN = "JOURNEY_PLAN";
|
||||||
|
public static final String KEY_NOTICE_BOARD = "Mer_NoticeBoard";
|
||||||
public static final String KEY_ADHOC_JOURNEY_PLAN = "ADHOC_JOURNEYPLAN";
|
public static final String KEY_ADHOC_JOURNEY_PLAN = "ADHOC_JOURNEYPLAN";
|
||||||
public static final String KEY_JOURNEY_PLAN_ADDITIONAL = "JOURNEY_PLAN_ADDITIONAL";
|
public static final String KEY_JOURNEY_PLAN_ADDITIONAL = "JOURNEY_PLAN_ADDITIONAL";
|
||||||
public static final String KEY_JOURNEY_PLAN_PHARMA = "JOURNEY_PLAN_PHARMA";
|
public static final String KEY_JOURNEY_PLAN_PHARMA = "JOURNEY_PLAN_PHARMA";
|
||||||
@@ -135,6 +140,7 @@ public class CommonString {
|
|||||||
public static final String KEY_SUB_CATEGORY = "SUB_CATEGORY";
|
public static final String KEY_SUB_CATEGORY = "SUB_CATEGORY";
|
||||||
public static final String KEY_SUB_CATEGORY_ID = "SUB_CATEGORY_ID";
|
public static final String KEY_SUB_CATEGORY_ID = "SUB_CATEGORY_ID";
|
||||||
public static final String KEY_SUB_CATEGORY_CODE = "SUB_CATEGORY_CODE";
|
public static final String KEY_SUB_CATEGORY_CODE = "SUB_CATEGORY_CODE";
|
||||||
|
public static final String KEY_SUB_CATEGORY_ENGLISH = "SUB_CATEGORY_ENGLISH";
|
||||||
public static final String KEY_FROM = "FROM";
|
public static final String KEY_FROM = "FROM";
|
||||||
public static final String KEY_CHAT_ID = "CHAT_ID";
|
public static final String KEY_CHAT_ID = "CHAT_ID";
|
||||||
public static final String KEY_MESSAGE = "MESSAGE";
|
public static final String KEY_MESSAGE = "MESSAGE";
|
||||||
@@ -147,15 +153,13 @@ public class CommonString {
|
|||||||
public static final int UNIT_HORIZONTAL = 200;
|
public static final int UNIT_HORIZONTAL = 200;
|
||||||
|
|
||||||
// public static String URL = "http://gskme.parinaam.in/Gskwebservice.asmx";
|
// public static String URL = "http://gskme.parinaam.in/Gskwebservice.asmx";
|
||||||
public static String URL = "http://gskmeIR.parinaam.in/Gskwebservice.asmx";
|
// public static String URL = "http://gskmeIR.parinaam.in/Gskwebservice.asmx";
|
||||||
// public static String URL = "https://gskme1.parinaam.in/Gskwebservice.asmx";
|
// public static String URL = "https://gskme2.parinaam.in/Gskwebservice.asmx";
|
||||||
//Added new Test url for Turkey
|
//Added new Test url for Turkey
|
||||||
// public static String URL = "http://gskmetest.parinaam.in/Gskwebservice.asmx";
|
// 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://haleonme.parinaam.in/Gskwebservice.asmx";
|
||||||
//public static String URL = " https://gskme1.parinaam.in/Gskwebservice.asmx";
|
// public static String URL = "https://gskme2.parinaam.in/Gskwebservice.asmx";
|
||||||
//public static String URL = "https://gskme-test.parinaam.in/Gskwebservice.asmx";
|
|
||||||
|
|
||||||
public static final String NAMESPACE = "http://tempuri.org/";
|
public static final String NAMESPACE = "http://tempuri.org/";
|
||||||
public static final String METHOD_LOGIN = "UserLoginDetail";
|
public static final String METHOD_LOGIN = "UserLoginDetail";
|
||||||
public static final String SOAP_ACTION_LOGIN = "http://tempuri.org/"
|
public static final String SOAP_ACTION_LOGIN = "http://tempuri.org/"
|
||||||
@@ -695,7 +699,8 @@ public class CommonString {
|
|||||||
+ KEY_SKU_ID + " VARCHAR," + KEY_QUANTITY + " VARCHAR," + KEY_Common_ID + " VARCHAR,"
|
+ KEY_SKU_ID + " VARCHAR," + KEY_QUANTITY + " VARCHAR," + KEY_Common_ID + " VARCHAR,"
|
||||||
+ "categoryId" + " VARCHAR,"
|
+ "categoryId" + " VARCHAR,"
|
||||||
+ KEY_SKUNAME + " VARCHAR,"
|
+ KEY_SKUNAME + " VARCHAR,"
|
||||||
+ KEY_PROCESS_ID + " VARCHAR)";
|
+ KEY_SUB_CATEGORY_ID + " VARCHAR,"
|
||||||
|
+ KEY_SUB_CATEGORY + " VARCHAR)";
|
||||||
|
|
||||||
//Tables related to T2p Compliance
|
//Tables related to T2p Compliance
|
||||||
|
|
||||||
@@ -1132,6 +1137,12 @@ public class CommonString {
|
|||||||
+ "QTYPE"
|
+ "QTYPE"
|
||||||
+ " VARCHAR,"
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "SUB_CATEGORY"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "ANSWER"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
+ "ANSWER_ID"
|
+ "ANSWER_ID"
|
||||||
+ " INTEGER,"
|
+ " INTEGER,"
|
||||||
|
|
||||||
@@ -1147,6 +1158,7 @@ public class CommonString {
|
|||||||
public static String MPIN = "MPIN";
|
public static String MPIN = "MPIN";
|
||||||
public static String TABLE_MAPPING_STOCK_ADHOC = "MAPPING_STOCK_ADHOC";
|
public static String TABLE_MAPPING_STOCK_ADHOC = "MAPPING_STOCK_ADHOC";
|
||||||
public static String TABLE_MAPPING_STOCK = "MAPPING_STOCK";
|
public static String TABLE_MAPPING_STOCK = "MAPPING_STOCK";
|
||||||
|
public static String TABLE_MASTER_STORELIST_PD = "Master_StoreList_PDA";
|
||||||
public static String TABLE_MAPPING_STOCK_STOREWISE = "MAPPING_STOCK_STOREWISE";
|
public static String TABLE_MAPPING_STOCK_STOREWISE = "MAPPING_STOCK_STOREWISE";
|
||||||
public static String TABLE_MAPPING_STOCK_ADDITIONAL = "MAPPING_STOCK_ADDITIONAL";
|
public static String TABLE_MAPPING_STOCK_ADDITIONAL = "MAPPING_STOCK_ADDITIONAL";
|
||||||
public static String TABLE_MAPPING_T2P_ADHOC = "MAPPING_T2P_ADHOC";
|
public static String TABLE_MAPPING_T2P_ADHOC = "MAPPING_T2P_ADHOC";
|
||||||
@@ -1240,6 +1252,15 @@ public class CommonString {
|
|||||||
|
|
||||||
public static final String TABLE_INSERT_STOCK = "Stock_Data";
|
public static final String TABLE_INSERT_STOCK = "Stock_Data";
|
||||||
|
|
||||||
|
public static final String CREATE_TABLE_INSERT_STOCK_DATA = "CREATE TABLE IF NOT EXISTS " + TABLE_INSERT_STOCK
|
||||||
|
+ " ("
|
||||||
|
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||||
|
+ "Store_Id INTEGER, " + KEY_VISIT_DATE + " VARCHAR,"
|
||||||
|
+ "Category_Id INTEGER," + "Brand_Id INTEGER,"
|
||||||
|
+ "SKU_ID INTEGER," + "SKU VARCHAR," + "SKU_SEQUENCE INTEGER,"
|
||||||
|
+ "MBQ INTEGER," + "STOCK INTEGER," + "COMPANY_ID INTEGER," + "TOGGLE_VALUE VARCHAR,"
|
||||||
|
+ "MUST_HAVE VARCHAR)";
|
||||||
|
|
||||||
public static final String CREATE_TABLE_INSERT_STOCK_ENTRY = "CREATE TABLE IF NOT EXISTS "
|
public static final String CREATE_TABLE_INSERT_STOCK_ENTRY = "CREATE TABLE IF NOT EXISTS "
|
||||||
+ TABLE_INSERT_STOCK_ENTRY
|
+ TABLE_INSERT_STOCK_ENTRY
|
||||||
+ "("
|
+ "("
|
||||||
@@ -1434,7 +1455,6 @@ public class CommonString {
|
|||||||
public static final String CREATE_TABLE_INSERT_ORDER_TAKING_DATA = "CREATE TABLE IF NOT EXISTS "
|
public static final String CREATE_TABLE_INSERT_ORDER_TAKING_DATA = "CREATE TABLE IF NOT EXISTS "
|
||||||
+ TABLE_INSERT_ORDER_TAKING_DATA
|
+ TABLE_INSERT_ORDER_TAKING_DATA
|
||||||
+ " ("
|
+ " ("
|
||||||
|
|
||||||
+ "KEY_ID"
|
+ "KEY_ID"
|
||||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||||
|
|
||||||
@@ -1465,9 +1485,18 @@ public class CommonString {
|
|||||||
+ "SKU_ID"
|
+ "SKU_ID"
|
||||||
+ " INTEGER,"
|
+ " INTEGER,"
|
||||||
|
|
||||||
|
+ "SUBCAT_ID"
|
||||||
|
+ " INTEGER,"
|
||||||
|
|
||||||
+ "SKU"
|
+ "SKU"
|
||||||
+ " VARCHAR,"
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "BRAND"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "SUBCAT"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
+ "SKU_SEQUENCE"
|
+ "SKU_SEQUENCE"
|
||||||
+ " VARCHAR,"
|
+ " VARCHAR,"
|
||||||
|
|
||||||
@@ -1536,6 +1565,7 @@ public class CommonString {
|
|||||||
|
|
||||||
public static final String KEY_IRPD_IMAGES = "IRPD_IMAGES";
|
public static final String KEY_IRPD_IMAGES = "IRPD_IMAGES";
|
||||||
public static final String KEY_IRPD_MODIFY_IMAGES = "IRPD_IMAGES_MODIFY";
|
public static final String KEY_IRPD_MODIFY_IMAGES = "IRPD_IMAGES_MODIFY";
|
||||||
|
public static final String KEY_TOGGLE_VALUE = "TOGGLE_VALUE";
|
||||||
public static final String TABLE_IRPD = "DR_IRPD";
|
public static final String TABLE_IRPD = "DR_IRPD";
|
||||||
public static final String CREATE_TABLE_IRPD = "CREATE TABLE IF NOT EXISTS "
|
public static final String CREATE_TABLE_IRPD = "CREATE TABLE IF NOT EXISTS "
|
||||||
+ TABLE_IRPD
|
+ TABLE_IRPD
|
||||||
@@ -1546,6 +1576,34 @@ public class CommonString {
|
|||||||
+ " INTEGER,"
|
+ " INTEGER,"
|
||||||
+ KEY_VISIT_DATE
|
+ KEY_VISIT_DATE
|
||||||
+ " VARCHAR,"
|
+ " VARCHAR,"
|
||||||
|
+ KEY_SAVE_MODE
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ KEY_CATEGORY_ID
|
||||||
|
+ " INTEGER,"
|
||||||
|
+ KEY_SUB_CATEGORY_ID
|
||||||
|
+ " INTEGER,"
|
||||||
|
+ KEY_SUB_CATEGORY_CODE
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ KEY_IRPD_MODIFY_IMAGES
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ KEY_TOGGLE_VALUE
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ KEY_IRPD_IMAGES
|
||||||
|
+ " VARCHAR)";
|
||||||
|
|
||||||
|
|
||||||
|
public static final String TABLE_IRPD_POG = "DR_IRPD_POG";
|
||||||
|
public static final String CREATE_TABLE_IRPD_POG = "CREATE TABLE IF NOT EXISTS "
|
||||||
|
+ TABLE_IRPD_POG
|
||||||
|
+ " ("
|
||||||
|
+ "KEY_ID"
|
||||||
|
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||||
|
+ KEY_STORE_ID
|
||||||
|
+ " INTEGER,"
|
||||||
|
+ KEY_VISIT_DATE
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ KEY_SAVE_MODE
|
||||||
|
+ " VARCHAR,"
|
||||||
+ KEY_CATEGORY_ID
|
+ KEY_CATEGORY_ID
|
||||||
+ " INTEGER,"
|
+ " INTEGER,"
|
||||||
+ KEY_SUB_CATEGORY_ID
|
+ KEY_SUB_CATEGORY_ID
|
||||||
@@ -1557,6 +1615,48 @@ public class CommonString {
|
|||||||
+ KEY_IRPD_IMAGES
|
+ KEY_IRPD_IMAGES
|
||||||
+ " VARCHAR)";
|
+ " VARCHAR)";
|
||||||
|
|
||||||
|
public static final String KEY_IRPD_VISIBILITY_IMAGES = "IRPD_VISIBILITY_IMAGES";
|
||||||
|
public static final String KEY_IRPD_VISIBILITY_MODIFY_IMAGES = "IRPD_VISIBILITY_IMAGES_MODIFY";
|
||||||
|
public static final String TABLE_IRPD_VISIBILITY = "DR_IRPD_VISIBILITY";
|
||||||
|
public static final String CREATE_TABLE_IRPD_VISIBILITY = "CREATE TABLE IF NOT EXISTS "
|
||||||
|
+ TABLE_IRPD_VISIBILITY
|
||||||
|
+ " ("
|
||||||
|
+ "KEY_ID"
|
||||||
|
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||||
|
+ KEY_STORE_ID
|
||||||
|
+ " INTEGER,"
|
||||||
|
+ KEY_VISIT_DATE
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ KEY_SAVE_MODE
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ KEY_CATEGORY_ID
|
||||||
|
+ " INTEGER,"
|
||||||
|
+ KEY_SUB_CATEGORY_ID
|
||||||
|
+ " INTEGER,"
|
||||||
|
+ KEY_SUB_CATEGORY_CODE
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ KEY_IRPD_VISIBILITY_MODIFY_IMAGES
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ KEY_TOGGLE_VALUE
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ KEY_IRPD_VISIBILITY_IMAGES
|
||||||
|
+ " VARCHAR)";
|
||||||
|
|
||||||
|
public static final String TABLE_WEBVIEW_TIME_SPENT = "WEBVIEW_TIME_SPENT";
|
||||||
|
public static final String CREATE_TABLE_WEBVIEW_TIME_SPENT = "CREATE TABLE IF NOT EXISTS "
|
||||||
|
+ TABLE_WEBVIEW_TIME_SPENT
|
||||||
|
+ " ("
|
||||||
|
+ "KEY_ID INTEGER PRIMARY KEY AUTOINCREMENT,"
|
||||||
|
+ "STORE_ID INTEGER,"
|
||||||
|
+ "VISIT_DATE VARCHAR,"
|
||||||
|
+ "START_TIME VARCHAR,"
|
||||||
|
+ "END_TIME VARCHAR,"
|
||||||
|
+ "DURATION VARCHAR,"
|
||||||
|
+ "DETAILER_ID INTEGER,"
|
||||||
|
+ "USER_ID VARCHAR,"
|
||||||
|
+ "DT_LEVEL VARCHAR,"
|
||||||
|
+ "CATEGORY_ID INTEGER)";
|
||||||
|
|
||||||
public static final String BACKUP_FOLDER_NAME = "HaleonMT_Backup";
|
public static final String BACKUP_FOLDER_NAME = "HaleonMT_Backup";
|
||||||
public static final String IMAGE_FOLDER_NAME = "HaleonMT_Images";
|
public static final String IMAGE_FOLDER_NAME = "HaleonMT_Images";
|
||||||
public static final String Download_IMAGE_FOLDER = "Downloaded_HaleonMT_Images";
|
public static final String Download_IMAGE_FOLDER = "Downloaded_HaleonMT_Images";
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package cpm.com.gskmtorange.constant
|
package cpm.com.gskmtorange.constant
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.net.Uri
|
import android.util.Log
|
||||||
import android.util.Patterns
|
import android.util.Patterns
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
|
import androidx.core.net.toUri
|
||||||
import androidx.swiperefreshlayout.widget.CircularProgressDrawable
|
import androidx.swiperefreshlayout.widget.CircularProgressDrawable
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
import com.bumptech.glide.Priority
|
import com.bumptech.glide.Priority
|
||||||
@@ -13,10 +14,10 @@ import com.sj.camera_lib_android.utils.CameraSDK.init
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
object CommonUtils {
|
object CommonUtils {
|
||||||
fun initializePDSDK(context: Context?, _userId: String?) {
|
fun initializePDSDK(context: Context?,projectId:String, _userId: String?) {
|
||||||
if (context != null) {
|
if (context != null) {
|
||||||
if (_userId != null) {
|
if (_userId != null) {
|
||||||
init(context, CommonString.PD_PROJECT_iD, _userId)
|
init(context = context, projectId = projectId, userId = _userId,uploadToSWServer = true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -30,7 +31,6 @@ object CommonUtils {
|
|||||||
val options: RequestOptions =
|
val options: RequestOptions =
|
||||||
RequestOptions().centerCrop().placeholder(circularProgressDrawable).error(resId)
|
RequestOptions().centerCrop().placeholder(circularProgressDrawable).error(resId)
|
||||||
.diskCacheStrategy(DiskCacheStrategy.ALL).priority(Priority.HIGH)
|
.diskCacheStrategy(DiskCacheStrategy.ALL).priority(Priority.HIGH)
|
||||||
|
|
||||||
Glide.with(context).load(url).apply(options).into(imgView)
|
Glide.with(context).load(url).apply(options).into(imgView)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,18 +39,14 @@ object CommonUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun deleteSpecificImage(context: Context,filePath: String?) {
|
fun deleteSpecificImage(context: Context,filePath: String?) {
|
||||||
val file = File(context.filesDir, "")
|
|
||||||
if (!filePath.isNullOrEmpty()) {
|
if (!filePath.isNullOrEmpty()) {
|
||||||
val file = File(filePath)
|
val file = File(filePath)
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
val directory = file.parent // Get the directory path
|
val isDeleted = file.delete()
|
||||||
val imageName = file.name // Get the image file name
|
if (isDeleted) {
|
||||||
println("Directory: $directory")
|
Log.d("deletefile","File deleted successfully");
|
||||||
println("Image Name: $imageName")
|
|
||||||
if (file.delete()) {
|
|
||||||
println("File deleted successfully: $filePath")
|
|
||||||
} else {
|
} else {
|
||||||
println("Failed to delete file: $filePath")
|
println("Failed to delete file")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
println("File does not exist: $filePath")
|
println("File does not exist: $filePath")
|
||||||
@@ -59,7 +55,7 @@ object CommonUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun deleteImage(context: Context, filePath: String) {
|
fun deleteImage(context: Context, filePath: String) {
|
||||||
val uri = Uri.parse(filePath)
|
val uri = filePath.toUri()
|
||||||
val contentResolver = context.contentResolver
|
val contentResolver = context.contentResolver
|
||||||
val deleted = contentResolver.delete(uri, null, null)
|
val deleted = contentResolver.delete(uri, null, null)
|
||||||
if (deleted > 0) {
|
if (deleted > 0) {
|
||||||
|
|||||||
+29
-192
@@ -1,5 +1,6 @@
|
|||||||
package cpm.com.gskmtorange.dailyentry;
|
package cpm.com.gskmtorange.dailyentry;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
@@ -219,8 +220,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
|
||||||
switch (parent.getId()) {
|
if (parent.getId() == R.id.sp_sub_category) {
|
||||||
case R.id.sp_sub_category:
|
|
||||||
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
sub_category = sub_category_list.get(position).getSub_category();
|
sub_category = sub_category_list.get(position).getSub_category();
|
||||||
@@ -233,18 +233,15 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
brand_select.setBRAND(str);
|
brand_select.setBRAND(str);
|
||||||
brand_select.setBRAND_ID("0");
|
brand_select.setBRAND_ID("0");
|
||||||
brand_list.add(0, brand_select);
|
brand_list.add(0, brand_select);
|
||||||
CustomBrandAdapter adapter = new CustomBrandAdapter(AdditionalPromoSKUwiseActivity.this, R.layout.custom_spinner_item, brand_list);
|
|
||||||
|
|
||||||
|
CustomBrandAdapter adapter = new CustomBrandAdapter(AdditionalPromoSKUwiseActivity.this, R.layout.custom_spinner_item, brand_list);
|
||||||
spinner_brand_list.setAdapter(adapter);
|
spinner_brand_list.setAdapter(adapter);
|
||||||
spinner_brand_list.setOnItemSelectedListener(this);
|
spinner_brand_list.setOnItemSelectedListener(this);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
clearBrandSpinner();
|
clearBrandSpinner();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (parent.getId() == R.id.sp_brand) {
|
||||||
|
|
||||||
case R.id.sp_brand:
|
|
||||||
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
brand = brand_list.get(position).getBRAND().get(0);
|
brand = brand_list.get(position).getBRAND().get(0);
|
||||||
@@ -257,46 +254,32 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
sku_select.setSKU(str);
|
sku_select.setSKU(str);
|
||||||
sku_select.setSKU_ID("0");
|
sku_select.setSKU_ID("0");
|
||||||
sku_list.add(0, sku_select);
|
sku_list.add(0, sku_select);
|
||||||
CustomSkuAdapter adapter = new CustomSkuAdapter(AdditionalPromoSKUwiseActivity.this, R.layout.custom_spinner_item, sku_list);
|
|
||||||
|
|
||||||
|
CustomSkuAdapter adapter = new CustomSkuAdapter(AdditionalPromoSKUwiseActivity.this, R.layout.custom_spinner_item, sku_list);
|
||||||
spinner_sku_list.setAdapter(adapter);
|
spinner_sku_list.setAdapter(adapter);
|
||||||
spinner_sku_list.setOnItemSelectedListener(this);
|
spinner_sku_list.setOnItemSelectedListener(this);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
clearSkuSpinner();
|
clearSkuSpinner();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (parent.getId() == R.id.sp_sku) {
|
||||||
|
|
||||||
case R.id.sp_sku:
|
|
||||||
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
sku = sku_list.get(position).getSKU().get(0);
|
sku = sku_list.get(position).getSKU().get(0);
|
||||||
sku_id = sku_list.get(position).getSKU_ID().get(0);
|
sku_id = sku_list.get(position).getSKU_ID().get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (parent.getId() == R.id.sp_flasher) {
|
||||||
|
|
||||||
case R.id.sp_flasher:
|
|
||||||
|
|
||||||
switch (position) {
|
|
||||||
|
|
||||||
case 0:
|
|
||||||
|
|
||||||
|
if (position == 0) {
|
||||||
price_flasher_available = -1;
|
price_flasher_available = -1;
|
||||||
break;
|
} else if (position == 1) {
|
||||||
|
|
||||||
case 1:
|
|
||||||
price_flasher_available = 1;
|
price_flasher_available = 1;
|
||||||
break;
|
} else if (position == 2) {
|
||||||
|
|
||||||
case 2:
|
|
||||||
price_flasher_available = 0;
|
price_flasher_available = 0;
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -336,9 +319,7 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
|
|
||||||
switch (id) {
|
if (id == R.id.fab) {
|
||||||
|
|
||||||
case R.id.fab:
|
|
||||||
|
|
||||||
boolean valid_flag = true;
|
boolean valid_flag = true;
|
||||||
|
|
||||||
@@ -351,85 +332,25 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
if (!valid_flag) {
|
if (!valid_flag) {
|
||||||
Snackbar.make(rec_added_promo, R.string.title_activity_Want_add, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(rec_added_promo, R.string.title_activity_Want_add, Snackbar.LENGTH_SHORT).show();
|
||||||
} else if (isdata_added) {
|
} else if (isdata_added) {
|
||||||
|
|
||||||
db.InsertPromoSKUwiseData(added_promo_list, categoryId, store_id, isExists);
|
db.InsertPromoSKUwiseData(added_promo_list, categoryId, store_id, isExists);
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
|
||||||
/*String promotion_sku_wise_data_xml = "", add_promotion_data_xml = "", exists_xml = "", add_xml = "";
|
|
||||||
|
|
||||||
db.open();
|
|
||||||
ArrayList<PromoComplianceSkuwiseGetterSetter> promoComplianceSkuwiseGetterSetters, promoComplianceSkuwiseExistsGetterSetters;
|
|
||||||
promoComplianceSkuwiseExistsGetterSetters = db.getPromoComplianceSkuwiseExistsAfterData(store_id, null);
|
|
||||||
if (promoComplianceSkuwiseExistsGetterSetters.size() > 0) {
|
|
||||||
|
|
||||||
for (int l = 0; l < promoComplianceSkuwiseExistsGetterSetters.size(); l++) {
|
|
||||||
|
|
||||||
promoComplianceSkuwiseGetterSetters = db.getPromoComplianceSkuwiseAfterData(promoComplianceSkuwiseExistsGetterSetters.get(l).get_id(), null);
|
|
||||||
|
|
||||||
for (int i1 = 0; i1 < promoComplianceSkuwiseGetterSetters.size(); i1++) {
|
|
||||||
if (!promoComplianceSkuwiseGetterSetters.get(i1).getCategory_id().equals("0")) {
|
|
||||||
|
|
||||||
String discount_val = promoComplianceSkuwiseGetterSetters.get(i1).getDiscount_value();
|
|
||||||
if (discount_val.equals("")) {
|
|
||||||
discount_val = "0";
|
|
||||||
}
|
|
||||||
|
|
||||||
add_xml = "[PROMOTION_DATA]"
|
|
||||||
+ "[MID]" + "0" + "[/MID]"
|
|
||||||
+ "[USER_ID]" + username + "[/USER_ID]"
|
|
||||||
+ "[CATEGORY_ID]" + Integer.parseInt(promoComplianceSkuwiseGetterSetters.get(i1).getCategory_id()) + "[/CATEGORY_ID]"
|
|
||||||
+ "[SUB_CATEGORY_ID]" + Integer.parseInt(promoComplianceSkuwiseGetterSetters.get(i1).getSub_category_id()) + "[/SUB_CATEGORY_ID]"
|
|
||||||
+ "[SKU_ID]" + Integer.parseInt(promoComplianceSkuwiseGetterSetters.get(i1).getSku_id()) + "[/SKU_ID]"
|
|
||||||
+ "[BRAND_ID]" + Integer.parseInt(promoComplianceSkuwiseGetterSetters.get(i1).getBrand_id()) + "[/BRAND_ID]"
|
|
||||||
+ "[DISCOUNT_VALUE]" + discount_val + "[/DISCOUNT_VALUE]"
|
|
||||||
+ "[PRICE]" + promoComplianceSkuwiseGetterSetters.get(i1).getPrice() + "[/PRICE]"
|
|
||||||
+ "[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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int exists = 0;
|
|
||||||
if (promoComplianceSkuwiseExistsGetterSetters.get(l).isExists()) {
|
|
||||||
exists = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
exists_xml = "[ADDITIONAL_PROMOTION_SKUWISE_DATA]"
|
|
||||||
+ "[MID]" + "0" + "[/MID]"
|
|
||||||
+ "[USER_ID]" + username + "[/USER_ID]"
|
|
||||||
+ "[CATEGORY_ID]" + Integer.parseInt(promoComplianceSkuwiseExistsGetterSetters.get(l).getCategory_id()) + "[/CATEGORY_ID]"
|
|
||||||
+ "[IS_EXISTS]" + exists + "[/IS_EXISTS]"
|
|
||||||
+ "[ADDITIONAL_PROMOTION_DATA]" + add_promotion_data_xml + "[/ADDITIONAL_PROMOTION_DATA]"
|
|
||||||
+ "[/ADDITIONAL_PROMOTION_SKUWISE_DATA]";
|
|
||||||
|
|
||||||
promotion_sku_wise_data_xml = promotion_sku_wise_data_xml + exists_xml;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
final String sos_xml = "[DATA]" + promotion_sku_wise_data_xml + "[/DATA]";
|
|
||||||
Log.d("sosdata", sos_xml);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.fab_add) {
|
||||||
|
|
||||||
case R.id.fab_add:
|
|
||||||
discount = et_discount.getText().toString();
|
discount = et_discount.getText().toString();
|
||||||
price = et_price.getText().toString();
|
price = et_price.getText().toString();
|
||||||
|
|
||||||
if (sub_category.equals("")) {
|
if (sub_category.equals("")) {
|
||||||
Snackbar.make(rec_added_promo, R.string.pls_select_sub_category, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(rec_added_promo, R.string.pls_select_sub_category, Snackbar.LENGTH_SHORT).show();
|
||||||
} else if (brand.equals("")) {
|
} else if (brand.equals("")) {
|
||||||
Snackbar.make(rec_added_promo, R.string.pls_select_brand, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(rec_added_promo, R.string.pls_select_brand, Snackbar.LENGTH_SHORT).show();
|
||||||
} else if (sku.equals("")) {
|
} else if (sku.equals("")) {
|
||||||
Snackbar.make(rec_added_promo, R.string.pls_select_sku, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(rec_added_promo, R.string.pls_select_sku, Snackbar.LENGTH_SHORT).show();
|
||||||
}/*else if(discount.equals("")){
|
} else if (price.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();
|
Snackbar.make(rec_added_promo, R.string.pls_enter_price, Snackbar.LENGTH_SHORT).show();
|
||||||
} else if (!price.equals("") && price.substring(0, 1).equals(".")) {
|
} else if (!price.equals("") && price.substring(0, 1).equals(".")) {
|
||||||
Snackbar.make(rec_added_promo, R.string.incorrect_price, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(rec_added_promo, R.string.incorrect_price, Snackbar.LENGTH_SHORT).show();
|
||||||
@@ -478,44 +399,37 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
} else {
|
} else {
|
||||||
img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
}
|
}
|
||||||
|
|
||||||
isdata_added = true;
|
isdata_added = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.img_promotion_add) {
|
||||||
|
|
||||||
case R.id.img_promotion_add:
|
|
||||||
|
|
||||||
_pathforcheck = "Additional_Promo_Skuwise_Image" + store_id + categoryId + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck = "Additional_Promo_Skuwise_Image" + store_id + categoryId + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(1);
|
startCameraActivity(1);
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.btntoggle:
|
} else if (id == R.id.btntoggle) {
|
||||||
|
|
||||||
isExists = btntoggle.isChecked();
|
isExists = btntoggle.isChecked();
|
||||||
|
|
||||||
if (isExists) {
|
if (isExists) {
|
||||||
lin_parent.setVisibility(View.VISIBLE);
|
lin_parent.setVisibility(View.VISIBLE);
|
||||||
fab_add.show();//.setVisibility(View.VISIBLE);
|
fab_add.show();
|
||||||
} else {
|
} else {
|
||||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AdditionalPromoSKUwiseActivity.this);
|
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AdditionalPromoSKUwiseActivity.this);
|
||||||
builder.setTitle("Parinaam");
|
builder.setTitle("Parinaam");
|
||||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false).setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
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) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
fab_add.hide();
|
||||||
fab_add.hide();//.setVisibility(View.GONE);
|
|
||||||
added_promo_list.clear();
|
added_promo_list.clear();
|
||||||
|
|
||||||
rec_added_promo.setLayoutManager(new LinearLayoutManager(context));
|
rec_added_promo.setLayoutManager(new LinearLayoutManager(context));
|
||||||
promoAdapter = new PromoAdapter(added_promo_list);
|
promoAdapter = new PromoAdapter(added_promo_list);
|
||||||
rec_added_promo.setAdapter(promoAdapter);
|
rec_added_promo.setAdapter(promoAdapter);
|
||||||
|
|
||||||
/* if(promoAdapter!=null){
|
|
||||||
promoAdapter.list.clear();
|
|
||||||
promoAdapter.notifyDataSetChanged();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
lin_parent.setVisibility(View.GONE);
|
lin_parent.setVisibility(View.GONE);
|
||||||
|
|
||||||
sub_category = "";
|
sub_category = "";
|
||||||
@@ -533,25 +447,26 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
spinner_sub_category_list.setSelection(0);
|
spinner_sub_category_list.setSelection(0);
|
||||||
clearBrandSpinner();
|
clearBrandSpinner();
|
||||||
clearSkuSpinner();
|
clearSkuSpinner();
|
||||||
|
|
||||||
if (is_camera_compulsory) {
|
if (is_camera_compulsory) {
|
||||||
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
||||||
} else {
|
} else {
|
||||||
img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
}
|
}
|
||||||
isdata_added = true;
|
|
||||||
|
|
||||||
|
isdata_added = true;
|
||||||
}
|
}
|
||||||
}).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
})
|
||||||
|
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
//checkBox.setChecked(true);
|
|
||||||
btntoggle.setChecked(true);
|
btntoggle.setChecked(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
android.app.AlertDialog alert = builder.create();
|
android.app.AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -877,90 +792,12 @@ public class AdditionalPromoSKUwiseActivity extends AppCompatActivity implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("MissingSuperCall")
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
ischanged();
|
ischanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
|
||||||
getMenuInflater().inflate(R.menu.menu_promo_skuwise, menu);
|
|
||||||
|
|
||||||
final CheckBox checkBox = (CheckBox) menu.findItem(R.id.menuShowDue).getActionView();
|
|
||||||
checkBox.setText(R.string.exists);
|
|
||||||
checkBox.setChecked(isExists);
|
|
||||||
|
|
||||||
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
||||||
@Override
|
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
|
||||||
isExists = isChecked;
|
|
||||||
|
|
||||||
if(isExists){
|
|
||||||
lin_parent.setVisibility(View.VISIBLE);
|
|
||||||
fab_add.show();//.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AdditionalPromoSKUwiseActivity.this);
|
|
||||||
builder.setTitle("Parinaam");
|
|
||||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
|
||||||
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
|
|
||||||
fab_add.hide();//.setVisibility(View.GONE);
|
|
||||||
added_promo_list.clear();
|
|
||||||
|
|
||||||
rec_added_promo.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
|
|
||||||
promoAdapter = new PromoAdapter(added_promo_list);
|
|
||||||
rec_added_promo.setAdapter(promoAdapter);
|
|
||||||
|
|
||||||
*//* if(promoAdapter!=null){
|
|
||||||
promoAdapter.list.clear();
|
|
||||||
promoAdapter.notifyDataSetChanged();
|
|
||||||
}*//*
|
|
||||||
|
|
||||||
lin_parent.setVisibility(View.GONE);
|
|
||||||
|
|
||||||
sub_category = "";
|
|
||||||
sub_category_id = "0";
|
|
||||||
brand= "";
|
|
||||||
brand_id = "0";
|
|
||||||
sku = "";
|
|
||||||
sku_id = "0";
|
|
||||||
discount = "";
|
|
||||||
price = "";
|
|
||||||
img_str = "";
|
|
||||||
|
|
||||||
et_discount.setText("");
|
|
||||||
et_price.setText("");
|
|
||||||
spinner_sub_category_list.setSelection(0);
|
|
||||||
clearBrandSpinner();
|
|
||||||
clearSkuSpinner();
|
|
||||||
if(is_camera_compulsory){
|
|
||||||
img_cam.setBackgroundResource(R.drawable.camera_orange_star_green);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
|
||||||
}
|
|
||||||
isdata_added = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
|
||||||
checkBox.setChecked(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
android.app.AlertDialog alert = builder.create();
|
|
||||||
alert.show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
// Handle action bar item clicks here. The action bar will
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
|||||||
+40
-393
@@ -1,5 +1,6 @@
|
|||||||
package cpm.com.gskmtorange.dailyentry;
|
package cpm.com.gskmtorange.dailyentry;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@@ -41,6 +42,7 @@ import android.widget.Spinner;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.ToggleButton;
|
import android.widget.ToggleButton;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import androidx.cardview.widget.CardView;
|
import androidx.cardview.widget.CardView;
|
||||||
@@ -82,7 +84,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
ArrayList<AdditionalDialogGetterSetter> defdata = new ArrayList<AdditionalDialogGetterSetter>();
|
ArrayList<AdditionalDialogGetterSetter> defdata = new ArrayList<AdditionalDialogGetterSetter>();
|
||||||
Spinner spinner_brand, spinner_sku;
|
Spinner spinner_brand, spinner_sku;
|
||||||
Spinner spinner_brand_list, spinner_sku_list;
|
Spinner spinner_brand_list, spinner_sku_list;
|
||||||
|
String subcatid = "", subcat= "", subcatEng= "";
|
||||||
AdditionalDialogGetterSetter additionalgeetersetter;
|
AdditionalDialogGetterSetter additionalgeetersetter;
|
||||||
public static ArrayList<AddittionalGetterSetter> data = new ArrayList<AddittionalGetterSetter>();
|
public static ArrayList<AddittionalGetterSetter> data = new ArrayList<AddittionalGetterSetter>();
|
||||||
ToggleButton btntoggle;
|
ToggleButton btntoggle;
|
||||||
@@ -139,9 +141,9 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
store_type_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
store_type_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||||
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||||
key_account_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
key_account_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||||
|
|
||||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||||
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
||||||
|
Log.e("camera_allow", camera_allow + " CountryId - " + country_id);
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
@@ -223,20 +225,16 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
spinner_sku_list.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
spinner_sku_list.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
|
|
||||||
img_planogram.setEnabled(true);
|
img_planogram.setEnabled(true);
|
||||||
sku_list_name = DisplayMaster_list.get(position).getDISPLAY().get(0);
|
sku_list_name = DisplayMaster_list.get(position).getDISPLAY().get(0);
|
||||||
sku_list_id = DisplayMaster_list.get(position).getDISPLAY_ID().get(0);
|
sku_list_id = DisplayMaster_list.get(position).getDISPLAY_ID().get(0);
|
||||||
display_planogram_url = DisplayMaster_list.get(position).getIMAGE_PATH().get(0) + DisplayMaster_list.get(position).getIMAGE_URL().get(0);
|
display_planogram_url = DisplayMaster_list.get(position).getIMAGE_PATH().get(0) + DisplayMaster_list.get(position).getIMAGE_URL().get(0);
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
img_planogram.setEnabled(false);
|
img_planogram.setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNothingSelected(AdapterView<?> parent) {
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
|
|
||||||
@@ -246,25 +244,10 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
/// maintable
|
/// maintable
|
||||||
|
|
||||||
listdata = db.getAdditionalMainStock(store_id, categoryId);
|
listdata = db.getAdditionalMainStock(store_id, categoryId);
|
||||||
|
|
||||||
for (int k = 0; k < listdata.size(); k++) {
|
for (int k = 0; k < listdata.size(); k++) {
|
||||||
listdata.get(k).setSkuDialogList(db.getDialogStock(listdata.get(k).getKey_id()));
|
listdata.get(k).setSkuDialogList(db.getDialogStock(listdata.get(k).getKey_id()));
|
||||||
|
|
||||||
String tooglevalue = listdata.get(k).getBtn_toogle();
|
String tooglevalue = listdata.get(k).getBtn_toogle();
|
||||||
|
|
||||||
/*if (tooglevalue.equalsIgnoreCase("0")) {
|
|
||||||
btnaddlayout.setVisibility(View.INVISIBLE);
|
|
||||||
cardvew.setVisibility(View.INVISIBLE);
|
|
||||||
listviewlay.setVisibility(View.INVISIBLE);
|
|
||||||
|
|
||||||
maincard.setVisibility(View.INVISIBLE);
|
|
||||||
btntoggle.setChecked(false);
|
|
||||||
brandlayout.setVisibility(View.GONE);
|
|
||||||
diaplylayout.setVisibility(View.INVISIBLE);
|
|
||||||
cameralayout.setVisibility(View.INVISIBLE);
|
|
||||||
btnsku.setVisibility(View.INVISIBLE);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if (tooglevalue.equalsIgnoreCase("0")) {
|
if (tooglevalue.equalsIgnoreCase("0")) {
|
||||||
listviewlay.setVisibility(View.INVISIBLE);
|
listviewlay.setVisibility(View.INVISIBLE);
|
||||||
//btnaddlayout.setVisibility(View.INVISIBLE);
|
//btnaddlayout.setVisibility(View.INVISIBLE);
|
||||||
@@ -283,126 +266,16 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
fab_add.show();
|
fab_add.show();
|
||||||
listviewlay.setVisibility(View.VISIBLE);
|
listviewlay.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* String KeyID = listdata.get(k).getKey_id();
|
|
||||||
|
|
||||||
uploadlist = db.getDialogStock(KeyID);*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* listdata = db.getAdditionalStock(store_id, categoryId);
|
|
||||||
|
|
||||||
for (int k = 0; k < listdata.size(); k++) {
|
|
||||||
|
|
||||||
String tooglevalue = listdata.get(k).getBtn_toogle();
|
|
||||||
|
|
||||||
if (tooglevalue.equalsIgnoreCase("0")) {
|
|
||||||
btnaddlayout.setVisibility(View.INVISIBLE);
|
|
||||||
cardvew.setVisibility(View.INVISIBLE);
|
|
||||||
listviewlay.setVisibility(View.INVISIBLE);
|
|
||||||
|
|
||||||
maincard.setVisibility(View.INVISIBLE);
|
|
||||||
btntoggle.setChecked(false);
|
|
||||||
brandlayout.setVisibility(View.GONE);
|
|
||||||
diaplylayout.setVisibility(View.INVISIBLE);
|
|
||||||
cameralayout.setVisibility(View.INVISIBLE);
|
|
||||||
btnsku.setVisibility(View.INVISIBLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
/*if (listdata.size() > 0) {
|
|
||||||
for (int i = 0; i < listdata.size(); i++) {
|
|
||||||
if (listdata.get(i).getBtn_toogle().equalsIgnoreCase("0")) {
|
|
||||||
listviewlay.setVisibility(View.INVISIBLE);
|
|
||||||
maincard.setVisibility(View.INVISIBLE);
|
|
||||||
cardvew.setVisibility(View.INVISIBLE);
|
|
||||||
btnaddlayout.setVisibility(View.INVISIBLE);
|
|
||||||
} else {
|
|
||||||
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
|
||||||
listviewlay.setAdapter(adapteradditional);
|
|
||||||
listviewlay.invalidateViews();
|
|
||||||
btnaddlayout.setVisibility(View.VISIBLE);
|
|
||||||
cardvew.setVisibility(View.VISIBLE);
|
|
||||||
listviewlay.setVisibility(View.VISIBLE);
|
|
||||||
maincard.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
fab.setOnClickListener(new View.OnClickListener() {
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
if (togglevalue.equals("1")) {
|
if (togglevalue.equals("1")) {
|
||||||
|
|
||||||
//listdata = db.getAdditionalStock(store_id, categoryId);
|
|
||||||
|
|
||||||
if (listdata.size() > 0) {
|
if (listdata.size() > 0) {
|
||||||
|
|
||||||
db.deleteStockEntryMainTable(store_id, categoryId);
|
db.deleteStockEntryMainTable(store_id, categoryId);
|
||||||
|
|
||||||
db.InsertMainListAdditionalData(listdata, categoryId);
|
db.InsertMainListAdditionalData(listdata, categoryId);
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
|
||||||
/* AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
|
||||||
AdditionalVisibility.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) {
|
|
||||||
|
|
||||||
db.deleteStockEntryMainTable(store_id, categoryId);
|
|
||||||
|
|
||||||
*//*for (int J = 0; J < listdata.size(); J++) {
|
|
||||||
newadd = new AddittionalGetterSetter();
|
|
||||||
newadd.setBrand(listdata.get(J).getBrand_id());
|
|
||||||
newadd.setBrand_id(listdata.get(J).getBrand_id());
|
|
||||||
newadd.setImage(listdata.get(J).getImage());
|
|
||||||
newadd.setImage2(listdata.get(J).getImage2());
|
|
||||||
newadd.setImage3(listdata.get(J).getImage3());
|
|
||||||
newadd.setSku(listdata.get(J).getSku());
|
|
||||||
newadd.setSku_id(listdata.get(J).getSku_id());
|
|
||||||
newadd.setStore_id(listdata.get(J).getStore_id());
|
|
||||||
newadd.setBtn_toogle(listdata.get(J).getBtn_toogle());
|
|
||||||
newadd.setCategoryId(listdata.get(J).getCategoryId());
|
|
||||||
String KeyID = listdata.get(J).getKey_id();
|
|
||||||
|
|
||||||
//additionalVisibilitySkuList = db.getDialogStock(KeyID);
|
|
||||||
|
|
||||||
db.InsertMainListAdditionalData(listdata, additionalVisibilitySkuList, categoryId);
|
|
||||||
|
|
||||||
KeyID = "";
|
|
||||||
additionalVisibilitySkuList.clear();
|
|
||||||
}*//*
|
|
||||||
db.InsertMainListAdditionalData(listdata, 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) {
|
|
||||||
// if this button is clicked, just close
|
|
||||||
// the dialog box and do nothing
|
|
||||||
dialog.cancel();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// create alert dialog
|
|
||||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
|
||||||
|
|
||||||
// show it
|
|
||||||
alertDialog.show();*/
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(view, getResources().getString(R.string.title_activity_Want_add), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(view, getResources().getString(R.string.title_activity_Want_add), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
}
|
}
|
||||||
@@ -410,7 +283,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
db.deleteStockEntryMainTable(store_id, categoryId);
|
db.deleteStockEntryMainTable(store_id, categoryId);
|
||||||
|
|
||||||
listdata.clear();
|
listdata.clear();
|
||||||
|
|
||||||
newadd = new AddittionalGetterSetter();
|
newadd = new AddittionalGetterSetter();
|
||||||
newadd.setBrand("");
|
newadd.setBrand("");
|
||||||
newadd.setBrand_id("");
|
newadd.setBrand_id("");
|
||||||
@@ -419,88 +291,34 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
newadd.setImage3("");
|
newadd.setImage3("");
|
||||||
newadd.setSku("");
|
newadd.setSku("");
|
||||||
newadd.setSku_id("");
|
newadd.setSku_id("");
|
||||||
|
newadd.setSubCat("");
|
||||||
|
newadd.setSubCatId("");
|
||||||
newadd.setStore_id(store_id);
|
newadd.setStore_id(store_id);
|
||||||
newadd.setBtn_toogle(togglevalue);
|
newadd.setBtn_toogle(togglevalue);
|
||||||
newadd.setCategoryId(categoryId);
|
newadd.setCategoryId(categoryId);
|
||||||
|
|
||||||
listdata.add(newadd);
|
listdata.add(newadd);
|
||||||
|
|
||||||
db.InsertMainListAdditionalData(listdata, categoryId);
|
|
||||||
finish();
|
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
|
||||||
|
|
||||||
/* AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
|
||||||
AdditionalVisibility.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) {
|
|
||||||
|
|
||||||
|
|
||||||
db.deleteStockEntryMainTable(store_id, categoryId);
|
|
||||||
|
|
||||||
listdata.clear();
|
|
||||||
|
|
||||||
newadd = new AddittionalGetterSetter();
|
|
||||||
newadd.setBrand("");
|
|
||||||
newadd.setBrand_id("");
|
|
||||||
newadd.setImage("");
|
|
||||||
newadd.setImage2("");
|
|
||||||
newadd.setImage3("");
|
|
||||||
newadd.setSku("");
|
|
||||||
newadd.setSku_id("");
|
|
||||||
newadd.setStore_id(store_id);
|
|
||||||
newadd.setBtn_toogle(togglevalue);
|
|
||||||
newadd.setCategoryId(categoryId);
|
|
||||||
|
|
||||||
listdata.add(newadd);
|
|
||||||
|
|
||||||
db.InsertMainListAdditionalData(listdata, categoryId);
|
db.InsertMainListAdditionalData(listdata, categoryId);
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
})
|
|
||||||
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
// if this button is clicked, just close
|
|
||||||
// the dialog box and do nothing
|
|
||||||
dialog.cancel();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// create alert dialog
|
|
||||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
|
||||||
|
|
||||||
// show it
|
|
||||||
alertDialog.show();*/
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
fab_add.setOnClickListener(new View.OnClickListener() {
|
fab_add.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
// Log.d("subcatdata",subcat + ","+subcatid);
|
||||||
adGt = new AddittionalGetterSetter();
|
adGt = new AddittionalGetterSetter();
|
||||||
adGt.setBrand(brand_list_name);
|
adGt.setBrand(brand_list_name);
|
||||||
adGt.setBrand_id(brand_list_id);
|
adGt.setBrand_id(brand_list_id);
|
||||||
adGt.setImage(img_str1);
|
adGt.setImage(img_str1);
|
||||||
adGt.setImage2(img_str2);
|
adGt.setImage2(img_str2);
|
||||||
adGt.setImage3(img_str3);
|
adGt.setImage3(img_str3);
|
||||||
|
|
||||||
adGt.setSku(sku_list_name);
|
adGt.setSku(sku_list_name);
|
||||||
adGt.setSku_id(sku_list_id);
|
adGt.setSku_id(sku_list_id);
|
||||||
adGt.setStore_id(store_id);
|
adGt.setStore_id(store_id);
|
||||||
adGt.setBtn_toogle(togglevalue);
|
adGt.setBtn_toogle(togglevalue);
|
||||||
adGt.setCategoryId(categoryId);
|
adGt.setCategoryId(categoryId);
|
||||||
|
|
||||||
ArrayList<AdditionalDialogGetterSetter> listdataTemp = new ArrayList<>();
|
ArrayList<AdditionalDialogGetterSetter> listdataTemp = new ArrayList<>();
|
||||||
listdataTemp.addAll(defdata);
|
listdataTemp.addAll(defdata);
|
||||||
adGt.setSkuDialogList(listdataTemp);
|
adGt.setSkuDialogList(listdataTemp);
|
||||||
@@ -522,10 +340,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
//Adding data to existing parent list
|
//Adding data to existing parent list
|
||||||
listdata.add(adGt);
|
listdata.add(adGt);
|
||||||
editFlag = true;
|
editFlag = true;
|
||||||
|
|
||||||
clearViews();
|
clearViews();
|
||||||
|
|
||||||
|
|
||||||
//listdata = db.getAdditionalStock(store_id, categoryId);
|
//listdata = db.getAdditionalStock(store_id, categoryId);
|
||||||
if (listdata.size() > 0) {
|
if (listdata.size() > 0) {
|
||||||
for (int i = 0; i < listdata.size(); i++) {
|
for (int i = 0; i < listdata.size(); i++) {
|
||||||
@@ -572,114 +388,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
if (btntoggle.isChecked()) {
|
if (btntoggle.isChecked()) {
|
||||||
//listdata = db.getAdditionalStock(store_id, categoryId);
|
|
||||||
|
|
||||||
/*if (listdata.size() > 0) {
|
|
||||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
|
||||||
AdditionalVisibility.this);
|
|
||||||
// set title
|
|
||||||
alertDialogBuilder.setTitle(getResources().getString(R.string.dialog_title));
|
|
||||||
// set dialog message
|
|
||||||
alertDialogBuilder
|
|
||||||
.setMessage(getResources().getString(R.string.data_will_be_lost))
|
|
||||||
.setCancelable(false)
|
|
||||||
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
togglevalue = "1";
|
|
||||||
btntoggle.setChecked(true);
|
|
||||||
db.deleteStockEntryall(store_id, categoryId);
|
|
||||||
brandlayout.setVisibility(View.GONE);
|
|
||||||
diaplylayout.setVisibility(View.VISIBLE);
|
|
||||||
cameralayout.setVisibility(View.VISIBLE);
|
|
||||||
btnsku.setVisibility(View.VISIBLE);
|
|
||||||
btnaddlayout.setVisibility(View.VISIBLE);
|
|
||||||
cardvew.setVisibility(View.VISIBLE);
|
|
||||||
listviewlay.setVisibility(View.VISIBLE);
|
|
||||||
maincard.setVisibility(View.INVISIBLE);
|
|
||||||
|
|
||||||
listdata = db.getAdditionalStock(store_id, categoryId);
|
|
||||||
|
|
||||||
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
|
||||||
listviewlay.setAdapter(adapteradditional);
|
|
||||||
listviewlay.invalidateViews();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.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();
|
|
||||||
btntoggle.setChecked(false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// create alert dialog
|
|
||||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
|
||||||
// show it
|
|
||||||
alertDialog.show();
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
listMain = db.getAdditionalMainStock(store_id, categoryId);
|
|
||||||
|
|
||||||
if (listMain.size() > 0) {
|
|
||||||
|
|
||||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
|
||||||
AdditionalVisibility.this);
|
|
||||||
// set title
|
|
||||||
alertDialogBuilder.setTitle(getResources().getString(R.string.dialog_title));
|
|
||||||
// set dialog message
|
|
||||||
alertDialogBuilder
|
|
||||||
.setMessage(getResources().getString(R.string.data_will_be_lost))
|
|
||||||
.setCancelable(false)
|
|
||||||
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
db.deleteStockEntryall(store_id, categoryId);
|
|
||||||
togglevalue = "1";
|
|
||||||
btntoggle.setChecked(true);
|
|
||||||
brandlayout.setVisibility(View.GONE);
|
|
||||||
diaplylayout.setVisibility(View.VISIBLE);
|
|
||||||
cameralayout.setVisibility(View.VISIBLE);
|
|
||||||
btnsku.setVisibility(View.VISIBLE);
|
|
||||||
btnaddlayout.setVisibility(View.VISIBLE);
|
|
||||||
cardvew.setVisibility(View.VISIBLE);
|
|
||||||
listviewlay.setVisibility(View.INVISIBLE);
|
|
||||||
maincard.setVisibility(View.INVISIBLE);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.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();
|
|
||||||
btntoggle.setChecked(false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// create alert dialog
|
|
||||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
|
||||||
// show it
|
|
||||||
alertDialog.show();
|
|
||||||
|
|
||||||
} else {
|
|
||||||
togglevalue = "1";
|
|
||||||
btntoggle.setChecked(true);
|
|
||||||
brandlayout.setVisibility(View.GONE);
|
|
||||||
diaplylayout.setVisibility(View.VISIBLE);
|
|
||||||
cameralayout.setVisibility(View.VISIBLE);
|
|
||||||
btnsku.setVisibility(View.VISIBLE);
|
|
||||||
btnaddlayout.setVisibility(View.VISIBLE);
|
|
||||||
cardvew.setVisibility(View.VISIBLE);
|
|
||||||
listviewlay.setVisibility(View.INVISIBLE);
|
|
||||||
maincard.setVisibility(View.INVISIBLE);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
listdata.clear();
|
listdata.clear();
|
||||||
|
|
||||||
togglevalue = "1";
|
togglevalue = "1";
|
||||||
btntoggle.setChecked(true);
|
btntoggle.setChecked(true);
|
||||||
brandlayout.setVisibility(View.GONE);
|
brandlayout.setVisibility(View.GONE);
|
||||||
@@ -706,26 +415,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
//db.deleteStockEntryall(store_id, categoryId);
|
|
||||||
/* togglevalue = "0";
|
|
||||||
btntoggle.setChecked(false);
|
|
||||||
*/
|
|
||||||
//clear both parent and child data lists
|
|
||||||
//defdata.clear();
|
|
||||||
listdata.clear();
|
listdata.clear();
|
||||||
|
|
||||||
/* btnaddlayout.setVisibility(View.INVISIBLE);
|
|
||||||
brandlayout.setVisibility(View.GONE);
|
|
||||||
diaplylayout.setVisibility(View.INVISIBLE);
|
|
||||||
cameralayout.setVisibility(View.INVISIBLE);
|
|
||||||
btnsku.setVisibility(View.INVISIBLE);
|
|
||||||
maincard.setVisibility(View.INVISIBLE);*/
|
|
||||||
|
|
||||||
// listdata = db.getAdditionalStock(store_id, categoryId);
|
|
||||||
|
|
||||||
/* adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
|
||||||
listviewlay.setAdapter(adapteradditional);
|
|
||||||
listviewlay.invalidateViews();*/
|
|
||||||
togglevalue = "0";
|
togglevalue = "0";
|
||||||
btntoggle.setChecked(false);
|
btntoggle.setChecked(false);
|
||||||
defdata.clear();
|
defdata.clear();
|
||||||
@@ -738,7 +428,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
listviewlay.setVisibility(View.INVISIBLE);
|
listviewlay.setVisibility(View.INVISIBLE);
|
||||||
adapteradditional.notifyDataSetChanged();
|
adapteradditional.notifyDataSetChanged();
|
||||||
editFlag = true;
|
editFlag = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
||||||
@@ -788,59 +477,48 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
|
|
||||||
if (camera_allow.equals("1")) {
|
if (camera_allow.equals("1")) {
|
||||||
|
btnimage.setOnClickListener(view -> {
|
||||||
btnimage.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
_pathforcheck1 = store_id + categoryId + "AdditionalImage1" + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck1 = store_id + categoryId + "AdditionalImage1" + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck1;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck1;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
btnimage1.setOnClickListener(new View.OnClickListener() {
|
btnimage1.setOnClickListener(view -> {
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
_pathforcheck2 = store_id + categoryId + "AdditionalImage2" + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck2 = store_id + categoryId + "AdditionalImage2" + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck2;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck2;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
btnimage2.setOnClickListener(new View.OnClickListener() {
|
btnimage2.setOnClickListener(view -> {
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
_pathforcheck3 = store_id + categoryId + "AdditionalImage3" + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck3 = store_id + categoryId + "AdditionalImage3" + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck3;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck3;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
btnimage.setBackgroundResource(R.mipmap.camera_grey);
|
btnimage.setBackgroundResource(R.mipmap.camera_grey);
|
||||||
btnimage1.setBackgroundResource(R.mipmap.camera_grey);
|
btnimage1.setBackgroundResource(R.mipmap.camera_grey);
|
||||||
btnimage2.setBackgroundResource(R.mipmap.camera_grey);
|
btnimage2.setBackgroundResource(R.mipmap.camera_grey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// new changes by jp
|
||||||
btnsku.setOnClickListener(new View.OnClickListener() {
|
if (camera_allow.equals("1")) {
|
||||||
@Override
|
btnimage.setBackgroundResource(country_id.equals("6") ? R.mipmap.camera_orange_star_green : R.mipmap.camera_orange);
|
||||||
public void onClick(View view) {
|
btnimage1.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
showSkuDialog();
|
btnimage2.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
}
|
} else {
|
||||||
});
|
Log.d("camallow","false");
|
||||||
|
btnimage.setBackgroundResource(R.mipmap.camera_grey);
|
||||||
|
btnimage1.setBackgroundResource(R.mipmap.camera_grey);
|
||||||
|
btnimage2.setBackgroundResource(R.mipmap.camera_grey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
btnsku.setOnClickListener(view -> showSkuDialog());
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("MissingSuperCall")
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
//super.onBackPressed();
|
//super.onBackPressed();
|
||||||
@@ -867,8 +545,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
});
|
});
|
||||||
android.app.AlertDialog alert = builder.create();
|
android.app.AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
@@ -885,29 +562,21 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
sku_list_name = "";
|
sku_list_name = "";
|
||||||
sku_list_id = "";
|
sku_list_id = "";
|
||||||
defdata.clear();
|
defdata.clear();
|
||||||
|
|
||||||
btnsku.setBackgroundResource(R.color.colorPrimary);
|
btnsku.setBackgroundResource(R.color.colorPrimary);
|
||||||
|
|
||||||
if (camera_allow.equals("1")) {
|
if (camera_allow.equals("1")) {
|
||||||
btnimage.setBackgroundResource(R.drawable.camera_orange_star_green);
|
btnimage.setBackgroundResource(country_id.equals("6") ? R.mipmap.camera_orange_star_green : R.mipmap.camera_orange);
|
||||||
|
|
||||||
btnimage1.setBackgroundResource(R.mipmap.camera_orange);
|
btnimage1.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
btnimage2.setBackgroundResource(R.mipmap.camera_orange);
|
btnimage2.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
btnimage.setBackgroundResource(R.mipmap.camera_grey);
|
btnimage.setBackgroundResource(R.mipmap.camera_grey);
|
||||||
|
|
||||||
btnimage1.setBackgroundResource(R.mipmap.camera_grey);
|
btnimage1.setBackgroundResource(R.mipmap.camera_grey);
|
||||||
btnimage2.setBackgroundResource(R.mipmap.camera_grey);
|
btnimage2.setBackgroundResource(R.mipmap.camera_grey);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showPlanogram(String planogram_image) {
|
public void showPlanogram(String planogram_image) {
|
||||||
|
|
||||||
final Dialog dialog = new Dialog(AdditionalVisibility.this);
|
final Dialog dialog = new Dialog(AdditionalVisibility.this);
|
||||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
//dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
|
||||||
dialog.setContentView(R.layout.planogram_dialog_layout);
|
dialog.setContentView(R.layout.planogram_dialog_layout);
|
||||||
dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
||||||
dialog.setCancelable(false);
|
dialog.setCancelable(false);
|
||||||
@@ -923,20 +592,11 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
webView.getSettings().setJavaScriptEnabled(true);
|
webView.getSettings().setJavaScriptEnabled(true);
|
||||||
webView.getSettings().setBuiltInZoomControls(true);
|
webView.getSettings().setBuiltInZoomControls(true);
|
||||||
|
|
||||||
|
|
||||||
String html = "<html><head></head><body><img src=\"" + planogram_image + "\"></body></html>";
|
String html = "<html><head></head><body><img src=\"" + planogram_image + "\"></body></html>";
|
||||||
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
||||||
|
|
||||||
dialog.show();
|
dialog.show();
|
||||||
|
|
||||||
ImageView cancel = (ImageView) dialog.findViewById(R.id.img_cancel);
|
ImageView cancel = (ImageView) dialog.findViewById(R.id.img_cancel);
|
||||||
cancel.setOnClickListener(new View.OnClickListener() {
|
cancel.setOnClickListener(v -> dialog.dismiss());
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
//setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
|
||||||
dialog.dismiss();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1035,12 +695,13 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View getDropDownView(int position, View convertView, ViewGroup parent) {
|
public View getDropDownView(int position, View convertView, @NonNull ViewGroup parent) {
|
||||||
return getCustomView(position, convertView, parent);
|
return getCustomView(position, convertView, parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public View getView(int position, View convertView, ViewGroup parent) {
|
public View getView(int position, View convertView, @NonNull ViewGroup parent) {
|
||||||
return getCustomView(position, convertView, parent);
|
return getCustomView(position, convertView, parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1393,6 +1054,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
ab.setBrand(brand_name);
|
ab.setBrand(brand_name);
|
||||||
ab.setBrand_id(brand_id);
|
ab.setBrand_id(brand_id);
|
||||||
|
ab.setSubcat(subcat);
|
||||||
|
ab.setSubcatid(subcatid);
|
||||||
//ab.setDisplay_id(data.get(position).getDisplay_id());
|
//ab.setDisplay_id(data.get(position).getDisplay_id());
|
||||||
ab.setStore_id(store_id);
|
ab.setStore_id(store_id);
|
||||||
// ab.setUnique_id(data.get(position).getUnique_id());
|
// ab.setUnique_id(data.get(position).getUnique_id());
|
||||||
@@ -1410,6 +1073,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
Edt_txt.setText("");
|
Edt_txt.setText("");
|
||||||
SKU_ID = "";
|
SKU_ID = "";
|
||||||
SKU_name = "";
|
SKU_name = "";
|
||||||
|
subcatid="";
|
||||||
|
subcat="";
|
||||||
// list = db.getDialogStock(store_id);
|
// list = db.getDialogStock(store_id);
|
||||||
linearlay.setVisibility(View.VISIBLE);
|
linearlay.setVisibility(View.VISIBLE);
|
||||||
cardlay.setVisibility(View.VISIBLE);
|
cardlay.setVisibility(View.VISIBLE);
|
||||||
@@ -1445,14 +1110,14 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
brand_id = brandList.get(position).getBRAND_ID().get(0);
|
brand_id = brandList.get(position).getBRAND_ID().get(0);
|
||||||
brand_name = brandList.get(position).getBRAND().get(0);
|
brand_name = brandList.get(position).getBRAND().get(0);
|
||||||
|
subcatid = brandList.get(position).getSUB_CATEGORY_ID().get(0);
|
||||||
|
subcat = brandList.get(position).getSUB_CATEGORY().get(0);
|
||||||
|
|
||||||
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("11") || country_id.equals("17")) {
|
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("11") || country_id.equals("17")) {
|
||||||
sku_list = db.getSkuT2PData(null, null, null, brand_id, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
sku_list = db.getSkuT2PData(null, null, null, brand_id, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||||
}
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)){
|
|
||||||
sku_list = db.getSkuT2PData(store_type_id, class_id, key_account_id, brand_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
sku_list = db.getSkuT2PData(store_type_id, class_id, key_account_id, brand_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
sku_list = db.getSkuT2PData(store_type_id, class_id, key_account_id, brand_id, store_id, CommonString.TABLE_MAPPING_STOCK);
|
sku_list = db.getSkuT2PData(store_type_id, class_id, key_account_id, brand_id, store_id, CommonString.TABLE_MAPPING_STOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1639,10 +1304,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
holder.brand.setText(list.get(position1).getBrand().toString());
|
holder.brand.setText(list.get(position1).getBrand().toString());
|
||||||
holder.display.setText(list.get(position1).getSku_name().toString());
|
holder.display.setText(list.get(position1).getSku_name().toString());
|
||||||
|
|
||||||
holder.qty_bought.setText(list.get(position1).getQuantity());
|
holder.qty_bought.setText(list.get(position1).getQuantity());
|
||||||
|
|
||||||
|
|
||||||
holder.brand.setId(position1);
|
holder.brand.setId(position1);
|
||||||
holder.display.setId(position1);
|
holder.display.setId(position1);
|
||||||
holder.qty_bought.setId(position1);
|
holder.qty_bought.setId(position1);
|
||||||
@@ -1692,11 +1355,9 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
@Override
|
@Override
|
||||||
public View getView(final int position1, View convertView, ViewGroup parent) {
|
public View getView(final int position1, View convertView, ViewGroup parent) {
|
||||||
final ViewHolder holder;
|
final ViewHolder holder;
|
||||||
|
|
||||||
if (convertView == null) {
|
if (convertView == null) {
|
||||||
convertView = mInflater.inflate(R.layout.additionallistlayout, null);
|
convertView = mInflater.inflate(R.layout.additionallistlayout, null);
|
||||||
holder = new ViewHolder();
|
holder = new ViewHolder();
|
||||||
|
|
||||||
holder.brand = (TextView) convertView.findViewById(R.id.brand_name);
|
holder.brand = (TextView) convertView.findViewById(R.id.brand_name);
|
||||||
holder.display = (TextView) convertView.findViewById(R.id.display_name);
|
holder.display = (TextView) convertView.findViewById(R.id.display_name);
|
||||||
holder.qty_bought = (TextView) convertView.findViewById(R.id.qty_bought);
|
holder.qty_bought = (TextView) convertView.findViewById(R.id.qty_bought);
|
||||||
@@ -1708,7 +1369,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
|
|
||||||
holder.delete.setOnClickListener(new View.OnClickListener() {
|
holder.delete.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdditionalVisibility.this);
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdditionalVisibility.this);
|
||||||
@@ -1753,8 +1413,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
||||||
@@ -1782,10 +1440,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
boolean validateData(AddittionalGetterSetter data) {
|
boolean validateData(AddittionalGetterSetter data) {
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
|
|
||||||
String brandid = data.getBrand_id();
|
String brandid = data.getBrand_id();
|
||||||
String skuid = data.getSku_id();
|
String skuid = data.getSku_id();
|
||||||
|
|
||||||
String imageu = data.getImage();
|
String imageu = data.getImage();
|
||||||
String toggleid = data.getBtn_toogle();
|
String toggleid = data.getBtn_toogle();
|
||||||
ArrayList<AdditionalDialogGetterSetter> skuList = data.getSkuDialogList();
|
ArrayList<AdditionalDialogGetterSetter> skuList = data.getSkuDialogList();
|
||||||
@@ -1796,15 +1452,11 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
if (/*brandid.equalsIgnoreCase("") ||*/ skuid.equalsIgnoreCase("")) {
|
if (/*brandid.equalsIgnoreCase("") ||*/ skuid.equalsIgnoreCase("")) {
|
||||||
flag = false;
|
flag = false;
|
||||||
|
|
||||||
errormsg = getResources().getString(R.string.title_activity_select_dropdown);
|
errormsg = getResources().getString(R.string.title_activity_select_dropdown);
|
||||||
|
|
||||||
} else if (camera_allow.equals("1")) {
|
} else if (camera_allow.equals("1")) {
|
||||||
if (!country_id.equals("6") && (imageu == null || imageu.equalsIgnoreCase(""))) {
|
if ((imageu == null || imageu.equalsIgnoreCase(""))) {
|
||||||
flag = false;
|
flag = false;
|
||||||
|
|
||||||
errormsg = getResources().getString(R.string.title_activity_take_image);
|
errormsg = getResources().getString(R.string.title_activity_take_image);
|
||||||
|
|
||||||
} else if (skuList.size() == 0) {
|
} else if (skuList.size() == 0) {
|
||||||
errormsg = getResources().getString(R.string.title_activity_fill_sku);
|
errormsg = getResources().getString(R.string.title_activity_fill_sku);
|
||||||
flag = false;
|
flag = false;
|
||||||
@@ -1815,15 +1467,10 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
errormsg = getResources().getString(R.string.title_activity_fill_sku);
|
errormsg = getResources().getString(R.string.title_activity_fill_sku);
|
||||||
flag = false;
|
flag = false;
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,10 +19,14 @@ import android.text.InputFilter;
|
|||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.KeyEvent;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.view.inputmethod.EditorInfo;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
@@ -130,7 +134,6 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
for (int j = 0; j < childListData.size(); j++) {
|
for (int j = 0; j < childListData.size(); j++) {
|
||||||
answerList.add(childListData.get(j));
|
answerList.add(childListData.get(j));
|
||||||
}
|
}
|
||||||
|
|
||||||
hashMapAnsListChildData.put(question_list.get(i), answerList); // Header, Child data
|
hashMapAnsListChildData.put(question_list.get(i), answerList); // Header, Child data
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -514,7 +517,7 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
holder.edt_answer.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
/*holder.edt_answer.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onFocusChange(View v, boolean hasFocus) {
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
if (!hasFocus) {
|
if (!hasFocus) {
|
||||||
@@ -528,8 +531,66 @@ public class AuditActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});*/
|
||||||
|
|
||||||
|
|
||||||
|
holder.edt_answer.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
|
if (!hasFocus) {
|
||||||
|
EditText edit = (EditText) v;
|
||||||
|
String input = edit.getText().toString();
|
||||||
|
String cleanText;
|
||||||
|
|
||||||
|
// Clean text based on type
|
||||||
|
if (holder.data.getANSWER_TYPE().equalsIgnoreCase("NUMBER")) {
|
||||||
|
cleanText = input.replaceFirst("^0+.(?!$)", "");
|
||||||
|
} else {
|
||||||
|
cleanText = input.replaceAll("[&^<>{}'$]", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ✔ Prevent crash if ViewHolder is recycled
|
||||||
|
if (holder.getAdapterPosition() != RecyclerView.NO_POSITION) {
|
||||||
|
holder.data.setANSWER_ID("0");
|
||||||
|
holder.data.setANSWER(cleanText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*holder.edt_answer.setImeOptions(EditorInfo.IME_ACTION_NEXT);
|
||||||
|
holder.edt_answer.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_NEXT) {
|
||||||
|
|
||||||
|
View next = v.focusSearch(View.FOCUS_DOWN);
|
||||||
|
|
||||||
|
if (next != null) {
|
||||||
|
if (next instanceof EditText) {
|
||||||
|
// Focus next EditText, keyboard stays
|
||||||
|
next.requestFocus();
|
||||||
|
} else if (next instanceof Spinner) {
|
||||||
|
// Hide keyboard safely
|
||||||
|
InputMethodManager imm = (InputMethodManager) v.getContext()
|
||||||
|
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
if (imm != null) {
|
||||||
|
imm.hideSoftInputFromWindow(holder.edt_answer.getWindowToken(), 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Post the performClick to ensure it happens after keyboard hides
|
||||||
|
next.post(() -> next.performClick());
|
||||||
|
} else {
|
||||||
|
next.requestFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true; // consume action
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});*/
|
||||||
|
|
||||||
|
|
||||||
//set remark
|
//set remark
|
||||||
holder.edt_text.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
holder.edt_text.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,164 @@
|
|||||||
|
package cpm.com.gskmtorange.dailyentry
|
||||||
|
|
||||||
|
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.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.ImageView
|
||||||
|
import android.widget.TextView
|
||||||
|
import android.view.Menu
|
||||||
|
import android.view.MenuItem
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.bumptech.glide.Glide
|
||||||
|
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
|
||||||
|
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.xmlGetterSetter.MasterDetailerGetterSetter
|
||||||
|
import java.net.URLEncoder
|
||||||
|
|
||||||
|
class BannerActivity : AppCompatActivity() {
|
||||||
|
private lateinit var recyclerView: RecyclerView
|
||||||
|
var bannerlistnew: ArrayList<MasterDetailerGetterSetter>? = ArrayList()
|
||||||
|
|
||||||
|
private lateinit var preferences: SharedPreferences
|
||||||
|
private lateinit var db: GSKOrangeDB
|
||||||
|
private lateinit var countryId: String
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
setContentView(R.layout.activity_banner)
|
||||||
|
|
||||||
|
val toolbar: androidx.appcompat.widget.Toolbar = findViewById(R.id.toolbar)
|
||||||
|
setSupportActionBar(toolbar)
|
||||||
|
supportActionBar?.title = "Banner Dashboard"
|
||||||
|
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||||
|
toolbar.setNavigationOnClickListener {
|
||||||
|
onBackPressedDispatcher.onBackPressed()
|
||||||
|
}
|
||||||
|
|
||||||
|
recyclerView = findViewById(R.id.recyclerView)
|
||||||
|
recyclerView.layoutManager = LinearLayoutManager(this)
|
||||||
|
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this)
|
||||||
|
CommonFunctions.updateLangResources(this, preferences.getString(CommonString.KEY_LANGUAGE, ""))
|
||||||
|
countryId = preferences.getString(CommonString.KEY_COUNTRY_ID, "") ?: ""
|
||||||
|
|
||||||
|
db = GSKOrangeDB(this)
|
||||||
|
db.open()
|
||||||
|
val storetype = intent.getStringExtra("DT_LEVEL") ?: ""
|
||||||
|
val categoryId = intent.getStringExtra("CategoryId") ?: ""
|
||||||
|
|
||||||
|
bannerlistnew = db.getMasterDetailerData("MASTER_DETAILER",storetype,categoryId)
|
||||||
|
/*if(!categoryId.equals("0")){
|
||||||
|
bannerlistnew = db.getMasterDetailerData("MASTER_DETAILER",storetype,categoryId)
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
bannerlistnew = db.getMasterDetailerData("MASTER_DETAILER",storetype,"0")
|
||||||
|
}*/
|
||||||
|
|
||||||
|
Log.d("bannerlistkotlin", bannerlistnew?.size.toString())
|
||||||
|
|
||||||
|
bannerlistnew?.let {
|
||||||
|
if (it.isNotEmpty()) {
|
||||||
|
recyclerView.adapter = BannerListAdapter(it) { item -> handleClick(item) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||||
|
menuInflater.inflate(R.menu.banner_menu, menu)
|
||||||
|
return true
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/* override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
|
if (item.itemId == R.id.action_social_media) {
|
||||||
|
// Handle social media icon click
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item)
|
||||||
|
}*/
|
||||||
|
|
||||||
|
private fun handleClick(item: MasterDetailerGetterSetter) {
|
||||||
|
val url = if (item.dT_URL.isNotEmpty()) item.dT_URL[0] else ""
|
||||||
|
val type = "html-webview" // Default type as not specified in MASTER_DETAILER metadata
|
||||||
|
Log.e("clickdata", "URL = $url")
|
||||||
|
|
||||||
|
val storeId = preferences.getString(CommonString.KEY_STORE_ID, "") ?: ""
|
||||||
|
val merId = if (item.dtid.isNotEmpty()) item.dtid[0] else ""
|
||||||
|
val categoryId = intent.getStringExtra("CategoryId") ?: ""
|
||||||
|
val finalUrl = appendStoreMerQuery(url, storeId, merId)
|
||||||
|
val storetype = intent.getStringExtra("DT_LEVEL") ?: ""
|
||||||
|
Log.d("finalurl", finalUrl)
|
||||||
|
|
||||||
|
val webIntent = Intent(this, WebViewActivity::class.java).apply {
|
||||||
|
putExtra("url", finalUrl)
|
||||||
|
putExtra("type", type)
|
||||||
|
putExtra("storeid", storeId)
|
||||||
|
putExtra("merid", merId)
|
||||||
|
putExtra("categoryId", categoryId)
|
||||||
|
putExtra("dt_level", storetype)
|
||||||
|
}
|
||||||
|
startActivity(webIntent)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun appendStoreMerQuery(url: String?, storeId: String?, merId: String?): String {
|
||||||
|
if (url == null) return ""
|
||||||
|
return try {
|
||||||
|
val sb = StringBuilder(url)
|
||||||
|
var separator = if (url.contains("?")) "&" else "?"
|
||||||
|
if (!storeId.isNullOrEmpty()) {
|
||||||
|
sb.append(separator).append("storeid=").append(URLEncoder.encode(storeId, "UTF-8"))
|
||||||
|
separator = "&"
|
||||||
|
}
|
||||||
|
if (!merId.isNullOrEmpty()) {
|
||||||
|
sb.append(separator).append("merid=").append(URLEncoder.encode(merId, "UTF-8"))
|
||||||
|
}
|
||||||
|
sb.toString()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
|
url
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inner class BannerListAdapter(
|
||||||
|
private val list: List<MasterDetailerGetterSetter>,
|
||||||
|
private val listener: (MasterDetailerGetterSetter) -> Unit
|
||||||
|
) : RecyclerView.Adapter<BannerListAdapter.ViewHolder>() {
|
||||||
|
|
||||||
|
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||||
|
val image: ImageView = itemView.findViewById(R.id.imgThumbnail)
|
||||||
|
val name: TextView = itemView.findViewById(R.id.tvName)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||||
|
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_banner_list, parent, false)
|
||||||
|
return ViewHolder(view)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||||
|
val item = list[position]
|
||||||
|
// Accessing first element of internal list as per parinaam pattern
|
||||||
|
val url = if (item.dT_THUMBNAIL.isNotEmpty()) item.dT_THUMBNAIL[0] else ""
|
||||||
|
val displayName = if (item.dT_NAME.isNotEmpty()) item.dT_NAME[0] else ""
|
||||||
|
|
||||||
|
holder.name.text = displayName
|
||||||
|
|
||||||
|
Glide.with(holder.itemView.context)
|
||||||
|
.load(url)
|
||||||
|
.placeholder(R.mipmap.ic_launcher)
|
||||||
|
.transform(RoundedCorners(15))
|
||||||
|
.into(holder.image)
|
||||||
|
|
||||||
|
holder.itemView.setOnClickListener { listener(item) }
|
||||||
|
}
|
||||||
|
override fun getItemCount(): Int = list.size
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -167,68 +167,32 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
db.InsertCategoryPictureData(CP, listdat, categoryId);
|
db.InsertCategoryPictureData(CP, listdat, categoryId);
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
|
||||||
/* AlertDialog.Builder builder = new AlertDialog.Builder(CategoryPicture.this);
|
|
||||||
builder.setMessage(getResources().getString(R.string.check_save_message))
|
|
||||||
.setCancelable(false)
|
|
||||||
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
db.open();
|
|
||||||
|
|
||||||
db.InsertCategoryPictureData(CP, listdat, categoryId);
|
|
||||||
finish();
|
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
dialog.cancel();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
AlertDialog alert = builder.create();
|
|
||||||
alert.show();*/
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(view, R.string.title_activity_take_image, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(view, R.string.title_activity_take_image, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
im1.setOnClickListener(new View.OnClickListener() {
|
im1.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
|
|
||||||
_pathforcheck1 = store_id + "CategoryPicture1" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck1 = store_id + "CategoryPicture1" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck1;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck1;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
im2.setOnClickListener(view -> {
|
im2.setOnClickListener(view -> {
|
||||||
|
|
||||||
_pathforcheck2 = store_id + "CategoryPicture2" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck2 = store_id + "CategoryPicture2" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck2;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck2;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
});
|
});
|
||||||
im3.setOnClickListener(view -> {
|
im3.setOnClickListener(view -> {
|
||||||
|
|
||||||
_pathforcheck3 = store_id + "CategoryPicture3" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck3 = store_id + "CategoryPicture3" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck3;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck3;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
im4.setOnClickListener(view -> {
|
im4.setOnClickListener(view -> {
|
||||||
|
|
||||||
@@ -237,8 +201,6 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck4;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck4;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,36 +1,26 @@
|
|||||||
package cpm.com.gskmtorange.dailyentry;
|
package cpm.com.gskmtorange.dailyentry;
|
||||||
|
|
||||||
|
import static cpm.com.gskmtorange.constant.CommonFunctions.isInternetAvailable;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.res.Configuration;
|
|
||||||
import android.content.res.Resources;
|
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.view.View;
|
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
|
||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
import org.ksoap2.serialization.SoapObject;
|
import org.ksoap2.serialization.SoapObject;
|
||||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
import org.ksoap2.transport.HttpTransportSE;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
||||||
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||||
@@ -39,7 +29,8 @@ import cpm.com.gskmtorange.adapter.data.ImageUri;
|
|||||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.constant.CommonUtils;
|
import cpm.com.gskmtorange.constant.CommonUtils;
|
||||||
import cpm.com.gskmtorange.download.DownloadActivity;
|
import cpm.com.gskmtorange.upload.UploadActivity;
|
||||||
|
import cpm.com.gskmtorange.utils.OkHttpTransportSE;
|
||||||
|
|
||||||
public class CheckoutActivity extends AppCompatActivity {
|
public class CheckoutActivity extends AppCompatActivity {
|
||||||
private Context context;
|
private Context context;
|
||||||
@@ -73,8 +64,14 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
lat = getIntent().getStringExtra(CommonString.KEY_LATITUDE);
|
lat = getIntent().getStringExtra(CommonString.KEY_LATITUDE);
|
||||||
lon = getIntent().getStringExtra(CommonString.KEY_LONGITUDE);
|
lon = getIntent().getStringExtra(CommonString.KEY_LONGITUDE);
|
||||||
coverageBean = db.getCoverageSpecificData(visit_date, store_id);
|
coverageBean = db.getCoverageSpecificData(visit_date, store_id);
|
||||||
|
|
||||||
|
if(isInternetAvailable(context)){
|
||||||
new BackgroundTask(CheckoutActivity.this).execute();
|
new BackgroundTask(CheckoutActivity.this).execute();
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private class BackgroundTask extends AsyncTask<Void, Data, String> {
|
private class BackgroundTask extends AsyncTask<Void, Data, String> {
|
||||||
private Context context;
|
private Context context;
|
||||||
@@ -122,7 +119,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + service, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + service, envelope);
|
||||||
|
|
||||||
Object result = (Object) envelope.getResponse();
|
Object result = (Object) envelope.getResponse();
|
||||||
@@ -177,9 +174,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
table = CommonString.KEY_ADHOC_JOURNEY_PLAN;
|
table = CommonString.KEY_ADHOC_JOURNEY_PLAN;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
db.updateCheckoutStatus(store_id, CommonString.KEY_Y, table);
|
db.updateCheckoutStatus(store_id, CommonString.KEY_Y, table);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (result.toString().equalsIgnoreCase(CommonString.KEY_FALSE)) {
|
if (result.toString().equalsIgnoreCase(CommonString.KEY_FALSE)) {
|
||||||
return service;
|
return service;
|
||||||
|
|||||||
+18
-59
@@ -33,6 +33,7 @@ import com.androidbuts.multispinnerfilter.MultiSpinnerSearch;
|
|||||||
import com.androidbuts.multispinnerfilter.SpinnerListener;
|
import com.androidbuts.multispinnerfilter.SpinnerListener;
|
||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -114,8 +115,7 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
if (configurationData.size() > 0) {
|
if (configurationData.size() > 0) {
|
||||||
|
|
||||||
for (int i = 0; i < configurationData.size(); i++) {
|
for (int i = 0; i < configurationData.size(); i++) {
|
||||||
if (configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("COACHING VISIT IMAGE") &&
|
if (configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("COACHING VISIT IMAGE") && configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")) {
|
||||||
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")) {
|
|
||||||
coaching_visit_camera_flag = true;
|
coaching_visit_camera_flag = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -131,8 +131,7 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
|
|
||||||
supervisorList = database.getSupervisorListData();
|
supervisorList = database.getSupervisorListData();
|
||||||
|
|
||||||
exist_adapter = new ArrayAdapter<>(this,
|
exist_adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item);
|
||||||
android.R.layout.simple_spinner_item);
|
|
||||||
|
|
||||||
String select_str = getResources().getString(R.string.select);
|
String select_str = getResources().getString(R.string.select);
|
||||||
|
|
||||||
@@ -142,8 +141,7 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
|
|
||||||
exist_spinner.setAdapter(exist_adapter);
|
exist_spinner.setAdapter(exist_adapter);
|
||||||
|
|
||||||
exist_adapter
|
exist_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
|
||||||
|
|
||||||
exist_spinner.setOnItemSelectedListener(this);
|
exist_spinner.setOnItemSelectedListener(this);
|
||||||
|
|
||||||
@@ -168,8 +166,8 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
|
||||||
switch (parent.getId()) {
|
if (parent.getId() == R.id.spinner_coaching_visit) {
|
||||||
case R.id.spinner_coaching_visit:
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
|
|
||||||
if (!update_flag) {
|
if (!update_flag) {
|
||||||
@@ -179,32 +177,8 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
if (position == 1) {
|
if (position == 1) {
|
||||||
|
|
||||||
linear_supervisor.setVisibility(View.VISIBLE);
|
linear_supervisor.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
coaching_visit = 1;
|
coaching_visit = 1;
|
||||||
|
|
||||||
/*supervisor_adapter = new ArrayAdapter<CharSequence>(this,
|
|
||||||
android.R.layout.simple_spinner_item);
|
|
||||||
|
|
||||||
String select_str = getResources().getString(R.string.select_promo);
|
|
||||||
|
|
||||||
supervisor_adapter.add(select_str);
|
|
||||||
|
|
||||||
for (int i = 0; i < supervisorList.size(); i++) {
|
|
||||||
supervisor_adapter.add(supervisorList.get(i).getSUPERVISOR().get(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
supervisor_spinner.setAdapter(supervisor_adapter);
|
|
||||||
|
|
||||||
supervisor_adapter
|
|
||||||
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
|
||||||
|
|
||||||
supervisor_spinner.setOnItemSelectedListener(this);*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Getting array of String to Bind in Spinner
|
|
||||||
*/
|
|
||||||
//final List<String> list = Arrays.asList(getResources().getStringArray(R.array.sports_array));
|
|
||||||
|
|
||||||
final List<KeyPairBoolData> listArray0 = new ArrayList<>();
|
final List<KeyPairBoolData> listArray0 = new ArrayList<>();
|
||||||
|
|
||||||
for (int i = 0; i < supervisorList.size(); i++) {
|
for (int i = 0; i < supervisorList.size(); i++) {
|
||||||
@@ -216,7 +190,6 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
}
|
}
|
||||||
|
|
||||||
multi_spinner_supervisor.setItems(listArray0, -1, new SpinnerListener() {
|
multi_spinner_supervisor.setItems(listArray0, -1, new SpinnerListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemsSelected(List<KeyPairBoolData> items) {
|
public void onItemsSelected(List<KeyPairBoolData> items) {
|
||||||
|
|
||||||
@@ -224,7 +197,6 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
|
|
||||||
for (int i = 0; i < items.size(); i++) {
|
for (int i = 0; i < items.size(); i++) {
|
||||||
if (items.get(i).isSelected()) {
|
if (items.get(i).isSelected()) {
|
||||||
|
|
||||||
selectedSupervisorList.add(items.get(i).getName());
|
selectedSupervisorList.add(items.get(i).getName());
|
||||||
Log.i("MultiSpinner", i + " : " + items.get(i).getName() + " : " + items.get(i).isSelected());
|
Log.i("MultiSpinner", i + " : " + items.get(i).getName() + " : " + items.get(i).isSelected());
|
||||||
}
|
}
|
||||||
@@ -238,24 +210,17 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
linear_supervisor.setVisibility(View.GONE);
|
linear_supervisor.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
coaching_visit = -1;
|
coaching_visit = -1;
|
||||||
linear_supervisor.setVisibility(View.GONE);
|
linear_supervisor.setVisibility(View.GONE);
|
||||||
fab_save.hide(); //setVisibility(View.GONE);
|
fab_save.hide(); //setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (parent.getId() == R.id.multi_spinner_supervisor) {
|
||||||
|
// Commented-out code from original
|
||||||
case R.id.multi_spinner_supervisor:
|
|
||||||
/* if(position!=0){
|
|
||||||
emp_id = supervisorList.get(position-1).getEMP_ID().get(0);
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
emp_id = "";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -266,18 +231,18 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
switch (v.getId()) {
|
if (v.getId() == R.id.img_cam) {
|
||||||
case R.id.img_cam:
|
|
||||||
_pathforcheck = store_id + "CoachingVisit" + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck = store_id + "CoachingVisit" + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.fab_save:
|
} else if (v.getId() == R.id.fab_save) {
|
||||||
|
|
||||||
if (coaching_visit == 1) {
|
if (coaching_visit == 1) {
|
||||||
String error_msg = "";
|
String error_msg = "";
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
//if(emp_id.equals("")){
|
|
||||||
if (selectedSupervisorList.size() == 0) {
|
if (selectedSupervisorList.size() == 0) {
|
||||||
flag = false;
|
flag = false;
|
||||||
error_msg = getString(R.string.title_activity_select_dropdown);
|
error_msg = getString(R.string.title_activity_select_dropdown);
|
||||||
@@ -296,13 +261,12 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
}
|
}
|
||||||
|
|
||||||
Toast.makeText(context, getString(R.string.save_message), Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, getString(R.string.save_message), Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
saved_flag = true;
|
saved_flag = true;
|
||||||
|
|
||||||
fab_next.show(); // setVisibility(View.VISIBLE);
|
fab_next.show(); // setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(linear_supervisor, error_msg, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(linear_supervisor, error_msg, Snackbar.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
CoachingVisitGetterSetter coachingVisitGetterSetter = new CoachingVisitGetterSetter();
|
CoachingVisitGetterSetter coachingVisitGetterSetter = new CoachingVisitGetterSetter();
|
||||||
coachingVisitGetterSetter.setEmp_id("0");
|
coachingVisitGetterSetter.setEmp_id("0");
|
||||||
@@ -316,25 +280,20 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
|||||||
fab_next.show(); // setVisibility(View.VISIBLE);
|
fab_next.show(); // setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (v.getId() == R.id.fab) {
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.fab:
|
|
||||||
|
|
||||||
if (saved_flag || update_flag) {
|
if (saved_flag || update_flag) {
|
||||||
|
|
||||||
// Intent i = new Intent(CoachingVisitActivity.this, StoreCheckoutImageActivity.class);
|
|
||||||
Intent i = new Intent(CoachingVisitActivity.this, CoachingVisitStoreActivity.class);
|
Intent i = new Intent(CoachingVisitActivity.this, CoachingVisitStoreActivity.class);
|
||||||
i.putExtra(CommonString.KEY_STORE_ID, store_id);
|
i.putExtra(CommonString.KEY_STORE_ID, store_id);
|
||||||
i.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
i.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||||
startActivity(i);
|
startActivity(i);
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(linear_supervisor, getString(R.string.please_save_data), Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(linear_supervisor, getString(R.string.please_save_data), Snackbar.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String getEmp_idFromName(String name) {
|
String getEmp_idFromName(String name) {
|
||||||
|
|||||||
+14
-39
@@ -168,8 +168,8 @@ public class CoachingVisitStoreActivity extends AppCompatActivity implements Ada
|
|||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
|
||||||
switch (parent.getId()) {
|
if (parent.getId() == R.id.spinner_coaching_visit) {
|
||||||
case R.id.spinner_coaching_visit:
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
|
|
||||||
if (!update_flag) {
|
if (!update_flag) {
|
||||||
@@ -179,14 +179,9 @@ public class CoachingVisitStoreActivity extends AppCompatActivity implements Ada
|
|||||||
if (position == 1) {
|
if (position == 1) {
|
||||||
|
|
||||||
linear_supervisor.setVisibility(View.VISIBLE);
|
linear_supervisor.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
coaching_visit = 1;
|
coaching_visit = 1;
|
||||||
|
|
||||||
/**
|
// Creating list for multi-spinner
|
||||||
* Getting array of String to Bind in Spinner
|
|
||||||
*/
|
|
||||||
//final List<String> list = Arrays.asList(getResources().getStringArray(R.array.sports_array));
|
|
||||||
|
|
||||||
final List<KeyPairBoolData> listArray0 = new ArrayList<>();
|
final List<KeyPairBoolData> listArray0 = new ArrayList<>();
|
||||||
|
|
||||||
for (int i = 0; i < supervisorList.size(); i++) {
|
for (int i = 0; i < supervisorList.size(); i++) {
|
||||||
@@ -198,15 +193,11 @@ public class CoachingVisitStoreActivity extends AppCompatActivity implements Ada
|
|||||||
}
|
}
|
||||||
|
|
||||||
multi_spinner_supervisor.setItems(listArray0, -1, new SpinnerListener() {
|
multi_spinner_supervisor.setItems(listArray0, -1, new SpinnerListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemsSelected(List<KeyPairBoolData> items) {
|
public void onItemsSelected(List<KeyPairBoolData> items) {
|
||||||
|
|
||||||
selectedSupervisorList.clear();
|
selectedSupervisorList.clear();
|
||||||
|
|
||||||
for (int i = 0; i < items.size(); i++) {
|
for (int i = 0; i < items.size(); i++) {
|
||||||
if (items.get(i).isSelected()) {
|
if (items.get(i).isSelected()) {
|
||||||
|
|
||||||
selectedSupervisorList.add(items.get(i).getName());
|
selectedSupervisorList.add(items.get(i).getName());
|
||||||
Log.i("MultiSpinner", i + " : " + items.get(i).getName() + " : " + items.get(i).isSelected());
|
Log.i("MultiSpinner", i + " : " + items.get(i).getName() + " : " + items.get(i).isSelected());
|
||||||
}
|
}
|
||||||
@@ -222,25 +213,13 @@ public class CoachingVisitStoreActivity extends AppCompatActivity implements Ada
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
coaching_visit = -1;
|
coaching_visit = -1;
|
||||||
linear_supervisor.setVisibility(View.GONE);
|
linear_supervisor.setVisibility(View.GONE);
|
||||||
fab_save.hide(); // setVisibility(View.GONE);
|
fab_save.hide(); // setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.multi_spinner_supervisor:
|
|
||||||
|
|
||||||
/* if(position!=0){
|
|
||||||
emp_id = supervisorList.get(position-1).getEMP_ID().get(0);
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
emp_id = "";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -251,22 +230,21 @@ public class CoachingVisitStoreActivity extends AppCompatActivity implements Ada
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
switch (v.getId()) {
|
if (v.getId() == R.id.img_cam) {
|
||||||
case R.id.img_cam:
|
|
||||||
_pathforcheck = store_id + "CheckVisit" + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck = store_id + "CheckVisit" + visit_date.replace("/", "") +
|
||||||
|
CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.fab_save:
|
} else if (v.getId() == R.id.fab_save) {
|
||||||
|
|
||||||
if (coaching_visit == 1) {
|
if (coaching_visit == 1) {
|
||||||
|
|
||||||
String error_msg = "";
|
String error_msg = "";
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
//if(emp_id.equals("")){
|
|
||||||
if (selectedSupervisorList.size() == 0) {
|
if (selectedSupervisorList.size() == 0) {
|
||||||
flag = false;
|
flag = false;
|
||||||
error_msg = getString(R.string.title_activity_select_dropdown);
|
error_msg = getString(R.string.title_activity_select_dropdown);
|
||||||
@@ -276,7 +254,6 @@ public class CoachingVisitStoreActivity extends AppCompatActivity implements Ada
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
|
|
||||||
for (int i = 0; i < selectedSupervisorList.size(); i++) {
|
for (int i = 0; i < selectedSupervisorList.size(); i++) {
|
||||||
CoachingVisitGetterSetter coachingVisitGetterSetter = new CoachingVisitGetterSetter();
|
CoachingVisitGetterSetter coachingVisitGetterSetter = new CoachingVisitGetterSetter();
|
||||||
coachingVisitGetterSetter.setEmp_id(getEmp_idFromName(selectedSupervisorList.get(i)));
|
coachingVisitGetterSetter.setEmp_id(getEmp_idFromName(selectedSupervisorList.get(i)));
|
||||||
@@ -287,13 +264,13 @@ public class CoachingVisitStoreActivity extends AppCompatActivity implements Ada
|
|||||||
}
|
}
|
||||||
|
|
||||||
Toast.makeText(context, getString(R.string.save_message), Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, getString(R.string.save_message), Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
saved_flag = true;
|
saved_flag = true;
|
||||||
|
|
||||||
fab_next.show(); // setVisibility(View.VISIBLE);
|
fab_next.show(); // setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(linear_supervisor, error_msg, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(linear_supervisor, error_msg, Snackbar.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
CoachingVisitGetterSetter coachingVisitGetterSetter = new CoachingVisitGetterSetter();
|
CoachingVisitGetterSetter coachingVisitGetterSetter = new CoachingVisitGetterSetter();
|
||||||
coachingVisitGetterSetter.setEmp_id("0");
|
coachingVisitGetterSetter.setEmp_id("0");
|
||||||
@@ -307,10 +284,7 @@ public class CoachingVisitStoreActivity extends AppCompatActivity implements Ada
|
|||||||
fab_next.show(); // setVisibility(View.VISIBLE);
|
fab_next.show(); // setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (v.getId() == R.id.fab) {
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.fab:
|
|
||||||
|
|
||||||
if (saved_flag || update_flag) {
|
if (saved_flag || update_flag) {
|
||||||
|
|
||||||
@@ -320,11 +294,12 @@ public class CoachingVisitStoreActivity extends AppCompatActivity implements Ada
|
|||||||
startActivity(i);
|
startActivity(i);
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(linear_supervisor, getString(R.string.please_save_data), Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(linear_supervisor, getString(R.string.please_save_data), Snackbar.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String getEmp_idFromName(String name) {
|
String getEmp_idFromName(String name) {
|
||||||
|
|||||||
+19
-45
@@ -172,9 +172,6 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
sp_promotion_typ.setAdapter(comp_adapter);
|
sp_promotion_typ.setAdapter(comp_adapter);
|
||||||
sp_promotion_typ.setOnItemSelectedListener(this);
|
sp_promotion_typ.setOnItemSelectedListener(this);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Product List
|
//Product List
|
||||||
exists_data = db.getCompetitionPromoExistsAfterData(store_id, categoryId);
|
exists_data = db.getCompetitionPromoExistsAfterData(store_id, categoryId);
|
||||||
|
|
||||||
@@ -204,8 +201,7 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
|
|
||||||
switch (id) {
|
if (id == R.id.btntoggle) {
|
||||||
case R.id.btntoggle:
|
|
||||||
isExists = btntoggle.isChecked();
|
isExists = btntoggle.isChecked();
|
||||||
|
|
||||||
if (isExists) {
|
if (isExists) {
|
||||||
@@ -242,19 +238,15 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
//checkBox.setChecked(true);
|
|
||||||
btntoggle.setChecked(true);
|
btntoggle.setChecked(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
android.app.AlertDialog alert = builder.create();
|
android.app.AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.fab_add:
|
|
||||||
|
|
||||||
|
} else if (id == R.id.fab_add) {
|
||||||
skuName = et_sku_name.getText().toString().replaceAll("[&^<>{}'$]", "").replaceFirst("^0+(?!$)", "");
|
skuName = et_sku_name.getText().toString().replaceAll("[&^<>{}'$]", "").replaceFirst("^0+(?!$)", "");
|
||||||
|
|
||||||
if (promotion.equals("")) {
|
if (promotion.equals("")) {
|
||||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_promo_type, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_promo_type, Snackbar.LENGTH_SHORT).show();
|
||||||
} else if (subcategory.equals("")) {
|
} else if (subcategory.equals("")) {
|
||||||
@@ -263,9 +255,7 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_competitor, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_competitor, Snackbar.LENGTH_SHORT).show();
|
||||||
} else if (skuName.equals("")) {
|
} else if (skuName.equals("")) {
|
||||||
Snackbar.make(rec_added_counterfeit_product, R.string.pls_enter_comment, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(rec_added_counterfeit_product, R.string.pls_enter_comment, Snackbar.LENGTH_SHORT).show();
|
||||||
} /*else if (img_str.equals("") && img_str1.equals("") && img_str2.equals("")) {
|
} else {
|
||||||
Snackbar.make(rec_added_counterfeit_product, R.string.click_image, Snackbar.LENGTH_SHORT).show();
|
|
||||||
}*/ else {
|
|
||||||
CompetitonPromoGetterSetter product = new CompetitonPromoGetterSetter();
|
CompetitonPromoGetterSetter product = new CompetitonPromoGetterSetter();
|
||||||
product.setBrand(brand);
|
product.setBrand(brand);
|
||||||
product.setPromotion(promotion);
|
product.setPromotion(promotion);
|
||||||
@@ -275,9 +265,7 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
product.setImgStr(img_str);
|
product.setImgStr(img_str);
|
||||||
product.setImgStr1(img_str1);
|
product.setImgStr1(img_str1);
|
||||||
product.setImgStr2(img_str2);
|
product.setImgStr2(img_str2);
|
||||||
|
|
||||||
addedCounterfeitProducts.add(product);
|
addedCounterfeitProducts.add(product);
|
||||||
|
|
||||||
rec_added_counterfeit_product.setLayoutManager(new LinearLayoutManager(context));
|
rec_added_counterfeit_product.setLayoutManager(new LinearLayoutManager(context));
|
||||||
productAdapter = new ProductAdapter(addedCounterfeitProducts);
|
productAdapter = new ProductAdapter(addedCounterfeitProducts);
|
||||||
rec_added_counterfeit_product.setAdapter(productAdapter);
|
rec_added_counterfeit_product.setAdapter(productAdapter);
|
||||||
@@ -296,7 +284,6 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
sp_subcategory.setSelection(0);
|
sp_subcategory.setSelection(0);
|
||||||
spinner_brand_list.setSelection(0);
|
spinner_brand_list.setSelection(0);
|
||||||
sp_promotion_typ.setSelection(0);
|
sp_promotion_typ.setSelection(0);
|
||||||
//clearBrandSpinner();
|
|
||||||
|
|
||||||
imgCam.setBackgroundResource(R.mipmap.camera_orange);
|
imgCam.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
imgCam1.setBackgroundResource(R.mipmap.camera_orange);
|
imgCam1.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
@@ -305,39 +292,33 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
isdata_added = true;
|
isdata_added = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.fab) {
|
||||||
|
|
||||||
case R.id.fab:
|
|
||||||
if (isExists && addedCounterfeitProducts.size() == 0) {
|
if (isExists && addedCounterfeitProducts.size() == 0) {
|
||||||
Snackbar.make(rec_added_counterfeit_product, R.string.title_activity_Want_add, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(rec_added_counterfeit_product, R.string.title_activity_Want_add, Snackbar.LENGTH_SHORT).show();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
db.InsertComptionPromotData(addedCounterfeitProducts, categoryId, store_id, isExists);
|
db.InsertComptionPromotData(addedCounterfeitProducts, categoryId, store_id, isExists);
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.img_cam) {
|
||||||
|
|
||||||
case R.id.img_cam:
|
|
||||||
_pathforcheck = store_id + "CounterfeitProductImg1" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck = store_id + "CounterfeitProductImg1" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.img_cam1:
|
} else if (id == R.id.img_cam1) {
|
||||||
_pathforcheck1 = store_id + "CounterfeitProductImg2" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck1 = store_id + "CounterfeitProductImg2" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck1;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck1;
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.img_cam2:
|
} else if (id == R.id.img_cam2) {
|
||||||
_pathforcheck2 = store_id + "CounterfeitProductImg3" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck2 = store_id + "CounterfeitProductImg3" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck2;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck2;
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearBrandSpinner() {
|
void clearBrandSpinner() {
|
||||||
@@ -355,20 +336,23 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long _po) {
|
||||||
switch (parent.getId()) {
|
int id = parent.getId();
|
||||||
case R.id.sp_subcategory:
|
|
||||||
|
if (id == R.id.sp_subcategory) {
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
subcategory = subcategory_list.get(position).getSUB_CATEGORY().get(0);
|
subcategory = subcategory_list.get(position).getSUB_CATEGORY().get(0);
|
||||||
subcategoryId = Integer.parseInt(subcategory_list.get(position).getSUB_CATEGORY_ID().get(0));
|
subcategoryId = Integer.parseInt(subcategory_list.get(position).getSUB_CATEGORY_ID().get(0));
|
||||||
|
|
||||||
brand_list = db.getCompetionData(keyAccount_id, storeType_id, class_id, categoryId, subcategoryId);
|
brand_list = db.getCompetionData(keyAccount_id, storeType_id, class_id, categoryId, subcategoryId);
|
||||||
//brand data
|
|
||||||
|
// Prepare brand data with default "Select" option
|
||||||
BrandMasterGetterSetter brand_select = new BrandMasterGetterSetter();
|
BrandMasterGetterSetter brand_select = new BrandMasterGetterSetter();
|
||||||
String select = getResources().getString(R.string.select);
|
String select = getResources().getString(R.string.select);
|
||||||
brand_select.setBRAND(select);
|
brand_select.setBRAND(select);
|
||||||
brand_select.setBRAND_ID("0");
|
brand_select.setBRAND_ID("0");
|
||||||
brand_list.add(0, brand_select);
|
brand_list.add(0, brand_select);
|
||||||
|
|
||||||
CustomBrandAdapter adapter = new CustomBrandAdapter(CompetitionPromoActivity.this, R.layout.custom_spinner_item, brand_list);
|
CustomBrandAdapter adapter = new CustomBrandAdapter(CompetitionPromoActivity.this, R.layout.custom_spinner_item, brand_list);
|
||||||
spinner_brand_list.setAdapter(adapter);
|
spinner_brand_list.setAdapter(adapter);
|
||||||
spinner_brand_list.setOnItemSelectedListener(this);
|
spinner_brand_list.setOnItemSelectedListener(this);
|
||||||
@@ -379,10 +363,7 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
subcategoryId = 0;
|
subcategoryId = 0;
|
||||||
lay_competitor_name.setVisibility(View.GONE);
|
lay_competitor_name.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
break;
|
} else if (id == R.id.sp_brand) {
|
||||||
|
|
||||||
case R.id.sp_brand:
|
|
||||||
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
brand = brand_list.get(position).getBRAND().get(0);
|
brand = brand_list.get(position).getBRAND().get(0);
|
||||||
brand_id = Integer.parseInt(brand_list.get(position).getBRAND_ID().get(0));
|
brand_id = Integer.parseInt(brand_list.get(position).getBRAND_ID().get(0));
|
||||||
@@ -390,23 +371,16 @@ public class CompetitionPromoActivity extends AppCompatActivity implements Adapt
|
|||||||
brand = "";
|
brand = "";
|
||||||
brand_id = 0;
|
brand_id = 0;
|
||||||
}
|
}
|
||||||
|
} else if (id == R.id.sp_promotion_typ) {
|
||||||
break;
|
|
||||||
case R.id.sp_promotion_typ:
|
|
||||||
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
promotion = promotion_list.get(position).getPROMOTION_TYPE().get(0);
|
promotion = promotion_list.get(position).getPROMOTION_TYPE().get(0);
|
||||||
promotion_id = Integer.parseInt(promotion_list.get(position).getPROMOTION_TYPE_ID().get(0));
|
promotion_id = Integer.parseInt(promotion_list.get(position).getPROMOTION_TYPE_ID().get(0));
|
||||||
} else {
|
} else {
|
||||||
promotion = "";
|
promotion = "";
|
||||||
promotion_id = 0;
|
promotion_id = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+16
-27
@@ -168,8 +168,7 @@ public class CounterfeitProductsActivity extends AppCompatActivity implements Ad
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
|
|
||||||
switch (id) {
|
if (id == R.id.btntoggle) {
|
||||||
case R.id.btntoggle:
|
|
||||||
isExists = btntoggle.isChecked();
|
isExists = btntoggle.isChecked();
|
||||||
|
|
||||||
if (isExists) {
|
if (isExists) {
|
||||||
@@ -211,10 +210,8 @@ public class CounterfeitProductsActivity extends AppCompatActivity implements Ad
|
|||||||
android.app.AlertDialog alert = builder.create();
|
android.app.AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.fab_add:
|
|
||||||
|
|
||||||
|
} else if (id == R.id.fab_add) {
|
||||||
skuName = et_sku_name.getText().toString().replaceAll("[&^<>{}'$]", "").replaceFirst("^0+(?!$)", "");
|
skuName = et_sku_name.getText().toString().replaceAll("[&^<>{}'$]", "").replaceFirst("^0+(?!$)", "");
|
||||||
stock = et_stock.getText().toString();
|
stock = et_stock.getText().toString();
|
||||||
|
|
||||||
@@ -254,7 +251,6 @@ public class CounterfeitProductsActivity extends AppCompatActivity implements Ad
|
|||||||
et_stock.setText("");
|
et_stock.setText("");
|
||||||
et_sku_name.setText("");
|
et_sku_name.setText("");
|
||||||
spinner_brand_list.setSelection(0);
|
spinner_brand_list.setSelection(0);
|
||||||
//clearBrandSpinner();
|
|
||||||
|
|
||||||
imgCam.setBackgroundResource(R.mipmap.camera_orange);
|
imgCam.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
imgCam1.setBackgroundResource(R.mipmap.camera_orange);
|
imgCam1.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
@@ -263,39 +259,35 @@ public class CounterfeitProductsActivity extends AppCompatActivity implements Ad
|
|||||||
isdata_added = true;
|
isdata_added = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.fab) {
|
||||||
|
|
||||||
case R.id.fab:
|
|
||||||
if (isExists && addedCounterfeitProducts.size() == 0) {
|
if (isExists && addedCounterfeitProducts.size() == 0) {
|
||||||
Snackbar.make(rec_added_counterfeit_product, R.string.title_activity_Want_add, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(rec_added_counterfeit_product, R.string.title_activity_Want_add, Snackbar.LENGTH_SHORT).show();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
db.InsertCounterfeitProductData(addedCounterfeitProducts, categoryId, store_id, isExists);
|
db.InsertCounterfeitProductData(addedCounterfeitProducts, categoryId, store_id, isExists);
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.img_cam) {
|
||||||
|
_pathforcheck = store_id + "CounterfeitProductImg1" + categoryId + visit_date.replace("/", "") +
|
||||||
case R.id.img_cam:
|
CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
_pathforcheck = store_id + "CounterfeitProductImg1" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.img_cam1:
|
} else if (id == R.id.img_cam1) {
|
||||||
_pathforcheck1 = store_id + "CounterfeitProductImg2" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck1 = store_id + "CounterfeitProductImg2" + categoryId + visit_date.replace("/", "") +
|
||||||
|
CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck1;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck1;
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.img_cam2:
|
} else if (id == R.id.img_cam2) {
|
||||||
_pathforcheck2 = store_id + "CounterfeitProductImg3" + categoryId + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck2 = store_id + "CounterfeitProductImg3" + categoryId + visit_date.replace("/", "") +
|
||||||
|
CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck2;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck2;
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearBrandSpinner() {
|
void clearBrandSpinner() {
|
||||||
@@ -314,9 +306,7 @@ public class CounterfeitProductsActivity extends AppCompatActivity implements Ad
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
switch (parent.getId()) {
|
if (parent.getId() == R.id.sp_brand) {
|
||||||
case R.id.sp_brand:
|
|
||||||
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
brand = brand_list.get(position).getBRAND().get(0);
|
brand = brand_list.get(position).getBRAND().get(0);
|
||||||
brand_id = Integer.parseInt(brand_list.get(position).getBRAND_ID().get(0));
|
brand_id = Integer.parseInt(brand_list.get(position).getBRAND_ID().get(0));
|
||||||
@@ -324,10 +314,9 @@ public class CounterfeitProductsActivity extends AppCompatActivity implements Ad
|
|||||||
brand = "";
|
brand = "";
|
||||||
brand_id = 0;
|
brand_id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -91,27 +91,18 @@ public class DeliveryCallActivity extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
|
|
||||||
switch (id) {
|
if (id == R.id.fab_upload) {
|
||||||
|
|
||||||
case R.id.fab_upload:
|
|
||||||
|
|
||||||
new UploadTask().execute();
|
new UploadTask().execute();
|
||||||
break;
|
} else if (id == R.id.fab) {
|
||||||
|
|
||||||
case R.id.fab:
|
|
||||||
|
|
||||||
if (isCheckedIn()) {
|
if (isCheckedIn()) {
|
||||||
Snackbar.make(recyclerView, getString(R.string.title_store_list_checkout_current), Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(recyclerView, getString(R.string.title_store_list_checkout_current), Snackbar.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Intent in = new Intent(context, DeliveryCallAddStoreActivity.class);
|
Intent in = new Intent(context, DeliveryCallAddStoreActivity.class);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
|
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class DeliveryAdapter extends RecyclerView.Adapter<DeliveryAdapter.MyViewHolder> {
|
class DeliveryAdapter extends RecyclerView.Adapter<DeliveryAdapter.MyViewHolder> {
|
||||||
|
|||||||
+6
-5
@@ -315,8 +315,9 @@ public class DeliveryCallAddStoreActivity extends AppCompatActivity implements V
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
int viewId = v.getId();
|
||||||
case R.id.img_checkin:
|
|
||||||
|
if (viewId == R.id.img_checkin) {
|
||||||
|
|
||||||
in_time = CommonFunctions.getCurrentTimeWithLanguage(context);
|
in_time = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
|
|
||||||
@@ -325,9 +326,8 @@ public class DeliveryCallAddStoreActivity extends AppCompatActivity implements V
|
|||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(0);
|
startCameraActivity(0);
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.img_checkout:
|
} else if (viewId == R.id.img_checkout) {
|
||||||
|
|
||||||
out_time = CommonFunctions.getCurrentTimeWithLanguage(context);
|
out_time = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
|
|
||||||
@@ -336,8 +336,9 @@ public class DeliveryCallAddStoreActivity extends AppCompatActivity implements V
|
|||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(1);
|
startCameraActivity(1);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void startCameraActivity(int request_code) {
|
protected void startCameraActivity(int request_code) {
|
||||||
|
|||||||
@@ -80,20 +80,21 @@ public class FutureJCPActivity extends AppCompatActivity implements View.OnClick
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
int viewId = v.getId();
|
||||||
case R.id.iconCalender:
|
|
||||||
|
if (viewId == R.id.iconCalender) {
|
||||||
c = Calendar.getInstance();
|
c = Calendar.getInstance();
|
||||||
year = c.get(Calendar.YEAR);
|
year = c.get(Calendar.YEAR);
|
||||||
month = c.get(Calendar.MONTH);
|
month = c.get(Calendar.MONTH);
|
||||||
day = c.get(Calendar.DAY_OF_MONTH);
|
day = c.get(Calendar.DAY_OF_MONTH);
|
||||||
showDatePickerDialog(year, month, day);
|
showDatePickerDialog(year, month, day);
|
||||||
break;
|
|
||||||
case R.id.fab:
|
} else if (viewId == R.id.fab) {
|
||||||
Snackbar.make(v, "Replace with your own action", Snackbar.LENGTH_LONG)
|
Snackbar.make(v, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||||
.setAction("Action", null).show();
|
.setAction("Action", null).show();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showDatePickerDialog(int year, int month, int day) {
|
protected void showDatePickerDialog(int year, int month, int day) {
|
||||||
|
|||||||
@@ -211,9 +211,8 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
super.onBackPressed();
|
||||||
finish();
|
finish();
|
||||||
|
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,8 +221,9 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
long arg3) {
|
long arg3) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
switch (arg0.getId()) {
|
int id = arg0.getId();
|
||||||
case R.id.spinner_reason:
|
|
||||||
|
if (id == R.id.spinner_reason) {
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
reasonname = reasondata.get(position - 1).getREASON().get(0);
|
reasonname = reasondata.get(position - 1).getREASON().get(0);
|
||||||
reasonid = reasondata.get(position - 1).getREASON_ID().get(0);
|
reasonid = reasondata.get(position - 1).getREASON_ID().get(0);
|
||||||
@@ -240,14 +240,13 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
rel_cam.setVisibility(View.GONE);
|
rel_cam.setVisibility(View.GONE);
|
||||||
image = "false";
|
image = "false";
|
||||||
}
|
}
|
||||||
//reason_reamrk = "true";
|
|
||||||
if (remark_allow.equalsIgnoreCase("1")) {
|
if (remark_allow.equalsIgnoreCase("1")) {
|
||||||
reason_lay.setVisibility(View.VISIBLE);
|
reason_lay.setVisibility(View.VISIBLE);
|
||||||
if (remark_type.equalsIgnoreCase("Text")) {
|
if (remark_type.equalsIgnoreCase("Text")) {
|
||||||
text.setVisibility(View.VISIBLE);
|
text.setVisibility(View.VISIBLE);
|
||||||
subreason_spinner.setVisibility(View.GONE);
|
subreason_spinner.setVisibility(View.GONE);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
text.setVisibility(View.GONE);
|
text.setVisibility(View.GONE);
|
||||||
subreason_spinner.setVisibility(View.VISIBLE);
|
subreason_spinner.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
@@ -266,8 +265,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
|
|
||||||
subreason_spinner.setAdapter(sub_reason_adapter);
|
subreason_spinner.setAdapter(sub_reason_adapter);
|
||||||
|
|
||||||
sub_reason_adapter
|
sub_reason_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
|
||||||
|
|
||||||
subreason_spinner.setOnItemSelectedListener(this);
|
subreason_spinner.setOnItemSelectedListener(this);
|
||||||
}
|
}
|
||||||
@@ -280,19 +278,15 @@ public class NonWorkingReason extends AppCompatActivity implements
|
|||||||
reasonid = "";
|
reasonid = "";
|
||||||
reason_lay.setVisibility(View.GONE);
|
reason_lay.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
break;
|
} else if (id == R.id.spinner_sub_reason) {
|
||||||
|
|
||||||
case R.id.spinner_sub_reason:
|
|
||||||
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
sub_reason_id = sub_reasondata.get(position - 1).getSUB_REASON_ID().get(0);
|
sub_reason_id = sub_reasondata.get(position - 1).getSUB_REASON_ID().get(0);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
sub_reason_id = "";
|
sub_reason_id = "";
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+465
-74
@@ -1,25 +1,22 @@
|
|||||||
package cpm.com.gskmtorange.dailyentry;
|
package cpm.com.gskmtorange.dailyentry;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import androidx.cardview.widget.CardView;
|
import androidx.cardview.widget.CardView;
|
||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.ActivityInfo;
|
|
||||||
import android.content.pm.ApplicationInfo;
|
import android.content.pm.ApplicationInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.graphics.BitmapFactory;
|
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
@@ -34,59 +31,58 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.Window;
|
|
||||||
import android.view.WindowManager;
|
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.webkit.WebView;
|
|
||||||
import android.widget.AbsListView;
|
import android.widget.AbsListView;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.BaseExpandableListAdapter;
|
import android.widget.BaseExpandableListAdapter;
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ExpandableListAdapter;
|
|
||||||
import android.widget.ExpandableListView;
|
import android.widget.ExpandableListView;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RadioButton;
|
import android.widget.RadioButton;
|
||||||
import android.widget.RadioGroup;
|
import android.widget.RadioGroup;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import android.widget.ToggleButton;
|
import android.widget.ToggleButton;
|
||||||
|
|
||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
import com.toptoche.searchablespinnerlibrary.SearchableSpinner;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.gsk_dailyentry.MSL_Availability_StockFacingActivity;
|
|
||||||
import cpm.com.gskmtorange.interfaces.DialogCallbackListener;
|
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.MSL_AvailabilityStockFacingGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.PharmaMSLInsertedGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
|
||||||
|
|
||||||
public class OrderTakingActivity extends AppCompatActivity implements DialogCallbackListener {
|
public class OrderTakingActivity extends AppCompatActivity implements DialogCallbackListener, AdapterView.OnItemSelectedListener {
|
||||||
ExpandableListView expandableListView;
|
ExpandableListView expandableListView;
|
||||||
private Context context;
|
private Context context;
|
||||||
|
String sys_po_number="";
|
||||||
|
EditText editText_QTY;
|
||||||
|
RecyclerView rec_added_counterfeit_product;
|
||||||
|
int brand_id = 0;
|
||||||
|
FloatingActionButton fab_add;
|
||||||
|
int skuid = 0;
|
||||||
|
String skuname = "";
|
||||||
|
int subcategoryId = 0;
|
||||||
TextView txt_mslAvailabilityName;
|
TextView txt_mslAvailabilityName;
|
||||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> headerDataList;
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> headerDataList;
|
||||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> childDataList;
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> childDataList;
|
||||||
List<MSL_AvailabilityStockFacingGetterSetter> hashMapListHeaderData;
|
|
||||||
|
|
||||||
|
List<MSL_AvailabilityStockFacingGetterSetter> hashMapListHeaderData;
|
||||||
String _pathforcheck1, _pathforcheck2, _pathforcheck3, _path, str, msg;
|
String _pathforcheck1, _pathforcheck2, _pathforcheck3, _path, str, msg;
|
||||||
|
boolean editFlag = false, isdata_added = false;
|
||||||
|
|
||||||
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> hashMapListChildData;
|
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> hashMapListChildData;
|
||||||
List<Integer> checkHeaderArray = new ArrayList<>();
|
List<Integer> checkHeaderArray = new ArrayList<>();
|
||||||
@@ -95,14 +91,23 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
ImageView camera1, camera2, camera3, camera4;
|
ImageView camera1, camera2, camera3, camera4;
|
||||||
LinearLayout lin_camera1, lin_camera2, lin_camera3, lin_camera4;
|
LinearLayout lin_camera1, lin_camera2, lin_camera3, lin_camera4;
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
|
|
||||||
|
String brand = "",subcategory="";
|
||||||
String categoryName, categoryId, storeId, Error_Message = "";
|
String categoryName, categoryId, storeId, Error_Message = "";
|
||||||
String store_id, store_flag_hide, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str;
|
String store_id, store_flag_hide, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str;
|
||||||
boolean isDialogOpen = true;
|
boolean isDialogOpen = true;
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
int scrollPosition = 0;
|
int scrollPosition = 0;
|
||||||
|
Spinner spinner_brand_list,sp_subcategory;
|
||||||
|
|
||||||
|
SearchableSpinner sp_promotion_typ;
|
||||||
|
|
||||||
String gallery_package = "";
|
String gallery_package = "";
|
||||||
Uri outputFileUri;
|
Uri outputFileUri;
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> subcategory_list = new ArrayList<>();
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> brand_list = new ArrayList<>();
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> addedCounterfeitProducts = new ArrayList<>();
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> skuListdata = new ArrayList<>();
|
||||||
|
|
||||||
String str_planogram = "", _pathforcheck = "";
|
String str_planogram = "", _pathforcheck = "";
|
||||||
EditText storepoET,podateET;
|
EditText storepoET,podateET;
|
||||||
@@ -110,15 +115,14 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> planogramShelfHeaderDataList = new ArrayList<>();
|
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> planogramShelfHeaderDataList = new ArrayList<>();
|
||||||
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> planogramSkuChildDataList;
|
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> planogramSkuChildDataList;
|
||||||
HashMap<StockFacing_PlanogramTrackerDataGetterSetter, ArrayList<StockFacing_PlanogramTrackerDataGetterSetter>> planogramHashMapListChildData = new HashMap<>();
|
HashMap<StockFacing_PlanogramTrackerDataGetterSetter, ArrayList<StockFacing_PlanogramTrackerDataGetterSetter>> planogramHashMapListChildData = new HashMap<>();
|
||||||
boolean editFlag = false;
|
String Order_qty = "";
|
||||||
//temp
|
//temp
|
||||||
public static final String FILE_PATH = Environment.getExternalStorageDirectory() + "/";
|
public static final String FILE_PATH = Environment.getExternalStorageDirectory() + "/";
|
||||||
//ImageView bmImage;
|
ProductAdapter productAdapter;
|
||||||
RelativeLayout view;
|
RelativeLayout view;
|
||||||
RadioButton radio_yes,radio_no;
|
RadioButton radio_yes,radio_no;
|
||||||
RadioGroup radio_group;
|
RadioGroup radio_group;
|
||||||
String isExist="";
|
String isExist="";
|
||||||
String sys_po_number="";
|
|
||||||
TextView sys_gen_poTV;
|
TextView sys_gen_poTV;
|
||||||
LinearLayout poLL,pocamLL;
|
LinearLayout poLL,pocamLL;
|
||||||
String storepo ="";
|
String storepo ="";
|
||||||
@@ -128,19 +132,22 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
try {
|
try {
|
||||||
//setContentView(R.layout.activity_msl__availability_stock_facing);
|
|
||||||
setContentView(R.layout.activity_order_taking);
|
setContentView(R.layout.activity_order_taking);
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
expandableListView = (ExpandableListView) findViewById(R.id.expandableListView);
|
expandableListView = (ExpandableListView) findViewById(R.id.expandableListView);
|
||||||
txt_mslAvailabilityName = (TextView) findViewById(R.id.txt_mslAvailabilityName);
|
txt_mslAvailabilityName = (TextView) findViewById(R.id.txt_mslAvailabilityName);
|
||||||
|
editText_QTY = findViewById(R.id.editText_QTY);
|
||||||
|
rec_added_counterfeit_product =findViewById(R.id.rec_added_counterfeit_product);
|
||||||
|
spinner_brand_list = (Spinner) findViewById(R.id.sp_brand);
|
||||||
|
sp_promotion_typ = findViewById(R.id.sp_promotion_typ);
|
||||||
camera1 = (ImageView) findViewById(R.id.img_camera1);
|
camera1 = (ImageView) findViewById(R.id.img_camera1);
|
||||||
camera2 = (ImageView) findViewById(R.id.img_camera2);
|
camera2 = (ImageView) findViewById(R.id.img_camera2);
|
||||||
camera3 = (ImageView) findViewById(R.id.img_camera3);
|
camera3 = (ImageView) findViewById(R.id.img_camera3);
|
||||||
camera4 = (ImageView) findViewById(R.id.img_camera4);
|
camera4 = (ImageView) findViewById(R.id.img_camera4);
|
||||||
|
fab_add = findViewById(R.id.fab_add);
|
||||||
poIV = (ImageView) findViewById(R.id.poIV);
|
poIV = (ImageView) findViewById(R.id.poIV);
|
||||||
pocamLL = findViewById(R.id.pocamLL);
|
pocamLL = findViewById(R.id.pocamLL);
|
||||||
poLL = findViewById(R.id.poLL);
|
poLL = findViewById(R.id.poLL);
|
||||||
|
|
||||||
radio_group =findViewById(R.id.radio_group);
|
radio_group =findViewById(R.id.radio_group);
|
||||||
radio_yes = findViewById(R.id.radio_yes);
|
radio_yes = findViewById(R.id.radio_yes);
|
||||||
radio_no = findViewById(R.id.radio_no);
|
radio_no = findViewById(R.id.radio_no);
|
||||||
@@ -148,6 +155,7 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
|
|
||||||
storepoET = findViewById(R.id.storepoET);
|
storepoET = findViewById(R.id.storepoET);
|
||||||
podateET = findViewById(R.id.podateET);
|
podateET = findViewById(R.id.podateET);
|
||||||
|
sp_subcategory = findViewById(R.id.sp_subcategory);
|
||||||
|
|
||||||
lin_camera1 = (LinearLayout) findViewById(R.id.lin_camera1);
|
lin_camera1 = (LinearLayout) findViewById(R.id.lin_camera1);
|
||||||
lin_camera2 = (LinearLayout) findViewById(R.id.lin_camera2);
|
lin_camera2 = (LinearLayout) findViewById(R.id.lin_camera2);
|
||||||
@@ -180,9 +188,17 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
//Intent data
|
//Intent data
|
||||||
categoryName = getIntent().getStringExtra("categoryName");
|
categoryName = getIntent().getStringExtra("categoryName");
|
||||||
categoryId = getIntent().getStringExtra("categoryId");
|
categoryId = getIntent().getStringExtra("categoryId");
|
||||||
|
setNewData();
|
||||||
|
//subcategory_list.clear();
|
||||||
//txt_mslAvailabilityName.setText(getResources().getString(R.string.title_activity_msl__availability));
|
//txt_mslAvailabilityName.setText(getResources().getString(R.string.title_activity_msl__availability));
|
||||||
|
addedCounterfeitProducts = db.getOrderTakingNewAfterData(store_id, categoryId);
|
||||||
|
if(!addedCounterfeitProducts.isEmpty()){
|
||||||
|
rec_added_counterfeit_product.setLayoutManager(new LinearLayoutManager(context));
|
||||||
|
productAdapter = new ProductAdapter(addedCounterfeitProducts);
|
||||||
|
rec_added_counterfeit_product.setAdapter(productAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
toolbar.setTitle(getResources().getString(R.string.order_taking));
|
toolbar.setTitle(getResources().getString(R.string.order_taking));
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
@@ -190,7 +206,7 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
String str1 = str[0];
|
String str1 = str[0];
|
||||||
String str2 = str[1];
|
String str2 = str[1];
|
||||||
String str3 = str[2];
|
String str3 = str[2];
|
||||||
sys_po_number = store_id + "-" +str3+str1+str2;
|
sys_po_number = store_id + "-" + categoryId +"-" +str3+str1+str2;
|
||||||
sys_gen_poTV.setText(sys_po_number);
|
sys_gen_poTV.setText(sys_po_number);
|
||||||
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
@@ -199,27 +215,67 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
podateET.setText(visit_date);
|
podateET.setText(visit_date);
|
||||||
prepareList();
|
prepareList();
|
||||||
|
|
||||||
|
fab_add.setOnClickListener(view -> {
|
||||||
|
Order_qty = editText_QTY.getText().toString();
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter>finddetailbysku= new ArrayList<>();
|
||||||
|
finddetailbysku = db.getSkuDetails(String.valueOf(skuid));
|
||||||
|
|
||||||
//Camera
|
for(int i =0;i<addedCounterfeitProducts.size();i++){
|
||||||
// prepareDefaultList();
|
if (String.valueOf(skuid)
|
||||||
// cameraMethod();
|
.equalsIgnoreCase(addedCounterfeitProducts.get(i).getSku_id())) {
|
||||||
|
Snackbar.make(rec_added_counterfeit_product, R.string.add_different_sku,
|
||||||
|
Snackbar.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (skuname.isEmpty()) {
|
||||||
|
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_sku, Snackbar.LENGTH_SHORT).show();
|
||||||
|
} else if (Order_qty.isEmpty()) {
|
||||||
|
Snackbar.make(rec_added_counterfeit_product, R.string.please_enter_order_qty, Snackbar.LENGTH_SHORT).show();
|
||||||
|
} else {
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter product = new MSL_AvailabilityStockFacingGetterSetter();
|
||||||
|
product.setBrand(brand.isEmpty() ? finddetailbysku.get(0).getBrand() : brand);
|
||||||
|
product.setSub_category(subcategory.isEmpty() ? finddetailbysku.get(0).getSub_category() : subcategory);
|
||||||
|
product.setSub_category_id(subcategoryId==0? finddetailbysku.get(0).getSub_category_id() : String.valueOf(subcategoryId));
|
||||||
|
product.setBrand_id(brand_id==0 ? finddetailbysku.get(0).getBrand_id() : String.valueOf(brand_id));
|
||||||
|
product.setSku(skuname);
|
||||||
|
product.setSku_id(String.valueOf(skuid));
|
||||||
|
product.setOrder_qty(Order_qty);
|
||||||
|
addedCounterfeitProducts.add(product);
|
||||||
|
|
||||||
|
rec_added_counterfeit_product.setLayoutManager(new LinearLayoutManager(context));
|
||||||
|
productAdapter = new ProductAdapter(addedCounterfeitProducts);
|
||||||
|
rec_added_counterfeit_product.setAdapter(productAdapter);
|
||||||
|
subcategory = "";
|
||||||
|
brand = "";
|
||||||
|
subcategory = "";
|
||||||
|
subcategoryId = 0;
|
||||||
|
brand_id = 0;
|
||||||
|
skuid = 0;
|
||||||
|
skuname = "";
|
||||||
|
editText_QTY.setText("");
|
||||||
|
sp_subcategory.setSelection(0);
|
||||||
|
spinner_brand_list.setSelection(0);
|
||||||
|
sp_promotion_typ.setSelection(0);
|
||||||
|
brand_list.clear();
|
||||||
|
subcategory_list.clear();
|
||||||
|
skuListdata.clear();
|
||||||
|
setNewData();
|
||||||
|
isdata_added = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
|
|
||||||
poIV.setOnClickListener(new View.OnClickListener() {
|
poIV.setOnClickListener(v -> {
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
_pathforcheck = store_id + categoryId + "POImage_" + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck = store_id + categoryId + "POImage_" + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
radio_group.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
radio_group.setOnCheckedChangeListener((radioGroup, i) -> {
|
||||||
@Override
|
|
||||||
public void onCheckedChanged(RadioGroup radioGroup, int i) {
|
|
||||||
if (radio_yes.isChecked()) {
|
if (radio_yes.isChecked()) {
|
||||||
radio_yes.setBackground(getResources().getDrawable(R.mipmap.yes_green));
|
radio_yes.setBackground(getResources().getDrawable(R.mipmap.yes_green));
|
||||||
radio_no.setBackground(getResources().getDrawable(R.mipmap.no_white));
|
radio_no.setBackground(getResources().getDrawable(R.mipmap.no_white));
|
||||||
@@ -231,9 +287,6 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
pocamLL.setVisibility(View.GONE);
|
pocamLL.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
isExist="yes";
|
isExist="yes";
|
||||||
/*expListView.setVisibility(View.VISIBLE);
|
|
||||||
categoryobject.setIsChecked(1);
|
|
||||||
skuData.get(0).setIsChecked(1);*/
|
|
||||||
}
|
}
|
||||||
if (radio_no.isChecked()) {
|
if (radio_no.isChecked()) {
|
||||||
radio_no.setBackground(getResources().getDrawable(R.mipmap.no_red));
|
radio_no.setBackground(getResources().getDrawable(R.mipmap.no_red));
|
||||||
@@ -242,29 +295,34 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
pocamLL.setVisibility(View.GONE);
|
pocamLL.setVisibility(View.GONE);
|
||||||
isExist="no";
|
isExist="no";
|
||||||
img_str = "";
|
img_str = "";
|
||||||
/*expListView.setVisibility(View.GONE);
|
|
||||||
categoryobject.setIsChecked(0);
|
|
||||||
skuData.get(0).setIsChecked(0);*/
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
fab.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(final View view) {
|
fab.setOnClickListener(view -> {
|
||||||
expandableListView.clearFocus();
|
expandableListView.clearFocus();
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
storepo = storepoET.getText().toString();
|
storepo = storepoET.getText().toString();
|
||||||
|
if (addedCounterfeitProducts.isEmpty()) {
|
||||||
|
Snackbar.make(rec_added_counterfeit_product, R.string.title_activity_Want_add, Snackbar.LENGTH_SHORT).show();
|
||||||
|
} else {
|
||||||
|
Log.d("sysponumber",sys_po_number);
|
||||||
|
db.InsertOrderTakingData(addedCounterfeitProducts, categoryId, store_id,date,sys_po_number);
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
}
|
||||||
|
|
||||||
//Log.e("storepo",storepo);
|
//Log.e("storepo",storepo);
|
||||||
if(isExist.equalsIgnoreCase("no")){
|
/* if(isExist.equalsIgnoreCase("no")){
|
||||||
if (db.checkOrder_taking_Data(store_id, categoryId)) {
|
if (db.checkOrder_taking_Data(store_id, categoryId)) {
|
||||||
db.updateOrder_taking_data(img_str,isExist,storepo,sys_po_number,date,store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
db.updateOrder_taking_data(addedCounterfeitProducts, categoryId, store_id);
|
||||||
Toast.makeText(context,getResources().getString(R.string.update_message),Toast.LENGTH_SHORT).show();
|
Toast.makeText(context,getResources().getString(R.string.update_message),Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
db.InsertOrderTakingData(img_str,isExist,storepo,sys_po_number,date,store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
db.InsertOrderTakingData(addedCounterfeitProducts, categoryId, store_id);
|
||||||
Toast.makeText(context,getResources().getString(R.string.save_message),Toast.LENGTH_SHORT).show();
|
Toast.makeText(context,getResources().getString(R.string.save_message),Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*String pharma_msl_xml = "";
|
*//*String pharma_msl_xml = "";
|
||||||
String onXML = "";
|
String onXML = "";
|
||||||
String _onxml = "";
|
String _onxml = "";
|
||||||
String categoryxml = "";
|
String categoryxml = "";
|
||||||
@@ -305,7 +363,7 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
|
|
||||||
final String sos_xml = "[DATA]" + data_xml + "[/DATA]";
|
final String sos_xml = "[DATA]" + data_xml + "[/DATA]";
|
||||||
Log.e("order_xml",sos_xml);
|
Log.e("order_xml",sos_xml);
|
||||||
}*/
|
}*//*
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
@@ -376,9 +434,8 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
expandableListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
expandableListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||||
@@ -390,11 +447,11 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
int lastItem = firstVisibleItem + visibleItemCount;
|
int lastItem = firstVisibleItem + visibleItemCount;
|
||||||
|
|
||||||
if (firstVisibleItem == 0) {
|
if (firstVisibleItem == 0) {
|
||||||
fab.show();//.setVisibility(View.VISIBLE);
|
fab.show();
|
||||||
} else if (lastItem == totalItemCount) {
|
} else if (lastItem == totalItemCount) {
|
||||||
fab.hide();//setVisibility(View.INVISIBLE);
|
fab.hide();
|
||||||
} else {
|
} else {
|
||||||
fab.show();//setVisibility(View.VISIBLE);
|
fab.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -457,9 +514,70 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean validation() {
|
private void setNewData() {
|
||||||
|
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||||
|
subcategory_list = db.getOrderTaking_SubcategoryData(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)) {
|
||||||
|
subcategory_list = db.getOrderTaking_SubcategoryData(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 {
|
||||||
|
// subcategory_list =db.getSubcategoryData(keyAccount_id, storeType_id,class_id,categoryId);
|
||||||
|
subcategory_list = db.getOrderTaking_SubcategoryData(country_id,categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide);
|
||||||
|
}
|
||||||
|
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter subcategory_select = new MSL_AvailabilityStockFacingGetterSetter();
|
||||||
|
String subcat_select = getResources().getString(R.string.select);
|
||||||
|
subcategory_select.setSub_category(subcat_select);
|
||||||
|
subcategory_select.setSub_category_id("0");
|
||||||
|
subcategory_list.add(0, subcategory_select);
|
||||||
|
CustomSubcategoryAdapter subcat_adapter = new CustomSubcategoryAdapter(OrderTakingActivity.this, R.layout.custom_spinner_item, subcategory_list);
|
||||||
|
sp_subcategory.setAdapter(subcat_adapter);
|
||||||
|
sp_subcategory.setOnItemSelectedListener(this);
|
||||||
|
|
||||||
|
brand_list.clear();
|
||||||
|
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||||
|
brand_list = db.getOrderTaking_StockFacingHeaderData(country_id,categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide,0);
|
||||||
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
brand_list = db.getOrderTaking_StockFacingHeaderData(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,0);
|
||||||
|
} else {
|
||||||
|
brand_list = db.getOrderTaking_StockFacingHeaderData(country_id,categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter brand_select = new MSL_AvailabilityStockFacingGetterSetter();
|
||||||
|
String select = getResources().getString(R.string.select);
|
||||||
|
brand_select.setBrand(select);
|
||||||
|
brand_select.setBrand_id("0");
|
||||||
|
brand_list.add(0, brand_select);
|
||||||
|
CustomBrandAdapter brandAdapter = new CustomBrandAdapter(OrderTakingActivity.this, R.layout.custom_spinner_item, brand_list);
|
||||||
|
spinner_brand_list.setAdapter(brandAdapter);
|
||||||
|
spinner_brand_list.setOnItemSelectedListener(this);
|
||||||
|
|
||||||
|
|
||||||
|
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||||
|
skuListdata = db.getORDERTAKING_StockFacingSKUData("0", categoryId, "0", null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE, store_flag_hide);
|
||||||
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
skuListdata = db.getORDERTAKING_StockFacingSKUData("0", categoryId, "0", keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC, store_flag_hide);
|
||||||
|
} else {
|
||||||
|
skuListdata = db.getORDERTAKING_StockFacingSKUData("0", categoryId, "0", keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, store_flag_hide);
|
||||||
|
}
|
||||||
|
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter sku_select = new MSL_AvailabilityStockFacingGetterSetter();
|
||||||
|
String selectnew = getResources().getString(R.string.select);
|
||||||
|
sku_select.setSku(selectnew);
|
||||||
|
sku_select.setSku_id("0");
|
||||||
|
// skuListdata.add(0, sku_select);
|
||||||
|
if (!skuListdata.isEmpty()) {
|
||||||
|
skuListdata.add(0, sku_select);
|
||||||
|
}
|
||||||
|
CustomSkuAdapter skuAdapter = new CustomSkuAdapter(OrderTakingActivity.this, R.layout.custom_spinner_item, skuListdata);
|
||||||
|
sp_promotion_typ.setAdapter(skuAdapter);
|
||||||
|
sp_promotion_typ.setTitle("Search SKU");
|
||||||
|
sp_promotion_typ.setPositiveButton("Close");
|
||||||
|
sp_promotion_typ.setOnItemSelectedListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean validation() {
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
if(img_str.equals("") && country_id.equals("17")){
|
if(img_str.isEmpty() && country_id.equals("17")){
|
||||||
flag = false;
|
flag = false;
|
||||||
Toast.makeText(context, context.getString(R.string.pls_capture_img), Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, context.getString(R.string.pls_capture_img), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
@@ -575,20 +693,17 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
hashMapListChildData = new HashMap<>();
|
hashMapListChildData = new HashMap<>();
|
||||||
//Header
|
//Header
|
||||||
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||||
headerDataList = db.getOrderTaking_StockFacingHeaderData(country_id,categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide);
|
headerDataList = db.getOrderTaking_StockFacingHeaderData(country_id,categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide, subcategoryId);
|
||||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
headerDataList = db.getOrderTaking_StockFacingHeaderData(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);
|
headerDataList = db.getOrderTaking_StockFacingHeaderData(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, subcategoryId);
|
||||||
} else {
|
} else {
|
||||||
headerDataList = db.getOrderTaking_StockFacingHeaderData(country_id,categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide);
|
headerDataList = db.getOrderTaking_StockFacingHeaderData(country_id,categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide, subcategoryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headerDataList.size() > 0) {
|
if (headerDataList.size() > 0) {
|
||||||
for (int i = 0; i < headerDataList.size(); i++) {
|
for (int i = 0; i < headerDataList.size(); i++) {
|
||||||
hashMapListHeaderData.add(headerDataList.get(i));
|
hashMapListHeaderData.add(headerDataList.get(i));
|
||||||
//childDataList = new ArrayList<>();
|
|
||||||
childDataList = db.getOrder_TAKING_SKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
childDataList = db.getOrder_TAKING_SKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||||
//Log.e("childlistsize", String.valueOf(childDataList.size()));
|
|
||||||
// childDataList = db.getMSL_Availability_StockFacingSKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
|
||||||
if (!(childDataList.size() > 0)) {
|
if (!(childDataList.size() > 0)) {
|
||||||
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||||
childDataList = db.getORDERTAKING_StockFacingSKUData(headerDataList.get(i).getSub_category_id(), categoryId, headerDataList.get(i).getBrand_id(), null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE, store_flag_hide);
|
childDataList = db.getORDERTAKING_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);
|
||||||
@@ -666,6 +781,81 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long _po) {
|
||||||
|
int id = parent.getId();
|
||||||
|
if (id == R.id.sp_subcategory) {
|
||||||
|
if (position != 0) {
|
||||||
|
subcategory = subcategory_list.get(position).getSub_category();
|
||||||
|
subcategoryId = Integer.parseInt(subcategory_list.get(position).getSub_category_id());
|
||||||
|
|
||||||
|
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||||
|
brand_list = db.getOrderTaking_Branddata(country_id,categoryId, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide,subcategoryId);
|
||||||
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
brand_list = db.getOrderTaking_Branddata(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,subcategoryId);
|
||||||
|
} else {
|
||||||
|
brand_list = db.getOrderTaking_StockFacingHeaderData(country_id,categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, CommonString.TABLE_MAPPING_SOS_TARGET, store_flag_hide,subcategoryId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// brand_list = db.getCompetionData(keyAccount_id, storeType_id, class_id, categoryId, subcategoryId);
|
||||||
|
// Prepare brand data with default "Select" option
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter brand_select = new MSL_AvailabilityStockFacingGetterSetter();
|
||||||
|
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(OrderTakingActivity.this, R.layout.custom_spinner_item, brand_list);
|
||||||
|
spinner_brand_list.setAdapter(adapter);
|
||||||
|
spinner_brand_list.setOnItemSelectedListener(this);
|
||||||
|
} 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();
|
||||||
|
brand_id = Integer.parseInt(brand_list.get(position).getBrand_id());
|
||||||
|
// skuListdata.clear();
|
||||||
|
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||||
|
skuListdata = db.getORDERTAKING_StockFacingSKUData(String.valueOf(subcategoryId), categoryId, String.valueOf(brand_id), null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE, store_flag_hide);
|
||||||
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
skuListdata = db.getORDERTAKING_StockFacingSKUData(String.valueOf(subcategoryId), categoryId, String.valueOf(brand_id), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC, store_flag_hide);
|
||||||
|
} else {
|
||||||
|
skuListdata = db.getORDERTAKING_StockFacingSKUData(String.valueOf(subcategoryId), categoryId, String.valueOf(brand_id), keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK, store_flag_hide);
|
||||||
|
}
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter sku_select = new MSL_AvailabilityStockFacingGetterSetter();
|
||||||
|
String select = getResources().getString(R.string.select);
|
||||||
|
sku_select.setSku(select);
|
||||||
|
sku_select.setSku_id("0");
|
||||||
|
skuListdata.add(0, sku_select);
|
||||||
|
CustomSkuAdapter skuAdapter = new CustomSkuAdapter(OrderTakingActivity.this, R.layout.custom_spinner_item, skuListdata);
|
||||||
|
sp_promotion_typ.setAdapter(skuAdapter);
|
||||||
|
sp_promotion_typ.setTitle("Search SKU");
|
||||||
|
sp_promotion_typ.setPositiveButton("Close");
|
||||||
|
sp_promotion_typ.setOnItemSelectedListener(this);
|
||||||
|
} else {
|
||||||
|
brand = "";
|
||||||
|
brand_id = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (id == R.id.sp_promotion_typ) {
|
||||||
|
if (position != 0) {
|
||||||
|
skuname = skuListdata.get(position).getSku();
|
||||||
|
skuid = Integer.parseInt(skuListdata.get(position).getSku_id());
|
||||||
|
} else {
|
||||||
|
skuname = "";
|
||||||
|
skuid = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNothingSelected(AdapterView<?> adapterView) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public class ExpandableListAdapter extends BaseExpandableListAdapter {
|
public class ExpandableListAdapter extends BaseExpandableListAdapter {
|
||||||
private Context _context;
|
private Context _context;
|
||||||
private List<MSL_AvailabilityStockFacingGetterSetter> _listDataHeader;
|
private List<MSL_AvailabilityStockFacingGetterSetter> _listDataHeader;
|
||||||
@@ -917,12 +1107,10 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
AlertDialog.Builder builder = new AlertDialog.Builder(OrderTakingActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(OrderTakingActivity.this);
|
||||||
builder.setMessage(getString(R.string.check_faceup))
|
builder.setMessage(getString(R.string.check_faceup))
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
.setPositiveButton(getString(R.string.ok), (dialog, id) -> {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
finalHolder1.facing.setText("");
|
finalHolder1.facing.setText("");
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
finalHolder2.facing.setText("");
|
finalHolder2.facing.setText("");
|
||||||
}
|
|
||||||
});
|
});
|
||||||
AlertDialog alert = builder.create();
|
AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
@@ -945,10 +1133,8 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
faceup = "0";
|
faceup = "0";
|
||||||
} else {
|
} else {
|
||||||
faceup = edFaceup.replaceFirst("^0+(?!$)", "");
|
faceup = edFaceup.replaceFirst("^0+(?!$)", "");
|
||||||
//faceup = new DecimalFormat("##.#").format(Double.parseDouble(faceup));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// String str2 = PerfectDecimal(faceup, 3, 1);
|
|
||||||
childData.setFacing(faceup);
|
childData.setFacing(faceup);
|
||||||
} else {
|
} else {
|
||||||
childData.setFacing("");
|
childData.setFacing("");
|
||||||
@@ -1100,6 +1286,7 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
//super.onBackPressed();
|
//super.onBackPressed();
|
||||||
|
super.onBackPressed();
|
||||||
if (editFlag) {
|
if (editFlag) {
|
||||||
CommonFunctions.showAlertDialog(OrderTakingActivity.this, getResources().getString(R.string.data_will_be_lost));
|
CommonFunctions.showAlertDialog(OrderTakingActivity.this, getResources().getString(R.string.data_will_be_lost));
|
||||||
} else {
|
} else {
|
||||||
@@ -1157,10 +1344,214 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
|
|||||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||||
intent.setPackage(gallery_package);
|
intent.setPackage(gallery_package);
|
||||||
startActivityForResult(intent, 0);
|
startActivityForResult(intent, 0);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class CustomSubcategoryAdapter extends ArrayAdapter<String> {
|
||||||
|
private Activity activity;
|
||||||
|
private ArrayList data;
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter tempValues = null;
|
||||||
|
LayoutInflater inflater;
|
||||||
|
|
||||||
|
public CustomSubcategoryAdapter(
|
||||||
|
OrderTakingActivity activitySpinner,
|
||||||
|
int textViewResourceId,
|
||||||
|
ArrayList objects
|
||||||
|
|
||||||
|
) {
|
||||||
|
super(activitySpinner, textViewResourceId, objects);
|
||||||
|
/********** Take passed values **********/
|
||||||
|
activity = activitySpinner;
|
||||||
|
data = objects;
|
||||||
|
/*********** Layout inflator to call external xml layout () **********************/
|
||||||
|
inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getDropDownView(int position, View convertView, ViewGroup parent) {
|
||||||
|
return getCustomView(position, convertView, parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
return getCustomView(position, convertView, parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
// This funtion called for each row ( Called data.size() times )
|
||||||
|
public View getCustomView(int position, View convertView, ViewGroup parent) {
|
||||||
|
|
||||||
|
/********** Inflate spinner_rows.xml file for each row ( Defined below ) ************/
|
||||||
|
View row = inflater.inflate(R.layout.custom_spinner_item, parent, false);
|
||||||
|
|
||||||
|
/***** Get each Model object from Arraylist ********/
|
||||||
|
tempValues = null;
|
||||||
|
tempValues = (MSL_AvailabilityStockFacingGetterSetter) data.get(position);
|
||||||
|
|
||||||
|
TextView label = (TextView) row.findViewById(R.id.tv_text);
|
||||||
|
|
||||||
|
if (position == 0) {
|
||||||
|
|
||||||
|
// Default selected Spinner item
|
||||||
|
label.setText(getResources().getString(R.string.select));
|
||||||
|
//sub.setText("");
|
||||||
|
} else {
|
||||||
|
// Set values for spinner each row
|
||||||
|
label.setText(tempValues.getSub_category());
|
||||||
|
}
|
||||||
|
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CustomBrandAdapter extends ArrayAdapter<String> {
|
||||||
|
|
||||||
|
private Activity activity;
|
||||||
|
private ArrayList data;
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter tempValues = null;
|
||||||
|
LayoutInflater inflater;
|
||||||
|
|
||||||
|
/*************
|
||||||
|
* CustomBrandAdapter Constructor
|
||||||
|
*****************/
|
||||||
|
public CustomBrandAdapter(
|
||||||
|
OrderTakingActivity activitySpinner,
|
||||||
|
int textViewResourceId,
|
||||||
|
ArrayList objects
|
||||||
|
) {
|
||||||
|
super(activitySpinner, textViewResourceId, objects);
|
||||||
|
|
||||||
|
/********** Take passed values **********/
|
||||||
|
activity = activitySpinner;
|
||||||
|
data = objects;
|
||||||
|
/*********** Layout inflator to call external xml layout () **********************/
|
||||||
|
inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getDropDownView(int position, View convertView, ViewGroup parent) {
|
||||||
|
return getCustomView(position, convertView, parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
return getCustomView(position, convertView, parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
// This funtion called for each row ( Called data.size() times )
|
||||||
|
public View getCustomView(int position, View convertView, ViewGroup parent) {
|
||||||
|
|
||||||
|
/********** Inflate spinner_rows.xml file for each row ( Defined below ) ************/
|
||||||
|
View row = inflater.inflate(R.layout.custom_spinner_item, parent, false);
|
||||||
|
|
||||||
|
/***** Get each Model object from Arraylist ********/
|
||||||
|
tempValues = null;
|
||||||
|
tempValues = (MSL_AvailabilityStockFacingGetterSetter) data.get(position);
|
||||||
|
TextView label = (TextView) row.findViewById(R.id.tv_text);
|
||||||
|
// label.setText(tempValues.getBrand() + "-"+ tempValues.getSub_category());
|
||||||
|
if (position == 0) {
|
||||||
|
// Default selected Spinner item
|
||||||
|
label.setText(getResources().getString(R.string.select));
|
||||||
|
//sub.setText("");
|
||||||
|
} else {
|
||||||
|
// Set values for spinner each row
|
||||||
|
label.setText(tempValues.getBrand() + "-"+ tempValues.getSub_category());
|
||||||
|
}
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class CustomSkuAdapter extends ArrayAdapter<String> {
|
||||||
|
private Activity activity;
|
||||||
|
private ArrayList data;
|
||||||
|
MSL_AvailabilityStockFacingGetterSetter tempValues = null;
|
||||||
|
LayoutInflater inflater;
|
||||||
|
|
||||||
|
public CustomSkuAdapter(
|
||||||
|
OrderTakingActivity activitySpinner,
|
||||||
|
int textViewResourceId,
|
||||||
|
ArrayList objects
|
||||||
|
) {
|
||||||
|
super(activitySpinner, textViewResourceId, objects);
|
||||||
|
|
||||||
|
/********** Take passed values **********/
|
||||||
|
activity = activitySpinner;
|
||||||
|
data = objects;
|
||||||
|
/*********** Layout inflator to call external xml layout () **********************/
|
||||||
|
inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getDropDownView(int position, View convertView, ViewGroup parent) {
|
||||||
|
return getCustomView(position, convertView, parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
return getCustomView(position, convertView, parent);
|
||||||
|
}
|
||||||
|
public View getCustomView(int position, View convertView, ViewGroup parent) {
|
||||||
|
|
||||||
|
/********** Inflate spinner_rows.xml file for each row ( Defined below ) ************/
|
||||||
|
View row = inflater.inflate(R.layout.custom_spinner_item, parent, false);
|
||||||
|
tempValues = null;
|
||||||
|
tempValues = (MSL_AvailabilityStockFacingGetterSetter) data.get(position);
|
||||||
|
TextView label = (TextView) row.findViewById(R.id.tv_text);
|
||||||
|
if (position == 0) {
|
||||||
|
// Default selected Spinner item
|
||||||
|
label.setText(getResources().getString(R.string.select));
|
||||||
|
} else {
|
||||||
|
label.setText(tempValues.getSku());
|
||||||
|
}
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ProductAdapter extends RecyclerView.Adapter<ProductAdapter.ViewHolder> {
|
||||||
|
|
||||||
|
private ArrayList<MSL_AvailabilityStockFacingGetterSetter> list;
|
||||||
|
|
||||||
|
public ProductAdapter(ArrayList<MSL_AvailabilityStockFacingGetterSetter> promoList) {
|
||||||
|
list = promoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProductAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
View view = LayoutInflater.from(parent.getContext())
|
||||||
|
.inflate(R.layout.item_order_taking_new, parent, false);
|
||||||
|
return new ProductAdapter.ViewHolder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(final ProductAdapter.ViewHolder holder, int position) {
|
||||||
|
final MSL_AvailabilityStockFacingGetterSetter mItem = list.get(position);
|
||||||
|
holder.tv_brand.setText(mItem.getSub_category());
|
||||||
|
holder.tv_competitor.setText(mItem.getBrand());
|
||||||
|
holder.tv_sku_name.setText(mItem.getSku());
|
||||||
|
holder.tv_order_qty.setText(mItem.getOrder_qty());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return list.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
public final View mView;
|
||||||
|
public final TextView tv_brand, tv_competitor,tv_sku_name,tv_order_qty;
|
||||||
|
|
||||||
|
public ViewHolder(View view) {
|
||||||
|
super(view);
|
||||||
|
mView = view;
|
||||||
|
tv_brand = (TextView) mView.findViewById(R.id.tv_brand);
|
||||||
|
tv_order_qty = (TextView) mView.findViewById(R.id.tv_order_qty);
|
||||||
|
tv_sku_name = (TextView) mView.findViewById(R.id.tv_sku_name);
|
||||||
|
tv_competitor = (TextView) mView.findViewById(R.id.tv_competitor);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,419 @@
|
|||||||
|
package cpm.com.gskmtorange.dailyentry
|
||||||
|
|
||||||
|
import android.content.BroadcastReceiver
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.content.IntentFilter
|
||||||
|
import android.content.SharedPreferences
|
||||||
|
import android.net.ConnectivityManager
|
||||||
|
import android.net.NetworkCapabilities
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.preference.PreferenceManager
|
||||||
|
import android.util.Log
|
||||||
|
import android.view.MenuItem
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.Toast
|
||||||
|
import androidx.appcompat.app.AlertDialog
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.core.net.toUri
|
||||||
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.google.android.material.snackbar.Snackbar
|
||||||
|
import com.sj.camera_lib_android.Database.ReactPendingData
|
||||||
|
import com.sj.camera_lib_android.Database.ReactSingleImage
|
||||||
|
import com.sj.camera_lib_android.models.ImageUploadModel
|
||||||
|
import com.sj.camera_lib_android.utils.CameraSDK
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter
|
||||||
|
import cpm.com.gskmtorange.R
|
||||||
|
import cpm.com.gskmtorange.adapter.SubCatPdAdapter
|
||||||
|
import cpm.com.gskmtorange.adapter.data.ImageUri
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions.savefile
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString
|
||||||
|
import cpm.com.gskmtorange.constant.CommonUtils
|
||||||
|
import cpm.com.gskmtorange.databinding.ActivityPdvisibilityBinding
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.Master_Storelist_PDA_GetterSetter
|
||||||
|
import kotlinx.coroutines.delay
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
import org.json.JSONObject
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
class PDVisibilityActivity : AppCompatActivity() {
|
||||||
|
private var context: Context? = null
|
||||||
|
var categoryName: String? = null
|
||||||
|
var categoryId: String? = null
|
||||||
|
var store_id: String? = null;
|
||||||
|
var lang: String? = null;
|
||||||
|
var date: String? = null;
|
||||||
|
var store_type_id: String? = null
|
||||||
|
var class_id: String? = null
|
||||||
|
var key_account_id: String? = null
|
||||||
|
var country_id: String? = null
|
||||||
|
var store_flag_str: String? = null
|
||||||
|
private var preferences: SharedPreferences? = null
|
||||||
|
var db: GSKOrangeDB? = null
|
||||||
|
var listdat: ArrayList<CategoryPictureGetterSetter>? = ArrayList()
|
||||||
|
var masterStoreListPd: ArrayList<Master_Storelist_PDA_GetterSetter>? = ArrayList()
|
||||||
|
var username: String? = ""
|
||||||
|
var toggle: String? = "1"
|
||||||
|
private var kpi_name: String? = ""
|
||||||
|
private lateinit var binding: ActivityPdvisibilityBinding
|
||||||
|
private var adapter: SubCatPdAdapter? = null
|
||||||
|
val PERMISSION_ALL: Int = 99
|
||||||
|
private var _pos = -1;
|
||||||
|
var devicename : String? = ""
|
||||||
|
var store_name : String? = ""
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
binding = ActivityPdvisibilityBinding.inflate(layoutInflater)
|
||||||
|
setContentView(binding.root)
|
||||||
|
setSupportActionBar(binding.toolbar)
|
||||||
|
context = this
|
||||||
|
db = GSKOrangeDB(context)
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
|
db?.open()
|
||||||
|
preferences?.let {
|
||||||
|
lang = it.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
|
store_id = it.getString(CommonString.KEY_STORE_ID, "")
|
||||||
|
store_name = it.getString(CommonString.KEY_STORE_NAME, "")
|
||||||
|
username = it.getString(CommonString.KEY_USERNAME, "")
|
||||||
|
store_type_id = it.getString(CommonString.KEY_STORETYPE_ID, "")
|
||||||
|
class_id = it.getString(CommonString.KEY_CLASS_ID, "")
|
||||||
|
key_account_id = it.getString(CommonString.KEY_KEYACCOUNT_ID, "")
|
||||||
|
country_id = it.getString(CommonString.KEY_COUNTRY_ID, "")
|
||||||
|
store_flag_str = it.getString(CommonString.KEY_STORE_FLAG, "")
|
||||||
|
date = it.getString(CommonString.KEY_DATE, "")
|
||||||
|
//Log.d("languagedata", lang.toString());
|
||||||
|
}
|
||||||
|
devicename = android.os.Build.MANUFACTURER
|
||||||
|
|
||||||
|
CommonFunctions.updateLangResources(
|
||||||
|
context, preferences?.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
|
)
|
||||||
|
intent?.let {
|
||||||
|
categoryName = it.getStringExtra("categoryName")
|
||||||
|
categoryId = it.getStringExtra("categoryId")
|
||||||
|
Log.d("catdata",categoryId.toString() +","+categoryName);
|
||||||
|
kpi_name = it.getStringExtra("kpi_name")
|
||||||
|
}
|
||||||
|
|
||||||
|
supportActionBar?.apply {
|
||||||
|
setHomeButtonEnabled(true)
|
||||||
|
setDisplayHomeAsUpEnabled(true)
|
||||||
|
title = kpi_name
|
||||||
|
}
|
||||||
|
masterStoreListPd = db?.getMasterStoreListPd(store_id,CommonString.TABLE_MASTER_STORELIST_PD)
|
||||||
|
preferences?.getString(CommonString.KEY_PD_PROJECT_Id, "")?.let { projectId ->
|
||||||
|
val userId = preferences?.getString(CommonString.KEY_PD_USER_Id, "")
|
||||||
|
.takeIf { !it.isNullOrBlank() } ?: username
|
||||||
|
|
||||||
|
CommonUtils.initializePDSDK(
|
||||||
|
this@PDVisibilityActivity,
|
||||||
|
projectId = projectId,
|
||||||
|
_userId = userId
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
registerIntentFilter(
|
||||||
|
listOf(
|
||||||
|
"DataSaved", "did-receive-queue-data", "did-receive-image-upload-status"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
binding.rlContent.btntoggle.setOnClickListener {
|
||||||
|
if(toggle =="1"){
|
||||||
|
toggle = "0"
|
||||||
|
binding.rlContent.recyclerViewSubCat.visibility = View.GONE
|
||||||
|
binding.rlContent.btntoggle.isChecked = false
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
toggle = "1"
|
||||||
|
binding.rlContent.recyclerViewSubCat.visibility = View.VISIBLE
|
||||||
|
binding.rlContent.btntoggle.isChecked = true
|
||||||
|
Log.d("toggle_value_new",toggle.toString())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
binding.apply {
|
||||||
|
fab.setOnClickListener {
|
||||||
|
if (validate()) {
|
||||||
|
val builder = AlertDialog.Builder(this@PDVisibilityActivity)
|
||||||
|
builder.setMessage(getString(R.string.check_save_message)).setCancelable(false)
|
||||||
|
.setPositiveButton(getString(R.string.yes)) { dialog, _ ->
|
||||||
|
// Handle Yes button click
|
||||||
|
db?.open()
|
||||||
|
db?.InsertPdImageVisibilityData(
|
||||||
|
date,
|
||||||
|
store_id,
|
||||||
|
categoryId,
|
||||||
|
listdat,
|
||||||
|
toggle,
|
||||||
|
CommonString.KEY_COMPELETE
|
||||||
|
)?.let {
|
||||||
|
if (it > 0) {
|
||||||
|
Snackbar.make(
|
||||||
|
binding.fab,
|
||||||
|
resources.getString(R.string.save_message),
|
||||||
|
Snackbar.LENGTH_LONG
|
||||||
|
).setAction("Action", null).show()
|
||||||
|
lifecycleScope.launch {
|
||||||
|
delay(3000) // 3 seconds delay
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Snackbar.make(
|
||||||
|
binding.fab,
|
||||||
|
resources.getString(R.string.save_message),
|
||||||
|
Snackbar.LENGTH_LONG
|
||||||
|
).setAction("Action", null).show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dialog.dismiss()
|
||||||
|
}.setNegativeButton(getString(R.string.no)) { dialog, _ ->
|
||||||
|
dialog.cancel()
|
||||||
|
}
|
||||||
|
val alert = builder.create()
|
||||||
|
alert.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
callAdapter()
|
||||||
|
// checkAndRequestPermissions()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
CommonFunctions.updateLangResources(
|
||||||
|
context,
|
||||||
|
preferences!!.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
|
)
|
||||||
|
db?.open()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun validate(): Boolean {
|
||||||
|
var checkFlag = true // Use local variable to avoid issues
|
||||||
|
if (!listdat.isNullOrEmpty() && toggle=="1") {
|
||||||
|
for (data in listdat!!) { // Use standard loop for better control
|
||||||
|
if (data.imageUris.isNullOrEmpty()) {
|
||||||
|
checkFlag = false // Set false if validation fails
|
||||||
|
Snackbar.make(
|
||||||
|
binding.fab,
|
||||||
|
"Please capture IR images of ${data.suB_CATEGORY}",
|
||||||
|
Snackbar.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
break // Stop further checks once an issue is found
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return checkFlag // Correctly return validation result
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
val id = item.itemId
|
||||||
|
if (id == android.R.id.home) {
|
||||||
|
//showDataLossAlert();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
if (id == R.id.action_settings) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
super.onDestroy()
|
||||||
|
LocalBroadcastManager.getInstance(this@PDVisibilityActivity)
|
||||||
|
.unregisterReceiver(myBroadcastReceiver) // onDestroy
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun registerIntentFilter(filters: List<String> = listOf()) {
|
||||||
|
filters.forEach { filter ->
|
||||||
|
LocalBroadcastManager.getInstance(this@PDVisibilityActivity)
|
||||||
|
.registerReceiver(myBroadcastReceiver, IntentFilter(filter))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private val savedImages = mutableListOf<ImageUri>()
|
||||||
|
private var myBroadcastReceiver: BroadcastReceiver = object : BroadcastReceiver() {
|
||||||
|
override fun onReceive(context: Context?, intent: Intent?) {
|
||||||
|
when (intent?.action) {
|
||||||
|
"did-receive-queue-data" -> {
|
||||||
|
val receivedList =
|
||||||
|
intent.getParcelableArrayListExtra<ReactPendingData>("imageList")
|
||||||
|
Log.d("DEBUG-LOG did-receive-queue-data", "$receivedList")
|
||||||
|
if (receivedList.isNullOrEmpty()) {
|
||||||
|
CameraSDK.uploadFailedImage(this@PDVisibilityActivity)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
"did-receive-image-upload-status" -> {
|
||||||
|
val receivedImage = intent.getParcelableExtra<ReactSingleImage>("image")
|
||||||
|
Log.d("DEBUG-LOG did-receive-image-upload-status", "$receivedImage")
|
||||||
|
}
|
||||||
|
|
||||||
|
"DataSaved" -> {
|
||||||
|
val receivedList =
|
||||||
|
intent.getParcelableArrayListExtra<ImageUploadModel>("imageListSaved")
|
||||||
|
Log.d("DEBUG-LOG DataSaved", "$receivedList")
|
||||||
|
receivedList?.let {
|
||||||
|
savedImages.clear()
|
||||||
|
it.forEach { item ->
|
||||||
|
val dir = CommonString.getImagesFolder(context)
|
||||||
|
val setName =
|
||||||
|
store_id + "_" + username?.replace(".", "") + "_IRPD_VISI_IMG-" + File(
|
||||||
|
item.uri
|
||||||
|
).getName()
|
||||||
|
savedImages.add(ImageUri(uri = item.uri, modify_uri = setName))
|
||||||
|
savefile(item.uri.toUri(), "$dir $setName")
|
||||||
|
}
|
||||||
|
adapter?.updateItem(position = _pos, savedImages)
|
||||||
|
Log.e("savedImages", savedImages.toString())
|
||||||
|
_pos = -1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun launchCamera(subCat_code: String, subCategory: String, subCategoryId: String) {
|
||||||
|
val uploadFrom = "TestApp"
|
||||||
|
var shelftype = "posm_$subCategory" +"_"+subCategoryId
|
||||||
|
shelftype = shelftype.lowercase().replace("[^a-z0-9_]".toRegex(), "")
|
||||||
|
val masterstorelistpddata = masterStoreListPd?.getOrNull(0)
|
||||||
|
val metadata = JSONObject().apply {
|
||||||
|
put("Device_Name", devicename ?: "NA")
|
||||||
|
put("username", username ?: "NA")
|
||||||
|
put("shop_name", store_name ?: "NA")
|
||||||
|
put("parinaam_id", masterstorelistpddata?.storeId?.getOrNull(0) ?: "NA") //storeid
|
||||||
|
put("channel", masterstorelistpddata?.channel?.getOrNull(0) ?: "NA")
|
||||||
|
put("format", masterstorelistpddata?.format?.getOrNull(0) ?: "NA")
|
||||||
|
put("region", masterstorelistpddata?.region?.getOrNull(0) ?: "NA")
|
||||||
|
put("bay_type", masterstorelistpddata?.bay_type?.getOrNull(0) ?: "NA")
|
||||||
|
put("no_of_bays", masterstorelistpddata?.no_of_bays?.getOrNull(0) ?: "NA")
|
||||||
|
put("category", categoryName?: "NA")
|
||||||
|
put("user_id", masterstorelistpddata?.user_id?.getOrNull(0) ?: "NA")
|
||||||
|
put("Active", masterstorelistpddata?.active?.getOrNull(0) ?: "NA")
|
||||||
|
put("ASMArea", masterstorelistpddata?.asmArea?.getOrNull(0) ?: "NA")
|
||||||
|
put("EmployeeName", masterstorelistpddata?.employeeName?.getOrNull(0) ?: "NA")
|
||||||
|
put("DesignationName", masterstorelistpddata?.designationName?.getOrNull(0) ?: "NA")
|
||||||
|
put("SupervisorId", masterstorelistpddata?.supervisorId?.getOrNull(0) ?: "NA")
|
||||||
|
put("Supervisor", masterstorelistpddata?.supervisor?.getOrNull(0) ?: "NA")
|
||||||
|
put("StoreCode", masterstorelistpddata?.storeCode?.getOrNull(0) ?: "NA")
|
||||||
|
put("ChainId", masterstorelistpddata?.chainId?.getOrNull(0) ?: "NA")
|
||||||
|
put("StoreTypeId", masterstorelistpddata?.storeTypeId?.getOrNull(0) ?: "NA")
|
||||||
|
put("SOName", masterstorelistpddata?.soName?.getOrNull(0) ?: "NA")
|
||||||
|
}
|
||||||
|
|
||||||
|
val uploadParams = JSONObject().apply {
|
||||||
|
put("shop_id", store_id)
|
||||||
|
put("project_id", preferences?.getString(CommonString.KEY_PD_PROJECT_Id, ""))
|
||||||
|
put("shelf_type", shelftype)
|
||||||
|
put("category_id", subCat_code)
|
||||||
|
put("user_id", username)
|
||||||
|
put("metadata", metadata)
|
||||||
|
}
|
||||||
|
|
||||||
|
// "metadata": { "Device_Name": $devicename,"Username": $username }
|
||||||
|
/* uploadParams.put("shop_id", store_id)
|
||||||
|
uploadParams.put("user_id", username)
|
||||||
|
uploadParams.put("category_id", subCat_code)
|
||||||
|
uploadParams.put("project_id", preferences?.getString(CommonString.KEY_PD_PROJECT_Id, ""))*/
|
||||||
|
|
||||||
|
Log.d("uploadParams", uploadParams.toString())
|
||||||
|
if(!lang.equals("ENGLISH",ignoreCase = true)){
|
||||||
|
CameraSDK.startCamera(
|
||||||
|
context = this,
|
||||||
|
orientation = "",
|
||||||
|
widthPercentage = 20,
|
||||||
|
uploadParams = uploadParams,
|
||||||
|
resolution = 3000,
|
||||||
|
referenceUrl = "",
|
||||||
|
allowBlurCheck = true,
|
||||||
|
allowCrop = true,
|
||||||
|
uploadFrom = uploadFrom,
|
||||||
|
isRetake = false,
|
||||||
|
showOverlapToggleButton = false,
|
||||||
|
showGridLines = true,
|
||||||
|
zoomLevel = 1.0,
|
||||||
|
language_code = "ar",
|
||||||
|
isLambda = false
|
||||||
|
)
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
CameraSDK.startCamera(
|
||||||
|
context = this,
|
||||||
|
orientation = "",
|
||||||
|
widthPercentage = 20,
|
||||||
|
uploadParams = uploadParams,
|
||||||
|
resolution = 3000,
|
||||||
|
referenceUrl = "",
|
||||||
|
allowBlurCheck = true,
|
||||||
|
allowCrop = true,
|
||||||
|
uploadFrom = uploadFrom,
|
||||||
|
isRetake = false,
|
||||||
|
showOverlapToggleButton = false,
|
||||||
|
showGridLines = true,
|
||||||
|
zoomLevel = 1.0,
|
||||||
|
language_code = "en",
|
||||||
|
isLambda = false
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun callAdapter() {
|
||||||
|
db?.open()
|
||||||
|
listdat = db?.getirVisibilityData(date,store_id,categoryId)
|
||||||
|
|
||||||
|
// Log.d("listdatsize", listdat?.size.toString() +","+listdat?.get(0)?.toggle_value)
|
||||||
|
adapter = SubCatPdAdapter(
|
||||||
|
category = categoryName,
|
||||||
|
context = this,
|
||||||
|
subcates = ArrayList(),
|
||||||
|
btnlistener = object : SubCatPdAdapter.BtnClickListener {
|
||||||
|
override fun onStartSessionClick(_pos: Int, data: CategoryPictureGetterSetter) {
|
||||||
|
this@PDVisibilityActivity._pos = _pos
|
||||||
|
launchCamera(data.subCatCode,data.suB_CATEGORY,data.suB_CATEGORY_ID)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
binding.rlContent.apply {
|
||||||
|
recyclerViewSubCat.adapter = adapter
|
||||||
|
recyclerViewSubCat.layoutManager = LinearLayoutManager(this@PDVisibilityActivity)
|
||||||
|
adapter?.addsubCatItems(listdat)
|
||||||
|
}
|
||||||
|
|
||||||
|
toggle = listdat?.get(0)?.toggle_value ?: "1"
|
||||||
|
|
||||||
|
if(toggle == "1"){
|
||||||
|
binding.rlContent.recyclerViewSubCat.visibility = View.VISIBLE
|
||||||
|
binding.rlContent.btntoggle.isChecked = true
|
||||||
|
} else {
|
||||||
|
binding.rlContent.recyclerViewSubCat.visibility = View.GONE
|
||||||
|
binding.rlContent.btntoggle.isChecked = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
override fun onPause() {
|
||||||
|
super.onPause()
|
||||||
|
db?.open()
|
||||||
|
if (!db!!.isPdVisibility(store_id, date, CommonString.KEY_COMPELETE, categoryId)) {
|
||||||
|
db?.InsertPdImageVisibilityData(date, store_id, categoryId, listdat,toggle, CommonString.KEY_DRAFT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fun isNetworkAvailable(context: Context): Boolean {
|
||||||
|
val connectivityManager =
|
||||||
|
context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
|
||||||
|
|
||||||
|
val network = connectivityManager.activeNetwork ?: return false
|
||||||
|
val activeNetwork = connectivityManager.getNetworkCapabilities(network) ?: return false
|
||||||
|
|
||||||
|
return when {
|
||||||
|
activeNetwork.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) -> true
|
||||||
|
activeNetwork.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR) -> true
|
||||||
|
activeNetwork.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET) -> true
|
||||||
|
else -> false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,465 @@
|
|||||||
|
package cpm.com.gskmtorange.dailyentry
|
||||||
|
|
||||||
|
import android.Manifest
|
||||||
|
import android.content.BroadcastReceiver
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.DialogInterface
|
||||||
|
import android.content.Intent
|
||||||
|
import android.content.IntentFilter
|
||||||
|
import android.content.SharedPreferences
|
||||||
|
import android.content.pm.PackageManager
|
||||||
|
import android.os.Build
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.preference.PreferenceManager
|
||||||
|
import android.util.Log
|
||||||
|
import android.view.MenuItem
|
||||||
|
import androidx.appcompat.app.AlertDialog
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.core.app.ActivityCompat
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
|
import androidx.core.net.toUri
|
||||||
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.google.android.material.snackbar.Snackbar
|
||||||
|
import com.sj.camera_lib_android.Database.ReactPendingData
|
||||||
|
import com.sj.camera_lib_android.Database.ReactSingleImage
|
||||||
|
import com.sj.camera_lib_android.models.ImageUploadModel
|
||||||
|
import com.sj.camera_lib_android.utils.CameraSDK
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter
|
||||||
|
import cpm.com.gskmtorange.R
|
||||||
|
import cpm.com.gskmtorange.adapter.SubCatPdAdapter
|
||||||
|
import cpm.com.gskmtorange.adapter.data.ImageUri
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions.savefile
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString
|
||||||
|
import cpm.com.gskmtorange.constant.CommonUtils
|
||||||
|
import cpm.com.gskmtorange.databinding.ActivityPdPogBinding
|
||||||
|
import cpm.com.gskmtorange.databinding.ActivityPdimageBinding
|
||||||
|
import kotlinx.coroutines.delay
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
import org.json.JSONObject
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
class PD_Pog_Activity : AppCompatActivity() {
|
||||||
|
private var context: Context? = null
|
||||||
|
var categoryName: String? = null
|
||||||
|
var categoryId: String? = null
|
||||||
|
var store_id: String? = null;
|
||||||
|
var date: String? = null;
|
||||||
|
var store_type_id: String? = null
|
||||||
|
var class_id: String? = null
|
||||||
|
var key_account_id: String? = null
|
||||||
|
var country_id: String? = null
|
||||||
|
var store_flag_str: String? = null
|
||||||
|
private var preferences: SharedPreferences? = null
|
||||||
|
var db: GSKOrangeDB? = null
|
||||||
|
var listdat: ArrayList<CategoryPictureGetterSetter>? = ArrayList()
|
||||||
|
var username: String? = ""
|
||||||
|
private var kpi_name: String? = ""
|
||||||
|
private lateinit var binding: ActivityPdPogBinding
|
||||||
|
private var adapter: SubCatPdAdapter? = null
|
||||||
|
val PERMISSION_ALL: Int = 99
|
||||||
|
private var _pos = -1;
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
binding = ActivityPdPogBinding.inflate(layoutInflater)
|
||||||
|
setContentView(binding.root)
|
||||||
|
setSupportActionBar(binding.toolbar)
|
||||||
|
context = this
|
||||||
|
|
||||||
|
db = GSKOrangeDB(context)
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
|
db?.open()
|
||||||
|
preferences?.let {
|
||||||
|
store_id = it.getString(CommonString.KEY_STORE_ID, "")
|
||||||
|
username = it.getString(CommonString.KEY_USERNAME, "")
|
||||||
|
store_type_id = it.getString(CommonString.KEY_STORETYPE_ID, "")
|
||||||
|
class_id = it.getString(CommonString.KEY_CLASS_ID, "")
|
||||||
|
key_account_id = it.getString(CommonString.KEY_KEYACCOUNT_ID, "")
|
||||||
|
country_id = it.getString(CommonString.KEY_COUNTRY_ID, "")
|
||||||
|
store_flag_str = it.getString(CommonString.KEY_STORE_FLAG, "")
|
||||||
|
date = it.getString(CommonString.KEY_DATE, "")
|
||||||
|
}
|
||||||
|
|
||||||
|
CommonFunctions.updateLangResources(
|
||||||
|
context, preferences?.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
|
)
|
||||||
|
intent?.let {
|
||||||
|
categoryName = it.getStringExtra("categoryName")
|
||||||
|
categoryId = it.getStringExtra("categoryId")
|
||||||
|
kpi_name = it.getStringExtra("kpi_name")
|
||||||
|
}
|
||||||
|
supportActionBar?.apply {
|
||||||
|
setHomeButtonEnabled(true)
|
||||||
|
setDisplayHomeAsUpEnabled(true)
|
||||||
|
title = kpi_name
|
||||||
|
}
|
||||||
|
preferences?.getString(CommonString.KEY_PD_PROJECT_Id, "")?.let { projectId ->
|
||||||
|
val userId = preferences?.getString(CommonString.KEY_PD_USER_Id, "")
|
||||||
|
.takeIf { !it.isNullOrBlank() } ?: username
|
||||||
|
Log.d("pd_user_id",userId.toString());
|
||||||
|
|
||||||
|
CommonUtils.initializePDSDK(
|
||||||
|
this@PD_Pog_Activity,
|
||||||
|
projectId = projectId,
|
||||||
|
_userId = userId
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
registerIntentFilter(
|
||||||
|
listOf(
|
||||||
|
"DataSaved", "did-receive-queue-data", "did-receive-image-upload-status"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
binding.apply {
|
||||||
|
fab.setOnClickListener {
|
||||||
|
if (validate()) {
|
||||||
|
val builder = AlertDialog.Builder(this@PD_Pog_Activity)
|
||||||
|
builder.setMessage(getString(R.string.check_save_message)).setCancelable(false)
|
||||||
|
.setPositiveButton(getString(R.string.yes)) { dialog, _ ->
|
||||||
|
// Handle Yes button click
|
||||||
|
db?.open()
|
||||||
|
db?.InsertPdPogImageData(
|
||||||
|
date,
|
||||||
|
store_id,
|
||||||
|
categoryId,
|
||||||
|
listdat,
|
||||||
|
CommonString.KEY_COMPELETE
|
||||||
|
)?.let {
|
||||||
|
if (it > 0) {
|
||||||
|
Snackbar.make(
|
||||||
|
binding.fab,
|
||||||
|
resources.getString(R.string.save_message),
|
||||||
|
Snackbar.LENGTH_LONG
|
||||||
|
).setAction("Action", null).show()
|
||||||
|
lifecycleScope.launch {
|
||||||
|
delay(3000) // 3 seconds delay
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Snackbar.make(
|
||||||
|
binding.fab,
|
||||||
|
resources.getString(R.string.save_message),
|
||||||
|
Snackbar.LENGTH_LONG
|
||||||
|
).setAction("Action", null).show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dialog.dismiss()
|
||||||
|
}.setNegativeButton(getString(R.string.no)) { dialog, _ ->
|
||||||
|
dialog.cancel()
|
||||||
|
}
|
||||||
|
val alert = builder.create()
|
||||||
|
alert.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
callAdapter()
|
||||||
|
checkAndRequestPermissions()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
db?.open()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun validate(): Boolean {
|
||||||
|
var checkFlag = true // Use local variable to avoid issues
|
||||||
|
if (!listdat.isNullOrEmpty()) {
|
||||||
|
for (data in listdat!!) { // Use standard loop for better control
|
||||||
|
if (data.imageUris.isNullOrEmpty()) {
|
||||||
|
checkFlag = false // Set false if validation fails
|
||||||
|
Snackbar.make(
|
||||||
|
binding.fab,
|
||||||
|
"Please capture IR images of ${data.suB_CATEGORY}",
|
||||||
|
Snackbar.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
break // Stop further checks once an issue is found
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return checkFlag // Correctly return validation result
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
val id = item.itemId
|
||||||
|
if (id == android.R.id.home) {
|
||||||
|
//showDataLossAlert();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
if (id == R.id.action_settings) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
super.onDestroy()
|
||||||
|
LocalBroadcastManager.getInstance(this@PD_Pog_Activity)
|
||||||
|
.unregisterReceiver(myBroadcastReceiver) // onDestroy
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun registerIntentFilter(filters: List<String> = listOf()) {
|
||||||
|
filters.forEach { filter ->
|
||||||
|
LocalBroadcastManager.getInstance(this@PD_Pog_Activity)
|
||||||
|
.registerReceiver(myBroadcastReceiver, IntentFilter(filter))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private val savedImages = mutableListOf<ImageUri>()
|
||||||
|
private var myBroadcastReceiver: BroadcastReceiver = object : BroadcastReceiver() {
|
||||||
|
override fun onReceive(context: Context?, intent: Intent?) {
|
||||||
|
when (intent?.action) {
|
||||||
|
"did-receive-queue-data" -> {
|
||||||
|
val receivedList =
|
||||||
|
intent.getParcelableArrayListExtra<ReactPendingData>("imageList")
|
||||||
|
Log.d("DEBUG-LOG did-receive-queue-data", "$receivedList")
|
||||||
|
if (receivedList.isNullOrEmpty()) {
|
||||||
|
CameraSDK.uploadFailedImage(this@PD_Pog_Activity)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
"did-receive-image-upload-status" -> {
|
||||||
|
val receivedImage = intent.getParcelableExtra<ReactSingleImage>("image")
|
||||||
|
Log.d("DEBUG-LOG did-receive-image-upload-status", "$receivedImage")
|
||||||
|
}
|
||||||
|
|
||||||
|
"DataSaved" -> {
|
||||||
|
val receivedList =
|
||||||
|
intent.getParcelableArrayListExtra<ImageUploadModel>("imageListSaved")
|
||||||
|
Log.d("DEBUG-LOG DataSaved", "$receivedList")
|
||||||
|
receivedList?.let {
|
||||||
|
savedImages.clear()
|
||||||
|
it.forEach { item ->
|
||||||
|
val dir = CommonString.getImagesFolder(context)
|
||||||
|
val setName =
|
||||||
|
store_id + "_" + username?.replace(".", "") + "_IRPDIMG-" + File(
|
||||||
|
item.uri
|
||||||
|
).getName()
|
||||||
|
savedImages.add(ImageUri(uri = item.uri, modify_uri = setName))
|
||||||
|
savefile(item.uri.toUri(), "$dir $setName")
|
||||||
|
}
|
||||||
|
adapter?.updateItem(position = _pos, savedImages)
|
||||||
|
Log.e("savedImages", savedImages.toString())
|
||||||
|
_pos = -1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun launchCamera(subCat_code: String) {
|
||||||
|
val uploadFrom = "TestApp"
|
||||||
|
val uploadParams = JSONObject(
|
||||||
|
"""
|
||||||
|
{
|
||||||
|
"shop_id": 62475,
|
||||||
|
"project_id": "4f57635b-6b07-45bf-bfba-c61c2826b6db",
|
||||||
|
"td_version_id": 178,
|
||||||
|
"shelf_image_id": null,
|
||||||
|
"asset_image_id": null,
|
||||||
|
"shelf_type": "Primary Shelf",
|
||||||
|
"category_id": 123,
|
||||||
|
"user_id": 133,
|
||||||
|
"isConnected": true,
|
||||||
|
"sn_image_type": "skus",
|
||||||
|
"image_type": "multiple",
|
||||||
|
"seq_no": 1,
|
||||||
|
"level": 1,
|
||||||
|
"uploadOnlyOnWifi": 0,
|
||||||
|
"app_session_id": "8e2faa6b-d6fe-413a-a693-76a0cbe0ce71",
|
||||||
|
"metadata": { "Device_Name": "Samsung" }
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
uploadParams.put("shop_id", store_id)
|
||||||
|
uploadParams.put("user_id", username)
|
||||||
|
uploadParams.put("category_id", subCat_code)
|
||||||
|
uploadParams.put("project_id", preferences?.getString(CommonString.KEY_PD_PROJECT_Id, ""))
|
||||||
|
Log.d("uploadparamdata",uploadParams.toString());
|
||||||
|
|
||||||
|
CameraSDK.startCamera(
|
||||||
|
context = this,
|
||||||
|
orientation = "",
|
||||||
|
widthPercentage = 20,
|
||||||
|
uploadParams = uploadParams,
|
||||||
|
resolution = 3000,
|
||||||
|
referenceUrl = "",
|
||||||
|
allowBlurCheck = true,
|
||||||
|
allowCrop = true,
|
||||||
|
uploadFrom = uploadFrom,
|
||||||
|
isRetake = false,
|
||||||
|
showOverlapToggleButton = false,
|
||||||
|
showGridLines = true,
|
||||||
|
zoomLevel = 1.0,
|
||||||
|
language_code = "en",
|
||||||
|
isLambda = false
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun callAdapter() {
|
||||||
|
if (country_id == "8") {
|
||||||
|
db?.open()
|
||||||
|
listdat = db?.getCategoryPicturePogdata(
|
||||||
|
date,
|
||||||
|
categoryId,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_STOREWISE
|
||||||
|
)
|
||||||
|
} else if (store_flag_str.equals(CommonString.FROM_DEVIATION, ignoreCase = true)) {
|
||||||
|
db?.open()
|
||||||
|
listdat = db?.getCategoryPicturePogdata(
|
||||||
|
date,
|
||||||
|
categoryId,
|
||||||
|
key_account_id,
|
||||||
|
store_type_id,
|
||||||
|
class_id,
|
||||||
|
store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADHOC
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
db?.open()
|
||||||
|
listdat = db?.getCategoryPicturePogdata(
|
||||||
|
date,
|
||||||
|
categoryId,
|
||||||
|
key_account_id,
|
||||||
|
store_type_id,
|
||||||
|
class_id,
|
||||||
|
store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
Log.d("listdatsize", listdat?.size.toString())
|
||||||
|
adapter = SubCatPdAdapter(
|
||||||
|
category = categoryName,
|
||||||
|
context = this,
|
||||||
|
subcates = ArrayList(),
|
||||||
|
btnlistener = object : SubCatPdAdapter.BtnClickListener {
|
||||||
|
override fun onStartSessionClick(_pos: Int, data: CategoryPictureGetterSetter) {
|
||||||
|
this@PD_Pog_Activity._pos = _pos
|
||||||
|
launchCamera(data.subCatCode)
|
||||||
|
Log.d("subCatCode", data.subCatCode)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
binding.rlContent.apply {
|
||||||
|
recyclerViewSubCat.adapter = adapter
|
||||||
|
recyclerViewSubCat.layoutManager = LinearLayoutManager(this@PD_Pog_Activity)
|
||||||
|
adapter?.addsubCatItems(listdat)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
super.onPause()
|
||||||
|
db?.open()
|
||||||
|
if (!db!!.isSOSPogCategory(store_id, date, CommonString.KEY_COMPELETE, categoryId)) {
|
||||||
|
db?.InsertPdPogImageData(date, store_id, categoryId, listdat, CommonString.KEY_DRAFT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun checkAndRequestPermissions() {
|
||||||
|
var read_phone_state = 0
|
||||||
|
var write_storage = 0
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
|
write_storage =
|
||||||
|
ContextCompat.checkSelfPermission(this, Manifest.permission.READ_MEDIA_IMAGES)
|
||||||
|
} else {
|
||||||
|
read_phone_state =
|
||||||
|
ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE)
|
||||||
|
write_storage =
|
||||||
|
ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||||
|
}
|
||||||
|
|
||||||
|
val listPermissionsNeeded: MutableList<String> = java.util.ArrayList()
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
|
if (write_storage != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
listPermissionsNeeded.add(Manifest.permission.READ_MEDIA_IMAGES)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (write_storage != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
listPermissionsNeeded.add(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (listPermissionsNeeded.isNotEmpty()) {
|
||||||
|
ActivityCompat.requestPermissions(
|
||||||
|
this,
|
||||||
|
listPermissionsNeeded.toTypedArray<String>(),
|
||||||
|
PERMISSION_ALL
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override fun onRequestPermissionsResult(
|
||||||
|
requestCode: Int,
|
||||||
|
permissions: Array<String>,
|
||||||
|
grantResults: IntArray
|
||||||
|
) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
||||||
|
if (requestCode == PERMISSION_ALL) {
|
||||||
|
val perms: MutableMap<String, Int> = HashMap()
|
||||||
|
// Initialize the map with both permissions
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
|
perms[Manifest.permission.READ_MEDIA_IMAGES] = PackageManager.PERMISSION_GRANTED
|
||||||
|
} else {
|
||||||
|
perms[Manifest.permission.WRITE_EXTERNAL_STORAGE] =
|
||||||
|
PackageManager.PERMISSION_GRANTED
|
||||||
|
}
|
||||||
|
// Fill with actual results from user
|
||||||
|
if (grantResults.isNotEmpty()) {
|
||||||
|
for (i in permissions.indices) perms[permissions[i]] = grantResults[i]
|
||||||
|
// Check for both permissions//
|
||||||
|
if (perms[Manifest.permission.READ_MEDIA_IMAGES] == PackageManager.PERMISSION_GRANTED &&
|
||||||
|
perms[Manifest.permission.WRITE_EXTERNAL_STORAGE] == PackageManager.PERMISSION_GRANTED
|
||||||
|
) {
|
||||||
|
Log.d("", "sms & location services permission granted")
|
||||||
|
} else {
|
||||||
|
Log.d("", "Some permissions are not granted ask again ")
|
||||||
|
if (ActivityCompat.shouldShowRequestPermissionRationale(
|
||||||
|
this,
|
||||||
|
Manifest.permission.READ_MEDIA_IMAGES
|
||||||
|
) ||
|
||||||
|
ActivityCompat.shouldShowRequestPermissionRationale(
|
||||||
|
this,
|
||||||
|
Manifest.permission.WRITE_EXTERNAL_STORAGE
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
showDialogOK(
|
||||||
|
"Photos or media Service Permission required for this app"
|
||||||
|
) { _: DialogInterface?, which: Int ->
|
||||||
|
when (which) {
|
||||||
|
DialogInterface.BUTTON_POSITIVE -> checkAndRequestPermissions()
|
||||||
|
DialogInterface.BUTTON_NEGATIVE -> {
|
||||||
|
// proceed with logic by disabling the related features or quit the app.
|
||||||
|
val startMain =
|
||||||
|
Intent(Intent.ACTION_MAIN)
|
||||||
|
startMain.addCategory(Intent.CATEGORY_HOME)
|
||||||
|
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
|
startActivity(startMain)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showDialogOK(message: String, okListener: DialogInterface.OnClickListener) {
|
||||||
|
AlertDialog.Builder(this).setMessage(message).setPositiveButton("OK", okListener)
|
||||||
|
.setNegativeButton("Cancel", okListener).create().show()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,260 @@
|
|||||||
|
package cpm.com.gskmtorange.dailyentry
|
||||||
|
|
||||||
|
import android.Manifest
|
||||||
|
import android.content.BroadcastReceiver
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.content.IntentFilter
|
||||||
|
import android.content.SharedPreferences
|
||||||
|
import android.content.pm.PackageManager
|
||||||
|
import android.os.Build
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.preference.PreferenceManager
|
||||||
|
import android.util.Log
|
||||||
|
import android.view.MenuItem
|
||||||
|
import androidx.activity.enableEdgeToEdge
|
||||||
|
import androidx.appcompat.app.AlertDialog
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.core.app.ActivityCompat
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
|
import androidx.core.net.toUri
|
||||||
|
import androidx.core.view.ViewCompat
|
||||||
|
import androidx.core.view.WindowInsetsCompat
|
||||||
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.google.android.material.snackbar.Snackbar
|
||||||
|
import com.sj.camera_lib_android.Database.ReactPendingData
|
||||||
|
import com.sj.camera_lib_android.Database.ReactSingleImage
|
||||||
|
import com.sj.camera_lib_android.models.ImageUploadModel
|
||||||
|
import com.sj.camera_lib_android.utils.CameraSDK
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter
|
||||||
|
import cpm.com.gskmtorange.R
|
||||||
|
import cpm.com.gskmtorange.adapter.RealtimeAdapter
|
||||||
|
import cpm.com.gskmtorange.adapter.SubCatPdAdapter
|
||||||
|
import cpm.com.gskmtorange.adapter.data.ImageUri
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions.savefile
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString
|
||||||
|
import cpm.com.gskmtorange.constant.CommonUtils
|
||||||
|
import cpm.com.gskmtorange.databinding.ActivityPdRealtimeReportBinding
|
||||||
|
import cpm.com.gskmtorange.databinding.ActivityPdimageBinding
|
||||||
|
import kotlinx.coroutines.delay
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
import org.json.JSONObject
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
class PD_Realtime_Report : AppCompatActivity() {
|
||||||
|
private var context: Context? = null
|
||||||
|
var categoryName: String? = null
|
||||||
|
var categoryId: String? = null
|
||||||
|
var store_id: String? = null;
|
||||||
|
var date: String? = null;
|
||||||
|
var lang: String? = null;
|
||||||
|
var store_type_id: String? = null
|
||||||
|
var class_id: String? = null
|
||||||
|
var key_account_id: String? = null
|
||||||
|
var country_id: String? = null
|
||||||
|
var store_flag_str: String? = null
|
||||||
|
private var preferences: SharedPreferences? = null
|
||||||
|
var db: GSKOrangeDB? = null
|
||||||
|
var listdat: ArrayList<CategoryPictureGetterSetter>? = ArrayList()
|
||||||
|
var username: String? = ""
|
||||||
|
private var kpi_name: String? = ""
|
||||||
|
private lateinit var binding: ActivityPdRealtimeReportBinding
|
||||||
|
private var adapter: RealtimeAdapter? = null
|
||||||
|
val PERMISSION_ALL: Int = 99
|
||||||
|
private var _pos = -1;
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
binding = ActivityPdRealtimeReportBinding.inflate(layoutInflater)
|
||||||
|
setContentView(binding.root)
|
||||||
|
setSupportActionBar(binding.toolbar)
|
||||||
|
context = this
|
||||||
|
db = GSKOrangeDB(context)
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
|
db?.open()
|
||||||
|
preferences?.let {
|
||||||
|
lang = it.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
|
store_id = it.getString(CommonString.KEY_STORE_ID, "")
|
||||||
|
username = it.getString(CommonString.KEY_USERNAME, "")
|
||||||
|
store_type_id = it.getString(CommonString.KEY_STORETYPE_ID, "")
|
||||||
|
class_id = it.getString(CommonString.KEY_CLASS_ID, "")
|
||||||
|
key_account_id = it.getString(CommonString.KEY_KEYACCOUNT_ID, "")
|
||||||
|
country_id = it.getString(CommonString.KEY_COUNTRY_ID, "")
|
||||||
|
store_flag_str = it.getString(CommonString.KEY_STORE_FLAG, "")
|
||||||
|
date = it.getString(CommonString.KEY_DATE, "")
|
||||||
|
}
|
||||||
|
|
||||||
|
CommonFunctions.updateLangResources(
|
||||||
|
context, preferences?.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
|
)
|
||||||
|
intent?.let {
|
||||||
|
categoryName = it.getStringExtra("categoryName")
|
||||||
|
categoryId = it.getStringExtra("categoryId")
|
||||||
|
kpi_name = it.getStringExtra("kpi_name")
|
||||||
|
}
|
||||||
|
supportActionBar?.apply {
|
||||||
|
setHomeButtonEnabled(true)
|
||||||
|
setDisplayHomeAsUpEnabled(true)
|
||||||
|
title = kpi_name
|
||||||
|
}
|
||||||
|
preferences?.getString(CommonString.KEY_PD_PROJECT_Id, "")?.let { projectId ->
|
||||||
|
val userId = preferences?.getString(CommonString.KEY_PD_USER_Id, "")
|
||||||
|
.takeIf { !it.isNullOrBlank() } ?: username
|
||||||
|
Log.d("pd_user_id",userId.toString());
|
||||||
|
|
||||||
|
CommonUtils.initializePDSDK(
|
||||||
|
this@PD_Realtime_Report,
|
||||||
|
projectId = projectId,
|
||||||
|
_userId = userId
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
registerIntentFilter(
|
||||||
|
listOf(
|
||||||
|
"DataSaved", "did-receive-queue-data", "did-receive-image-upload-status"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
callAdapter()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
db?.open()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
val id = item.itemId
|
||||||
|
if (id == android.R.id.home) {
|
||||||
|
//showDataLossAlert();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
if (id == R.id.action_settings) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
super.onDestroy()
|
||||||
|
LocalBroadcastManager.getInstance(this@PD_Realtime_Report)
|
||||||
|
.unregisterReceiver(myBroadcastReceiver) // onDestroy
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun registerIntentFilter(filters: List<String> = listOf()) {
|
||||||
|
filters.forEach { filter ->
|
||||||
|
LocalBroadcastManager.getInstance(this@PD_Realtime_Report)
|
||||||
|
.registerReceiver(myBroadcastReceiver, IntentFilter(filter))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private val savedImages = mutableListOf<ImageUri>()
|
||||||
|
private var myBroadcastReceiver: BroadcastReceiver = object : BroadcastReceiver() {
|
||||||
|
override fun onReceive(context: Context?, intent: Intent?) {
|
||||||
|
when (intent?.action) {
|
||||||
|
"did-receive-queue-data" -> {
|
||||||
|
val receivedList =
|
||||||
|
intent.getParcelableArrayListExtra<ReactPendingData>("imageList")
|
||||||
|
Log.d("DEBUG-LOG did-receive-queue-data", "$receivedList")
|
||||||
|
if (receivedList.isNullOrEmpty()) {
|
||||||
|
CameraSDK.uploadFailedImage(this@PD_Realtime_Report)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
"did-receive-image-upload-status" -> {
|
||||||
|
val receivedImage = intent.getParcelableExtra<ReactSingleImage>("image")
|
||||||
|
Log.d("DEBUG-LOG did-receive-image-upload-status", "$receivedImage")
|
||||||
|
}
|
||||||
|
|
||||||
|
"DataSaved" -> {
|
||||||
|
val receivedList =
|
||||||
|
intent.getParcelableArrayListExtra<ImageUploadModel>("imageListSaved")
|
||||||
|
Log.d("DEBUG-LOG DataSaved", "$receivedList")
|
||||||
|
receivedList?.let {
|
||||||
|
savedImages.clear()
|
||||||
|
it.forEach { item ->
|
||||||
|
val dir = CommonString.getImagesFolder(context)
|
||||||
|
val setName =
|
||||||
|
store_id + "_" + username?.replace(".", "") + "_IRPDIMG-" + File(
|
||||||
|
item.uri
|
||||||
|
).getName()
|
||||||
|
savedImages.add(ImageUri(uri = item.uri, modify_uri = setName))
|
||||||
|
savefile(item.uri.toUri(), "$dir $setName")
|
||||||
|
}
|
||||||
|
adapter?.updateItem(position = _pos, savedImages)
|
||||||
|
Log.e("savedImages", savedImages.toString())
|
||||||
|
_pos = -1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun callAdapter() {
|
||||||
|
if (country_id == "8") {
|
||||||
|
db?.open()
|
||||||
|
listdat = db?.getCategoryPicturedata(
|
||||||
|
date,
|
||||||
|
categoryId,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_STOREWISE
|
||||||
|
)
|
||||||
|
} else if (store_flag_str.equals(CommonString.FROM_DEVIATION, ignoreCase = true)) {
|
||||||
|
db?.open()
|
||||||
|
listdat = db?.getCategoryPicturedata(
|
||||||
|
date,
|
||||||
|
categoryId,
|
||||||
|
key_account_id,
|
||||||
|
store_type_id,
|
||||||
|
class_id,
|
||||||
|
store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADHOC
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
db?.open()
|
||||||
|
listdat = db?.getCategoryPicturedata(
|
||||||
|
date,
|
||||||
|
categoryId,
|
||||||
|
key_account_id,
|
||||||
|
store_type_id,
|
||||||
|
class_id,
|
||||||
|
store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK
|
||||||
|
)
|
||||||
|
}
|
||||||
|
adapter = RealtimeAdapter(
|
||||||
|
category = categoryName,
|
||||||
|
context = this,
|
||||||
|
subcates = ArrayList(),
|
||||||
|
btnlistener = object : RealtimeAdapter.BtnClickListener {
|
||||||
|
override fun onStartSessionClick(_pos: Int, data: CategoryPictureGetterSetter) {
|
||||||
|
this@PD_Realtime_Report._pos = _pos
|
||||||
|
val intent = Intent(this@PD_Realtime_Report, PD_Realtime_Report_Detail::class.java)
|
||||||
|
intent.putExtra("categoryName", categoryName)
|
||||||
|
intent.putExtra("categoryId", categoryId)
|
||||||
|
intent.putExtra("pd_subcat_code", data.subCatCode)
|
||||||
|
intent.putExtra("subcat_name", data.suB_CATEGORY)
|
||||||
|
intent.putExtra("kpi_name", "IR Realtime Report")
|
||||||
|
startActivity(intent)
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out)
|
||||||
|
// launchCamera(data.subCatCode)
|
||||||
|
// Log.d("subCatCode", data.subCatCode)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
binding.rlContent.apply {
|
||||||
|
recyclerViewSubCat.adapter = adapter
|
||||||
|
recyclerViewSubCat.layoutManager = LinearLayoutManager(this@PD_Realtime_Report)
|
||||||
|
adapter?.addsubCatItems(listdat)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+281
@@ -0,0 +1,281 @@
|
|||||||
|
package cpm.com.gskmtorange.dailyentry
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.SharedPreferences
|
||||||
|
import android.net.ConnectivityManager
|
||||||
|
import android.net.NetworkCapabilities
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.preference.PreferenceManager
|
||||||
|
import android.util.Log
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.squareup.okhttp.Callback
|
||||||
|
import com.squareup.okhttp.HttpUrl
|
||||||
|
import com.squareup.okhttp.OkHttpClient
|
||||||
|
import com.squareup.okhttp.Request
|
||||||
|
import com.squareup.okhttp.Response
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter
|
||||||
|
import cpm.com.gskmtorange.adapter.ScoreAdapter
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString
|
||||||
|
import cpm.com.gskmtorange.databinding.ActivityPdRealtimeReportDetailBinding
|
||||||
|
import cpm.com.gskmtorange.utils.ScoreItem
|
||||||
|
import org.json.JSONObject
|
||||||
|
import android.os.Handler
|
||||||
|
import android.os.Looper
|
||||||
|
import android.view.MenuItem
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.Toast
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.Locale
|
||||||
|
|
||||||
|
class PD_Realtime_Report_Detail : AppCompatActivity() {
|
||||||
|
private var context: Context? = null
|
||||||
|
var categoryName: String? = null
|
||||||
|
var categoryId: String? = null
|
||||||
|
var store_id: String? = null;
|
||||||
|
var date: String? = null;
|
||||||
|
var lang: String? = null;
|
||||||
|
var store_type_id: String? = null
|
||||||
|
var class_id: String? = null
|
||||||
|
var key_account_id: String? = null
|
||||||
|
var country_id: String? = null
|
||||||
|
var pd_categoryId: String? = null
|
||||||
|
var subcat_name: String? = null
|
||||||
|
var store_flag_str: String? = null
|
||||||
|
private var preferences: SharedPreferences? = null
|
||||||
|
var db: GSKOrangeDB? = null
|
||||||
|
var listdat: ArrayList<CategoryPictureGetterSetter>? = ArrayList()
|
||||||
|
var username: String? = ""
|
||||||
|
private var kpi_name: String? = ""
|
||||||
|
private lateinit var binding: ActivityPdRealtimeReportDetailBinding
|
||||||
|
val PERMISSION_ALL: Int = 99
|
||||||
|
private var _pos = -1;
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
binding = ActivityPdRealtimeReportDetailBinding.inflate(layoutInflater)
|
||||||
|
setContentView(binding.root)
|
||||||
|
setSupportActionBar(binding.toolbar)
|
||||||
|
context = this
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
|
preferences?.let {
|
||||||
|
lang = it.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
|
store_id = it.getString(CommonString.KEY_STORE_ID, "")
|
||||||
|
username = it.getString(CommonString.KEY_USERNAME, "")
|
||||||
|
store_type_id = it.getString(CommonString.KEY_STORETYPE_ID, "")
|
||||||
|
class_id = it.getString(CommonString.KEY_CLASS_ID, "")
|
||||||
|
key_account_id = it.getString(CommonString.KEY_KEYACCOUNT_ID, "")
|
||||||
|
country_id = it.getString(CommonString.KEY_COUNTRY_ID, "")
|
||||||
|
store_flag_str = it.getString(CommonString.KEY_STORE_FLAG, "")
|
||||||
|
date = it.getString(CommonString.KEY_DATE, "")
|
||||||
|
}
|
||||||
|
CommonFunctions.updateLangResources(
|
||||||
|
context, preferences?.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
|
)
|
||||||
|
intent?.let {
|
||||||
|
categoryName = it.getStringExtra("categoryName")
|
||||||
|
categoryId = it.getStringExtra("categoryId")
|
||||||
|
kpi_name = it.getStringExtra("kpi_name")
|
||||||
|
pd_categoryId = it.getStringExtra("pd_subcat_code")
|
||||||
|
subcat_name = it.getStringExtra("subcat_name")
|
||||||
|
Log.d("pdcode",pd_categoryId.toString())
|
||||||
|
}
|
||||||
|
supportActionBar?.apply {
|
||||||
|
setHomeButtonEnabled(true)
|
||||||
|
setDisplayHomeAsUpEnabled(true)
|
||||||
|
title = kpi_name
|
||||||
|
}
|
||||||
|
preferences?.getString(CommonString.KEY_PD_PROJECT_Id, "")?.let { projectId ->
|
||||||
|
val userId = preferences?.getString(CommonString.KEY_PD_USER_Id, "")
|
||||||
|
.takeIf { !it.isNullOrBlank() } ?: username
|
||||||
|
Log.d("pd_user_id", userId.toString());
|
||||||
|
|
||||||
|
}
|
||||||
|
if (isNetworkAvailable(this@PD_Realtime_Report_Detail)) {
|
||||||
|
fetchlivedata()
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, "No internet connection", Toast.LENGTH_SHORT).show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private fun fetchlivedata() {
|
||||||
|
Log.d("apidata",date +","+store_id+","+pd_categoryId+","+preferences?.getString(CommonString.KEY_PD_PROJECT_Id, ""))
|
||||||
|
|
||||||
|
Handler(Looper.getMainLooper()).post {
|
||||||
|
binding.progressBar.visibility = View.VISIBLE
|
||||||
|
binding.recyclerView.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
|
val client = OkHttpClient()
|
||||||
|
val formattedDate = formatDate(date)
|
||||||
|
val urlBuilder = HttpUrl.Builder()
|
||||||
|
.scheme("https")
|
||||||
|
.host("apis.shelfwatch.io")
|
||||||
|
.addPathSegment("get_haleon_insights")
|
||||||
|
.addQueryParameter("visit_date", formattedDate)
|
||||||
|
.addQueryParameter("store_id", store_id)
|
||||||
|
.addQueryParameter("category_id", pd_categoryId)
|
||||||
|
.addQueryParameter("project_id", preferences?.getString(CommonString.KEY_PD_PROJECT_Id, ""))
|
||||||
|
|
||||||
|
val request = Request.Builder()
|
||||||
|
.url(urlBuilder.build())
|
||||||
|
.build()
|
||||||
|
Log.d("apiparams",request.toString() + ","+urlBuilder)
|
||||||
|
|
||||||
|
client.newCall(request).enqueue(object : Callback {
|
||||||
|
override fun onFailure(request: Request?, e: java.io.IOException?) {
|
||||||
|
Log.e("RealtimeReport", "API call failed", e)
|
||||||
|
Handler(Looper.getMainLooper()).post {
|
||||||
|
binding.progressBar.visibility = View.GONE
|
||||||
|
binding.recyclerView.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResponse(response: Response?) {
|
||||||
|
Handler(Looper.getMainLooper()).post {
|
||||||
|
binding.progressBar.visibility = View.GONE
|
||||||
|
binding.recyclerView.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
val responseData = response?.body()?.string()
|
||||||
|
Log.d("responsedata", responseData.toString())
|
||||||
|
|
||||||
|
responseData?.let { jsonStr ->
|
||||||
|
try {
|
||||||
|
val json = JSONObject(jsonStr)
|
||||||
|
val output = json.getJSONObject("output")
|
||||||
|
val report = output.getJSONObject("report")
|
||||||
|
val overallArray = report.getJSONArray("overall")
|
||||||
|
val imagelist = output.getJSONArray("images")
|
||||||
|
|
||||||
|
var osa = "0%"
|
||||||
|
var msl = "0%"
|
||||||
|
var posm = "0%"
|
||||||
|
var sosSku = "0%"
|
||||||
|
var sosBrand = "0%"
|
||||||
|
|
||||||
|
for (i in 0 until overallArray.length()) {
|
||||||
|
val obj = overallArray.getJSONObject(i)
|
||||||
|
when (obj.getString("kpi_name")) {
|
||||||
|
"OSA" -> osa = obj.getString("value")
|
||||||
|
"MSL OSA" -> msl = obj.getString("value")
|
||||||
|
"POSM" -> posm = obj.getString("value")
|
||||||
|
"SOS - SKU Level" -> sosSku = obj.getString("value")
|
||||||
|
"SOS - Brand Level" -> sosBrand = obj.getString("value")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build OverallScore
|
||||||
|
val scoreItems = mutableListOf<ScoreItem>()
|
||||||
|
scoreItems.add(
|
||||||
|
ScoreItem.OverallScore(
|
||||||
|
osa = osa,
|
||||||
|
msl = msl,
|
||||||
|
posm = posm,
|
||||||
|
sosSku = sosSku,
|
||||||
|
sosBrand = sosBrand
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
// ===== Brand Details for "Toothpaste" =====
|
||||||
|
val detailedArray = report.getJSONArray("detailed")
|
||||||
|
var brandDetails: List<Pair<String, String>> = emptyList()
|
||||||
|
|
||||||
|
for (i in 0 until detailedArray.length()) {
|
||||||
|
val detail = detailedArray.getJSONObject(i)
|
||||||
|
if (detail.getString("kpi_name") == "SOS - Brand Level") {
|
||||||
|
val dataArray = detail.getJSONArray("data")
|
||||||
|
val brands = mutableListOf<Pair<String, String>>()
|
||||||
|
for (j in 0 until dataArray.length()) {
|
||||||
|
val brandObj = dataArray.getJSONObject(j)
|
||||||
|
val brandName = brandObj.optString("brand_name", "Unknown")
|
||||||
|
val value = brandObj.getString("value")
|
||||||
|
if (brandName.isNotEmpty() && brandName != "null") {
|
||||||
|
brands.add(brandName to value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
brandDetails = brands
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
scoreItems.add(
|
||||||
|
ScoreItem.CategoryScore(
|
||||||
|
categoryName = subcat_name.toString(),
|
||||||
|
msl = msl,
|
||||||
|
posm = posm,
|
||||||
|
sosSku = sosSku,
|
||||||
|
sosBrand = sosBrand,
|
||||||
|
brandDetails = brandDetails
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
// ===== IMAGE ITEMS =====
|
||||||
|
if (imagelist.length()>0) {
|
||||||
|
for (i in 0 until imagelist.length()) {
|
||||||
|
val imgObj = imagelist.getJSONObject(i)
|
||||||
|
val rawImages = imgObj.getJSONArray("raw_images")
|
||||||
|
for (j in 0 until rawImages.length()) {
|
||||||
|
val imgObjnew = rawImages.getJSONObject(j)
|
||||||
|
val url = imgObjnew.getString("url")
|
||||||
|
Log.d("imgurl",url);
|
||||||
|
scoreItems.add(ScoreItem.ImageItem(url))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update UI on main thread
|
||||||
|
Handler(Looper.getMainLooper()).post {
|
||||||
|
binding.recyclerView.layoutManager = LinearLayoutManager(context)
|
||||||
|
binding.recyclerView.adapter = ScoreAdapter(scoreItems)
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e("RealtimeReport", "Parse error", e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun formatDate(inputDate: String?): String {
|
||||||
|
return try {
|
||||||
|
// Parse input date (from "MM/dd/yyyy")
|
||||||
|
val inputFormat = SimpleDateFormat("MM/dd/yyyy", Locale.US)
|
||||||
|
val date = inputFormat.parse(inputDate ?: "")
|
||||||
|
|
||||||
|
// Format to "yyyy-MM-dd" for API, using Locale.US to avoid locale-specific digits
|
||||||
|
val outputFormat = SimpleDateFormat("yyyy-MM-dd", Locale.US)
|
||||||
|
if (date != null) outputFormat.format(date) else ""
|
||||||
|
} catch (e: Exception) {
|
||||||
|
""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
|
return when (item.itemId) {
|
||||||
|
android.R.id.home -> {
|
||||||
|
// Finish the current activity and go back
|
||||||
|
finish()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
else -> super.onOptionsItemSelected(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fun isNetworkAvailable(context: Context): Boolean {
|
||||||
|
val connectivityManager =
|
||||||
|
context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
|
||||||
|
|
||||||
|
val network = connectivityManager.activeNetwork ?: return false
|
||||||
|
val activeNetwork = connectivityManager.getNetworkCapabilities(network) ?: return false
|
||||||
|
|
||||||
|
return when {
|
||||||
|
activeNetwork.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) -> true
|
||||||
|
activeNetwork.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR) -> true
|
||||||
|
activeNetwork.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET) -> true
|
||||||
|
else -> false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,23 +1,18 @@
|
|||||||
package cpm.com.gskmtorange.dailyentry
|
package cpm.com.gskmtorange.dailyentry
|
||||||
|
|
||||||
import android.Manifest
|
|
||||||
import android.content.BroadcastReceiver
|
import android.content.BroadcastReceiver
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.DialogInterface
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.IntentFilter
|
import android.content.IntentFilter
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.content.pm.PackageManager
|
|
||||||
import android.net.Uri
|
|
||||||
import android.os.Build
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.preference.PreferenceManager
|
import android.preference.PreferenceManager
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
|
import android.view.View
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.app.ActivityCompat
|
import androidx.core.net.toUri
|
||||||
import androidx.core.content.ContextCompat
|
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
@@ -28,7 +23,6 @@ import com.sj.camera_lib_android.models.ImageUploadModel
|
|||||||
import com.sj.camera_lib_android.utils.CameraSDK
|
import com.sj.camera_lib_android.utils.CameraSDK
|
||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB
|
import cpm.com.gskmtorange.Database.GSKOrangeDB
|
||||||
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter
|
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter
|
||||||
import cpm.com.gskmtorange.LoginActivity
|
|
||||||
import cpm.com.gskmtorange.R
|
import cpm.com.gskmtorange.R
|
||||||
import cpm.com.gskmtorange.adapter.SubCatPdAdapter
|
import cpm.com.gskmtorange.adapter.SubCatPdAdapter
|
||||||
import cpm.com.gskmtorange.adapter.data.ImageUri
|
import cpm.com.gskmtorange.adapter.data.ImageUri
|
||||||
@@ -37,18 +31,20 @@ import cpm.com.gskmtorange.constant.CommonFunctions.savefile
|
|||||||
import cpm.com.gskmtorange.constant.CommonString
|
import cpm.com.gskmtorange.constant.CommonString
|
||||||
import cpm.com.gskmtorange.constant.CommonUtils
|
import cpm.com.gskmtorange.constant.CommonUtils
|
||||||
import cpm.com.gskmtorange.databinding.ActivityPdimageBinding
|
import cpm.com.gskmtorange.databinding.ActivityPdimageBinding
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.Master_Storelist_PDA_GetterSetter
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
|
|
||||||
class PDimageActivity : AppCompatActivity() {
|
class PDimageActivity : AppCompatActivity() {
|
||||||
private var context: Context? = null
|
private var context: Context? = null
|
||||||
var categoryName: String? = null
|
var categoryName: String? = null
|
||||||
var categoryId: String? = null
|
var categoryId: String? = null
|
||||||
var store_id: String? = null;
|
var store_id: String? = null;
|
||||||
var date: String? = null;
|
var date: String? = null;
|
||||||
|
var lang: String? = null;
|
||||||
|
var userId: String? = null
|
||||||
var store_type_id: String? = null
|
var store_type_id: String? = null
|
||||||
var class_id: String? = null
|
var class_id: String? = null
|
||||||
var key_account_id: String? = null
|
var key_account_id: String? = null
|
||||||
@@ -57,12 +53,16 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
private var preferences: SharedPreferences? = null
|
private var preferences: SharedPreferences? = null
|
||||||
var db: GSKOrangeDB? = null
|
var db: GSKOrangeDB? = null
|
||||||
var listdat: ArrayList<CategoryPictureGetterSetter>? = ArrayList()
|
var listdat: ArrayList<CategoryPictureGetterSetter>? = ArrayList()
|
||||||
|
var masterStoreListPd: ArrayList<Master_Storelist_PDA_GetterSetter>? = ArrayList()
|
||||||
var username: String? = ""
|
var username: String? = ""
|
||||||
|
var toggle: String? = "1"
|
||||||
private var kpi_name: String? = ""
|
private var kpi_name: String? = ""
|
||||||
private lateinit var binding: ActivityPdimageBinding
|
private lateinit var binding: ActivityPdimageBinding
|
||||||
private var adapter: SubCatPdAdapter? = null
|
private var adapter: SubCatPdAdapter? = null
|
||||||
val PERMISSION_ALL: Int = 99
|
val PERMISSION_ALL: Int = 99
|
||||||
private var _pos = -1;
|
private var _pos = -1;
|
||||||
|
var devicename : String? = ""
|
||||||
|
var store_name : String? = ""
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
@@ -74,7 +74,9 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
db?.open()
|
db?.open()
|
||||||
preferences?.let {
|
preferences?.let {
|
||||||
|
lang = it.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
store_id = it.getString(CommonString.KEY_STORE_ID, "")
|
store_id = it.getString(CommonString.KEY_STORE_ID, "")
|
||||||
|
store_name = it.getString(CommonString.KEY_STORE_NAME, "")
|
||||||
username = it.getString(CommonString.KEY_USERNAME, "")
|
username = it.getString(CommonString.KEY_USERNAME, "")
|
||||||
store_type_id = it.getString(CommonString.KEY_STORETYPE_ID, "")
|
store_type_id = it.getString(CommonString.KEY_STORETYPE_ID, "")
|
||||||
class_id = it.getString(CommonString.KEY_CLASS_ID, "")
|
class_id = it.getString(CommonString.KEY_CLASS_ID, "")
|
||||||
@@ -83,6 +85,8 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
store_flag_str = it.getString(CommonString.KEY_STORE_FLAG, "")
|
store_flag_str = it.getString(CommonString.KEY_STORE_FLAG, "")
|
||||||
date = it.getString(CommonString.KEY_DATE, "")
|
date = it.getString(CommonString.KEY_DATE, "")
|
||||||
}
|
}
|
||||||
|
devicename = android.os.Build.MANUFACTURER
|
||||||
|
// Log.d("device_name",devicename.toString())
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(
|
CommonFunctions.updateLangResources(
|
||||||
context, preferences?.getString(CommonString.KEY_LANGUAGE, "")
|
context, preferences?.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
@@ -97,7 +101,34 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
setDisplayHomeAsUpEnabled(true)
|
setDisplayHomeAsUpEnabled(true)
|
||||||
title = kpi_name
|
title = kpi_name
|
||||||
}
|
}
|
||||||
CommonUtils.initializePDSDK(this@PDimageActivity, _userId = username)
|
masterStoreListPd = db?.getMasterStoreListPd(store_id,CommonString.TABLE_MASTER_STORELIST_PD)
|
||||||
|
// Log.d("master_store_list_size",masterStoreListPd.toString())
|
||||||
|
|
||||||
|
|
||||||
|
binding.rlContent.btntoggle.setOnClickListener {
|
||||||
|
if(toggle =="1"){
|
||||||
|
toggle = "0"
|
||||||
|
binding.rlContent.recyclerViewSubCat.visibility = View.GONE
|
||||||
|
binding.rlContent.btntoggle.isChecked = false
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
toggle = "1"
|
||||||
|
binding.rlContent.recyclerViewSubCat.visibility = View.VISIBLE
|
||||||
|
binding.rlContent.btntoggle.isChecked = true
|
||||||
|
Log.d("toggle_value_new",toggle.toString())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
preferences?.getString(CommonString.KEY_PD_PROJECT_Id, "")?.let { projectId ->
|
||||||
|
userId = preferences?.getString(CommonString.KEY_PD_USER_Id, "")
|
||||||
|
.takeIf { !it.isNullOrBlank() } ?: username
|
||||||
|
// Log.d("pd_user_id",userId.toString());
|
||||||
|
|
||||||
|
CommonUtils.initializePDSDK(
|
||||||
|
this@PDimageActivity,
|
||||||
|
projectId = projectId,
|
||||||
|
_userId = userId
|
||||||
|
)
|
||||||
|
}
|
||||||
registerIntentFilter(
|
registerIntentFilter(
|
||||||
listOf(
|
listOf(
|
||||||
"DataSaved", "did-receive-queue-data", "did-receive-image-upload-status"
|
"DataSaved", "did-receive-queue-data", "did-receive-image-upload-status"
|
||||||
@@ -112,7 +143,14 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
.setPositiveButton(getString(R.string.yes)) { dialog, _ ->
|
.setPositiveButton(getString(R.string.yes)) { dialog, _ ->
|
||||||
// Handle Yes button click
|
// Handle Yes button click
|
||||||
db?.open()
|
db?.open()
|
||||||
db?.InsertPdImageData(date, store_id, categoryId, listdat)?.let {
|
db?.InsertPdImageData(
|
||||||
|
date,
|
||||||
|
store_id,
|
||||||
|
categoryId,
|
||||||
|
listdat,
|
||||||
|
toggle,
|
||||||
|
CommonString.KEY_COMPELETE
|
||||||
|
)?.let {
|
||||||
if (it > 0) {
|
if (it > 0) {
|
||||||
Snackbar.make(
|
Snackbar.make(
|
||||||
binding.fab,
|
binding.fab,
|
||||||
@@ -121,6 +159,12 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
).setAction("Action", null).show()
|
).setAction("Action", null).show()
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
delay(3000) // 3 seconds delay
|
delay(3000) // 3 seconds delay
|
||||||
|
val intent = Intent(this@PDimageActivity, PD_Realtime_Report::class.java)
|
||||||
|
intent.putExtra("categoryName", categoryName)
|
||||||
|
intent.putExtra("categoryId", categoryId)
|
||||||
|
intent.putExtra("kpi_name", "IR Realtime Analytics")
|
||||||
|
startActivity(intent)
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out)
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -140,20 +184,23 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
callAdapter()
|
callAdapter()
|
||||||
checkAndRequestPermissions()
|
// checkAndRequestPermissions()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
CommonFunctions.updateLangResources(
|
||||||
|
context,
|
||||||
|
preferences!!.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
|
)
|
||||||
|
|
||||||
db?.open()
|
db?.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun validate(): Boolean {
|
private fun validate(): Boolean {
|
||||||
var checkFlag = true // Use local variable to avoid issues
|
var checkFlag = true // Use local variable to avoid issues
|
||||||
if (!listdat.isNullOrEmpty()) {
|
if (!listdat.isNullOrEmpty() && toggle=="1") {
|
||||||
for (data in listdat!!) { // Use standard loop for better control
|
for (data in listdat!!) { // Use standard loop for better control
|
||||||
if (data.imageUris.isNullOrEmpty()) {
|
if (data.imageUris.isNullOrEmpty()) {
|
||||||
checkFlag = false // Set false if validation fails
|
checkFlag = false // Set false if validation fails
|
||||||
@@ -169,7 +216,6 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
return checkFlag // Correctly return validation result
|
return checkFlag // Correctly return validation result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
// as you specify a parent activity in AndroidManifest.xml.
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
val id = item.itemId
|
val id = item.itemId
|
||||||
@@ -181,7 +227,6 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
if (id == R.id.action_settings) {
|
if (id == R.id.action_settings) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item)
|
return super.onOptionsItemSelected(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,9 +273,8 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
store_id + "_" + username?.replace(".", "") + "_IRPDIMG-" + File(
|
store_id + "_" + username?.replace(".", "") + "_IRPDIMG-" + File(
|
||||||
item.uri
|
item.uri
|
||||||
).getName()
|
).getName()
|
||||||
|
|
||||||
savedImages.add(ImageUri(uri = item.uri, modify_uri = setName))
|
savedImages.add(ImageUri(uri = item.uri, modify_uri = setName))
|
||||||
savefile(Uri.parse(item.uri), "$dir $setName")
|
savefile(item.uri.toUri(), "$dir $setName")
|
||||||
}
|
}
|
||||||
adapter?.updateItem(position = _pos, savedImages)
|
adapter?.updateItem(position = _pos, savedImages)
|
||||||
Log.e("savedImages", savedImages.toString())
|
Log.e("savedImages", savedImages.toString())
|
||||||
@@ -243,33 +287,67 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
private fun launchCamera(subCat_code: String) {
|
private fun launchCamera(subCat_code: String) {
|
||||||
val uploadFrom = "TestApp"
|
val uploadFrom = "TestApp"
|
||||||
val uploadParams = JSONObject(
|
val masterstorelistpddata = masterStoreListPd?.getOrNull(0)
|
||||||
"""
|
val metadata = JSONObject().apply {
|
||||||
{
|
put("Device_Name", devicename ?: "NA")
|
||||||
"shop_id": 62475,
|
put("username", username ?: "NA")
|
||||||
"project_id": "4f57635b-6b07-45bf-bfba-c61c2826b6db",
|
put("shop_name", store_name ?: "NA")
|
||||||
"td_version_id": 178,
|
put("parinaam_id", masterstorelistpddata?.storeId?.getOrNull(0) ?: "NA") //storeid
|
||||||
"shelf_image_id": null,
|
put("channel", masterstorelistpddata?.channel?.getOrNull(0) ?: "NA")
|
||||||
"asset_image_id": null,
|
put("format", masterstorelistpddata?.format?.getOrNull(0) ?: "NA")
|
||||||
"shelf_type": "Primary Shelf",
|
put("region", masterstorelistpddata?.region?.getOrNull(0) ?: "NA")
|
||||||
"category_id": 123,
|
put("bay_type", masterstorelistpddata?.bay_type?.getOrNull(0) ?: "NA")
|
||||||
"user_id": 133,
|
put("no_of_bays", masterstorelistpddata?.no_of_bays?.getOrNull(0) ?: "NA")
|
||||||
"isConnected": true,
|
put("category", categoryName?: "NA")
|
||||||
"sn_image_type": "skus",
|
put("user_id", masterstorelistpddata?.user_id?.getOrNull(0) ?: "NA")
|
||||||
"image_type": "multiple",
|
put("Active", masterstorelistpddata?.active?.getOrNull(0) ?: "NA")
|
||||||
"seq_no": 1,
|
put("ASMArea", masterstorelistpddata?.asmArea?.getOrNull(0) ?: "NA")
|
||||||
"level": 1,
|
put("EmployeeName", masterstorelistpddata?.employeeName?.getOrNull(0) ?: "NA")
|
||||||
"uploadOnlyOnWifi": 0,
|
put("DesignationName", masterstorelistpddata?.designationName?.getOrNull(0) ?: "NA")
|
||||||
"app_session_id": "8e2faa6b-d6fe-413a-a693-76a0cbe0ce71",
|
put("SupervisorId", masterstorelistpddata?.supervisorId?.getOrNull(0) ?: "NA")
|
||||||
"metadata": { "Device_Name": "Samsung" }
|
put("Supervisor", masterstorelistpddata?.supervisor?.getOrNull(0) ?: "NA")
|
||||||
|
put("StoreCode", masterstorelistpddata?.storeCode?.getOrNull(0) ?: "NA")
|
||||||
|
put("ChainId", masterstorelistpddata?.chainId?.getOrNull(0) ?: "NA")
|
||||||
|
put("StoreTypeId", masterstorelistpddata?.storeTypeId?.getOrNull(0) ?: "NA")
|
||||||
|
put("SOName", masterstorelistpddata?.soName?.getOrNull(0) ?: "NA")
|
||||||
}
|
}
|
||||||
"""
|
val uploadParams = JSONObject().apply {
|
||||||
)
|
put("shop_id", store_id)
|
||||||
uploadParams.put("shop_id", store_id)
|
put("project_id", preferences?.getString(CommonString.KEY_PD_PROJECT_Id, ""))
|
||||||
|
put("shelf_type", "Primary Shelf")
|
||||||
|
put("category_id", subCat_code)
|
||||||
|
put("user_id", userId)
|
||||||
|
// put("user_id", userId)
|
||||||
|
put("metadata", metadata)
|
||||||
|
}
|
||||||
|
|
||||||
|
// "metadata": { "Device_Name": $devicename,"Username": $username }
|
||||||
|
/* uploadParams.put("shop_id", store_id)
|
||||||
uploadParams.put("user_id", username)
|
uploadParams.put("user_id", username)
|
||||||
uploadParams.put("category_id", subCat_code)
|
uploadParams.put("category_id", subCat_code)
|
||||||
uploadParams.put("project_id", CommonString.PD_PROJECT_iD)
|
uploadParams.put("project_id", preferences?.getString(CommonString.KEY_PD_PROJECT_Id, ""))*/
|
||||||
|
|
||||||
|
Log.d("uploadParams", uploadParams.toString())
|
||||||
|
if(!lang.equals("ENGLISH",ignoreCase = true)){
|
||||||
|
CameraSDK.startCamera(
|
||||||
|
context = this,
|
||||||
|
orientation = "",
|
||||||
|
widthPercentage = 20,
|
||||||
|
uploadParams = uploadParams,
|
||||||
|
resolution = 3000,
|
||||||
|
referenceUrl = "",
|
||||||
|
allowBlurCheck = true,
|
||||||
|
allowCrop = true,
|
||||||
|
uploadFrom = uploadFrom,
|
||||||
|
isRetake = false,
|
||||||
|
showOverlapToggleButton = false,
|
||||||
|
showGridLines = true,
|
||||||
|
zoomLevel = 1.0,
|
||||||
|
language_code = "ar",
|
||||||
|
isLambda = false
|
||||||
|
)
|
||||||
|
}
|
||||||
|
else{
|
||||||
CameraSDK.startCamera(
|
CameraSDK.startCamera(
|
||||||
context = this,
|
context = this,
|
||||||
orientation = "",
|
orientation = "",
|
||||||
@@ -288,6 +366,7 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
isLambda = false
|
isLambda = false
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun callAdapter() {
|
private fun callAdapter() {
|
||||||
if (country_id == "8") {
|
if (country_id == "8") {
|
||||||
@@ -324,9 +403,8 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
CommonString.TABLE_MAPPING_STOCK
|
CommonString.TABLE_MAPPING_STOCK
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
adapter = SubCatPdAdapter(
|
||||||
Log.d("listdatsize", listdat?.size.toString())
|
category = categoryName,
|
||||||
adapter = SubCatPdAdapter(category = categoryName,
|
|
||||||
context = this,
|
context = this,
|
||||||
subcates = ArrayList(),
|
subcates = ArrayList(),
|
||||||
btnlistener = object : SubCatPdAdapter.BtnClickListener {
|
btnlistener = object : SubCatPdAdapter.BtnClickListener {
|
||||||
@@ -340,107 +418,23 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
recyclerViewSubCat.layoutManager = LinearLayoutManager(this@PDimageActivity)
|
recyclerViewSubCat.layoutManager = LinearLayoutManager(this@PDimageActivity)
|
||||||
adapter?.addsubCatItems(listdat)
|
adapter?.addsubCatItems(listdat)
|
||||||
}
|
}
|
||||||
|
// Now only handle toggle visibility
|
||||||
|
toggle = listdat?.get(0)?.toggle_value ?: "1"
|
||||||
|
|
||||||
|
if(toggle == "1"){
|
||||||
|
binding.rlContent.recyclerViewSubCat.visibility = View.VISIBLE
|
||||||
|
binding.rlContent.btntoggle.isChecked = true
|
||||||
|
} else {
|
||||||
|
binding.rlContent.recyclerViewSubCat.visibility = View.GONE
|
||||||
|
binding.rlContent.btntoggle.isChecked = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
super.onPause()
|
super.onPause()
|
||||||
db?.open()
|
db?.open()
|
||||||
db?.InsertPdImageData(date, store_id, categoryId, listdat)
|
if (!db!!.isSOSCategory(store_id, date, CommonString.KEY_COMPELETE, categoryId)) {
|
||||||
}
|
db?.InsertPdImageData(date, store_id, categoryId, listdat,toggle, CommonString.KEY_DRAFT)
|
||||||
|
|
||||||
private fun checkAndRequestPermissions() {
|
|
||||||
var read_phone_state = 0
|
|
||||||
var write_storage = 0
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
||||||
write_storage =
|
|
||||||
ContextCompat.checkSelfPermission(this, Manifest.permission.READ_MEDIA_IMAGES)
|
|
||||||
} else {
|
|
||||||
read_phone_state =
|
|
||||||
ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE)
|
|
||||||
write_storage =
|
|
||||||
ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
|
||||||
}
|
|
||||||
|
|
||||||
val listPermissionsNeeded: MutableList<String> = java.util.ArrayList()
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
||||||
if (write_storage != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
listPermissionsNeeded.add(Manifest.permission.READ_MEDIA_IMAGES)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (write_storage != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
listPermissionsNeeded.add(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (listPermissionsNeeded.isNotEmpty()) {
|
|
||||||
ActivityCompat.requestPermissions(
|
|
||||||
this,
|
|
||||||
listPermissionsNeeded.toTypedArray<String>(),
|
|
||||||
PERMISSION_ALL
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
override fun onRequestPermissionsResult(
|
|
||||||
requestCode: Int,
|
|
||||||
permissions: Array<String>,
|
|
||||||
grantResults: IntArray
|
|
||||||
) {
|
|
||||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
|
||||||
|
|
||||||
if (requestCode == PERMISSION_ALL) {
|
|
||||||
val perms: MutableMap<String, Int> = HashMap()
|
|
||||||
// Initialize the map with both permissions
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
||||||
perms[Manifest.permission.READ_MEDIA_IMAGES] = PackageManager.PERMISSION_GRANTED
|
|
||||||
} else {
|
|
||||||
perms[Manifest.permission.WRITE_EXTERNAL_STORAGE] =
|
|
||||||
PackageManager.PERMISSION_GRANTED
|
|
||||||
}
|
|
||||||
// Fill with actual results from user
|
|
||||||
if (grantResults.isNotEmpty()) {
|
|
||||||
for (i in permissions.indices) perms[permissions[i]] = grantResults[i]
|
|
||||||
// Check for both permissions//
|
|
||||||
if (perms[Manifest.permission.READ_MEDIA_IMAGES] == PackageManager.PERMISSION_GRANTED &&
|
|
||||||
perms[Manifest.permission.WRITE_EXTERNAL_STORAGE] == PackageManager.PERMISSION_GRANTED
|
|
||||||
) {
|
|
||||||
Log.d("", "sms & location services permission granted")
|
|
||||||
} else {
|
|
||||||
Log.d("", "Some permissions are not granted ask again ")
|
|
||||||
if (ActivityCompat.shouldShowRequestPermissionRationale(
|
|
||||||
this,
|
|
||||||
Manifest.permission.READ_MEDIA_IMAGES
|
|
||||||
) ||
|
|
||||||
ActivityCompat.shouldShowRequestPermissionRationale(
|
|
||||||
this,
|
|
||||||
Manifest.permission.WRITE_EXTERNAL_STORAGE
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
showDialogOK(
|
|
||||||
"Photos or media Service Permission required for this app"
|
|
||||||
) { dialog: DialogInterface?, which: Int ->
|
|
||||||
when (which) {
|
|
||||||
DialogInterface.BUTTON_POSITIVE -> checkAndRequestPermissions()
|
|
||||||
DialogInterface.BUTTON_NEGATIVE -> {
|
|
||||||
// proceed with logic by disabling the related features or quit the app.
|
|
||||||
val startMain =
|
|
||||||
Intent(Intent.ACTION_MAIN)
|
|
||||||
startMain.addCategory(Intent.CATEGORY_HOME)
|
|
||||||
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
|
||||||
startActivity(startMain)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun showDialogOK(message: String, okListener: DialogInterface.OnClickListener) {
|
|
||||||
AlertDialog.Builder(this).setMessage(message).setPositiveButton("OK", okListener)
|
|
||||||
.setNegativeButton("Cancel", okListener).create().show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -118,32 +118,10 @@ public class POGQuestionsActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
if (validateData()) {
|
if (validateData()) {
|
||||||
|
|
||||||
db.savePOGQuestionAnswerData(hashMapListChildData, headerDataList, store_id, categoryId);
|
db.savePOGQuestionAnswerData(hashMapListChildData, headerDataList, store_id, categoryId);
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
|
||||||
/* AlertDialog.Builder builder = new AlertDialog.Builder(POGQuestionsActivity.this);
|
|
||||||
builder.setMessage(R.string.title_activity_Want_save)
|
|
||||||
.setCancelable(false)
|
|
||||||
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
|
|
||||||
db.savePOGQuestionAnswerData(hashMapListChildData, headerDataList,store_id, categoryId);
|
|
||||||
finish();
|
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
dialog.cancel();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
AlertDialog alert = builder.create();
|
|
||||||
alert.show();*/
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if(adapter!=null){
|
if(adapter!=null){
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
expandableListView.invalidateViews();
|
expandableListView.invalidateViews();
|
||||||
|
|||||||
+12
-16
@@ -51,7 +51,6 @@ import com.google.android.gms.location.Priority;
|
|||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
import org.ksoap2.serialization.SoapObject;
|
import org.ksoap2.serialization.SoapObject;
|
||||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
import org.ksoap2.transport.HttpTransportSE;
|
|
||||||
import org.xml.sax.InputSource;
|
import org.xml.sax.InputSource;
|
||||||
import org.xml.sax.XMLReader;
|
import org.xml.sax.XMLReader;
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
@@ -78,6 +77,7 @@ import cpm.com.gskmtorange.R;
|
|||||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
|
import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
|
||||||
|
import cpm.com.gskmtorange.utils.OkHttpTransportSE;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
||||||
|
|
||||||
@@ -185,15 +185,16 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
switch (id) {
|
if (id == R.id.img_cam_selfie) {
|
||||||
case R.id.img_cam_selfie:
|
_pathforcheck = checkOutStore_id + "CHK_SI_"
|
||||||
_pathforcheck = checkOutStore_id + "CHK_SI_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
+ visit_date.replace("/", "") + "_"
|
||||||
|
+ CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.btn_save_selfie:
|
} else if (id == R.id.btn_save_selfie) {
|
||||||
if (img_str != null) {
|
if (img_str != null) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(StoreCheckoutImageActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(StoreCheckoutImageActivity.this);
|
||||||
builder.setMessage(getResources().getString(R.string.title_activity_save_data))
|
builder.setMessage(getResources().getString(R.string.title_activity_save_data))
|
||||||
@@ -208,16 +209,17 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
i.putExtra(CommonString.KEY_LONGITUDE, lon);
|
i.putExtra(CommonString.KEY_LONGITUDE, lon);
|
||||||
startActivity(i);
|
startActivity(i);
|
||||||
finish();
|
finish();
|
||||||
}).setNegativeButton(getResources().getString(R.string.cancel), (dialog, id12) -> dialog.cancel());
|
})
|
||||||
|
.setNegativeButton(getResources().getString(R.string.cancel), (dialog, id12) -> dialog.cancel());
|
||||||
|
|
||||||
alert = builder.create();
|
alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(context, getResources().getString(R.string.clickimage), Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, getResources().getString(R.string.clickimage), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void startCameraActivity() {
|
protected void startCameraActivity() {
|
||||||
@@ -467,9 +469,6 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
|
|
||||||
SoapObject request = new SoapObject(CommonString.NAMESPACE,
|
SoapObject request = new SoapObject(CommonString.NAMESPACE,
|
||||||
CommonString.METHOD_UPLOAD_CURRENT_DATA);
|
CommonString.METHOD_UPLOAD_CURRENT_DATA);
|
||||||
//request.addProperty("MID", "0");
|
|
||||||
// request.addProperty("KEYS", "CURRENT_DATA");
|
|
||||||
// request.addProperty("USERNAME", username);
|
|
||||||
|
|
||||||
request.addProperty("onXML", current_xml);
|
request.addProperty("onXML", current_xml);
|
||||||
|
|
||||||
@@ -478,7 +477,7 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(
|
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(
|
||||||
CommonString.URL);
|
CommonString.URL);
|
||||||
androidHttpTransport.call(
|
androidHttpTransport.call(
|
||||||
CommonString.SOAP_ACTION_UPLOAD_CURRRENT_DATA, envelope);
|
CommonString.SOAP_ACTION_UPLOAD_CURRRENT_DATA, envelope);
|
||||||
@@ -578,13 +577,10 @@ public class StoreCheckoutImageActivity extends AppCompatActivity implements Vie
|
|||||||
|
|
||||||
//showAlert(getString(R.string.data_downloaded_successfully));
|
//showAlert(getString(R.string.data_downloaded_successfully));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
GSKOrangeDB db = new GSKOrangeDB(StoreCheckoutImageActivity.this);
|
GSKOrangeDB db = new GSKOrangeDB(StoreCheckoutImageActivity.this);
|
||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
db.deleteTableWithStoreID(store_id);
|
db.deleteTableWithStoreID(store_id);
|
||||||
|
|
||||||
showAlert(getString(R.string.datanotfound) + " " + result);
|
showAlert(getString(R.string.datanotfound) + " " + result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package cpm.com.gskmtorange.dailyentry;
|
|||||||
|
|
||||||
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
||||||
|
|
||||||
|
import static cpm.com.gskmtorange.constant.CommonFunctions.isInternetAvailable;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
@@ -76,7 +78,6 @@ import com.google.android.material.snackbar.Snackbar;
|
|||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
import org.ksoap2.serialization.SoapObject;
|
import org.ksoap2.serialization.SoapObject;
|
||||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
import org.ksoap2.transport.HttpTransportSE;
|
|
||||||
import org.xmlpull.v1.XmlPullParser;
|
import org.xmlpull.v1.XmlPullParser;
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
import org.xmlpull.v1.XmlPullParserFactory;
|
import org.xmlpull.v1.XmlPullParserFactory;
|
||||||
@@ -112,26 +113,22 @@ import cpm.com.gskmtorange.constant.CommonUtils;
|
|||||||
import cpm.com.gskmtorange.download.DownloadActivity;
|
import cpm.com.gskmtorange.download.DownloadActivity;
|
||||||
import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
|
import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
|
||||||
import cpm.com.gskmtorange.pharma_stores.PharmaActivity;
|
import cpm.com.gskmtorange.pharma_stores.PharmaActivity;
|
||||||
import cpm.com.gskmtorange.storeinmap.StoreListMapActivity;
|
|
||||||
import cpm.com.gskmtorange.storeinmap.StoreListRouteActivity;
|
import cpm.com.gskmtorange.storeinmap.StoreListRouteActivity;
|
||||||
import cpm.com.gskmtorange.storeinmap.StoreRouteActivity;
|
import cpm.com.gskmtorange.storeinmap.StoreRouteActivity;
|
||||||
|
import cpm.com.gskmtorange.utils.OkHttpTransportSE;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.AdditionalQuestiongetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.AdditionalQuestiongetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryMasterGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationContrywiseGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationContrywiseGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayChecklistMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.DisplayChecklistMasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.GeoFencingGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.GeoFencingGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SOS_TARGET_MasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SOS_TARGET_MasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingCategoryImageAllowGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingCategoryImageAllowGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingPlanogramCountrywiseGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingPlanogramStorewiseGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingPlanogramStorewiseGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
||||||
@@ -147,7 +144,6 @@ import cpm.com.gskmtorange.xmlGetterSetter.ShelfMasterGetterSetter;
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuGroupMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.SkuGroupMasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
||||||
|
|
||||||
public class StoreListActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
public class StoreListActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
||||||
@@ -287,7 +283,7 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteIRURl();
|
// deleteIRURl();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteIRURl() {
|
private void deleteIRURl() {
|
||||||
@@ -299,7 +295,6 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
if (uris != null && !uris.isEmpty()) {
|
if (uris != null && !uris.isEmpty()) {
|
||||||
for (int k = 0; k < uris.size(); k++) {
|
for (int k = 0; k < uris.size(); k++) {
|
||||||
CommonUtils.INSTANCE.deleteSpecificImage(this,uris.get(k).getUri());
|
CommonUtils.INSTANCE.deleteSpecificImage(this,uris.get(k).getUri());
|
||||||
CommonUtils.INSTANCE. deleteImage(this,uris.get(k).getUri());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -501,7 +496,7 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
for (Location location : locationResult.getLocations()) {
|
for (Location location : locationResult.getLocations()) {
|
||||||
lat = location.getLatitude();
|
lat = location.getLatitude();
|
||||||
lon = location.getLongitude();
|
lon = location.getLongitude();
|
||||||
// Log.e("latitude_inside",location.getLatitude() + "," +location.getLongitude());
|
Log.e("latitude_inside",location.getLatitude() + "," +location.getLongitude());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -598,6 +593,7 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
|
|
||||||
} else if (id == R.id.iconMap) {
|
} else if (id == R.id.iconMap) {
|
||||||
|
|
||||||
|
Log.d("Mapdata", "latitude is :" +" " +lat + "," + lon);
|
||||||
Intent in = new Intent(context, StoreListRouteActivity.class);
|
Intent in = new Intent(context, StoreListRouteActivity.class);
|
||||||
in.putExtra(CommonString.KEY_STORE_LIST, storelist);
|
in.putExtra(CommonString.KEY_STORE_LIST, storelist);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
@@ -714,26 +710,27 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
viewHolder.imgview_navigation.setVisibility(View.VISIBLE);
|
viewHolder.imgview_navigation.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
viewHolder.parent_layout.setOnClickListener(new View.OnClickListener() {
|
viewHolder.parent_layout.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
store_id = current.getSTORE_ID();
|
store_id = current.getSTORE_ID();
|
||||||
store_facing_hide = current.getFACING_HIDE();
|
store_facing_hide = current.getFACING_HIDE();
|
||||||
storeCurrentObj = current;
|
storeCurrentObj = current;
|
||||||
|
|
||||||
if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_U) || current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_UN)) {
|
if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_U) || current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_UN)) {
|
||||||
Snackbar.make(v, R.string.title_store_list_activity_store_already_done, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(v, R.string.title_store_list_activity_store_already_done, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_D)) {
|
}
|
||||||
|
else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_D)) {
|
||||||
Snackbar.make(v, R.string.title_store_list_activity_store_data_uploaded, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(v, R.string.title_store_list_activity_store_data_uploaded, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
} else if (current.getCHECKOUT_STATUS().equalsIgnoreCase(CommonString.KEY_Y)) {
|
} else if (current.getCHECKOUT_STATUS().equalsIgnoreCase(CommonString.KEY_Y)) {
|
||||||
|
|
||||||
Snackbar.make(v, R.string.title_store_list_activity_store_already_checkout, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(v, R.string.title_store_list_activity_store_already_checkout, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
}
|
||||||
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_P)) {
|
else if (store_flag_str.equals(CommonString.FROM_DEVIATION) && (coverageObj.getStatus() != null
|
||||||
|
&& coverageObj.getStatus().equalsIgnoreCase(CommonString.KEY_VALID))) {
|
||||||
|
Snackbar.make(v, R.string.title_store_list_checkout_current, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
}
|
||||||
|
else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_P)) {
|
||||||
Snackbar.make(v, R.string.title_store_list_activity_store_again_uploaded, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(v, R.string.title_store_list_activity_store_again_uploaded, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_L)) {
|
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_L)) {
|
||||||
Snackbar.make(v, R.string.title_store_list_activity_store_closed, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(v, R.string.title_store_list_activity_store_closed, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
@@ -834,8 +831,13 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
startActivity(in);
|
startActivity(in);
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
} else {
|
} else {
|
||||||
|
if(isInternetAvailable(context)){
|
||||||
new UploadTask(StoreListActivity.this, store_id).execute();
|
new UploadTask(StoreListActivity.this, store_id).execute();
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
String msg = getString(R.string.you_need_to_be_in_the_store) + "\n " + getString(R.string.distance_from_the_store) + " - " + distance + " " + getString(R.string.meters);
|
String msg = getString(R.string.you_need_to_be_in_the_store) + "\n " + getString(R.string.distance_from_the_store) + " - " + distance + " " + getString(R.string.meters);
|
||||||
//dialog.cancel();
|
//dialog.cancel();
|
||||||
@@ -871,7 +873,12 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
editor.putString(CommonString.KEY_POG_TYPE_ID, current.getPOG_TYPE_ID());
|
editor.putString(CommonString.KEY_POG_TYPE_ID, current.getPOG_TYPE_ID());
|
||||||
editor.putString(CommonString.KEY_UPLOAD_STATUS, current.getUPLOAD_STATUS());
|
editor.putString(CommonString.KEY_UPLOAD_STATUS, current.getUPLOAD_STATUS());
|
||||||
editor.commit();
|
editor.commit();
|
||||||
|
if(isInternetAvailable(context)){
|
||||||
new UploadTask(StoreListActivity.this, store_id).execute();
|
new UploadTask(StoreListActivity.this, store_id).execute();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
//dialog.cancel();
|
//dialog.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -897,9 +904,12 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
viewHolder.imgview_navigation.setOnClickListener(new View.OnClickListener() {
|
viewHolder.imgview_navigation.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
Log.e("mapdata",lat + ","+lon);
|
||||||
Intent in = new Intent(context, StoreRouteActivity.class);
|
Intent in = new Intent(context, StoreRouteActivity.class);
|
||||||
in.putExtra(CommonString.KEY_STORE_LIST, current);
|
in.putExtra(CommonString.KEY_STORE_LIST, current);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
@@ -917,44 +927,6 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
/* String visit_xml = "";
|
|
||||||
String onXML = "";
|
|
||||||
ArrayList<Visit_Type_Master_GetterSetter> visittypelist = db.getUploadedVisitType(store_id);
|
|
||||||
|
|
||||||
if (visittypelist.size() > 0) {
|
|
||||||
for (int j = 0; j < visittypelist.size(); j++) {
|
|
||||||
// Log.e("visit_type_id", String.valueOf(visittypelist.get(j).getVISIT_TYPE_ID()));
|
|
||||||
if(String.valueOf(visittypelist.get(j).getVISIT_TYPE_ID()).equalsIgnoreCase("[3]")){
|
|
||||||
onXML = "[VISIT_TYPE_STATUS]"
|
|
||||||
+ "[MID]" + 0 + "[/MID]"
|
|
||||||
+ "[USERID]" + userId + "[/USERID]"
|
|
||||||
+ "[STORE_ID]" + store_id + "[/STORE_ID]"
|
|
||||||
+ "[VISIT_TYPE_ID]" + "3" + "[/VISIT_TYPE_ID]"
|
|
||||||
+ "[/VISIT_TYPE_STATUS]";
|
|
||||||
}
|
|
||||||
else if(String.valueOf(visittypelist.get(j).getVISIT_TYPE_ID()).equalsIgnoreCase("[2]")){
|
|
||||||
onXML = "[VISIT_TYPE_STATUS]"
|
|
||||||
+ "[MID]" + 0 + "[/MID]"
|
|
||||||
+ "[USERID]" + userId + "[/USERID]"
|
|
||||||
+ "[STORE_ID]" + store_id + "[/STORE_ID]"
|
|
||||||
+ "[VISIT_TYPE_ID]" + "2" + "[/VISIT_TYPE_ID]"
|
|
||||||
+ "[/VISIT_TYPE_STATUS]";
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
onXML = "[VISIT_TYPE_STATUS]"
|
|
||||||
+ "[MID]" + 0 + "[/MID]"
|
|
||||||
+ "[USERID]" + userId + "[/USERID]"
|
|
||||||
+ "[STORE_ID]" + store_id + "[/STORE_ID]"
|
|
||||||
+ "[VISIT_TYPE_ID]" +"1"+ "[/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);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(StoreListActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(StoreListActivity.this);
|
||||||
builder.setMessage(R.string.wantcheckout).setCancelable(false).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
builder.setMessage(R.string.wantcheckout).setCancelable(false).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
@@ -1152,8 +1124,7 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(StoreListActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(StoreListActivity.this);
|
||||||
builder.setTitle(getResources().getString(R.string.dialog_title));
|
builder.setTitle(getResources().getString(R.string.dialog_title));
|
||||||
builder.setMessage(R.string.first_geotag_the_store).setCancelable(false).setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
builder.setMessage(R.string.first_geotag_the_store).setCancelable(false).setPositiveButton(getResources().getString(R.string.ok), (dialog1, id) -> {
|
||||||
public void onClick(DialogInterface dialog1, int id) {
|
|
||||||
editor = preferences.edit();
|
editor = preferences.edit();
|
||||||
editor.putString(CommonString.KEY_STORE_FLAG_FACING_HIDE, current.getFACING_HIDE());
|
editor.putString(CommonString.KEY_STORE_FLAG_FACING_HIDE, current.getFACING_HIDE());
|
||||||
editor.putString(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
editor.putString(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||||
@@ -1179,7 +1150,6 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
startActivity(in);
|
startActivity(in);
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
dialog1.cancel();
|
dialog1.cancel();
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
AlertDialog alert = builder.create();
|
AlertDialog alert = builder.create();
|
||||||
@@ -1368,7 +1338,6 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return flag_checked_in;
|
return flag_checked_in;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1445,7 +1414,7 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
Object result = envelope.getResponse();
|
Object result = envelope.getResponse();
|
||||||
@@ -1469,7 +1438,6 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
} else {
|
} else {
|
||||||
// return "MAPPING_STOCK";
|
// return "MAPPING_STOCK";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
@@ -1483,7 +1451,7 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1523,7 +1491,7 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1559,7 +1527,7 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1594,7 +1562,7 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1632,7 +1600,7 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1669,7 +1637,7 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1705,7 +1673,7 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1927,7 +1895,6 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
db.createTable(mapping_sos_target_masterGetterSetter.getTable_MAPPING_SOS_TARGET());
|
db.createTable(mapping_sos_target_masterGetterSetter.getTable_MAPPING_SOS_TARGET());
|
||||||
db.createTable(noCameraLastVisitGetterSetter.getTable_NO_CAMERA_LAST_VISIT_DATA());
|
db.createTable(noCameraLastVisitGetterSetter.getTable_NO_CAMERA_LAST_VISIT_DATA());
|
||||||
db.createTable(store_performance_masterGetterSetter.getTable_STORE_PERFORMANCE());
|
db.createTable(store_performance_masterGetterSetter.getTable_STORE_PERFORMANCE());
|
||||||
|
|
||||||
db.InsertAdhocFilled(storeId, visit_date);
|
db.InsertAdhocFilled(storeId, visit_date);
|
||||||
db.InsertMAPPING_T2P(mappingt2PGetterSetter, CommonString.TABLE_MAPPING_T2P_ADHOC);
|
db.InsertMAPPING_T2P(mappingt2PGetterSetter, CommonString.TABLE_MAPPING_T2P_ADHOC);
|
||||||
db.InsertMappingStock(mappingStockGetterSetter, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
db.InsertMappingStock(mappingStockGetterSetter, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package cpm.com.gskmtorange.dailyentry;
|
|||||||
|
|
||||||
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
||||||
|
|
||||||
|
import static cpm.com.gskmtorange.constant.CommonFunctions.isInternetAvailable;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@@ -56,7 +58,6 @@ import com.google.android.gms.location.Priority;
|
|||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
import org.ksoap2.serialization.SoapObject;
|
import org.ksoap2.serialization.SoapObject;
|
||||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
import org.ksoap2.transport.HttpTransportSE;
|
|
||||||
import org.xml.sax.InputSource;
|
import org.xml.sax.InputSource;
|
||||||
import org.xml.sax.XMLReader;
|
import org.xml.sax.XMLReader;
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
@@ -84,7 +85,9 @@ import cpm.com.gskmtorange.R;
|
|||||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
|
import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
|
||||||
|
import cpm.com.gskmtorange.password.MPinActivity;
|
||||||
import cpm.com.gskmtorange.pharma_stores.PharmaActivity;
|
import cpm.com.gskmtorange.pharma_stores.PharmaActivity;
|
||||||
|
import cpm.com.gskmtorange.utils.OkHttpTransportSE;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
||||||
|
|
||||||
@@ -303,33 +306,6 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
@Override
|
@Override
|
||||||
public void onConnected(Bundle bundle) {
|
public void onConnected(Bundle bundle) {
|
||||||
|
|
||||||
/*if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
// TODO: Consider calling
|
|
||||||
// ActivityCompat#requestPermissions
|
|
||||||
// here to request the missing permissions, and then overriding
|
|
||||||
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
|
|
||||||
// int[] grantResults)
|
|
||||||
// to handle the case where the user grants the permission. See the documentation
|
|
||||||
// for ActivityCompat#requestPermissions for more details.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
|
|
||||||
|
|
||||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
|
||||||
|| ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
if (mLastLocation != null) {
|
|
||||||
lat = mLastLocation.getLatitude();
|
|
||||||
lon = mLastLocation.getLongitude();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// if (mRequestingLocationUpdates) {
|
|
||||||
startLocationUpdates();*/
|
|
||||||
// }
|
|
||||||
|
|
||||||
// startLocationUpdates();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -359,21 +335,12 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
super.onStop();// ATTENTION: This was auto-generated to implement the App Indexing API.
|
super.onStop();
|
||||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
|
||||||
// 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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
//stopLocationUpdates();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -481,9 +448,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
|
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
|
|
||||||
switch (id) {
|
if (id == R.id.img_cam_selfie) {
|
||||||
|
|
||||||
case R.id.img_cam_selfie:
|
|
||||||
|
|
||||||
_pathforcheck = store_id + "SI_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck = store_id + "SI_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
@@ -493,9 +458,8 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
|
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.btn_save_selfie) {
|
||||||
|
|
||||||
case R.id.btn_save_selfie:
|
|
||||||
if (img_str != null) {
|
if (img_str != null) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(StoreimageActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(StoreimageActivity.this);
|
||||||
builder.setMessage(getResources().getString(R.string.title_activity_save_data))
|
builder.setMessage(getResources().getString(R.string.title_activity_save_data))
|
||||||
@@ -504,9 +468,10 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
alert.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
|
alert.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
|
||||||
String status;
|
String status;
|
||||||
//if (store_flag_str.equals(CommonString.FROM_JCP) || country_id.equalsIgnoreCase("5") || country_id.equalsIgnoreCase(CommonString.COUNTRY_ID_EGYPT +"")
|
|
||||||
// || store_flag_str.equals(CommonString.FROM_ADDITIONAL) || store_flag_str.equals(CommonString.FROM_PHARMA)) {
|
if (store_flag_str.equals(CommonString.FROM_JCP)
|
||||||
if (store_flag_str.equals(CommonString.FROM_JCP) || country_id.equalsIgnoreCase("5") || country_id.equalsIgnoreCase("15")
|
|| country_id.equalsIgnoreCase("5")
|
||||||
|
|| country_id.equalsIgnoreCase("15")
|
||||||
|| store_flag_str.equals(CommonString.FROM_PHARMA)) {
|
|| store_flag_str.equals(CommonString.FROM_PHARMA)) {
|
||||||
status = CommonString.KEY_INVALID;
|
status = CommonString.KEY_INVALID;
|
||||||
} else {
|
} else {
|
||||||
@@ -519,8 +484,8 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
} else {
|
} else {
|
||||||
status = CommonString.KEY_VALID;
|
status = CommonString.KEY_VALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CoverageBean cdata = new CoverageBean();
|
CoverageBean cdata = new CoverageBean();
|
||||||
cdata.setStoreId(store_id);
|
cdata.setStoreId(store_id);
|
||||||
cdata.setVisitDate(visit_date);
|
cdata.setVisitDate(visit_date);
|
||||||
@@ -549,6 +514,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
|
|
||||||
database.open();
|
database.open();
|
||||||
database.InsertCoverageData(cdata);
|
database.InsertCoverageData(cdata);
|
||||||
|
|
||||||
String table;
|
String table;
|
||||||
if (store_flag_str.equals(CommonString.FROM_JCP)) {
|
if (store_flag_str.equals(CommonString.FROM_JCP)) {
|
||||||
table = CommonString.KEY_JOURNEY_PLAN;
|
table = CommonString.KEY_JOURNEY_PLAN;
|
||||||
@@ -564,17 +530,12 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
|
|
||||||
database.updateCheckoutStatus(store_id, status, table);
|
database.updateCheckoutStatus(store_id, status, table);
|
||||||
|
|
||||||
/* SharedPreferences.Editor editor = preferences.edit();
|
if(isInternetAvailable(context)){
|
||||||
|
|
||||||
editor.putString(CommonString.KEY_STOREVISITED_STATUS, "");
|
|
||||||
editor.putString(CommonString.KEY_STORE_IN_TIME, "");
|
|
||||||
|
|
||||||
editor.commit();*/
|
|
||||||
|
|
||||||
|
|
||||||
//Intent in = new Intent(StoreimageActivity.this, CategoryListActivity.class);
|
|
||||||
new GeoTagUpload(StoreimageActivity.this).execute();
|
new GeoTagUpload(StoreimageActivity.this).execute();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||||
@@ -589,28 +550,14 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
} else {
|
} else {
|
||||||
Toast.makeText(context, getResources().getString(R.string.clickimage), Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, getResources().getString(R.string.clickimage), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void startCameraActivity() {
|
protected void startCameraActivity() {
|
||||||
try {
|
try {
|
||||||
/*Log.i("MakeMachine", "startCameraActivity()");
|
|
||||||
File file = new File(_path);
|
|
||||||
Uri outputFileUri = FileProvider.getUriForFile(getApplicationContext(), "cpm.com.gskmtorange.fileprovider", file);
|
|
||||||
|
|
||||||
Intent intent = new Intent(
|
|
||||||
MediaStore.ACTION_IMAGE_CAPTURE);
|
|
||||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
|
||||||
|
|
||||||
startActivityForResult(intent, 0);*/
|
|
||||||
|
|
||||||
Log.i("MakeMachine", "startCameraActivity()");
|
Log.i("MakeMachine", "startCameraActivity()");
|
||||||
File file = new File(_path);
|
File file = new File(_path);
|
||||||
|
|
||||||
//android.os.FileUriExposedException: file:///storage/emulated/0/.GSK_MT_ORANGE_IMAGES/15024SI_01022019_120426.jpg exposed beyond app through ClipData.Item.getUri()
|
|
||||||
//outputFileUri = FileProvider.getUriForFile(getApplicationContext(), "cpm.com.gskmtorange.fileprovider", file);
|
|
||||||
|
|
||||||
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
outputFileUri = FileProvider.getUriForFile(context, "cpm.com.gskmtorange.fileprovider", file);
|
||||||
|
|
||||||
String defaultCameraPackage = "";
|
String defaultCameraPackage = "";
|
||||||
@@ -752,17 +699,6 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*protected void onStart() {
|
|
||||||
mGoogleApiClient.connect();
|
|
||||||
super.onStart();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void onStop() {
|
|
||||||
mGoogleApiClient.disconnect();
|
|
||||||
super.onStop();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLocationChanged(Location location) {
|
public void onLocationChanged(Location location) {
|
||||||
|
|
||||||
@@ -864,14 +800,13 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + service, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + service, envelope);
|
||||||
Object result = (Object) envelope.getResponse();
|
Object result = (Object) envelope.getResponse();
|
||||||
|
|
||||||
if (result.toString().equalsIgnoreCase(
|
if (result.toString().equalsIgnoreCase(
|
||||||
CommonString.KEY_SUCCESS)) {
|
CommonString.KEY_SUCCESS)) {
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (result.toString().equalsIgnoreCase(
|
if (result.toString().equalsIgnoreCase(
|
||||||
|
|||||||
@@ -0,0 +1,501 @@
|
|||||||
|
package cpm.com.gskmtorange.dailyentry
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.Intent
|
||||||
|
import android.content.SharedPreferences
|
||||||
|
import android.graphics.BitmapFactory
|
||||||
|
import android.net.Uri
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.preference.PreferenceManager
|
||||||
|
import android.provider.MediaStore
|
||||||
|
import android.util.Base64
|
||||||
|
import android.util.Log
|
||||||
|
import android.view.View
|
||||||
|
import android.webkit.ConsoleMessage
|
||||||
|
import android.webkit.JavascriptInterface
|
||||||
|
import android.webkit.WebChromeClient
|
||||||
|
import android.webkit.WebSettings
|
||||||
|
import android.webkit.WebView
|
||||||
|
import android.webkit.WebViewClient
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.appcompat.widget.Toolbar
|
||||||
|
import androidx.media3.common.MediaItem
|
||||||
|
import androidx.media3.exoplayer.ExoPlayer
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString
|
||||||
|
import cpm.com.gskmtorange.databinding.ActivityWebviewBinding
|
||||||
|
import org.json.JSONObject
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.Date
|
||||||
|
import java.util.Locale
|
||||||
|
|
||||||
|
class WebViewActivity : AppCompatActivity() {
|
||||||
|
private lateinit var binding: ActivityWebviewBinding
|
||||||
|
var toolbar: Toolbar? = null
|
||||||
|
private lateinit var type : String
|
||||||
|
private var player: ExoPlayer? = null
|
||||||
|
// private var player : ExoPlayer? = null
|
||||||
|
private var pageStartTime: Long = 0
|
||||||
|
private var pageEndTime: Long = 0
|
||||||
|
private lateinit var preferences: SharedPreferences
|
||||||
|
private lateinit var db: GSKOrangeDB
|
||||||
|
private var storeid: String = ""
|
||||||
|
private var detailerId: String = ""
|
||||||
|
private var categoryId: String = ""
|
||||||
|
private var dt_level: String = ""
|
||||||
|
|
||||||
|
@SuppressLint("SetJavaScriptEnabled")
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
binding = ActivityWebviewBinding.inflate(layoutInflater)
|
||||||
|
setContentView(binding.root)
|
||||||
|
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this)
|
||||||
|
db = GSKOrangeDB(this)
|
||||||
|
db.open()
|
||||||
|
|
||||||
|
val url = intent.getStringExtra("url") ?: ""
|
||||||
|
type = intent.getStringExtra("type") ?: "html-webview"
|
||||||
|
storeid = intent.getStringExtra("storeid") ?: ""
|
||||||
|
detailerId = intent.getStringExtra("merid") ?: ""
|
||||||
|
categoryId = intent.getStringExtra("categoryId") ?: ""
|
||||||
|
dt_level = intent.getStringExtra("dt_level") ?: ""
|
||||||
|
handleContent(type, url)
|
||||||
|
|
||||||
|
binding.toolbar.setTitle("Banner Detail")
|
||||||
|
setSupportActionBar(binding.toolbar)
|
||||||
|
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||||
|
|
||||||
|
if(dt_level.isNotEmpty()){
|
||||||
|
pageStartTime = System.currentTimeMillis()
|
||||||
|
val formattedTime = SimpleDateFormat(
|
||||||
|
"HH:mm:ss",
|
||||||
|
Locale.getDefault()
|
||||||
|
).format(Date(pageStartTime))
|
||||||
|
Log.d("WEBVIEW_START_TIME", "Start time is :$formattedTime ")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun handleContent(type: String, url: String) {
|
||||||
|
when (type) {
|
||||||
|
"html-webview" -> {
|
||||||
|
binding.webView.visibility = View.VISIBLE
|
||||||
|
binding.imageView.visibility = View.GONE
|
||||||
|
binding.videoView.visibility = View.GONE
|
||||||
|
setupWebView(url)
|
||||||
|
}
|
||||||
|
|
||||||
|
"image" -> {
|
||||||
|
binding.webView.visibility = View.GONE
|
||||||
|
binding.imageView.visibility = View.VISIBLE
|
||||||
|
binding.videoView.visibility = View.GONE
|
||||||
|
|
||||||
|
com.bumptech.glide.Glide.with(this)
|
||||||
|
.load(url)
|
||||||
|
.into(binding.imageView)
|
||||||
|
}
|
||||||
|
|
||||||
|
"video" -> {
|
||||||
|
binding.webView.visibility = View.GONE
|
||||||
|
binding.imageView.visibility = View.GONE
|
||||||
|
binding.videoView.visibility = View.VISIBLE
|
||||||
|
playVideo(url)
|
||||||
|
}
|
||||||
|
|
||||||
|
"html-webbrowser" -> {
|
||||||
|
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
|
||||||
|
else -> {
|
||||||
|
binding.webView.visibility = View.VISIBLE
|
||||||
|
setupWebView(url)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun playVideo(url: String) {
|
||||||
|
player = ExoPlayer.Builder(this).build()
|
||||||
|
binding.videoView.post {
|
||||||
|
val width = binding.videoView.width
|
||||||
|
val height = (width * 9) / 16
|
||||||
|
binding.videoView.layoutParams.height = height
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.videoView.player = player
|
||||||
|
|
||||||
|
val mediaItem = MediaItem.fromUri(url)
|
||||||
|
player?.setMediaItem(mediaItem)
|
||||||
|
player?.prepare()
|
||||||
|
player?.play()
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetJavaScriptEnabled")
|
||||||
|
private fun setupWebView(url: String) {
|
||||||
|
with(binding.webView.settings) {
|
||||||
|
javaScriptEnabled = true
|
||||||
|
domStorageEnabled = true
|
||||||
|
javaScriptCanOpenWindowsAutomatically = true
|
||||||
|
setSupportMultipleWindows(true)
|
||||||
|
loadWithOverviewMode = true
|
||||||
|
|
||||||
|
setSupportZoom(true)
|
||||||
|
builtInZoomControls = true
|
||||||
|
displayZoomControls = false
|
||||||
|
useWideViewPort = true
|
||||||
|
mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.webView.addJavascriptInterface(WebAppInterface(), "Android")
|
||||||
|
|
||||||
|
binding.webView.webViewClient = object : WebViewClient() {
|
||||||
|
override fun onPageStarted(view: WebView?, url: String?, favicon: android.graphics.Bitmap?) {
|
||||||
|
/* pageStartTime = System.currentTimeMillis()
|
||||||
|
val formattedTime = SimpleDateFormat(
|
||||||
|
"HH:mm:ss",
|
||||||
|
Locale.getDefault()
|
||||||
|
).format(Date(pageStartTime))*/
|
||||||
|
|
||||||
|
// println(formattedTime)
|
||||||
|
injectJS(view)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPageFinished(view: WebView?, url: String?) {
|
||||||
|
pageStartTime = System.currentTimeMillis()
|
||||||
|
Log.d("WEBVIEW_TIME", " viewed for $pageStartTime sec")
|
||||||
|
injectJS(view)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.webView.webChromeClient = object : WebChromeClient() {
|
||||||
|
override fun onConsoleMessage(consoleMessage: ConsoleMessage?): Boolean {
|
||||||
|
Log.e("JS_LOG", consoleMessage?.message() ?: "")
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
binding.webView.loadUrl(url)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 🔥 JS INJECTION (RN BRIDGE + FIXES)
|
||||||
|
private fun injectJS(view: WebView?) {
|
||||||
|
|
||||||
|
view?.evaluateJavascript(
|
||||||
|
"""
|
||||||
|
(function() {
|
||||||
|
|
||||||
|
console.log("🔥 JS INJECTED");
|
||||||
|
|
||||||
|
var meta = document.querySelector('meta[name=viewport]');
|
||||||
|
if (meta) {
|
||||||
|
meta.setAttribute(
|
||||||
|
'content',
|
||||||
|
'width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes'
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
var newMeta = document.createElement('meta');
|
||||||
|
newMeta.name = "viewport";
|
||||||
|
newMeta.content = "width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes";
|
||||||
|
document.head.appendChild(newMeta);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ✅ imageToBase64 FIX
|
||||||
|
window.imageToBase64 = function(img) {
|
||||||
|
try {
|
||||||
|
if (!img) return null;
|
||||||
|
|
||||||
|
var canvas = document.createElement('canvas');
|
||||||
|
canvas.width = img.naturalWidth || img.width;
|
||||||
|
canvas.height = img.naturalHeight || img.height;
|
||||||
|
|
||||||
|
var ctx = canvas.getContext('2d');
|
||||||
|
ctx.drawImage(img, 0, 0);
|
||||||
|
|
||||||
|
return canvas.toDataURL('image/png');
|
||||||
|
|
||||||
|
} catch(e) {
|
||||||
|
console.log("imageToBase64 error:", e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// ✅ React Native bridge
|
||||||
|
window.ReactNativeWebView = {
|
||||||
|
postMessage: function(data) {
|
||||||
|
console.log("POST MESSAGE:", data);
|
||||||
|
Android.postMessage(data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// ✅ Share function
|
||||||
|
window.nativeShare = function(options) {
|
||||||
|
console.log("CALL nativeShare:", options);
|
||||||
|
|
||||||
|
if (!options) return;
|
||||||
|
|
||||||
|
window.ReactNativeWebView.postMessage(JSON.stringify({
|
||||||
|
type: 'SHARE',
|
||||||
|
data: options
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
|
||||||
|
// 🔍 Debug click
|
||||||
|
document.addEventListener('click', function(e) {
|
||||||
|
console.log("CLICK:", e.target.innerText);
|
||||||
|
}, true);
|
||||||
|
|
||||||
|
})();
|
||||||
|
""".trimIndent(),
|
||||||
|
null
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ✅ JS INTERFACE
|
||||||
|
inner class WebAppInterface {
|
||||||
|
|
||||||
|
@JavascriptInterface
|
||||||
|
fun postMessage(message: String?) {
|
||||||
|
Log.e("WEB_MESSAGE", "RAW: $message")
|
||||||
|
|
||||||
|
runOnUiThread {
|
||||||
|
handleWebMessage(message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ✅ HANDLE MESSAGE
|
||||||
|
private fun handleWebMessage(message: String?) {
|
||||||
|
try {
|
||||||
|
val obj = JSONObject(message ?: return)
|
||||||
|
val type = obj.optString("type")
|
||||||
|
|
||||||
|
if (type == "SHARE") {
|
||||||
|
val data = obj.optJSONObject("data")
|
||||||
|
handleShare(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e("WEB_MESSAGE", "Error: ${e.message}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ✅ HANDLE SHARE
|
||||||
|
private fun handleShare(data: JSONObject?) {
|
||||||
|
|
||||||
|
if (data == null) return
|
||||||
|
|
||||||
|
val type = data.optString("type")
|
||||||
|
val message = data.optString("message")
|
||||||
|
val url = data.optString("url")
|
||||||
|
val image = data.optString("image")
|
||||||
|
val imagesArray = data.optJSONArray("images")
|
||||||
|
|
||||||
|
Log.e("SHARE_DEBUG", "TYPE: $type")
|
||||||
|
Log.e("SHARE_DEBUG", "MESSAGE: $message")
|
||||||
|
Log.e("SHARE_DEBUG", "URL: $url")
|
||||||
|
Log.e("SHARE_DEBUG", "IMAGE: ${image.take(50)}")
|
||||||
|
|
||||||
|
when (type) {
|
||||||
|
|
||||||
|
"text" -> shareText("$message\n$url")
|
||||||
|
|
||||||
|
"image" -> {
|
||||||
|
if (image.isNotEmpty()) shareImageSmart(image)
|
||||||
|
}
|
||||||
|
|
||||||
|
"multiple_images" -> {
|
||||||
|
if (imagesArray != null) {
|
||||||
|
val list = mutableListOf<String>()
|
||||||
|
for (i in 0 until imagesArray.length()) {
|
||||||
|
list.add(imagesArray.getString(i))
|
||||||
|
}
|
||||||
|
shareMultipleImages(list)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
"image_with_text" -> {
|
||||||
|
if (image.isNotEmpty()) {
|
||||||
|
shareImageTextSmart(image, "$message\n$url")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else -> shareText(message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ✅ TEXT SHARE
|
||||||
|
private fun shareText(text: String) {
|
||||||
|
val intent = Intent(Intent.ACTION_SEND)
|
||||||
|
intent.type = "text/plain"
|
||||||
|
intent.putExtra(Intent.EXTRA_TEXT, text)
|
||||||
|
startActivity(Intent.createChooser(intent, "Share via"))
|
||||||
|
}
|
||||||
|
|
||||||
|
// ✅ SMART IMAGE SHARE (BASE64 + URL)
|
||||||
|
private fun shareImageSmart(imageData: String) {
|
||||||
|
|
||||||
|
Log.e("SHARE_DEBUG", "Image Data: ${imageData.take(100)}")
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (imageData.startsWith("data:image")) {
|
||||||
|
|
||||||
|
val pure = imageData.substringAfter(",")
|
||||||
|
val bytes = Base64.decode(pure, Base64.DEFAULT)
|
||||||
|
val bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.size)
|
||||||
|
|
||||||
|
val path = MediaStore.Images.Media.insertImage(contentResolver, bitmap, "Image", null)
|
||||||
|
val uri = Uri.parse(path)
|
||||||
|
|
||||||
|
val intent = Intent(Intent.ACTION_SEND)
|
||||||
|
intent.type = "image/*"
|
||||||
|
intent.putExtra(Intent.EXTRA_STREAM, uri)
|
||||||
|
|
||||||
|
startActivity(Intent.createChooser(intent, "Share Image"))
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// URL → Glide
|
||||||
|
com.bumptech.glide.Glide.with(this)
|
||||||
|
.asBitmap()
|
||||||
|
.load(imageData)
|
||||||
|
.into(object : com.bumptech.glide.request.target.CustomTarget<android.graphics.Bitmap>() {
|
||||||
|
|
||||||
|
override fun onResourceReady(
|
||||||
|
resource: android.graphics.Bitmap,
|
||||||
|
transition: com.bumptech.glide.request.transition.Transition<in android.graphics.Bitmap>?
|
||||||
|
) {
|
||||||
|
|
||||||
|
val path = MediaStore.Images.Media.insertImage(
|
||||||
|
contentResolver, resource, "Image", null
|
||||||
|
)
|
||||||
|
|
||||||
|
val uri = Uri.parse(path)
|
||||||
|
|
||||||
|
val intent = Intent(Intent.ACTION_SEND)
|
||||||
|
intent.type = "image/*"
|
||||||
|
intent.putExtra(Intent.EXTRA_STREAM, uri)
|
||||||
|
|
||||||
|
startActivity(Intent.createChooser(intent, "Share Image"))
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onLoadCleared(placeholder: android.graphics.drawable.Drawable?) {}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e("SHARE_DEBUG", "Error: ${e.message}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ✅ IMAGE + TEXT
|
||||||
|
private fun shareImageTextSmart(imageData: String, text: String) {
|
||||||
|
|
||||||
|
if (imageData.startsWith("data:image")) {
|
||||||
|
|
||||||
|
val pure = imageData.substringAfter(",")
|
||||||
|
val bytes = Base64.decode(pure, Base64.DEFAULT)
|
||||||
|
val bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.size)
|
||||||
|
|
||||||
|
val path = MediaStore.Images.Media.insertImage(contentResolver, bitmap, "Image", null)
|
||||||
|
val uri = Uri.parse(path)
|
||||||
|
val intent = Intent(Intent.ACTION_SEND)
|
||||||
|
intent.type = "image/*"
|
||||||
|
intent.putExtra(Intent.EXTRA_STREAM, uri)
|
||||||
|
intent.putExtra(Intent.EXTRA_TEXT, text)
|
||||||
|
startActivity(Intent.createChooser(intent, "Share"))
|
||||||
|
} else {
|
||||||
|
shareText(text)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ✅ MULTIPLE IMAGES
|
||||||
|
private fun shareMultipleImages(list: List<String>) {
|
||||||
|
val uris = ArrayList<Uri>()
|
||||||
|
for (base64 in list) {
|
||||||
|
val pure = base64.substringAfter(",")
|
||||||
|
val bytes = Base64.decode(pure, Base64.DEFAULT)
|
||||||
|
val bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.size)
|
||||||
|
|
||||||
|
val path = MediaStore.Images.Media.insertImage(contentResolver, bitmap, "Image", null)
|
||||||
|
uris.add(Uri.parse(path))
|
||||||
|
}
|
||||||
|
val intent = Intent(Intent.ACTION_SEND_MULTIPLE)
|
||||||
|
intent.type = "image/*"
|
||||||
|
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris)
|
||||||
|
startActivity(Intent.createChooser(intent, "Share Images"))
|
||||||
|
}
|
||||||
|
override fun onSupportNavigateUp(): Boolean {
|
||||||
|
onBackPressedDispatcher.onBackPressed()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBackPressed() {
|
||||||
|
if (binding.webView.canGoBack()) {
|
||||||
|
binding.webView.goBack()
|
||||||
|
} else {
|
||||||
|
super.onBackPressed()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
override fun onPause() {
|
||||||
|
super.onPause()
|
||||||
|
player?.pause()
|
||||||
|
val visit_date = preferences.getString(CommonString.KEY_DATE, "") ?: ""
|
||||||
|
val user_id = preferences.getString(CommonString.KEY_USERNAME, "") ?: ""
|
||||||
|
if(dt_level.isNotEmpty()) {
|
||||||
|
pageEndTime = System.currentTimeMillis()
|
||||||
|
val start_time =
|
||||||
|
SimpleDateFormat("HH:mm:ss", Locale.getDefault()).format(Date(pageStartTime))
|
||||||
|
val end_time =
|
||||||
|
SimpleDateFormat("HH:mm:ss", Locale.getDefault()).format(Date(pageEndTime))
|
||||||
|
val spent = (pageEndTime - pageStartTime) / 1000
|
||||||
|
db.insertWebViewTimeSpent(
|
||||||
|
storeid,
|
||||||
|
visit_date,
|
||||||
|
start_time,
|
||||||
|
end_time,
|
||||||
|
spent.toString(),
|
||||||
|
detailerId,
|
||||||
|
user_id,
|
||||||
|
categoryId,
|
||||||
|
dt_level
|
||||||
|
)
|
||||||
|
// Log.d("WEBVIEW_END_TIME", "End time is :$end_time and viewed for $spent sec ")
|
||||||
|
/* var detailer_xml = ""
|
||||||
|
var onXML = ""
|
||||||
|
val detailerList = db.getUploadedDetailerData(storeid)
|
||||||
|
Log.d("detailersize", detailerList.size.toString());
|
||||||
|
if (!detailerList.isEmpty()) {
|
||||||
|
for (j in detailerList.indices) {
|
||||||
|
onXML =
|
||||||
|
"[DETAILER_DATA]" +
|
||||||
|
"[MID]" + 0 + "[/MID]" +
|
||||||
|
"[USERID]" + user_id + "[/USERID]" +
|
||||||
|
"[STORE_ID]" + storeid + "[/STORE_ID]" +
|
||||||
|
"[VISIT_DATE]" + detailerList.get(j)!!
|
||||||
|
.getVisitdate() + "[/VISIT_DATE]" +
|
||||||
|
"[START_TIME]" + detailerList.get(j)!!
|
||||||
|
.getStart_time() + "[/START_TIME]" +
|
||||||
|
"[END_TIME]" + detailerList.get(j)!!.getEnd_time() + "[/END_TIME]" +
|
||||||
|
"[DURATION]" + detailerList.get(j)!!.getDuration() + "[/DURATION]" +
|
||||||
|
"[DETAILER_ID]" + detailerList.get(j)!!
|
||||||
|
.getDetailerId() + "[/DETAILER_ID]" +
|
||||||
|
"[CATEGORY_ID]" + detailerList.get(j)!!
|
||||||
|
.getCATEGORY_ID().get(0) + "[/CATEGORY_ID]" +
|
||||||
|
"[DT_LEVEL]" + detailerList.get(j)!!.getDT_LEVEL().get(0) + "[/DT_LEVEL]" +
|
||||||
|
"[/DETAILER_DATA]"
|
||||||
|
|
||||||
|
detailer_xml = detailer_xml + onXML
|
||||||
|
}
|
||||||
|
val sos_xml = "[DATA]" + detailer_xml + "[/DATA]"
|
||||||
|
Log.e("detailer_xml_data", sos_xml)
|
||||||
|
|
||||||
|
Log.d("WEBVIEW_END_TIME", "End time is :$end_time and viewed for $spent sec ")
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
override fun onDestroy() {
|
||||||
|
super.onDestroy()
|
||||||
|
player?.release()
|
||||||
|
player = null
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
package cpm.com.gskmtorange.download;
|
package cpm.com.gskmtorange.download;
|
||||||
|
|
||||||
|
import static cpm.com.gskmtorange.constant.CommonFunctions.isInternetAvailable;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -14,20 +15,15 @@ import android.util.Log;
|
|||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
//import com.crashlytics.android.Crashlytics;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
|
||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
import org.ksoap2.serialization.SoapObject;
|
import org.ksoap2.serialization.SoapObject;
|
||||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
import org.ksoap2.transport.HttpTransportSE;
|
|
||||||
import org.xmlpull.v1.XmlPullParser;
|
import org.xmlpull.v1.XmlPullParser;
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
import org.xmlpull.v1.XmlPullParserFactory;
|
import org.xmlpull.v1.XmlPullParserFactory;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -39,11 +35,13 @@ import java.net.MalformedURLException;
|
|||||||
import java.net.SocketTimeoutException;
|
import java.net.SocketTimeoutException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.StoreListActivity;
|
||||||
|
import cpm.com.gskmtorange.utils.OkHttpTransportSE;
|
||||||
|
import cpm.com.gskmtorange.utils.TLSSocketFactory;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.AdditionalQuestiongetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.AdditionalQuestiongetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||||
@@ -69,10 +67,13 @@ import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockStorewiseGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockStorewiseGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingSubCategoryImageAllowGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingSubCategoryImageAllowGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MasterDetailerGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.Master_Storelist_PDA_GetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraLastVisitGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraLastVisitGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.NonT2pReasonGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.NonT2pReasonGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingSubReasonGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingSubReasonGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.NoticeboardGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.Order_Received_Status_GetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.Order_Received_Status_GetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.POGQuestionGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.POGQuestionGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.PROMOTION_TYPE_MASTERGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.PROMOTION_TYPE_MASTERGetterSetter;
|
||||||
@@ -86,6 +87,11 @@ import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
||||||
|
import javax.net.ssl.HttpsURLConnection;
|
||||||
|
import javax.net.ssl.SSLContext;
|
||||||
|
import javax.net.ssl.SSLSession;
|
||||||
|
import javax.net.ssl.SSLSocket;
|
||||||
|
import javax.net.ssl.SSLSocketFactory;
|
||||||
|
|
||||||
public class DownloadActivity extends AppCompatActivity {
|
public class DownloadActivity extends AppCompatActivity {
|
||||||
private Context context;
|
private Context context;
|
||||||
@@ -138,6 +144,10 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
MAPPING_SKU_PRICING_ENABLEGetterSetter mapping_sku_pricing_enableGetterSetter;
|
MAPPING_SKU_PRICING_ENABLEGetterSetter mapping_sku_pricing_enableGetterSetter;
|
||||||
Order_Received_Status_GetterSetter order_received_status_getterSetter;
|
Order_Received_Status_GetterSetter order_received_status_getterSetter;
|
||||||
Visit_Type_Master_GetterSetter visit_type_master_getterSetter;
|
Visit_Type_Master_GetterSetter visit_type_master_getterSetter;
|
||||||
|
Master_Storelist_PDA_GetterSetter masterStorelistPdaGetterSetter;
|
||||||
|
NoticeboardGetterSetter noticeboardGetterSetter;
|
||||||
|
MasterDetailerGetterSetter masterDetailerGetterSetter;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private Dialog dialog;
|
private Dialog dialog;
|
||||||
@@ -152,22 +162,28 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_download);
|
setContentView(R.layout.activity_download);
|
||||||
|
|
||||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
db = new GSKOrangeDB(this);
|
db = new GSKOrangeDB(this);
|
||||||
context = this;
|
context = this;
|
||||||
|
// ✅ Enable old TLS versions for SOAP
|
||||||
|
//enableOldTLS();
|
||||||
|
// checkTLSVersion();
|
||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
userId = preferences.getString(CommonString.KEY_USERNAME, null);
|
userId = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
culture_id = preferences.getString(CommonString.KEY_CULTURE_ID, "");
|
culture_id = preferences.getString(CommonString.KEY_CULTURE_ID, "");
|
||||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||||
|
|
||||||
|
if(isInternetAvailable(context)){
|
||||||
new UploadTask(DownloadActivity.this).execute();
|
new UploadTask(DownloadActivity.this).execute();
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
class Data {
|
class Data {
|
||||||
int value;
|
int value;
|
||||||
@@ -197,6 +213,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
dialog.setCancelable(false);
|
dialog.setCancelable(false);
|
||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String doInBackground(Void... voids) {
|
protected String doInBackground(Void... voids) {
|
||||||
try {
|
try {
|
||||||
@@ -223,24 +240,22 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
// OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
Log.d("requestdata",request.toString());
|
/* if (androidHttpTransport.responseDump != null) {
|
||||||
|
Log.e("SOAP_RESPONSE", androidHttpTransport.responseDump);
|
||||||
|
} else {
|
||||||
|
Log.e("SOAP_RESPONSE", "No response received");
|
||||||
|
}*/
|
||||||
Object result = envelope.getResponse();
|
Object result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
|
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
// xpp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
|
|
||||||
// xpp.setInput(stream,"UTF-8");
|
|
||||||
xpp.next();
|
xpp.next();
|
||||||
eventType = xpp.getEventType();
|
eventType = xpp.getEventType();
|
||||||
|
|
||||||
jcpgettersetter = XMLHandlers.JCPXMLHandler(xpp, eventType);
|
jcpgettersetter = XMLHandlers.JCPXMLHandler(xpp, eventType);
|
||||||
|
|
||||||
String jcpTable = jcpgettersetter.getTable_journey_plan();
|
String jcpTable = jcpgettersetter.getTable_journey_plan();
|
||||||
if (jcpTable != null)
|
if (jcpTable != null)
|
||||||
TableBean.setJourneyPlan(jcpTable);
|
TableBean.setJourneyPlan(jcpTable);
|
||||||
@@ -251,7 +266,6 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
//return "JOURNEY_PLAN";
|
//return "JOURNEY_PLAN";
|
||||||
no_jcp_flag = true;
|
no_jcp_flag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
data.value = 10;
|
data.value = 10;
|
||||||
data.name = "JCP " + getResources().getString(R.string.download_data);
|
data.name = "JCP " + getResources().getString(R.string.download_data);
|
||||||
}
|
}
|
||||||
@@ -267,16 +281,12 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
|
||||||
Log.d("resultdata",result.toString());
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
// xpp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
|
|
||||||
// xpp.setInput(stream,"UTF-8");
|
|
||||||
xpp.next();
|
xpp.next();
|
||||||
eventType = xpp.getEventType();
|
eventType = xpp.getEventType();
|
||||||
|
|
||||||
@@ -294,9 +304,6 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
data.name = "ADHOC JOURNEYPLAN " + getResources().getString(R.string.download_data);
|
data.name = "ADHOC JOURNEYPLAN " + getResources().getString(R.string.download_data);
|
||||||
} else {
|
} else {
|
||||||
no_adhoc_flag = true;
|
no_adhoc_flag = true;
|
||||||
/*if (no_jcp_flag) {
|
|
||||||
return "JOURNEY_PLAN";
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
@@ -310,8 +317,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -325,51 +331,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
if (additionalJcpGetterSetter.getSTORE_ID().size() > 0) {
|
if (additionalJcpGetterSetter.getSTORE_ID().size() > 0) {
|
||||||
resultHttp = CommonString.KEY_SUCCESS;
|
resultHttp = CommonString.KEY_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
no_addtional_jcp_flag = true;
|
no_addtional_jcp_flag = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String additional_jcpTable = additionalJcpGetterSetter.getTable_journey_plan();
|
String additional_jcpTable = additionalJcpGetterSetter.getTable_journey_plan();
|
||||||
TableBean.setAdditionalJourneyPlan(additional_jcpTable);
|
TableBean.setAdditionalJourneyPlan(additional_jcpTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
//SUPERVISOR_LIST
|
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
|
||||||
request.addProperty("UserName", userId);
|
|
||||||
request.addProperty("Type", "SUPERVISOR_LIST");
|
|
||||||
request.addProperty("cultureid", culture_id);
|
|
||||||
|
|
||||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
|
||||||
envelope.dotNet = true;
|
|
||||||
envelope.setOutputSoapObject(request);
|
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
|
||||||
|
|
||||||
result = envelope.getResponse();
|
|
||||||
Log.d("resultdata",result.toString());
|
|
||||||
|
|
||||||
if (result.toString() != null) {
|
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
|
||||||
xpp.next();
|
|
||||||
eventType = xpp.getEventType();
|
|
||||||
supervisorListGetterSetter = XMLHandlers.supervisorListXMLHandler(xpp, eventType);
|
|
||||||
|
|
||||||
String table_sup_list = supervisorListGetterSetter.getTable_SUPERVISOR_LIST();
|
|
||||||
if (table_sup_list != null) {
|
|
||||||
resultHttp = CommonString.KEY_SUCCESS;
|
|
||||||
TableBean.setTable_SUPERVISOR_LIST(table_sup_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supervisorListGetterSetter.getEMP_ID().size() > 0) {
|
|
||||||
data.value = 97;
|
|
||||||
data.name = "SUPERVISOR LIST DATA" + getResources().getString(R.string.download_data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
publishProgress(data);
|
|
||||||
|
|
||||||
|
|
||||||
//ADHOC_JOURNEYPLAN_ADDITIONAL
|
//ADHOC_JOURNEYPLAN_ADDITIONAL
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
request.addProperty("UserName", userId);
|
request.addProperty("UserName", userId);
|
||||||
@@ -380,7 +346,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -400,7 +367,6 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
return "JOURNEY_PLAN";
|
return "JOURNEY_PLAN";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String additional_jcpTable = additionalAdhocJcpGetterSetter.getTable_journey_plan();
|
String additional_jcpTable = additionalAdhocJcpGetterSetter.getTable_journey_plan();
|
||||||
TableBean.setAdhocJourneyplanAdditional(additional_jcpTable);
|
TableBean.setAdhocJourneyplanAdditional(additional_jcpTable);
|
||||||
}
|
}
|
||||||
@@ -415,7 +381,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -452,7 +419,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -489,7 +457,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -526,7 +495,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -562,7 +532,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -598,7 +569,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -633,7 +605,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -673,7 +645,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -713,7 +686,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -752,7 +726,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);;
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -788,7 +763,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -826,7 +802,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -861,7 +838,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -899,7 +877,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -936,7 +915,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -973,7 +953,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1001,6 +981,44 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
|
request.addProperty("UserName", userId);
|
||||||
|
request.addProperty("Type", "CATEGORYWISE_SOS_TARGET");
|
||||||
|
request.addProperty("cultureid", culture_id);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
|
if (result.toString() != null) {
|
||||||
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
|
xpp.next();
|
||||||
|
eventType = xpp.getEventType();
|
||||||
|
store_category_wiseGetterSetter = XMLHandlers.CATEGORYWISE_SOS_TARGETXMLHandler(xpp, eventType);
|
||||||
|
|
||||||
|
String table_store_performace = store_category_wiseGetterSetter.getTable_CATEGORYWISE_SOS_TARGET();
|
||||||
|
if (table_store_performace != null) {
|
||||||
|
resultHttp = CommonString.KEY_SUCCESS;
|
||||||
|
TableBean.setCategoryWiseSos(table_store_performace);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (store_category_wiseGetterSetter.getSTORE_ID().size() > 0) {
|
||||||
|
data.value = 85;
|
||||||
|
data.name = "CATEGORYWISE_SOS_TARGET Data Download";
|
||||||
|
} else {
|
||||||
|
//return "CATEGORYWISE_SOS_TARGET";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
//ADDITIONAL_DISPLAY_MASTER
|
//ADDITIONAL_DISPLAY_MASTER
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
@@ -1012,7 +1030,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1049,7 +1068,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1085,7 +1105,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1122,7 +1143,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1149,43 +1171,6 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
//CATEGORYWISE_SOS_TARGET
|
//CATEGORYWISE_SOS_TARGET
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
|
||||||
request.addProperty("UserName", userId);
|
|
||||||
request.addProperty("Type", "CATEGORYWISE_SOS_TARGET");
|
|
||||||
request.addProperty("cultureid", culture_id);
|
|
||||||
|
|
||||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
|
||||||
envelope.dotNet = true;
|
|
||||||
envelope.setOutputSoapObject(request);
|
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
|
||||||
|
|
||||||
result = envelope.getResponse();
|
|
||||||
Log.d("resultdata",result.toString());
|
|
||||||
|
|
||||||
if (result.toString() != null) {
|
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
|
||||||
xpp.next();
|
|
||||||
eventType = xpp.getEventType();
|
|
||||||
store_category_wiseGetterSetter = XMLHandlers.CATEGORYWISE_SOS_TARGETXMLHandler(xpp, eventType);
|
|
||||||
|
|
||||||
String table_store_performace = store_category_wiseGetterSetter.getTable_CATEGORYWISE_SOS_TARGET();
|
|
||||||
if (table_store_performace != null) {
|
|
||||||
resultHttp = CommonString.KEY_SUCCESS;
|
|
||||||
TableBean.setCategoryWiseSos(table_store_performace);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (store_category_wiseGetterSetter.getSTORE_ID().size() > 0) {
|
|
||||||
data.value = 85;
|
|
||||||
data.name = "CATEGORYWISE_SOS_TARGET Data Download";
|
|
||||||
} else {
|
|
||||||
//return "CATEGORYWISE_SOS_TARGET";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
publishProgress(data);
|
|
||||||
|
|
||||||
|
|
||||||
//SHELF_MASTER
|
//SHELF_MASTER
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
@@ -1197,7 +1182,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1233,7 +1219,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1269,7 +1256,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1294,6 +1282,42 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
|
//SUPERVISOR_LIST
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
|
request.addProperty("UserName", userId);
|
||||||
|
request.addProperty("Type", "SUPERVISOR_LIST");
|
||||||
|
request.addProperty("cultureid", culture_id);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
|
||||||
|
if (result.toString() != null) {
|
||||||
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
|
xpp.next();
|
||||||
|
eventType = xpp.getEventType();
|
||||||
|
supervisorListGetterSetter = XMLHandlers.supervisorListXMLHandler(xpp, eventType);
|
||||||
|
|
||||||
|
String table_sup_list = supervisorListGetterSetter.getTable_SUPERVISOR_LIST();
|
||||||
|
if (table_sup_list != null) {
|
||||||
|
resultHttp = CommonString.KEY_SUCCESS;
|
||||||
|
TableBean.setTable_SUPERVISOR_LIST(table_sup_list);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supervisorListGetterSetter.getEMP_ID().size() > 0) {
|
||||||
|
data.value = 97;
|
||||||
|
data.name = "SUPERVISOR LIST DATA" + getResources().getString(R.string.download_data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
//MAPPING_CATEGORY_IMAGE_ALLOW
|
//MAPPING_CATEGORY_IMAGE_ALLOW
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
request.addProperty("UserName", userId);
|
request.addProperty("UserName", userId);
|
||||||
@@ -1304,7 +1328,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1339,7 +1364,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1376,7 +1402,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1411,7 +1438,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1446,7 +1474,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1481,7 +1510,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1516,11 +1546,12 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
// Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1552,7 +1583,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1590,7 +1622,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1620,7 +1653,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1650,7 +1684,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1689,7 +1723,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1729,7 +1764,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1766,7 +1802,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1804,7 +1841,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1832,6 +1870,84 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
|
//VISIT_TYPE_MASTER
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
|
request.addProperty("UserName", userId);
|
||||||
|
request.addProperty("Type", "Master_StoreList_PDA");
|
||||||
|
request.addProperty("cultureid", culture_id);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
|
if (result.toString() != null) {
|
||||||
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
|
xpp.next();
|
||||||
|
eventType = xpp.getEventType();
|
||||||
|
|
||||||
|
masterStorelistPdaGetterSetter = XMLHandlers.Master_Storelist_PDA_XMLHandler(xpp, eventType);
|
||||||
|
String stocktable = masterStorelistPdaGetterSetter.getTable_master_storelist_pda();
|
||||||
|
if (stocktable != null) {
|
||||||
|
resultHttp = CommonString.KEY_SUCCESS;
|
||||||
|
TableBean.setTable_Master_PDA_STORE_LIST(stocktable);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (order_received_status_getterSetter.getSTORE_ID().size() > 0) {
|
||||||
|
Log.d("mastetpdadata","download");
|
||||||
|
data.value = 99;
|
||||||
|
data.name = "Master_StoreList_PDA" + getResources().getString(R.string.download_data);
|
||||||
|
} else {
|
||||||
|
// return "MAPPING_PHARMA_MSL";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Mer_Noticeboard
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
|
request.addProperty("UserName", userId);
|
||||||
|
request.addProperty("Type", "MASTER_DETAILER");
|
||||||
|
request.addProperty("cultureid", culture_id);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
|
if (result.toString() != null) {
|
||||||
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
|
xpp.next();
|
||||||
|
eventType = xpp.getEventType();
|
||||||
|
|
||||||
|
masterDetailerGetterSetter = XMLHandlers.MasterDetailer_XMLHandler(xpp, eventType);
|
||||||
|
String stocktable = masterDetailerGetterSetter.getTable_MASTER_DETAILER();
|
||||||
|
if (stocktable != null) {
|
||||||
|
resultHttp = CommonString.KEY_SUCCESS;
|
||||||
|
TableBean.setTable_MASTER_DETAILER(stocktable);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (masterDetailerGetterSetter.getDTID().size() > 0) {
|
||||||
|
Log.d("master_detailer","download");
|
||||||
|
data.value = 99;
|
||||||
|
data.name = "master_detailer" + getResources().getString(R.string.download_data);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
//Images DownLoads
|
//Images DownLoads
|
||||||
@@ -1955,12 +2071,9 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//MAPPING_PLANOGRAM_STORE_WISE Image save into folder
|
//MAPPING_PLANOGRAM_STORE_WISE Image save into folder
|
||||||
if (mappingPlanogramStorewiseGetterSetter != null) {
|
if (mappingPlanogramStorewiseGetterSetter != null) {
|
||||||
|
|
||||||
@@ -2069,34 +2182,38 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
db.InsertPROMOTION_TYPE_MASTER(promotion_type_masterGetterSetter);
|
db.InsertPROMOTION_TYPE_MASTER(promotion_type_masterGetterSetter);
|
||||||
db.InsertCATEGORYWISE_SOS_TARGET(store_category_wiseGetterSetter);
|
db.InsertCATEGORYWISE_SOS_TARGET(store_category_wiseGetterSetter);
|
||||||
db.InsertMAPPING_SKU_PRICING_ENABLE(mapping_sku_pricing_enableGetterSetter);
|
db.InsertMAPPING_SKU_PRICING_ENABLE(mapping_sku_pricing_enableGetterSetter);
|
||||||
}
|
db.InsertMaster_Storelist_Pda(masterStorelistPdaGetterSetter);
|
||||||
catch (MalformedURLException e) {
|
db.InsertMasterDetailerData(masterDetailerGetterSetter);
|
||||||
|
// db.InsertNoticeBoardData(noticeboardGetterSetter);
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
str = CommonString.MESSAGE_EXCEPTION;
|
str = CommonString.MESSAGE_EXCEPTION;
|
||||||
|
Log.d("exceptiondata", e.getMessage());
|
||||||
return CommonString.MESSAGE_EXCEPTION;
|
return CommonString.MESSAGE_EXCEPTION;
|
||||||
} catch (SocketTimeoutException e) {
|
} catch (SocketTimeoutException e) {
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
str = CommonString.MESSAGE_SOCKETEXCEPTION;
|
str = CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||||
|
Log.d("exceptiondata1", e.getMessage());
|
||||||
return CommonString.MESSAGE_SOCKETEXCEPTION;
|
return CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||||
} catch (InterruptedIOException e) {
|
} catch (InterruptedIOException e) {
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
str = CommonString.MESSAGE_EXCEPTION;
|
str = CommonString.MESSAGE_EXCEPTION;
|
||||||
|
Log.d("exceptiondata2", e.getMessage());
|
||||||
return CommonString.MESSAGE_EXCEPTION;
|
return CommonString.MESSAGE_EXCEPTION;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
str = CommonString.MESSAGE_SOCKETEXCEPTION;
|
str = CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||||
|
Log.d("exceptiondata3", e.getMessage());
|
||||||
return CommonString.MESSAGE_SOCKETEXCEPTION;
|
return CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||||
} catch (XmlPullParserException e) {
|
} catch (XmlPullParserException e) {
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
Log.d("exceptiondata",e.getMessage() + ","+data.name );
|
Log.d("exceptiondata4", e.getMessage() + "," + data.name);
|
||||||
str = CommonString.MESSAGE_XmlPull;
|
str = CommonString.MESSAGE_XmlPull;
|
||||||
return CommonString.MESSAGE_XmlPull;
|
return CommonString.MESSAGE_XmlPull;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
|
||||||
// Crashlytics.logException(e.getCause());
|
|
||||||
// Crashlytics.logException(new Exception(e.getCause()));
|
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
str = CommonString.MESSAGE_EXCEPTION;
|
str = CommonString.MESSAGE_EXCEPTION;
|
||||||
|
Log.d("exceptiondata5", e.getMessage());
|
||||||
return CommonString.MESSAGE_EXCEPTION;
|
return CommonString.MESSAGE_EXCEPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2156,4 +2273,13 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void enableOldTLS() {
|
||||||
|
try {
|
||||||
|
SSLSocketFactory tlsSocketFactory = new TLSSocketFactory();
|
||||||
|
HttpsURLConnection.setDefaultSSLSocketFactory(tlsSocketFactory);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.fillInStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,9 +158,7 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
|||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
int id = view.getId();
|
int id = view.getId();
|
||||||
|
|
||||||
switch (id) {
|
if (id == R.id.btn_language_one) {
|
||||||
case R.id.btn_language_one:
|
|
||||||
|
|
||||||
//selected_flag = true;
|
//selected_flag = true;
|
||||||
onButtonPressed(language.get(0), culture_id.get(0), login_data.getNOTICE_URL().get(0));
|
onButtonPressed(language.get(0), culture_id.get(0), login_data.getNOTICE_URL().get(0));
|
||||||
|
|
||||||
@@ -176,10 +174,7 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
|||||||
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(0));
|
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(0));
|
||||||
editor.commit();
|
editor.commit();
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.btn_language_two) {
|
||||||
|
|
||||||
case R.id.btn_language_two:
|
|
||||||
|
|
||||||
//selected_flag = true;
|
//selected_flag = true;
|
||||||
onButtonPressed(language.get(1), culture_id.get(1), login_data.getNOTICE_URL().get(1));
|
onButtonPressed(language.get(1), culture_id.get(1), login_data.getNOTICE_URL().get(1));
|
||||||
|
|
||||||
@@ -194,9 +189,8 @@ public class SelectLanguageFragment extends Fragment implements View.OnClickList
|
|||||||
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(1));
|
editor.putString(CommonString.KEY_CULTURE_ID, culture_id.get(1));
|
||||||
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(1));
|
editor.putString(CommonString.KEY_NOTICE_BOARD_LINK, login_data.getNOTICE_URL().get(1));
|
||||||
editor.commit();
|
editor.commit();
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
//import com.crashlytics.android.Crashlytics;
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.cardview.widget.CardView;
|
import androidx.cardview.widget.CardView;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
@@ -44,10 +42,6 @@ import retrofit.Callback;
|
|||||||
import retrofit.Response;
|
import retrofit.Response;
|
||||||
import retrofit.Retrofit;
|
import retrofit.Retrofit;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A placeholder fragment containing a simple view.
|
|
||||||
*/
|
|
||||||
public class ServiceActivityFragment extends Fragment {
|
public class ServiceActivityFragment extends Fragment {
|
||||||
String result = "";
|
String result = "";
|
||||||
boolean isvalid = false;
|
boolean isvalid = false;
|
||||||
|
|||||||
+243
-273
@@ -28,6 +28,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
||||||
@@ -35,18 +36,23 @@ import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
|||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.BannerActivity;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.CategoryGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MasterDetailerGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
||||||
|
|
||||||
public class CategoryListActivity extends AppCompatActivity {
|
public class CategoryListActivity extends AppCompatActivity {
|
||||||
private Context context;
|
private Context context;
|
||||||
RecyclerView recyclerView;
|
RecyclerView recyclerView;
|
||||||
ArrayList<CategoryGetterSetter> categoryList;
|
ArrayList<CategoryGetterSetter> categoryList;
|
||||||
|
|
||||||
|
ArrayList<MasterDetailerGetterSetter> bannerdatacheck;
|
||||||
|
|
||||||
CategoryListAdapter adapter;
|
CategoryListAdapter adapter;
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str, pog_type_id;
|
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str, pog_type_id, mer_Id;
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
String visit_type_id = "";
|
String visit_type_id = "";
|
||||||
|
|
||||||
@@ -68,17 +74,19 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||||
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||||
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||||
|
mer_Id = preferences.getString(CommonString.KEY_MERCHANDISER_ID, "");
|
||||||
camera_allow = preferences.getString(CommonString.KEY_CAMERA_ALLOW, "");
|
camera_allow = preferences.getString(CommonString.KEY_CAMERA_ALLOW, "");
|
||||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||||
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
|
||||||
pog_type_id = preferences.getString(CommonString.KEY_POG_TYPE_ID, "");
|
pog_type_id = preferences.getString(CommonString.KEY_POG_TYPE_ID, "");
|
||||||
if (preferences.getString(CommonString.KEY_VISIT_ID, "") != null) {
|
preferences.getString(CommonString.KEY_VISIT_ID, "");
|
||||||
visit_type_id = preferences.getString(CommonString.KEY_VISIT_ID, "");
|
visit_type_id = preferences.getString(CommonString.KEY_VISIT_ID, "");
|
||||||
}
|
|
||||||
toolbar.setTitle(getResources().getString(R.string.title_activity_category_list));
|
toolbar.setTitle(getResources().getString(R.string.title_activity_category_list));
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
|
||||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab_category);
|
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab_category);
|
||||||
|
|
||||||
|
bannerdatacheck = db.getMasterDetailerData("MASTER_DETAILER","", "0");
|
||||||
fab.setOnClickListener(view -> Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG).setAction("Action", null).show());
|
fab.setOnClickListener(view -> Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG).setAction("Action", null).show());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +99,6 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
Log.e("country_data", country_id + "," + keyAccount_id);
|
Log.e("country_data", country_id + "," + keyAccount_id);
|
||||||
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||||
categoryList = db.getCategoryListData(null, null, null, store_id, "MAPPING_STOCK_STOREWISE");
|
categoryList = db.getCategoryListData(null, null, null, store_id, "MAPPING_STOCK_STOREWISE");
|
||||||
Log.d("catlistsize", String.valueOf(categoryList.size()));
|
|
||||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
categoryList = db.getCategoryListData(keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
categoryList = db.getCategoryListData(keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
||||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
||||||
@@ -99,266 +106,52 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
categoryList = db.getCategoryListData(keyAccount_id, storeType_id, class_id, store_id, "MAPPING_STOCK");
|
categoryList = db.getCategoryListData(keyAccount_id, storeType_id, class_id, store_id, "MAPPING_STOCK");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add a manual KPI tile for "Detailer" (manual usage without a DB category id)
|
||||||
|
// This will appear as an extra item in the grid. The id used is a reserved key
|
||||||
|
// "detailer_manual" and its images are mapped in getImageRes().
|
||||||
if (categoryList != null && !categoryList.isEmpty()) {
|
if (categoryList != null && !categoryList.isEmpty()) {
|
||||||
for (int i = 0; i < categoryList.size(); i++) {
|
for (int i = 0; i < categoryList.size(); i++) {
|
||||||
boolean flag_filled = false;
|
|
||||||
String category_id = categoryList.get(i).getCategory_id();
|
String category_id = categoryList.get(i).getCategory_id();
|
||||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
boolean flag_filled = isCategoryComplete(category_id);
|
||||||
db.open();
|
int imageRes = getImageRes(flag_filled, category_id);
|
||||||
boolean flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADDITIONAL);
|
categoryList.get(i).setCategory_img(imageRes);
|
||||||
if (flag_mapping_stock) {
|
|
||||||
if (db.checkStockData(store_id, category_id, visit_date)) {
|
|
||||||
flag_filled = true;
|
|
||||||
} else {
|
|
||||||
flag_filled = false;
|
|
||||||
}
|
}
|
||||||
}
|
adapter = new CategoryListAdapter(this, categoryList);
|
||||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION) && country_id.equals("2") && visit_type_id.equals("3")) {
|
|
||||||
db.open();
|
|
||||||
if (db.additionalVisibilitydata(store_id, category_id)) {
|
|
||||||
flag_filled = true;
|
|
||||||
} else {
|
|
||||||
flag_filled = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//Additional_Visibility
|
|
||||||
if (db.additionalVisibilitydata(store_id, category_id)) {
|
|
||||||
boolean flag = true;
|
|
||||||
//MSL_Availability
|
|
||||||
boolean flag_mapping_stock;
|
|
||||||
//New MSL_Availability_StockFacing
|
|
||||||
if (country_id.equals("7")) {
|
|
||||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
|
||||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
|
||||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
|
||||||
} else {
|
|
||||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK);
|
|
||||||
}
|
|
||||||
if (flag_mapping_stock) {
|
|
||||||
if (!db.checkMsl_Availability_StockFacingDataNew(store_id, category_id, visit_date)) {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Stock_Entry
|
|
||||||
boolean flag_stock_mapping_stock;
|
|
||||||
if (country_id.equals("10")) {
|
|
||||||
flag_stock_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
|
||||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
|
||||||
flag_stock_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC);
|
|
||||||
} else {
|
|
||||||
flag_stock_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK);
|
|
||||||
}
|
|
||||||
if (flag_stock_mapping_stock) {
|
|
||||||
if (!db.checkStock_Entry_FacingDataNew(store_id, category_id, visit_date)) {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Promo Compliance
|
|
||||||
if (flag) {
|
|
||||||
if (country_id.equals("7")) {
|
|
||||||
if (db.getPromoComplianceSkuwiseExistsAfterData(store_id, category_id).size() == 0) {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
boolean isMappingPromotion_Flag;
|
|
||||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
|
||||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION_ADHOC);
|
|
||||||
} else {
|
|
||||||
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION);
|
|
||||||
}
|
|
||||||
if (isMappingPromotion_Flag) {
|
|
||||||
if (!db.checkPromoComplianceData(store_id, category_id)) {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//T2P
|
|
||||||
if (flag) {
|
|
||||||
boolean flag_t2p_mapping;
|
|
||||||
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
|
||||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id, CommonString.TABLE_MAPPING_T2P_ADHOC);
|
|
||||||
} else {
|
|
||||||
flag_t2p_mapping = db.isMappingT2PData(store_id, category_id, CommonString.TABLE_MAPPING_T2P);
|
|
||||||
}
|
|
||||||
if (flag_t2p_mapping) {
|
|
||||||
if (!db.isFilledT2P(store_id, category_id)) {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Category image
|
|
||||||
if (camera_allow.equals("1")) {
|
|
||||||
if (!db.isCategoryPictureData(store_id, category_id)) {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
final ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list = db.getSubCategoryMaster(category_id, store_id, country_id);
|
|
||||||
//if Sub Group Data exists for any Sub Category of the Category
|
|
||||||
boolean isSubGroupDataExists = false;
|
|
||||||
for (int j = 0; j < sub_category_list.size(); j++) {
|
|
||||||
if (db.getSkuGroupMasterData(category_id, sub_category_list.get(j).getSub_category_id()).size() > 0) {
|
|
||||||
isSubGroupDataExists = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isSubGroupDataExists) {
|
|
||||||
if (db.getNoCameraCategoryDataInserted(store_id, category_id, null).size() == 0) {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Order Taking Data
|
|
||||||
if (country_id.equals("15") || ((country_id.equals("17") && category_id.equals("2")))) {
|
|
||||||
if (!db.checkOrder_taking_Data(store_id, category_id)) {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flag) {
|
|
||||||
//changed on 23.10.2018
|
|
||||||
//ArrayList<AuditDataGetterSetter> question_list = getAuditAfterDeletion(category_id);
|
|
||||||
//changed on 03.12.2018
|
|
||||||
ArrayList<AuditDataGetterSetter> question_list = getAuditQnsRemoved(category_id);
|
|
||||||
if (question_list.size() > 0) {
|
|
||||||
/*if (!country_id.equals("6") && db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).size() == 0) {
|
|
||||||
flag = false;
|
|
||||||
}*/
|
|
||||||
if (db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).size() == 0) {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//new add UAE pharma
|
|
||||||
if (flag) {
|
|
||||||
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
|
||||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (country_id.equals("2")) {
|
|
||||||
if (camera_allow.equals("1")) {
|
|
||||||
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
|
||||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).size() > 0) {
|
|
||||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).size() == 0) {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flag) {
|
|
||||||
//Counterfeit Product Option - Egypt
|
|
||||||
if (country_id.equals("6")) {
|
|
||||||
if (db.getCounterfeitProductExistsAfterData(store_id, category_id).size() == 0) {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
//usk
|
|
||||||
if (country_id.equals("6") && category_id.equals("2")) {
|
|
||||||
if (db.getCompetitionPromoExistsAfterData(store_id, category_id).size() == 0) {
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//// IR PD images handling by jp
|
|
||||||
ArrayList<CategoryPictureGetterSetter> irList = isPdIRMapping(category_id);
|
|
||||||
if (irList != null && !irList.isEmpty() && camera_allow.equals("1")) {
|
|
||||||
flag = db.isFilledIRPDdata(store_id, visit_date, category_id);
|
|
||||||
} else {
|
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
flag_filled = flag;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flag_filled) {
|
|
||||||
switch (category_id) {
|
|
||||||
case "1":
|
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.health_food_drink_tick);
|
|
||||||
break;
|
|
||||||
case "2":
|
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.oralcare_tick);
|
|
||||||
break;
|
|
||||||
case "3":
|
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.wellness_tick);
|
|
||||||
break;
|
|
||||||
case "4":
|
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.nutritionals_tick);
|
|
||||||
break;
|
|
||||||
case "5":
|
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.gastro_n_indigestion_tick);
|
|
||||||
break;
|
|
||||||
case "6":
|
|
||||||
case "10":
|
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.cough_n_cold_tick);
|
|
||||||
break;
|
|
||||||
case "7":
|
|
||||||
case "9":
|
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.analgesics_tick);
|
|
||||||
break;
|
|
||||||
case "8":
|
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.first_aid_tick);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
switch (category_id) {
|
|
||||||
case "1":
|
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.health_food_drink);
|
|
||||||
break;
|
|
||||||
case "2":
|
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.oral_care);
|
|
||||||
break;
|
|
||||||
case "3":
|
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.wellness);
|
|
||||||
break;
|
|
||||||
case "4":
|
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.nutritionals);
|
|
||||||
break;
|
|
||||||
case "5":
|
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.gastro_n_indigestion);
|
|
||||||
break;
|
|
||||||
case "6":
|
|
||||||
case "10":
|
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.cough_n_cold);
|
|
||||||
break;
|
|
||||||
case "7":
|
|
||||||
case "9":
|
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.analgesics);
|
|
||||||
break;
|
|
||||||
case "8":
|
|
||||||
categoryList.get(i).setCategory_img(R.mipmap.first_aid);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
adapter = new CategoryListAdapter(CategoryListActivity.this, categoryList);
|
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
recyclerView.setLayoutManager(new GridLayoutManager(context, 2));
|
recyclerView.setLayoutManager(new GridLayoutManager(context, 2));
|
||||||
updateStatus();
|
updateStatus();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getImageRes(boolean flag_filled, String category_id) {
|
||||||
|
int imageRes = 0;
|
||||||
|
if (flag_filled) {
|
||||||
|
imageRes = switch (category_id) {
|
||||||
|
case "1" -> R.mipmap.health_food_drink_tick;
|
||||||
|
case "2" -> R.mipmap.oralcare_tick;
|
||||||
|
case "3" -> R.mipmap.wellness_tick;
|
||||||
|
case "4" -> R.mipmap.nutritionals_tick;
|
||||||
|
case "5" -> R.mipmap.gastro_n_indigestion_tick;
|
||||||
|
case "6", "10" -> R.mipmap.cough_n_cold_tick;
|
||||||
|
case "7", "9" -> R.mipmap.analgesics_tick;
|
||||||
|
case "8" -> R.mipmap.first_aid_tick;
|
||||||
|
default -> imageRes;
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
imageRes = switch (category_id) {
|
||||||
|
case "1" -> R.mipmap.health_food_drink;
|
||||||
|
case "2" -> R.mipmap.oral_care;
|
||||||
|
case "3" -> R.mipmap.wellness;
|
||||||
|
case "4" -> R.mipmap.nutritionals;
|
||||||
|
case "5" -> R.mipmap.gastro_n_indigestion;
|
||||||
|
case "6", "10" -> R.mipmap.cough_n_cold;
|
||||||
|
case "7", "9" -> R.mipmap.analgesics;
|
||||||
|
case "8" -> R.mipmap.first_aid;
|
||||||
|
default -> imageRes;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return imageRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<AuditDataGetterSetter> getAuditAfterDeletion(String category_id) {
|
ArrayList<AuditDataGetterSetter> getAuditAfterDeletion(String category_id) {
|
||||||
@@ -439,29 +232,27 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
return question_list;
|
return question_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@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
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
// Handle action bar item clicks here. The action bar will
|
|
||||||
// automatically handle clicks on the Home/Up button, so long
|
|
||||||
// as you specify a parent activity in AndroidManifest.xml.
|
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
if (id == android.R.id.home) {
|
if (id == android.R.id.home) {
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
|
if (id == R.id.action_social_media) {
|
||||||
|
Intent intent = new Intent(CategoryListActivity.this, BannerActivity.class);
|
||||||
|
intent.putExtra("StoreId", store_id);
|
||||||
|
intent.putExtra("MerId",mer_Id);
|
||||||
|
intent.putExtra("CategoryId", "0");
|
||||||
|
intent.putExtra("DT_LEVEL","STORE");
|
||||||
|
startActivity(intent);
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
}
|
||||||
//noinspection SimplifiableIfStatement
|
//noinspection SimplifiableIfStatement
|
||||||
if (id == R.id.action_settings) {
|
if (id == R.id.action_settings) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -494,8 +285,10 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
public void onBindViewHolder(MyViewHolder holder, int position) {
|
public void onBindViewHolder(MyViewHolder holder, int position) {
|
||||||
final CategoryGetterSetter categoryData = list.get(position);
|
final CategoryGetterSetter categoryData = list.get(position);
|
||||||
holder.categoryName.setText(categoryData.getCategory());
|
holder.categoryName.setText(categoryData.getCategory());
|
||||||
|
Log.e("CatImg--", "" + categoryData.getCategory_img());
|
||||||
holder.categoryIcon.setImageResource(categoryData.getCategory_img());
|
holder.categoryIcon.setImageResource(categoryData.getCategory_img());
|
||||||
holder.lay_menu.setOnClickListener(view -> {
|
holder.lay_menu.setOnClickListener(view -> {
|
||||||
|
|
||||||
Intent intent = new Intent(CategoryListActivity.this, CategoryWisePerformanceActivity.class);
|
Intent intent = new Intent(CategoryListActivity.this, CategoryWisePerformanceActivity.class);
|
||||||
intent.putExtra("categoryName", categoryData.getCategory());
|
intent.putExtra("categoryName", categoryData.getCategory());
|
||||||
intent.putExtra("categoryId", categoryData.getCategory_id());
|
intent.putExtra("categoryId", categoryData.getCategory_id());
|
||||||
@@ -560,7 +353,6 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//New MSL_Availability_StockFacing
|
|
||||||
if (country_id.equals("10") || country_id.equals("8")) {
|
if (country_id.equals("10") || country_id.equals("8")) {
|
||||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||||
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
@@ -683,6 +475,12 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (db.getCounterfeitProductExistsAfterData(store_id, category_id).isEmpty()) {
|
||||||
|
flag_filled = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
//usk
|
//usk
|
||||||
if (country_id.equals("6") && category_id.equals("2")) {
|
if (country_id.equals("6") && category_id.equals("2")) {
|
||||||
if (db.getCompetitionPromoExistsAfterData(store_id, category_id).isEmpty()) {
|
if (db.getCompetitionPromoExistsAfterData(store_id, category_id).isEmpty()) {
|
||||||
@@ -690,12 +488,12 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (country_id.equals("15")) {
|
/*if (country_id.equals("6")) {
|
||||||
if (!db.checkOrder_taking_Data(store_id, category_id)) {
|
if (!db.checkOrder_taking_Data(store_id, category_id)) {
|
||||||
flag_filled = false;
|
flag_filled = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
//// IR PD images handling by jp
|
//// IR PD images handling by jp
|
||||||
ArrayList<CategoryPictureGetterSetter> irList = isPdIRMapping(category_id);
|
ArrayList<CategoryPictureGetterSetter> irList = isPdIRMapping(category_id);
|
||||||
@@ -706,6 +504,14 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ArrayList<CategoryPictureGetterSetter> irVisibilityList = isPdVisibiltyMapping(category_id);
|
||||||
|
if (irVisibilityList != null && !irVisibilityList.isEmpty() && camera_allow.equals("1")) {
|
||||||
|
if (!db.isPdVisibility(store_id, visit_date, CommonString.KEY_COMPELETE, category_id)) {
|
||||||
|
flag_filled = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
flag_filled = true;
|
flag_filled = true;
|
||||||
} else {
|
} else {
|
||||||
flag_filled = false;
|
flag_filled = false;
|
||||||
@@ -713,9 +519,8 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flag_filled) {
|
db.open();
|
||||||
db.updateCheckoutStatus(store_id, CommonString.KEY_VALID, CommonString.KEY_JOURNEY_PLAN);
|
db.updateCheckoutStatus(store_id, flag_filled ? CommonString.KEY_VALID : CommonString.KEY_INVALID, CommonString.KEY_JOURNEY_PLAN);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -731,4 +536,169 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
return ir_list;
|
return ir_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ArrayList<CategoryPictureGetterSetter> isPdVisibiltyMapping(String categoryId) {
|
||||||
|
ArrayList<CategoryPictureGetterSetter> ir_list;
|
||||||
|
if (country_id.equals("8")) {
|
||||||
|
ir_list = db.getirVisibilityData(date,store_id,categoryId);
|
||||||
|
} else if (store_flag_str != null && store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
ir_list = db.getirVisibilityData(date,store_id,categoryId);
|
||||||
|
} else {
|
||||||
|
ir_list = db.getirVisibilityData(date,store_id,categoryId);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ir_list;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isCategoryComplete(String category_id) {
|
||||||
|
boolean flag_filled = true;
|
||||||
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
|
||||||
|
flag_filled = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADDITIONAL)
|
||||||
|
&& db.checkStockData(store_id, category_id, visit_date);
|
||||||
|
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)
|
||||||
|
&& country_id.equals("2") && visit_type_id.equals("3")) {
|
||||||
|
db.open();
|
||||||
|
flag_filled = db.additionalVisibilitydata(store_id, category_id);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
db.open();
|
||||||
|
if (!db.additionalVisibilitydata(store_id, category_id)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// MSL & Stock Entry
|
||||||
|
if (!validateStk(category_id)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// T2P
|
||||||
|
if (db.isMappingT2PData(store_id, category_id,
|
||||||
|
store_flag_str.equals(CommonString.FROM_DEVIATION)
|
||||||
|
? CommonString.TABLE_MAPPING_T2P_ADHOC
|
||||||
|
: CommonString.TABLE_MAPPING_T2P)) {
|
||||||
|
if (!db.isFilledT2P(store_id, category_id)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Camera
|
||||||
|
if (camera_allow.equals("1")) {
|
||||||
|
if (!db.isCategoryPictureData(store_id, category_id)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> sub_category_list =
|
||||||
|
db.getSubCategoryMaster(category_id, store_id, country_id);
|
||||||
|
|
||||||
|
boolean isSubGroupMissing = false;
|
||||||
|
for (MSL_AvailabilityStockFacingGetterSetter subCat : sub_category_list) {
|
||||||
|
if (db.getSkuGroupMasterData(category_id, subCat.getSub_category_id()).isEmpty()) {
|
||||||
|
isSubGroupMissing = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isSubGroupMissing && db.getNoCameraCategoryDataInserted(store_id, category_id, null).isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Audit Questions
|
||||||
|
if (!getAuditQnsRemoved(category_id).isEmpty()
|
||||||
|
&& db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (country_id.equals("7")) {
|
||||||
|
if (db.getPromoComplianceSkuwiseExistsAfterData(store_id, category_id).isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
boolean isMappingPromotion_Flag;
|
||||||
|
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION_ADHOC);
|
||||||
|
} else {
|
||||||
|
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION);
|
||||||
|
}
|
||||||
|
if (isMappingPromotion_Flag ) {
|
||||||
|
if (!db.checkPromoComplianceData(store_id, category_id)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// POG Upload
|
||||||
|
if (!db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).isEmpty()
|
||||||
|
&& db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Egypt - Counterfeit & Promo
|
||||||
|
if (country_id.equals("6")) {
|
||||||
|
if (db.getCounterfeitProductExistsAfterData(store_id, category_id).isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (category_id.equals("2") && db.getCompetitionPromoExistsAfterData(store_id, category_id).isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Order Taking for country 15
|
||||||
|
/* if (country_id.equals("6") && !db.checkOrder_taking_Data(store_id, category_id)) {
|
||||||
|
return false;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
// IR-PD Image Check
|
||||||
|
ArrayList<CategoryPictureGetterSetter> irList = isPdIRMapping(category_id);
|
||||||
|
if (irList != null && !irList.isEmpty() && camera_allow.equals("1")) {
|
||||||
|
if (!db.isFilledIRPDdata(store_id, visit_date, category_id)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ArrayList<CategoryPictureGetterSetter> irvisiList = isPdVisibiltyMapping(category_id);
|
||||||
|
if (irvisiList != null && !irvisiList.isEmpty() && camera_allow.equals("1")) {
|
||||||
|
if (!db.isPdVisibility(store_id, visit_date, CommonString.KEY_COMPELETE, category_id)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return flag_filled;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private boolean validateStk(String category_id) {
|
||||||
|
boolean flag_filled = true;
|
||||||
|
if (isMappingStockData(category_id)) {
|
||||||
|
if (country_id.equals("10")) {
|
||||||
|
db.open();
|
||||||
|
if (!db.checkStock_Entry_FacingDataNew(store_id, category_id, visit_date)) {
|
||||||
|
flag_filled = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!db.checkMsl_Availability_StockFacingDataNew(store_id, category_id, visit_date)) {
|
||||||
|
flag_filled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return flag_filled;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isMappingStockData(String categoryId) {
|
||||||
|
boolean flag;
|
||||||
|
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 {
|
||||||
|
flag = db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK);
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
getMenuInflater().inflate(R.menu.banner_menu, menu);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+249
-44
@@ -16,14 +16,17 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.cardview.widget.CardView;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@@ -34,17 +37,22 @@ import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
|||||||
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
||||||
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.adapter.data.ImageUri;
|
||||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonUtils;
|
||||||
import cpm.com.gskmtorange.dailyentry.AdditionalPromoSKUwiseActivity;
|
import cpm.com.gskmtorange.dailyentry.AdditionalPromoSKUwiseActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.AdditionalVisibility;
|
import cpm.com.gskmtorange.dailyentry.AdditionalVisibility;
|
||||||
import cpm.com.gskmtorange.dailyentry.AuditActivity;
|
import cpm.com.gskmtorange.dailyentry.AuditActivity;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.BannerActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.CategoryPicture;
|
import cpm.com.gskmtorange.dailyentry.CategoryPicture;
|
||||||
import cpm.com.gskmtorange.dailyentry.CompetitionPromoActivity;
|
import cpm.com.gskmtorange.dailyentry.CompetitionPromoActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.CounterfeitProductsActivity;
|
import cpm.com.gskmtorange.dailyentry.CounterfeitProductsActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.CreateSelfActivity;
|
import cpm.com.gskmtorange.dailyentry.CreateSelfActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.NewStockDataActivity;
|
import cpm.com.gskmtorange.dailyentry.NewStockDataActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.OrderTakingActivity;
|
import cpm.com.gskmtorange.dailyentry.OrderTakingActivity;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.PDVisibilityActivity;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.PD_Pog_Activity;
|
||||||
import cpm.com.gskmtorange.dailyentry.PDimageActivity;
|
import cpm.com.gskmtorange.dailyentry.PDimageActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.POGQuestionsActivity;
|
import cpm.com.gskmtorange.dailyentry.POGQuestionsActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.StockActivity;
|
import cpm.com.gskmtorange.dailyentry.StockActivity;
|
||||||
@@ -82,6 +90,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
db.open();
|
db.open();
|
||||||
context = this;
|
context = this;
|
||||||
//preference data
|
//preference data
|
||||||
|
//deletefile(context);
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||||
@@ -106,6 +115,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
db.open();
|
db.open();
|
||||||
|
// deleteIRURl(context);
|
||||||
visittypelist = db.getInsertedVisitType(store_id, visit_date, "3");
|
visittypelist = db.getInsertedVisitType(store_id, visit_date, "3");
|
||||||
if (visittypelist.size() > 0) {
|
if (visittypelist.size() > 0) {
|
||||||
if (visittypelist.get(0).getVISIT_TYPE_ID().equals("3")) {
|
if (visittypelist.get(0).getVISIT_TYPE_ID().equals("3")) {
|
||||||
@@ -117,6 +127,66 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void deleteIRURl(Context context) {
|
||||||
|
try {
|
||||||
|
ArrayList<CategoryPictureGetterSetter> irList = db.getIrPDforUpload(store_id, visit_date);
|
||||||
|
Log.d("irlistsize", String.valueOf(irList));
|
||||||
|
if (irList != null && !irList.isEmpty()) {
|
||||||
|
for (int i = 0; i < irList.size(); i++) {
|
||||||
|
ArrayList<ImageUri> uris = irList.get(i).getImageUris();
|
||||||
|
if (uris != null && !uris.isEmpty()) {
|
||||||
|
for (int k = 0; k < uris.size(); k++) {
|
||||||
|
// CommonUtils.INSTANCE.deleteSpecificImage(this,uris.get(k).getUri());
|
||||||
|
deleteSpecificImage(context,uris.get(k).getUri());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.fillInStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void deleteSpecificImage(Context context, String uri) {
|
||||||
|
// Path to the file in app-specific internal storage
|
||||||
|
String filePath = uri;
|
||||||
|
Log.d("filepath",filePath);
|
||||||
|
|
||||||
|
// Create a File object
|
||||||
|
File file = new File(filePath);
|
||||||
|
// Check if the file exists and delete it
|
||||||
|
if (file.exists()) {
|
||||||
|
boolean isDeleted = file.delete();
|
||||||
|
if (isDeleted) {
|
||||||
|
Toast.makeText(context, "File deleted successfully", Toast.LENGTH_SHORT).show();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(context, "Failed to delete the file", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(context, "File does not exist", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void deletefile(Context context) {
|
||||||
|
// Path to the file in app-specific internal storage
|
||||||
|
String filePath = context.getFilesDir().getAbsolutePath() + "/e462845c-0dc4-4aa0-9066-6334d33af7d8_1.jpg";
|
||||||
|
Log.d("filepathnew",filePath);
|
||||||
|
|
||||||
|
// Create a File object
|
||||||
|
File file = new File(filePath);
|
||||||
|
// Check if the file exists and delete it
|
||||||
|
if (file.exists()) {
|
||||||
|
boolean isDeleted = file.delete();
|
||||||
|
if (isDeleted) {
|
||||||
|
Toast.makeText(context, "File deleted successfully", Toast.LENGTH_SHORT).show();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(context, "Failed to delete the file", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(context, "File does not exist", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
@@ -282,9 +352,6 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
//Order Taking
|
//Order Taking
|
||||||
data = new DailyDataMenuGetterSetter();
|
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 (isMappingStockData()) {
|
||||||
if (db.checkOrder_taking_Data(store_id, categoryId)) {
|
if (db.checkOrder_taking_Data(store_id, categoryId)) {
|
||||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||||
@@ -296,12 +363,9 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
data.setCategory_name(getString(R.string.order_taking));
|
data.setCategory_name(getString(R.string.order_taking));
|
||||||
categoryList.add(data);
|
categoryList.add(data);
|
||||||
}
|
|
||||||
|
|
||||||
//Order Confirm
|
//Order Status
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
// ArrayList<AuditDataGetterSetter> question_list;
|
|
||||||
if (country_id.equals("15")) {
|
|
||||||
if (db.checkOrder_Received_Data(store_id, categoryId)) {
|
if (db.checkOrder_Received_Data(store_id, categoryId)) {
|
||||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||||
} else {
|
} else {
|
||||||
@@ -309,7 +373,6 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
data.setCategory_name(getString(R.string.order_confirm));
|
data.setCategory_name(getString(R.string.order_confirm));
|
||||||
categoryList.add(data);
|
categoryList.add(data);
|
||||||
}
|
|
||||||
|
|
||||||
//Audit
|
//Audit
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
@@ -410,25 +473,35 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
if (categoryId.equals("2")) {
|
if (categoryId.equals("2")) {
|
||||||
if (country_id.equals("6")) {
|
if (country_id.equals("6")) {
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
|
|
||||||
if (db.getCompetitionPromoExistsAfterData(store_id, categoryId).size() > 0) {
|
if (db.getCompetitionPromoExistsAfterData(store_id, categoryId).size() > 0) {
|
||||||
data.setCategory_img(R.mipmap.competition_done);
|
data.setCategory_img(R.mipmap.competition_done);
|
||||||
} else {
|
} else {
|
||||||
data.setCategory_img(R.mipmap.competition);
|
data.setCategory_img(R.mipmap.competition);
|
||||||
}
|
}
|
||||||
|
|
||||||
data.setCategory_name(getString(R.string.title_activity_competition_promo));
|
data.setCategory_name(getString(R.string.title_activity_competition_promo));
|
||||||
categoryList.add(data);
|
categoryList.add(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Detailer
|
||||||
|
/* data = new DailyDataMenuGetterSetter();
|
||||||
|
data.setCategory_name("Detailer");
|
||||||
|
data.setCategory_img(R.mipmap.oral_care);
|
||||||
|
categoryList.add(data);*/
|
||||||
|
|
||||||
|
if (categoryList.size() % 2 != 0) {
|
||||||
|
data = new DailyDataMenuGetterSetter();
|
||||||
|
data.setCategory_name("");
|
||||||
|
categoryList.add(data);
|
||||||
|
}
|
||||||
|
|
||||||
//IR Images
|
//IR Images
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
ArrayList<CategoryPictureGetterSetter> ir_list = isPdIRMapping();
|
ArrayList<CategoryPictureGetterSetter> ir_list = isPdIRMapping();
|
||||||
if (ir_list != null && !ir_list.isEmpty() && camera_allow.equals("1")) {
|
if (ir_list != null && !ir_list.isEmpty() && camera_allow.equals("1")) {
|
||||||
data.setCategory_img(R.mipmap.picturecatogory);
|
data.setCategory_img(R.mipmap.picturecatogory);
|
||||||
db.open();
|
db.open();
|
||||||
if (db.isFilledIRPDdata(store_id, visit_date, categoryId)) {
|
if (db.isSOSCategory(store_id, visit_date, CommonString.KEY_COMPELETE, categoryId)) {
|
||||||
data.setCategory_img(R.mipmap.picturecatogory_done);
|
data.setCategory_img(R.mipmap.picturecatogory_done);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -437,6 +510,36 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
data.setCategory_name(getResources()
|
data.setCategory_name(getResources()
|
||||||
.getString(R.string.title_activity_ir_image));
|
.getString(R.string.title_activity_ir_image));
|
||||||
categoryList.add(data);
|
categoryList.add(data);
|
||||||
|
|
||||||
|
//IR Visibility
|
||||||
|
data = new DailyDataMenuGetterSetter();
|
||||||
|
ArrayList<CategoryPictureGetterSetter> ir_visibility = isPdVisibiltyMapping();
|
||||||
|
if (ir_visibility != null && !ir_visibility.isEmpty() && camera_allow.equals("1")) {
|
||||||
|
data.setCategory_img(R.mipmap.picturecatogory);
|
||||||
|
db.open();
|
||||||
|
if (db.isPdVisibility(store_id, visit_date, CommonString.KEY_COMPELETE, categoryId)) {
|
||||||
|
data.setCategory_img(R.mipmap.picturecatogory_done);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
data.setCategory_img(R.mipmap.picturecatogory_grey);
|
||||||
|
}
|
||||||
|
data.setCategory_name(getResources().getString(R.string.title_activity_ir_visibility));
|
||||||
|
categoryList.add(data);
|
||||||
|
|
||||||
|
//IR POG
|
||||||
|
/*data = new DailyDataMenuGetterSetter();
|
||||||
|
ArrayList<CategoryPictureGetterSetter> ir_pog = isPdPogIRMapping();
|
||||||
|
if (ir_pog != null && !ir_pog.isEmpty() && camera_allow.equals("1")) {
|
||||||
|
data.setCategory_img(R.mipmap.picturecatogory);
|
||||||
|
db.open();
|
||||||
|
if (db.isPdPogImages(store_id, visit_date, CommonString.KEY_COMPELETE, categoryId)) {
|
||||||
|
data.setCategory_img(R.mipmap.picturecatogory_done);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
data.setCategory_img(R.mipmap.picturecatogory_grey);
|
||||||
|
}
|
||||||
|
data.setCategory_name(getResources().getString(R.string.title_activity_ir_pog));
|
||||||
|
categoryList.add(data);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
adapter = new DailyDataMenuAdapter(DailyDataMenuActivity.this, categoryList);
|
adapter = new DailyDataMenuAdapter(DailyDataMenuActivity.this, categoryList);
|
||||||
@@ -449,22 +552,29 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
getMenuInflater().inflate(R.menu.banner_menu, menu);
|
||||||
//getMenuInflater().inflate(R.menu.main, menu);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
// Handle action bar item clicks here. The action bar will
|
|
||||||
// automatically handle clicks on the Home/Up button, so long
|
|
||||||
// as you specify a parent activity in AndroidManifest.xml.
|
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
if (id == android.R.id.home) {
|
if (id == android.R.id.home) {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (id == R.id.action_social_media) {
|
||||||
|
Intent intent = new Intent(DailyDataMenuActivity.this, BannerActivity.class);
|
||||||
|
String merId = preferences.getString(CommonString.KEY_MERCHANDISER_ID, "");
|
||||||
|
intent.putExtra("StoreId", store_id);
|
||||||
|
intent.putExtra("MerId", merId);
|
||||||
|
intent.putExtra("CategoryId", categoryId);
|
||||||
|
intent.putExtra("DT_LEVEL", "CATEGORY");
|
||||||
|
startActivity(intent);
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
}
|
||||||
|
|
||||||
//noinspection SimplifiableIfStatement
|
//noinspection SimplifiableIfStatement
|
||||||
if (id == R.id.action_settings) {
|
if (id == R.id.action_settings) {
|
||||||
return true;
|
return true;
|
||||||
@@ -481,11 +591,9 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P);
|
flag_t2p_mapping = db.isMappingT2PData(store_id, categoryId, CommonString.TABLE_MAPPING_T2P);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag_t2p_mapping) {
|
if (flag_t2p_mapping) {
|
||||||
if (db.isFilledT2P(store_id, categoryId)) {
|
if (db.isFilledT2P(store_id, categoryId)) {
|
||||||
ArrayList<T2PGetterSetter> t2PList = db.getT2pComplianceData(store_id, categoryId);
|
ArrayList<T2PGetterSetter> t2PList = db.getT2pComplianceData(store_id, categoryId);
|
||||||
|
|
||||||
for (int i = 0; i < t2PList.size(); i++) {
|
for (int i = 0; i < t2PList.size(); i++) {
|
||||||
if (t2PList.get(i).getPresent() == 1) {
|
if (t2PList.get(i).getPresent() == 1) {
|
||||||
t2p_flag = true;
|
t2p_flag = true;
|
||||||
@@ -547,7 +655,14 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
public void onBindViewHolder(final DailyDataMenuAdapter.MyViewHolder holder, int position) {
|
public void onBindViewHolder(final DailyDataMenuAdapter.MyViewHolder holder, int position) {
|
||||||
final DailyDataMenuGetterSetter dailyData = list.get(position);
|
final DailyDataMenuGetterSetter dailyData = list.get(position);
|
||||||
holder.categoryName.setText(dailyData.getCategory_name());
|
holder.categoryName.setText(dailyData.getCategory_name());
|
||||||
|
if (dailyData.getCategory_img() != -1) {
|
||||||
holder.categoryIcon.setImageResource(dailyData.getCategory_img());
|
holder.categoryIcon.setImageResource(dailyData.getCategory_img());
|
||||||
|
} else {
|
||||||
|
holder.categoryIcon.setImageResource(0);
|
||||||
|
}
|
||||||
|
holder.lay_menu.setVisibility(View.VISIBLE);
|
||||||
|
holder.categoryName.setVisibility(View.VISIBLE);
|
||||||
|
holder.irview.setVisibility(View.GONE);
|
||||||
db.open();
|
db.open();
|
||||||
visittypelist = db.getInsertedVisitType(store_id, visit_date, "3");
|
visittypelist = db.getInsertedVisitType(store_id, visit_date, "3");
|
||||||
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
||||||
@@ -609,6 +724,14 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
holder.categoryName.setTextColor(ContextCompat.getColor(context, R.color.grey_background));
|
holder.categoryName.setTextColor(ContextCompat.getColor(context, R.color.grey_background));
|
||||||
}
|
}
|
||||||
|
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.order_taking))) {
|
||||||
|
if (isMappingStockData()) {
|
||||||
|
holder.categoryName.setTextColor(ContextCompat.getColor(context, R.color.black));
|
||||||
|
} else {
|
||||||
|
holder.categoryName.setTextColor(ContextCompat.getColor(context, R.color.grey_background));
|
||||||
|
}
|
||||||
|
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.order_confirm))) {
|
||||||
|
holder.categoryName.setTextColor(ContextCompat.getColor(context, R.color.black));
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.audit))) {
|
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.audit))) {
|
||||||
if (!getAuditQnsRemoved().isEmpty()) {
|
if (!getAuditQnsRemoved().isEmpty()) {
|
||||||
holder.categoryName.setTextColor(ContextCompat.getColor(context, R.color.black));
|
holder.categoryName.setTextColor(ContextCompat.getColor(context, R.color.black));
|
||||||
@@ -634,11 +757,32 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
holder.categoryName.setTextColor(ContextCompat.getColor(context, R.color.grey_background));
|
holder.categoryName.setTextColor(ContextCompat.getColor(context, R.color.grey_background));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getString(R.string.title_activity_ir_image))) {
|
}
|
||||||
|
else if(dailyData.getCategory_name().equalsIgnoreCase("")){
|
||||||
|
holder.lay_menu.setVisibility(View.GONE);
|
||||||
|
holder.irview.setVisibility(View.GONE);
|
||||||
|
holder.categoryName.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
else if (dailyData.getCategory_name().equalsIgnoreCase(getString(R.string.title_activity_ir_image))) {
|
||||||
|
holder.irview.setVisibility(View.VISIBLE);
|
||||||
holder.categoryName.setTextColor(isPdIRMapping() != null && !isPdIRMapping().isEmpty() && camera_allow.equals("1")
|
holder.categoryName.setTextColor(isPdIRMapping() != null && !isPdIRMapping().isEmpty() && camera_allow.equals("1")
|
||||||
? ContextCompat.getColor(context, R.color.black) : ContextCompat.getColor(context, R.color.grey_background));
|
? ContextCompat.getColor(context, R.color.black) : ContextCompat.getColor(context, R.color.grey_background));
|
||||||
}
|
}
|
||||||
|
else if (dailyData.getCategory_name().equalsIgnoreCase(getString(R.string.title_activity_ir_visibility))) {
|
||||||
|
holder.irview.setVisibility(View.VISIBLE);
|
||||||
|
holder.categoryName.setTextColor(isPdVisibiltyMapping() != null && !isPdVisibiltyMapping().isEmpty() && camera_allow.equals("1")
|
||||||
|
? ContextCompat.getColor(context, R.color.black) : ContextCompat.getColor(context, R.color.grey_background));
|
||||||
|
}
|
||||||
|
/*else if (dailyData.getCategory_name().equalsIgnoreCase(getString(R.string.title_activity_ir_pog))) {
|
||||||
|
holder.categoryName.setTextColor(isPdPogIRMapping() != null && !isPdPogIRMapping().isEmpty() && camera_allow.equals("1")
|
||||||
|
? ContextCompat.getColor(context, R.color.black) : ContextCompat.getColor(context, R.color.grey_background));
|
||||||
|
}*/
|
||||||
|
/* else if (dailyData.getCategory_name().equalsIgnoreCase("Detailer")) {
|
||||||
|
holder.categoryName.setTextColor(ContextCompat.getColor(context, R.color.black));
|
||||||
|
}*/
|
||||||
|
else{
|
||||||
|
holder.irview.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
holder.lay_menu.setOnClickListener(view -> {
|
holder.lay_menu.setOnClickListener(view -> {
|
||||||
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
|
||||||
@@ -705,7 +849,18 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
}
|
}
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.title_activity_ir_image))) {
|
}
|
||||||
|
/* else if (dailyData.getCategory_name().equalsIgnoreCase("Detailer")) {
|
||||||
|
Intent intent = new Intent(DailyDataMenuActivity.this, BannerActivity.class);
|
||||||
|
String merId = preferences.getString(CommonString.KEY_MERCHANDISER_ID, "");
|
||||||
|
intent.putExtra("StoreId", store_id);
|
||||||
|
intent.putExtra("MerId", merId);
|
||||||
|
intent.putExtra("CategoryId", categoryId);
|
||||||
|
intent.putExtra("DT_LEVEL", "CATEGORY");
|
||||||
|
startActivity(intent);
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
}*/
|
||||||
|
else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.title_activity_ir_image))) {
|
||||||
if (isPdIRMapping() != null && !isPdIRMapping().isEmpty() && camera_allow.equals("1")) {
|
if (isPdIRMapping() != null && !isPdIRMapping().isEmpty() && camera_allow.equals("1")) {
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, PDimageActivity.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, PDimageActivity.class);
|
||||||
intent.putExtra("kpi_name", dailyData.getCategory_name());
|
intent.putExtra("kpi_name", dailyData.getCategory_name());
|
||||||
@@ -714,7 +869,28 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
}
|
}
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.order_taking))) {
|
}
|
||||||
|
/*else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.title_activity_ir_pog))) {
|
||||||
|
if (isPdPogIRMapping() != null && !isPdPogIRMapping().isEmpty() && camera_allow.equals("1")) {
|
||||||
|
Intent intent = new Intent(DailyDataMenuActivity.this, PD_Pog_Activity.class);
|
||||||
|
intent.putExtra("kpi_name", dailyData.getCategory_name());
|
||||||
|
intent.putExtra("categoryName", categoryName);
|
||||||
|
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.title_activity_ir_visibility))) {
|
||||||
|
if (isPdVisibiltyMapping() != null && !isPdVisibiltyMapping().isEmpty() && camera_allow.equals("1")) {
|
||||||
|
Intent intent = new Intent(DailyDataMenuActivity.this, PDVisibilityActivity.class);
|
||||||
|
intent.putExtra("kpi_name", dailyData.getCategory_name());
|
||||||
|
intent.putExtra("categoryName", categoryName);
|
||||||
|
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_taking))) {
|
||||||
if (isMappingStockData()) {
|
if (isMappingStockData()) {
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, OrderTakingActivity.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, OrderTakingActivity.class);
|
||||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||||
@@ -831,12 +1007,16 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
TextView categoryName;
|
TextView categoryName;
|
||||||
ImageView categoryIcon;
|
ImageView categoryIcon;
|
||||||
LinearLayout lay_menu;
|
LinearLayout lay_menu;
|
||||||
|
View irview;
|
||||||
|
CardView cardView;
|
||||||
|
|
||||||
public MyViewHolder(View itemView) {
|
public MyViewHolder(View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
categoryName = (TextView) itemView.findViewById(R.id.categoryName);
|
categoryName = (TextView) itemView.findViewById(R.id.categoryName);
|
||||||
categoryIcon = (ImageView) itemView.findViewById(R.id.categoryIcon);
|
categoryIcon = (ImageView) itemView.findViewById(R.id.categoryIcon);
|
||||||
lay_menu = (LinearLayout) itemView.findViewById(R.id.lay_menu);
|
lay_menu = (LinearLayout) itemView.findViewById(R.id.lay_menu);
|
||||||
|
irview = itemView.findViewById(R.id.irview);
|
||||||
|
cardView = itemView.findViewById(R.id.cardView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -892,29 +1072,54 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
return ir_list;
|
return ir_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* private void check() {
|
private ArrayList<CategoryPictureGetterSetter> isPdPogIRMapping() {
|
||||||
////IRPD-Upload Data
|
ArrayList<CategoryPictureGetterSetter> ir_list;
|
||||||
String irPD_xmlData = "";
|
if (country_id.equals("8")) {
|
||||||
String onXML = "";
|
ir_list = db.getCategoryPicturePogdata(
|
||||||
ArrayList<CategoryPictureGetterSetter> irdata = db.getIrPDforUpload(store_id, visit_date);
|
date,
|
||||||
if (irdata != null && !irdata.isEmpty()) {
|
categoryId,
|
||||||
|
null,
|
||||||
for (int j = 0; j < irdata.size(); j++) {
|
null,
|
||||||
onXML = "[IR_DATA]"
|
null,
|
||||||
+ "[MID]" + 0 + "[/MID]"
|
store_id,
|
||||||
+ "[USERID]" + username + "[/USERID]"
|
CommonString.TABLE_MAPPING_STOCK_STOREWISE
|
||||||
+ "[CATEGORY_ID]" + irdata.get(j).getCategoryId() + "[/CATEGORY_ID]"
|
);
|
||||||
+ "[SUB_CATEGORY_ID]" + irdata.get(j).getSUB_CATEGORY_ID() + "[/SUB_CATEGORY_ID]"
|
} else if (store_flag_str != null && store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
+ "[SUB_CATEGORY_CODE]" + irdata.get(j).getSubCatCode() + "[/SUB_CATEGORY_CODE]"
|
ir_list = db.getCategoryPicturePogdata(
|
||||||
+ "[IR_IMAGES]" + irdata.get(j).getSubCategoryCamera2() + "[/IR_IMAGES]"
|
date,
|
||||||
+ "[/IR_DATA]";
|
categoryId,
|
||||||
|
keyAccount_id,
|
||||||
irPD_xmlData = irPD_xmlData + onXML;
|
storeType_id,
|
||||||
|
class_id,
|
||||||
|
store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADHOC
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
ir_list = db.getCategoryPicturePogdata(
|
||||||
|
date,
|
||||||
|
categoryId,
|
||||||
|
keyAccount_id,
|
||||||
|
storeType_id,
|
||||||
|
class_id,
|
||||||
|
store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ir_list;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ArrayList<CategoryPictureGetterSetter> isPdVisibiltyMapping() {
|
||||||
|
ArrayList<CategoryPictureGetterSetter> ir_list;
|
||||||
|
if (country_id.equals("6")) {
|
||||||
|
ir_list = db.getirVisibilityData(date,store_id,categoryId);
|
||||||
|
} else if (store_flag_str != null && store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
ir_list = db.getirVisibilityData(date,store_id,categoryId);
|
||||||
|
} else {
|
||||||
|
ir_list = db.getirVisibilityData(date,store_id,categoryId);
|
||||||
|
}
|
||||||
|
return ir_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String irpd_xml = "[DATA]" + irPD_xmlData + "[/DATA]";
|
|
||||||
Log.e("irpd_xml",irpd_xml);
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-5
@@ -215,11 +215,8 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity impl
|
|||||||
expandableListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
expandableListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
||||||
|
|
||||||
expandableListView.invalidate();
|
expandableListView.invalidate();
|
||||||
|
|
||||||
int lastItem = firstVisibleItem + visibleItemCount;
|
int lastItem = firstVisibleItem + visibleItemCount;
|
||||||
|
|
||||||
if (firstVisibleItem == 0) {
|
if (firstVisibleItem == 0) {
|
||||||
fab.show();//.setVisibility(View.VISIBLE);
|
fab.show();//.setVisibility(View.VISIBLE);
|
||||||
} else if (lastItem == totalItemCount) {
|
} else if (lastItem == totalItemCount) {
|
||||||
@@ -269,9 +266,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity impl
|
|||||||
} catch (Resources.NotFoundException e) {
|
} catch (Resources.NotFoundException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
getMenuInflater().inflate(R.menu.planogram, menu);
|
getMenuInflater().inflate(R.menu.planogram, menu);
|
||||||
|
|||||||
+8
-29
@@ -63,7 +63,7 @@ public class OrderConfirmActivity extends AppCompatActivity {
|
|||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
//toolbar.setTitle("Order Status" + "-"+"PO List");
|
//toolbar.setTitle("Order Status" + "-"+"PO List");
|
||||||
toolbar.setTitle(context.getString(R.string.order_status_polist));
|
toolbar.setTitle(context.getString(R.string.order_history));
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
declaration();
|
declaration();
|
||||||
@@ -73,11 +73,9 @@ public class OrderConfirmActivity extends AppCompatActivity {
|
|||||||
recyclerview = (RecyclerView) findViewById(R.id.recyclerview);
|
recyclerview = (RecyclerView) findViewById(R.id.recyclerview);
|
||||||
db = new GSKOrangeDB(this);
|
db = new GSKOrangeDB(this);
|
||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
//Intent data
|
//Intent data
|
||||||
categoryName = getIntent().getStringExtra("categoryName");
|
categoryName = getIntent().getStringExtra("categoryName");
|
||||||
categoryId = getIntent().getStringExtra("categoryId");
|
categoryId = getIntent().getStringExtra("categoryId");
|
||||||
|
|
||||||
storeid = preferences.getString(CommonString.KEY_STORE_ID, null);
|
storeid = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||||
setDataToListView();
|
setDataToListView();
|
||||||
}
|
}
|
||||||
@@ -86,7 +84,7 @@ public class OrderConfirmActivity extends AppCompatActivity {
|
|||||||
try {
|
try {
|
||||||
db.open();
|
db.open();
|
||||||
inserteslistData=db.getOrderstatusData(storeid,categoryId);
|
inserteslistData=db.getOrderstatusData(storeid,categoryId);
|
||||||
if(inserteslistData.size()>0){
|
if(!inserteslistData.isEmpty()){
|
||||||
adapter = new Recycler_view_adapter(context, inserteslistData);
|
adapter = new Recycler_view_adapter(context, inserteslistData);
|
||||||
recyclerview.setAdapter(adapter);
|
recyclerview.setAdapter(adapter);
|
||||||
recyclerview.setLayoutManager(new LinearLayoutManager(context));
|
recyclerview.setLayoutManager(new LinearLayoutManager(context));
|
||||||
@@ -114,26 +112,10 @@ public class OrderConfirmActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull final Recycler_view_adapter.Viewholder viewholder, final int pos) {
|
public void onBindViewHolder(@NonNull final Recycler_view_adapter.Viewholder viewholder, final int pos) {
|
||||||
final OrderReceivedStatus current = orderReceivedStatuses.get(pos);
|
final OrderReceivedStatus current = orderReceivedStatuses.get(pos);
|
||||||
viewholder.sys_gen_poTV.setText(current.getSys_gen_po());
|
//viewholder.podateTV.setText(current.getPodate());
|
||||||
viewholder.podateTV.setText(current.getPodate());
|
viewholder.podateTV.setText(current.getPodate() != null ? current.getPodate() : "");
|
||||||
viewholder.storepoTV.setText(current.getStorepo());
|
|
||||||
|
|
||||||
viewholder.lineItemTV.setText(""+current.getORDERQTY());
|
viewholder.lineItemTV.setText(""+current.getORDERQTY());
|
||||||
if(current.getStatus().equalsIgnoreCase("CONFIRMED")){
|
viewholder.sys_gen_poTV.setText(current.getSys_gen_po() != null ? current.getSys_gen_po() : "");
|
||||||
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() {
|
viewholder.cardview.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -155,18 +137,15 @@ public class OrderConfirmActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class Viewholder extends RecyclerView.ViewHolder {
|
public class Viewholder extends RecyclerView.ViewHolder {
|
||||||
TextView sys_gen_poTV,storepoTV,podateTV,lineItemTV,statusTV;
|
TextView podateTV,lineItemTV,sys_gen_poTV;
|
||||||
CardView cardview;
|
CardView cardview;
|
||||||
LinearLayout storepoLL;
|
LinearLayout storepoLL;
|
||||||
public Viewholder(@NonNull View itemView) {
|
public Viewholder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
cardview= (CardView) itemView.findViewById(R.id.cardview);
|
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);
|
podateTV= itemView.findViewById(R.id.podateTV);
|
||||||
|
sys_gen_poTV= itemView.findViewById(R.id.sys_gen_poTV);
|
||||||
lineItemTV= itemView.findViewById(R.id.lineItemTV);
|
lineItemTV= itemView.findViewById(R.id.lineItemTV);
|
||||||
statusTV= itemView.findViewById(R.id.statusTV);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -184,7 +163,7 @@ public class OrderConfirmActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
// super.onBackPressed();
|
super.onBackPressed();
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
|
|||||||
+118
-89
@@ -89,7 +89,7 @@ public class OrderStatusDetailActivity extends AppCompatActivity{
|
|||||||
RadioGroup radio_group;
|
RadioGroup radio_group;
|
||||||
String isExist="";
|
String isExist="";
|
||||||
String sys_po_number="";
|
String sys_po_number="";
|
||||||
TextView sys_gen_poTV,lineitemTV;
|
//TextView sys_gen_poTV,lineitemTV;
|
||||||
LinearLayout poLL;
|
LinearLayout poLL;
|
||||||
String storepo ="";
|
String storepo ="";
|
||||||
TextView storepoTV,podateTV;
|
TextView storepoTV,podateTV;
|
||||||
@@ -108,13 +108,11 @@ public class OrderStatusDetailActivity extends AppCompatActivity{
|
|||||||
camera2 = (ImageView) findViewById(R.id.img_camera2);
|
camera2 = (ImageView) findViewById(R.id.img_camera2);
|
||||||
camera3 = (ImageView) findViewById(R.id.img_camera3);
|
camera3 = (ImageView) findViewById(R.id.img_camera3);
|
||||||
camera4 = (ImageView) findViewById(R.id.img_camera4);
|
camera4 = (ImageView) findViewById(R.id.img_camera4);
|
||||||
storepoTV = findViewById(R.id.storepoTV);
|
|
||||||
lineitemTV = findViewById(R.id.lineitemTV);
|
|
||||||
podateTV = findViewById(R.id.podateTV);
|
podateTV = findViewById(R.id.podateTV);
|
||||||
poLL = findViewById(R.id.poLL);
|
poLL = findViewById(R.id.poLL);
|
||||||
|
|
||||||
sys_gen_poTV = findViewById(R.id.sys_gen_poTV);
|
//sys_gen_poTV = findViewById(R.id.sys_gen_poTV);
|
||||||
podateTV = findViewById(R.id.podateTV);
|
// podateTV = findViewById(R.id.podateTV);
|
||||||
|
|
||||||
lin_camera1 = (LinearLayout) findViewById(R.id.lin_camera1);
|
lin_camera1 = (LinearLayout) findViewById(R.id.lin_camera1);
|
||||||
lin_camera2 = (LinearLayout) findViewById(R.id.lin_camera2);
|
lin_camera2 = (LinearLayout) findViewById(R.id.lin_camera2);
|
||||||
@@ -154,13 +152,11 @@ public class OrderStatusDetailActivity extends AppCompatActivity{
|
|||||||
// Log.e("podetai",SYS_PO_NUM + ","+PO_NUM + ","+PO_DATE + ","+LINE);
|
// Log.e("podetai",SYS_PO_NUM + ","+PO_NUM + ","+PO_DATE + ","+LINE);
|
||||||
|
|
||||||
// toolbar.setTitle("Order Status" + "-"+"Entry");
|
// toolbar.setTitle("Order Status" + "-"+"Entry");
|
||||||
toolbar.setTitle(context.getString(R.string.order_status_entry));
|
// toolbar.setTitle(context.getString(R.string.order_status_entry));
|
||||||
|
toolbar.setTitle(context.getString(R.string.order_history_detail));
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
// podateTV.setText(PO_DATE);
|
||||||
sys_gen_poTV.setText(SYS_PO_NUM);
|
//lineitemTV.setText(LINE);
|
||||||
storepoTV.setText(PO_NUM);
|
|
||||||
podateTV.setText(PO_DATE);
|
|
||||||
lineitemTV.setText(LINE);
|
|
||||||
|
|
||||||
// Log.e("sys_po_num",sys_po_number +","+timeMilli);
|
// Log.e("sys_po_num",sys_po_number +","+timeMilli);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
@@ -176,7 +172,8 @@ public class OrderStatusDetailActivity extends AppCompatActivity{
|
|||||||
|
|
||||||
final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
|
|
||||||
fab.setOnClickListener(new View.OnClickListener() {
|
|
||||||
|
/*fab.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(final View view) {
|
public void onClick(final View view) {
|
||||||
expandableListView.clearFocus();
|
expandableListView.clearFocus();
|
||||||
@@ -184,17 +181,17 @@ public class OrderStatusDetailActivity extends AppCompatActivity{
|
|||||||
|
|
||||||
if (validateData(hashMapListHeaderData, hashMapListChildData)) {
|
if (validateData(hashMapListHeaderData, hashMapListChildData)) {
|
||||||
db.open();
|
db.open();
|
||||||
if (db.checkOrder_Received_Data(store_id, categoryId)) {
|
*//* 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);
|
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();
|
Toast.makeText(context, getResources().getString(R.string.update_message), Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
db.InsertOrderReceivedStatusData(POID, storepoTV.getText().toString(), sys_gen_poTV.getText().toString(), podateTV.getText().toString(), store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
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();
|
Toast.makeText(context, getResources().getString(R.string.save_message), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}*//*
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
|
||||||
/* String order_received_xml = "";
|
*//* String order_received_xml = "";
|
||||||
String onXML = "";
|
String onXML = "";
|
||||||
|
|
||||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> orderreceiveddata = db.getOrder_RECEIVED_UploadServerData(store_id);
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> orderreceiveddata = db.getOrder_RECEIVED_UploadServerData(store_id);
|
||||||
@@ -218,7 +215,7 @@ public class OrderStatusDetailActivity extends AppCompatActivity{
|
|||||||
final String sos_xml = "[DATA]" + order_received_xml + "[/DATA]";
|
final String sos_xml = "[DATA]" + order_received_xml + "[/DATA]";
|
||||||
Log.e("order_xml", sos_xml);
|
Log.e("order_xml", sos_xml);
|
||||||
|
|
||||||
} */
|
} *//*
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@@ -227,7 +224,7 @@ public class OrderStatusDetailActivity extends AppCompatActivity{
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});*/
|
||||||
|
|
||||||
expandableListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
expandableListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -237,13 +234,13 @@ public class OrderStatusDetailActivity extends AppCompatActivity{
|
|||||||
|
|
||||||
int lastItem = firstVisibleItem + visibleItemCount;
|
int lastItem = firstVisibleItem + visibleItemCount;
|
||||||
|
|
||||||
if (firstVisibleItem == 0) {
|
/* if (firstVisibleItem == 0) {
|
||||||
fab.show();//.setVisibility(View.VISIBLE);
|
fab.show();//.setVisibility(View.VISIBLE);
|
||||||
} else if (lastItem == totalItemCount) {
|
} else if (lastItem == totalItemCount) {
|
||||||
fab.hide();//setVisibility(View.INVISIBLE);
|
fab.hide();//setVisibility(View.INVISIBLE);
|
||||||
} else {
|
} else {
|
||||||
fab.show();//setVisibility(View.VISIBLE);
|
fab.show();//setVisibility(View.VISIBLE);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -342,11 +339,9 @@ public class OrderStatusDetailActivity extends AppCompatActivity{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!child_flag)
|
if (!child_flag)
|
||||||
listTemp.add(data);
|
listTemp.add(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag == false) {
|
if (flag == false) {
|
||||||
listDataHeaderTemp.add(listDataHeader.get(i));
|
listDataHeaderTemp.add(listDataHeader.get(i));
|
||||||
// listDataChildTemp.put(listDataHeader.get(i), listTemp);
|
// listDataChildTemp.put(listDataHeader.get(i), listTemp);
|
||||||
@@ -381,15 +376,18 @@ public class OrderStatusDetailActivity extends AppCompatActivity{
|
|||||||
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC, CommonString.TABLE_MAPPING_SOS_TARGET_ADHOC, store_flag_hide);
|
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id, CommonString.TABLE_MAPPING_STOCK_ADHOC, CommonString.TABLE_MAPPING_SOS_TARGET_ADHOC, store_flag_hide);
|
||||||
} else {
|
} else {
|
||||||
//Log.e("categorydata",categoryId + ","+keyAccount_id + ","+storeType_id+","+class_id+","+store_id);
|
//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);
|
// 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_StockFacingHeaderNewData(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()));
|
// Log.e("childlistsize", String.valueOf(headerDataList.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headerDataList.size() > 0) {
|
/*if (headerDataList.size() > 0) {
|
||||||
for (int i = 0; i < headerDataList.size(); i++) {
|
for (int i = 0; i < headerDataList.size(); i++) {
|
||||||
hashMapListHeaderData.add(headerDataList.get(i));
|
hashMapListHeaderData.add(headerDataList.get(i));
|
||||||
//childDataList = new ArrayList<>();
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> filteredChildList =
|
||||||
childDataList = db.getOrder_RECEIVED_SKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
new ArrayList<>();
|
||||||
|
childDataList = new ArrayList<>();
|
||||||
|
//childDataList = db.getOrder_RECEIVED_SKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||||
if (!(childDataList.size() > 0)) {
|
if (!(childDataList.size() > 0)) {
|
||||||
if (country_id.equals("7") || country_id.equals("8")) {
|
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);
|
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);
|
||||||
@@ -403,7 +401,96 @@ public class OrderStatusDetailActivity extends AppCompatActivity{
|
|||||||
else{
|
else{
|
||||||
|
|
||||||
}
|
}
|
||||||
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
for (MSL_AvailabilityStockFacingGetterSetter item : childDataList) {
|
||||||
|
|
||||||
|
String qty = item.getFacing();
|
||||||
|
|
||||||
|
if (qty != null &&
|
||||||
|
!qty.isEmpty() &&
|
||||||
|
!qty.equals("0") &&
|
||||||
|
!qty.equals("0.0")) {
|
||||||
|
filteredChildList.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!filteredChildList.isEmpty()) {
|
||||||
|
hashMapListHeaderData.add(headerDataList.get(i));
|
||||||
|
hashMapListChildData.put(
|
||||||
|
headerDataList.get(i),
|
||||||
|
filteredChildList
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
if (headerDataList.size() > 0) {
|
||||||
|
|
||||||
|
for (int i = 0; i < headerDataList.size(); i++) {
|
||||||
|
|
||||||
|
ArrayList<MSL_AvailabilityStockFacingGetterSetter> filteredChildList =
|
||||||
|
new ArrayList<>();
|
||||||
|
|
||||||
|
childDataList = new ArrayList<>();
|
||||||
|
|
||||||
|
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.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
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (MSL_AvailabilityStockFacingGetterSetter item : childDataList) {
|
||||||
|
String qty = item.getFacing();
|
||||||
|
if (qty != null &&
|
||||||
|
!qty.isEmpty() &&
|
||||||
|
!qty.equals("0") &&
|
||||||
|
!qty.equals("0.0")) {
|
||||||
|
|
||||||
|
filteredChildList.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!filteredChildList.isEmpty()) {
|
||||||
|
hashMapListHeaderData.add(headerDataList.get(i));
|
||||||
|
hashMapListChildData.put(
|
||||||
|
headerDataList.get(i),
|
||||||
|
filteredChildList
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -469,7 +556,6 @@ public class OrderStatusDetailActivity extends AppCompatActivity{
|
|||||||
}
|
}
|
||||||
txt_categoryHeader.setText(headerTitle.getSub_category() + "-" + headerTitle.getBrand());
|
txt_categoryHeader.setText(headerTitle.getSub_category() + "-" + headerTitle.getBrand());
|
||||||
|
|
||||||
|
|
||||||
if (!checkflag) {
|
if (!checkflag) {
|
||||||
if (checkHeaderArray.contains(groupPosition)) {
|
if (checkHeaderArray.contains(groupPosition)) {
|
||||||
card_view.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
card_view.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
@@ -533,12 +619,12 @@ public class OrderStatusDetailActivity extends AppCompatActivity{
|
|||||||
holder.txt_skuName = (TextView) convertView.findViewById(R.id.txt_skuName);
|
holder.txt_skuName = (TextView) convertView.findViewById(R.id.txt_skuName);
|
||||||
holder.poqtyTV = (TextView) convertView.findViewById(R.id.poqtyTV);
|
holder.poqtyTV = (TextView) convertView.findViewById(R.id.poqtyTV);
|
||||||
holder.txt_mbq = (TextView) convertView.findViewById(R.id.txt_mbq);
|
holder.txt_mbq = (TextView) convertView.findViewById(R.id.txt_mbq);
|
||||||
|
holder.orderqtyTV = (TextView) convertView.findViewById(R.id.orderqtyTV);
|
||||||
holder.toggle_available = (ToggleButton) convertView.findViewById(R.id.toggle_available);
|
holder.toggle_available = (ToggleButton) convertView.findViewById(R.id.toggle_available);
|
||||||
holder.facing = (EditText) convertView.findViewById(R.id.ed_facing);
|
holder.facing = (EditText) convertView.findViewById(R.id.ed_facing);
|
||||||
holder.facing.setFilters(new InputFilter[]{new OrderStatusDetailActivity.DecimalDigitsInputFilter(3, 1)});
|
holder.facing.setFilters(new InputFilter[]{new OrderStatusDetailActivity.DecimalDigitsInputFilter(3, 1)});
|
||||||
holder.stock = (EditText) convertView.findViewById(R.id.ed_stock);
|
holder.stock = (EditText) convertView.findViewById(R.id.ed_stock);
|
||||||
holder.ed_pricing = (EditText) convertView.findViewById(R.id.ed_pricing);
|
holder.ed_pricing = (EditText) convertView.findViewById(R.id.ed_pricing);
|
||||||
|
|
||||||
holder.facing_view = convertView.findViewById(R.id.facing_view);
|
holder.facing_view = convertView.findViewById(R.id.facing_view);
|
||||||
holder.stock_view = convertView.findViewById(R.id.stock_view);
|
holder.stock_view = convertView.findViewById(R.id.stock_view);
|
||||||
holder.pricing_view = convertView.findViewById(R.id.pricing_view);
|
holder.pricing_view = convertView.findViewById(R.id.pricing_view);
|
||||||
@@ -548,61 +634,8 @@ public class OrderStatusDetailActivity extends AppCompatActivity{
|
|||||||
}
|
}
|
||||||
|
|
||||||
holder.poqtyTV.setText(context.getString(R.string.po_qty) + ":"+childData.getOrderqty());
|
holder.poqtyTV.setText(context.getString(R.string.po_qty) + ":"+childData.getOrderqty());
|
||||||
// holder.poqtyTV.setText("PO QTY" + ":"+childData.getOrderqty());
|
holder.orderqtyTV.setText(context.getString(R.string.order_qty) + ":"+childData.getOrderqty());
|
||||||
// uae facing hide
|
|
||||||
/*if (store_flag_hide.equals("1")) {
|
|
||||||
holder.facing.setVisibility(View.GONE);
|
|
||||||
holder.facing_view.setVisibility(View.GONE);
|
|
||||||
} else {
|
|
||||||
holder.facing.setVisibility(View.VISIBLE);
|
|
||||||
holder.facing_view.setVisibility(View.VISIBLE);
|
|
||||||
}*/
|
|
||||||
//usk
|
|
||||||
/* 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);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
holder.txt_skuName.setText(childData.getSku());
|
holder.txt_skuName.setText(childData.getSku());
|
||||||
// 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.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);
|
|
||||||
} 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.facing.setVisibility(View.VISIBLE);
|
|
||||||
holder.stock.setVisibility(View.GONE);
|
|
||||||
holder.stock_view.setVisibility(View.GONE);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if (childData.getCompany_id().equals("1")) {
|
if (childData.getCompany_id().equals("1")) {
|
||||||
holder.txt_skuName.setTextColor(getResources().getColor(R.color.colorPrimary));
|
holder.txt_skuName.setTextColor(getResources().getColor(R.color.colorPrimary));
|
||||||
} else {
|
} else {
|
||||||
@@ -626,12 +659,8 @@ public class OrderStatusDetailActivity extends AppCompatActivity{
|
|||||||
} else {
|
} else {
|
||||||
finalHolder.stock.setVisibility(View.GONE);
|
finalHolder.stock.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/*childData.setStock("");
|
else {
|
||||||
childData.setFacing("");*/
|
|
||||||
} else {
|
|
||||||
/* childData.setStock("");
|
|
||||||
childData.setFacing("");*/
|
|
||||||
childData.setToggleValue("0");
|
childData.setToggleValue("0");
|
||||||
finalHolder.stock.setVisibility(View.VISIBLE);
|
finalHolder.stock.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
@@ -991,7 +1020,7 @@ public class OrderStatusDetailActivity extends AppCompatActivity{
|
|||||||
}
|
}
|
||||||
public class ViewHolder {
|
public class ViewHolder {
|
||||||
CardView cardView;
|
CardView cardView;
|
||||||
TextView txt_skuName, txt_mbq,poqtyTV;
|
TextView txt_skuName, txt_mbq,poqtyTV,orderqtyTV;
|
||||||
ToggleButton toggle_available;
|
ToggleButton toggle_available;
|
||||||
LinearLayout lin_category;
|
LinearLayout lin_category;
|
||||||
EditText facing, stock, ed_pricing;
|
EditText facing, stock, ed_pricing;
|
||||||
|
|||||||
+2
-4
@@ -77,8 +77,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
|||||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, store_flag_str;
|
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, store_flag_str;
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
|
|
||||||
String str = CommonString.getImagesFolder(context),
|
String str = "", path = "", _pathforcheck = "", img = "";
|
||||||
path = "", _pathforcheck = "", img = "";
|
|
||||||
int child_position = -1;
|
int child_position = -1;
|
||||||
Uri outputFileUri;
|
Uri outputFileUri;
|
||||||
String gallery_package = "";
|
String gallery_package = "";
|
||||||
@@ -100,6 +99,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
context = this;
|
context = this;
|
||||||
|
str = CommonString.getImagesFolder(context);
|
||||||
lin_promo_sku = (LinearLayout) findViewById(R.id.lin_promo_sku);
|
lin_promo_sku = (LinearLayout) findViewById(R.id.lin_promo_sku);
|
||||||
lin_addtional_promo = (LinearLayout) findViewById(R.id.lin_addtional_promo);
|
lin_addtional_promo = (LinearLayout) findViewById(R.id.lin_addtional_promo);
|
||||||
view_promo_sku = findViewById(R.id.view_promo_sku);
|
view_promo_sku = findViewById(R.id.view_promo_sku);
|
||||||
@@ -203,8 +203,6 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
|||||||
cd.setImage_promotion("");
|
cd.setImage_promotion("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
cd.setIn_stock("-1");
|
cd.setIn_stock("-1");
|
||||||
img_addPromotion.setClickable(false);
|
img_addPromotion.setClickable(false);
|
||||||
|
|||||||
@@ -138,8 +138,7 @@ public class ChangePasswordActivity extends AppCompatActivity implements View.On
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
|
|
||||||
switch (id){
|
if (id == R.id.img_info) {
|
||||||
case R.id.img_info:
|
|
||||||
|
|
||||||
Dialog dialog = new Dialog(ChangePasswordActivity.this);
|
Dialog dialog = new Dialog(ChangePasswordActivity.this);
|
||||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
@@ -147,16 +146,14 @@ public class ChangePasswordActivity extends AppCompatActivity implements View.On
|
|||||||
dialog.setContentView(R.layout.password_rule_dialog);
|
dialog.setContentView(R.layout.password_rule_dialog);
|
||||||
dialog.show();
|
dialog.show();
|
||||||
|
|
||||||
break;
|
} else if (id == R.id.btn_submit) {
|
||||||
|
|
||||||
case R.id.btn_submit:
|
|
||||||
|
|
||||||
if (isValid()) {
|
if (isValid()) {
|
||||||
|
// your code here
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isValid(){
|
boolean isValid(){
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package cpm.com.gskmtorange.password;
|
|||||||
|
|
||||||
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL;
|
||||||
|
|
||||||
|
import static cpm.com.gskmtorange.constant.CommonFunctions.isInternetAvailable;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
@@ -56,12 +58,12 @@ import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
|||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.GsonBuilder;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
import org.ksoap2.serialization.SoapObject;
|
import org.ksoap2.serialization.SoapObject;
|
||||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
import org.ksoap2.transport.HttpTransportSE;
|
|
||||||
import org.xmlpull.v1.XmlPullParser;
|
import org.xmlpull.v1.XmlPullParser;
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
import org.xmlpull.v1.XmlPullParserFactory;
|
import org.xmlpull.v1.XmlPullParserFactory;
|
||||||
@@ -76,23 +78,25 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.PD_CONFIGURATION;
|
||||||
import cpm.com.gskmtorange.LoginActivity;
|
import cpm.com.gskmtorange.LoginActivity;
|
||||||
import cpm.com.gskmtorange.MainActivity;
|
import cpm.com.gskmtorange.MainActivity;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.NoticeItem;
|
||||||
|
import cpm.com.gskmtorange.NoticeResponse;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.autoupdate.AutoUpdateActivity;
|
import cpm.com.gskmtorange.autoupdate.AutoUpdateActivity;
|
||||||
import cpm.com.gskmtorange.blurlockview.BlurLockView;
|
import cpm.com.gskmtorange.blurlockview.BlurLockView;
|
||||||
import cpm.com.gskmtorange.blurlockview.Directions.HideType;
|
|
||||||
import cpm.com.gskmtorange.blurlockview.Directions.ShowType;
|
|
||||||
import cpm.com.gskmtorange.blurlockview.Eases.EaseType;
|
|
||||||
import cpm.com.gskmtorange.blurlockview.Password;
|
import cpm.com.gskmtorange.blurlockview.Password;
|
||||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.constant.CommonUtils;
|
import cpm.com.gskmtorange.constant.CommonUtils;
|
||||||
|
import cpm.com.gskmtorange.utils.OkHttpTransportSE;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.NoticeboardGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
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 BlurLockView.OnPasswordInputListener, BlurLockView.OnLeftButtonClickListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
||||||
BlurLockView blurLockView;
|
BlurLockView blurLockView;
|
||||||
ImageView imageView1;
|
ImageView imageView1;
|
||||||
String pin = "";
|
String pin = "";
|
||||||
@@ -110,9 +114,9 @@ public class MPinActivity extends AppCompatActivity implements View.OnClickListe
|
|||||||
private static final int MY_PERMISSIONS_REQUEST_LOCATION = 11;
|
private static final int MY_PERMISSIONS_REQUEST_LOCATION = 11;
|
||||||
private static final int MY_PERMISSIONS_REQUEST_STORAGE_READ = 12;
|
private static final int MY_PERMISSIONS_REQUEST_STORAGE_READ = 12;
|
||||||
private static final int MY_PERMISSIONS_REQUEST_STORAGE_WRITE = 14;
|
private static final int MY_PERMISSIONS_REQUEST_STORAGE_WRITE = 14;
|
||||||
|
|
||||||
private static final int PERMISSION_ALL = 99;
|
private static final int PERMISSION_ALL = 99;
|
||||||
|
|
||||||
|
|
||||||
GoogleApiClient mGoogleApiClient;
|
GoogleApiClient mGoogleApiClient;
|
||||||
private static int UPDATE_INTERVAL = 200; // 5 sec
|
private static int UPDATE_INTERVAL = 200; // 5 sec
|
||||||
private static int FATEST_INTERVAL = 100; // 1 sec
|
private static int FATEST_INTERVAL = 100; // 1 sec
|
||||||
@@ -306,17 +310,11 @@ public class MPinActivity extends AppCompatActivity implements View.OnClickListe
|
|||||||
|
|
||||||
LocationCallback locationCallback = new LocationCallback() {
|
LocationCallback locationCallback = new LocationCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onLocationResult(LocationResult locationResult) {
|
public void onLocationResult(@NonNull LocationResult locationResult) {
|
||||||
if (locationResult != null) {
|
|
||||||
if (locationResult == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//Showing the latitude, longitude and accuracy on the home screen.
|
//Showing the latitude, longitude and accuracy on the home screen.
|
||||||
for (Location location : locationResult.getLocations()) {
|
for (Location location : locationResult.getLocations()) {
|
||||||
lat = location.getLatitude();
|
lat = location.getLatitude();
|
||||||
lon = location.getLongitude();
|
lon = location.getLongitude();
|
||||||
// Log.e("latitude_inside",location.getLatitude() + "," +location.getLongitude());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -350,7 +348,13 @@ public class MPinActivity extends AppCompatActivity implements View.OnClickListe
|
|||||||
userId = preferences.getString(CommonString.KEY_USERNAME, "");
|
userId = preferences.getString(CommonString.KEY_USERNAME, "");
|
||||||
password = preferences.getString(CommonString.KEY_PASSWORD, "");
|
password = preferences.getString(CommonString.KEY_PASSWORD, "");
|
||||||
|
|
||||||
|
if(isInternetAvailable(context)){
|
||||||
new AuthenticateTask().execute();
|
new AuthenticateTask().execute();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(this, "Correct", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "Correct", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
@@ -406,18 +410,6 @@ public class MPinActivity extends AppCompatActivity implements View.OnClickListe
|
|||||||
pin = remainingPassword;
|
pin = remainingPassword;
|
||||||
}
|
}
|
||||||
|
|
||||||
@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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick() {
|
public void onClick() {
|
||||||
@@ -463,153 +455,6 @@ public class MPinActivity extends AppCompatActivity implements View.OnClickListe
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private int downsamepleFactor;
|
|
||||||
|
|
||||||
private ShowType getShowType(int p) {
|
|
||||||
ShowType showType = ShowType.FROM_TOP_TO_BOTTOM;
|
|
||||||
switch (p) {
|
|
||||||
case 0:
|
|
||||||
showType = ShowType.FROM_TOP_TO_BOTTOM;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
showType = ShowType.FROM_RIGHT_TO_LEFT;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
showType = ShowType.FROM_BOTTOM_TO_TOP;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
showType = ShowType.FROM_LEFT_TO_RIGHT;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
showType = ShowType.FADE_IN;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return showType;
|
|
||||||
}
|
|
||||||
|
|
||||||
private HideType getHideType(int p) {
|
|
||||||
HideType hideType = HideType.FROM_TOP_TO_BOTTOM;
|
|
||||||
switch (p) {
|
|
||||||
case 0:
|
|
||||||
hideType = HideType.FROM_TOP_TO_BOTTOM;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
hideType = HideType.FROM_RIGHT_TO_LEFT;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
hideType = HideType.FROM_BOTTOM_TO_TOP;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
hideType = HideType.FROM_LEFT_TO_RIGHT;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
hideType = HideType.FADE_OUT;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return hideType;
|
|
||||||
}
|
|
||||||
|
|
||||||
private EaseType getEaseType(int p) {
|
|
||||||
EaseType easeType = EaseType.Linear;
|
|
||||||
switch (p) {
|
|
||||||
case 0:
|
|
||||||
easeType = EaseType.EaseInSine;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
easeType = EaseType.EaseOutSine;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
easeType = EaseType.EaseInOutSine;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
easeType = EaseType.EaseInQuad;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
easeType = EaseType.EaseOutQuad;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
easeType = EaseType.EaseInOutQuad;
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
easeType = EaseType.EaseInCubic;
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
easeType = EaseType.EaseOutCubic;
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
easeType = EaseType.EaseInOutCubic;
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
easeType = EaseType.EaseInQuart;
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
easeType = EaseType.EaseOutQuart;
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
easeType = EaseType.EaseInOutQuart;
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
easeType = EaseType.EaseInQuint;
|
|
||||||
break;
|
|
||||||
case 13:
|
|
||||||
easeType = EaseType.EaseOutQuint;
|
|
||||||
break;
|
|
||||||
case 14:
|
|
||||||
easeType = EaseType.EaseInOutQuint;
|
|
||||||
break;
|
|
||||||
case 15:
|
|
||||||
easeType = EaseType.EaseInExpo;
|
|
||||||
break;
|
|
||||||
case 16:
|
|
||||||
easeType = EaseType.EaseOutExpo;
|
|
||||||
break;
|
|
||||||
case 17:
|
|
||||||
easeType = EaseType.EaseInOutExpo;
|
|
||||||
break;
|
|
||||||
case 18:
|
|
||||||
easeType = EaseType.EaseInCirc;
|
|
||||||
break;
|
|
||||||
case 19:
|
|
||||||
easeType = EaseType.EaseOutCirc;
|
|
||||||
break;
|
|
||||||
case 20:
|
|
||||||
easeType = EaseType.EaseInOutCirc;
|
|
||||||
break;
|
|
||||||
case 21:
|
|
||||||
easeType = EaseType.EaseInBack;
|
|
||||||
break;
|
|
||||||
case 22:
|
|
||||||
easeType = EaseType.EaseOutBack;
|
|
||||||
break;
|
|
||||||
case 23:
|
|
||||||
easeType = EaseType.EaseInOutBack;
|
|
||||||
break;
|
|
||||||
case 24:
|
|
||||||
easeType = EaseType.EaseInElastic;
|
|
||||||
break;
|
|
||||||
case 25:
|
|
||||||
easeType = EaseType.EaseOutElastic;
|
|
||||||
break;
|
|
||||||
case 26:
|
|
||||||
easeType = EaseType.EaseInOutElastic;
|
|
||||||
break;
|
|
||||||
case 27:
|
|
||||||
easeType = EaseType.EaseInBounce;
|
|
||||||
break;
|
|
||||||
case 28:
|
|
||||||
easeType = EaseType.EaseOutBounce;
|
|
||||||
break;
|
|
||||||
case 29:
|
|
||||||
easeType = EaseType.EaseInOutBounce;
|
|
||||||
break;
|
|
||||||
case 30:
|
|
||||||
easeType = EaseType.Linear;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return easeType;
|
|
||||||
}
|
|
||||||
|
|
||||||
private class AuthenticateTask extends AsyncTask<Void, Void, String> {
|
private class AuthenticateTask extends AsyncTask<Void, Void, String> {
|
||||||
private Dialog dialog;
|
private Dialog dialog;
|
||||||
|
|
||||||
@@ -639,131 +484,160 @@ public class MPinActivity extends AppCompatActivity implements View.OnClickListe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String doInBackground(Void... params) {
|
protected String doInBackground(Void... params) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
versionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
|
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+"-T3" + "[/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 + "[/APP_VERSION]" + "[ATT_MODE]OnLine[/ATT_MODE]" + "[NETWORK_STATUS]" + "LoginStatus" + "[/NETWORK_STATUS]" + "[/USER_DATA][/DATA]";
|
|
||||||
|
|
||||||
SoapObject request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_LOGIN);
|
SoapObject request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_LOGIN);
|
||||||
request.addProperty("onXML", userauth_xml);
|
request.addProperty("onXML", userauth_xml);
|
||||||
|
|
||||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_LOGIN, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_LOGIN, envelope);
|
||||||
Object result = (Object) envelope.getResponse();
|
Object result = (Object) envelope.getResponse();
|
||||||
|
|
||||||
if (result.toString().equalsIgnoreCase(CommonString.KEY_FAILURE)) {
|
if (result.toString().equalsIgnoreCase(CommonString.KEY_FAILURE)) {
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(() -> showAlert(CommonString.MESSAGE_FAILURE));
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
|
|
||||||
showAlert(CommonString.MESSAGE_FAILURE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
} else if (result.toString().equalsIgnoreCase(CommonString.KEY_FALSE)) {
|
} else if (result.toString().equalsIgnoreCase(CommonString.KEY_FALSE)) {
|
||||||
|
runOnUiThread(() -> showAlert(CommonString.MESSAGE_FALSE));
|
||||||
runOnUiThread(new Runnable() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
|
|
||||||
showAlert(CommonString.MESSAGE_FALSE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
} else if (result.toString().equalsIgnoreCase(CommonString.KEY_CHANGED)) {
|
} else if (result.toString().equalsIgnoreCase(CommonString.KEY_CHANGED)) {
|
||||||
|
runOnUiThread(() -> showAlert(CommonString.MESSAGE_CHANGED));
|
||||||
runOnUiThread(new Runnable() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
|
|
||||||
showAlert(CommonString.MESSAGE_CHANGED);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
|
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
|
||||||
factory.setNamespaceAware(true);
|
factory.setNamespaceAware(true);
|
||||||
XmlPullParser xpp = factory.newPullParser();
|
XmlPullParser xpp = factory.newPullParser();
|
||||||
|
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
xpp.next();
|
xpp.next();
|
||||||
eventType = xpp.getEventType();
|
eventType = xpp.getEventType();
|
||||||
final FailureGetterSetter failureGetterSetter = XMLHandlers.failureXMLHandler(xpp, eventType);
|
final FailureGetterSetter failureGetterSetter = XMLHandlers.failureXMLHandler(xpp, eventType);
|
||||||
|
|
||||||
if (failureGetterSetter.getStatus().equalsIgnoreCase(CommonString.KEY_FAILURE)) {
|
if (failureGetterSetter.getStatus().equalsIgnoreCase(CommonString.KEY_FAILURE)) {
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(() -> {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
showAlert(CommonString.METHOD_LOGIN + failureGetterSetter.getErrorMsg());
|
showAlert(CommonString.METHOD_LOGIN + failureGetterSetter.getErrorMsg());
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// For String source
|
// For String source
|
||||||
|
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
xpp.next();
|
xpp.next();
|
||||||
eventType = xpp.getEventType();
|
eventType = xpp.getEventType();
|
||||||
lgs = XMLHandlers.loginXMLHandler(xpp, eventType);
|
lgs = XMLHandlers.loginXMLHandler(xpp, eventType);
|
||||||
|
//PD_CONFIGURATION
|
||||||
} catch (XmlPullParserException e) {
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
e.printStackTrace();
|
request.addProperty("UserName", userId);
|
||||||
} catch (IOException e) {
|
request.addProperty("Type", "PD_CONFIGURATION");
|
||||||
e.printStackTrace();
|
request.addProperty("cultureid", "1");
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
result = envelope.getResponse();
|
||||||
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
|
xpp.next();
|
||||||
|
eventType = xpp.getEventType();
|
||||||
|
PD_CONFIGURATION pdConfiguration = XMLHandlers.PDConfigXMLHandler(xpp);
|
||||||
|
Log.e("PD_CONFIGURATION_RESULT", result.toString());
|
||||||
|
// PUT IN PREFERENCES
|
||||||
|
if (pdConfiguration.getPROJECT_ID() != null && !pdConfiguration.getPROJECT_ID().isEmpty()) {
|
||||||
|
editor.putString(CommonString.KEY_PD_PROJECT_Id, pdConfiguration.getPROJECT_ID().get(0));
|
||||||
|
editor.putString(CommonString.KEY_PD_USER_Id, pdConfiguration.getUSER_ID().get(0));
|
||||||
|
} else {
|
||||||
|
return CommonString.KEY_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Mer_NoticeBoard
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
|
request.addProperty("UserName", userId);
|
||||||
|
request.addProperty("Type", "Mer_NoticeBoard");
|
||||||
|
request.addProperty("cultureid", "1");
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
result = envelope.getResponse();
|
||||||
|
|
||||||
|
factory = XmlPullParserFactory.newInstance();
|
||||||
|
factory.setNamespaceAware(false);
|
||||||
|
|
||||||
|
Log.e("Noticeboard_Result", result.toString());
|
||||||
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
|
xpp.next();
|
||||||
|
eventType = xpp.getEventType();
|
||||||
|
NoticeboardGetterSetter noticeboardGetterSetter1 = XMLHandlers.Noticeboard_XMLHandler(xpp,eventType);
|
||||||
|
Log.e("noticeboardGetterSetter1", noticeboardGetterSetter1.toString());
|
||||||
|
// PUT IN PREFERENCES
|
||||||
|
if (noticeboardGetterSetter1.getNoticeBoardId() != null && !noticeboardGetterSetter1.getNoticeBoardId().isEmpty()) {
|
||||||
|
List<NoticeItem> list = new ArrayList<>();
|
||||||
|
|
||||||
|
for (int i = 0; i < noticeboardGetterSetter1.getNoticeBoardId().size(); i++) {
|
||||||
|
|
||||||
|
NoticeItem item = new NoticeItem(
|
||||||
|
safe(noticeboardGetterSetter1.getNoticeBoardId(), i),
|
||||||
|
safe(noticeboardGetterSetter1.getNoticThumnail_Path(), i),
|
||||||
|
safe(noticeboardGetterSetter1.getNoticeLink_Thumbnail(), i),
|
||||||
|
safe(noticeboardGetterSetter1.getNoticeLink_FullPage(), i),
|
||||||
|
safe(noticeboardGetterSetter1.getFullPageTarget(), i)
|
||||||
|
);
|
||||||
|
|
||||||
|
list.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
NoticeResponse response = new NoticeResponse(list);
|
||||||
|
|
||||||
|
Gson gson = new GsonBuilder()
|
||||||
|
.disableHtmlEscaping()
|
||||||
|
.setPrettyPrinting()
|
||||||
|
.create();
|
||||||
|
|
||||||
|
String noticeJson = gson.toJson(response);
|
||||||
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
SharedPreferences.Editor editor = prefs.edit();
|
||||||
|
editor.putString("NOTICEBOARD_DATA", noticeJson);
|
||||||
|
editor.apply();
|
||||||
|
|
||||||
|
} /*else {
|
||||||
|
return CommonString.KEY_FAILURE;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
} catch (XmlPullParserException | IOException e) {
|
||||||
|
e.fillInStackTrace();
|
||||||
|
}
|
||||||
// PUT IN PREFERENCES
|
// PUT IN PREFERENCES
|
||||||
editor.putString(CommonString.KEY_USERNAME, userId);
|
editor.putString(CommonString.KEY_USERNAME, userId);
|
||||||
editor.putString(CommonString.KEY_PASSWORD, password);
|
editor.putString(CommonString.KEY_PASSWORD, password);
|
||||||
editor.putString(CommonString.KEY_VERSION, lgs.getAPP_VERSION());
|
editor.putString(CommonString.KEY_VERSION, lgs.getAPP_VERSION());
|
||||||
editor.putString(CommonString.KEY_PATH, lgs.getAPP_PATH());
|
editor.putString(CommonString.KEY_PATH, lgs.getAPP_PATH());
|
||||||
editor.putString(CommonString.KEY_DATE, lgs.getCURRENTDATE());
|
editor.putString(CommonString.KEY_DATE, lgs.getCURRENTDATE());
|
||||||
//editor.putString(CommonString.KEY_DATE, "01/25/2019");
|
|
||||||
editor.putString(CommonString.KEY_COUNTRY_ID, lgs.getCOUNTRY_ID());
|
editor.putString(CommonString.KEY_COUNTRY_ID, lgs.getCOUNTRY_ID());
|
||||||
editor.commit();
|
editor.commit();
|
||||||
setDataFromSharedPreferences(lgs);
|
setDataFromSharedPreferences(lgs);
|
||||||
|
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, userId);
|
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, userId);
|
||||||
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, CommonString.KEY_LOGIN_DATA);
|
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, CommonString.KEY_LOGIN_DATA);
|
||||||
bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "Data");
|
bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "Data");
|
||||||
bundle.putString(CommonString.KEY_LANGUAGE, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
bundle.putString(CommonString.KEY_LANGUAGE, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
return CommonString.KEY_SUCCESS;
|
return CommonString.KEY_SUCCESS;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
|
runOnUiThread(() -> showAlert(CommonString.MESSAGE_EXCEPTION));
|
||||||
runOnUiThread(new Runnable() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
|
|
||||||
showAlert(CommonString.MESSAGE_EXCEPTION);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
counter++;
|
counter++;
|
||||||
runOnUiThread(() -> {
|
runOnUiThread(() -> {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
if (counter < 3) {
|
if (counter < 3) {
|
||||||
|
if(isInternetAvailable(context)){
|
||||||
new AuthenticateTask().execute();
|
new AuthenticateTask().execute();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
showAlert(getString(R.string.nonetwork));
|
showAlert(getString(R.string.nonetwork));
|
||||||
counter = 1;
|
counter = 1;
|
||||||
@@ -780,7 +654,7 @@ public class MPinActivity extends AppCompatActivity implements View.OnClickListe
|
|||||||
protected void onPostExecute(String result) {
|
protected void onPostExecute(String result) {
|
||||||
super.onPostExecute(result);
|
super.onPostExecute(result);
|
||||||
if (result.equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
if (result.equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||||
initializePDSDK(context, userId);
|
initializePDSDK(context, preferences.getString(CommonString.KEY_PD_PROJECT_Id, ""), preferences.getString(CommonString.KEY_PD_USER_Id, "").isEmpty() ? userId : preferences.getString(CommonString.KEY_PD_USER_Id, ""));
|
||||||
if (preferences.getString(CommonString.KEY_VERSION, "").equals(Integer.toString(versionCode))) {
|
if (preferences.getString(CommonString.KEY_VERSION, "").equals(Integer.toString(versionCode))) {
|
||||||
setLanguageDataFromSharedPreferences();
|
setLanguageDataFromSharedPreferences();
|
||||||
Intent in = new Intent(context, MainActivity.class);
|
Intent in = new Intent(context, MainActivity.class);
|
||||||
@@ -794,10 +668,8 @@ public class MPinActivity extends AppCompatActivity implements View.OnClickListe
|
|||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<String> language, culture_id, notice_url;
|
ArrayList<String> language, culture_id, notice_url;
|
||||||
@@ -1039,7 +911,14 @@ public class MPinActivity extends AppCompatActivity implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializePDSDK(Context context, String _userId) {
|
private void initializePDSDK(Context context, String projectId, String _userId) {
|
||||||
CommonUtils.INSTANCE.initializePDSDK(context, _userId);
|
CommonUtils.INSTANCE.initializePDSDK(context, projectId, _userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String safe(ArrayList<String> list, int index) {
|
||||||
|
if (list == null || list.size() <= index || list.get(index) == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return list.get(index).trim();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-10
@@ -253,40 +253,35 @@ public class StoreDetailFragment extends Fragment implements View.OnClickListene
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
switch (id) {
|
if (id == R.id.img_camera1) {
|
||||||
|
|
||||||
case R.id.img_camera1:
|
|
||||||
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
||||||
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(1);
|
startCameraActivity(1);
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.img_camera2:
|
} else if (id == R.id.img_camera2) {
|
||||||
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
||||||
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(2);
|
startCameraActivity(2);
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.img_camera3:
|
} else if (id == R.id.img_camera3) {
|
||||||
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
||||||
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(3);
|
startCameraActivity(3);
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.img_camera4:
|
} else if (id == R.id.img_camera4) {
|
||||||
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
_pathforcheck = "Pharma_MSL_Top_Image_" + store_id + "_" + visit_date.replace("/", "") + "_" +
|
||||||
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") + ".jpg";
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
startCameraActivity(4);
|
startCameraActivity(4);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,11 +7,8 @@ import retrofit.Call;
|
|||||||
import retrofit.http.Body;
|
import retrofit.http.Body;
|
||||||
import retrofit.http.POST;
|
import retrofit.http.POST;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by jeevanp on 05-10-2017.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public interface PostApiForFile {
|
public interface PostApiForFile {
|
||||||
@POST("Uploadimages")
|
@POST("Uploadimages")
|
||||||
Call<String> getUploadImage(@Body RequestBody reqesBody);
|
Call<String> getUploadImage(@Body RequestBody reqestBody);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,13 @@
|
|||||||
package cpm.com.gskmtorange.retrofit;
|
package cpm.com.gskmtorange.retrofit;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import com.squareup.okhttp.MediaType;
|
import com.squareup.okhttp.MediaType;
|
||||||
import com.squareup.okhttp.RequestBody;
|
import com.squareup.okhttp.RequestBody;
|
||||||
import com.squareup.okhttp.ResponseBody;
|
import com.squareup.okhttp.ResponseBody;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
|
|
||||||
import retrofit.Converter;
|
import retrofit.Converter;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by jeevanp on 19-05-2017.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class StringConverterFactory implements Converter.Factory {
|
public class StringConverterFactory implements Converter.Factory {
|
||||||
public StringConverterFactory() {
|
public StringConverterFactory() {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package cpm.com.gskmtorange.service;
|
package cpm.com.gskmtorange.service;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.app.NotificationChannel;
|
import android.app.NotificationChannel;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
@@ -20,8 +21,8 @@ import com.google.firebase.messaging.RemoteMessage;
|
|||||||
import cpm.com.gskmtorange.MainActivity;
|
import cpm.com.gskmtorange.MainActivity;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
|
||||||
|
@SuppressLint("MissingFirebaseInstanceTokenRefresh")
|
||||||
public class FCMNotificationService extends FirebaseMessagingService {
|
public class FCMNotificationService extends FirebaseMessagingService {
|
||||||
|
|
||||||
String TAG = "FCM Notification";
|
String TAG = "FCM Notification";
|
||||||
|
|
||||||
public FCMNotificationService() {
|
public FCMNotificationService() {
|
||||||
@@ -31,23 +32,13 @@ public class FCMNotificationService extends FirebaseMessagingService {
|
|||||||
@Override
|
@Override
|
||||||
public void onMessageReceived(RemoteMessage remoteMessage) {
|
public void onMessageReceived(RemoteMessage remoteMessage) {
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
// TODO(developer): Handle FCM messages here.
|
// TODO(developer): Handle FCM messages here.
|
||||||
// Not getting messages here? See why this may be: https://goo.gl/39bRNJ
|
// Not getting messages here? See why this may be: https://goo.gl/39bRNJ
|
||||||
Log.d(TAG, "From: " + remoteMessage.getFrom());
|
Log.d(TAG, "From: " + remoteMessage.getFrom());
|
||||||
|
|
||||||
// Check if message contains a data payload.
|
// Check if message contains a data payload.
|
||||||
if (remoteMessage.getData().size() > 0) {
|
if (!remoteMessage.getData().isEmpty()) {
|
||||||
Log.d(TAG, "Message data payload: " + remoteMessage.getData());
|
Log.d(TAG, "Message data payload: " + remoteMessage.getData());
|
||||||
|
|
||||||
if (/* Check if data needs to be processed by long running job */ true) {
|
|
||||||
// For long-running tasks (10 seconds or more) use Firebase Job Dispatcher.
|
|
||||||
// scheduleJob();
|
|
||||||
} else {
|
|
||||||
// Handle message within 10 seconds
|
|
||||||
// handleNow();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if message contains a notification payload.
|
// Check if message contains a notification payload.
|
||||||
@@ -63,23 +54,7 @@ public class FCMNotificationService extends FirebaseMessagingService {
|
|||||||
/**
|
/**
|
||||||
* Schedule a job using FirebaseJobDispatcher.
|
* Schedule a job using FirebaseJobDispatcher.
|
||||||
*/
|
*/
|
||||||
private void scheduleJob() {
|
|
||||||
// [START dispatch_job]
|
|
||||||
/* FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(new GooglePlayDriver(this));
|
|
||||||
Job myJob = dispatcher.newJobBuilder()
|
|
||||||
.setService(MyJobService.class)
|
|
||||||
.setTag("my-job-tag")
|
|
||||||
.build();
|
|
||||||
dispatcher.schedule(myJob);*/
|
|
||||||
// [END dispatch_job]
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handle time allotted to BroadcastReceivers.
|
|
||||||
*/
|
|
||||||
private void handleNow() {
|
|
||||||
Log.d(TAG, "Short lived task is done.");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create and show a simple notification containing the received FCM message.
|
* Create and show a simple notification containing the received FCM message.
|
||||||
@@ -90,7 +65,7 @@ public class FCMNotificationService extends FirebaseMessagingService {
|
|||||||
Intent intent = new Intent(this, MainActivity.class);
|
Intent intent = new Intent(this, MainActivity.class);
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,
|
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,
|
||||||
PendingIntent.FLAG_ONE_SHOT);
|
PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);
|
||||||
|
|
||||||
String channelId = getString(R.string.default_notification_channel_id);
|
String channelId = getString(R.string.default_notification_channel_id);
|
||||||
Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
|
Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
|
||||||
@@ -114,6 +89,6 @@ public class FCMNotificationService extends FirebaseMessagingService {
|
|||||||
notificationManager.createNotificationChannel(channel);
|
notificationManager.createNotificationChannel(channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());
|
notificationManager.notify(0, notificationBuilder.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-14
@@ -1,5 +1,7 @@
|
|||||||
package cpm.com.gskmtorange.storeinmap;
|
package cpm.com.gskmtorange.storeinmap;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
@@ -10,6 +12,7 @@ import android.view.View;
|
|||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import com.google.android.gms.maps.CameraUpdateFactory;
|
import com.google.android.gms.maps.CameraUpdateFactory;
|
||||||
@@ -56,34 +59,23 @@ public class StoreListRouteActivity extends FragmentActivity implements OnMapRea
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_store_list_route);
|
setContentView(R.layout.activity_store_list_route);
|
||||||
storelist = (ArrayList<StoreBean>)getIntent().getSerializableExtra(CommonString.KEY_STORE_LIST);
|
storelist = (ArrayList<StoreBean>)getIntent().getSerializableExtra(CommonString.KEY_STORE_LIST);
|
||||||
|
|
||||||
|
|
||||||
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
|
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
|
||||||
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
|
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
|
||||||
.findFragmentById(R.id.map);
|
.findFragmentById(R.id.map);
|
||||||
mapFragment.getMapAsync(this);
|
|
||||||
|
|
||||||
|
mapFragment.getMapAsync(this);
|
||||||
color_list.add("#f44336");
|
color_list.add("#f44336");
|
||||||
color_list.add("#1e88e5");
|
color_list.add("#1e88e5");
|
||||||
color_list.add("#2e7d32");
|
color_list.add("#2e7d32");
|
||||||
color_list.add("#ab47bc");
|
color_list.add("#ab47bc");
|
||||||
color_list.add("#ffcc80");
|
color_list.add("#ffcc80");
|
||||||
color_list.add("#fdd835");
|
color_list.add("#fdd835");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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
|
@Override
|
||||||
public void onMapReady(GoogleMap googleMap) {
|
public void onMapReady(GoogleMap googleMap) {
|
||||||
mMap = googleMap;
|
mMap = googleMap;
|
||||||
|
|
||||||
showRoute(global_index);
|
showRoute(global_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,6 +94,10 @@ public class StoreListRouteActivity extends FragmentActivity implements OnMapRea
|
|||||||
Bitmap bm = tv.getDrawingCache();
|
Bitmap bm = tv.getDrawingCache();
|
||||||
lat = Double.parseDouble(storelist.get(index).getLATITUDE());
|
lat = Double.parseDouble(storelist.get(index).getLATITUDE());
|
||||||
lon = Double.parseDouble(storelist.get(index).getLONGITUDE());
|
lon = Double.parseDouble(storelist.get(index).getLONGITUDE());
|
||||||
|
/*lat = 28.5275;
|
||||||
|
lon = 77.2781;*/
|
||||||
|
|
||||||
|
Log.e("directiondata",lat +","+lon);
|
||||||
LatLng loc = new LatLng(lat, lon);
|
LatLng loc = new LatLng(lat, lon);
|
||||||
|
|
||||||
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)));
|
||||||
|
|||||||
+149
-324
@@ -6,7 +6,6 @@ import android.content.pm.PackageManager;
|
|||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -24,11 +23,10 @@ import androidx.fragment.app.FragmentActivity;
|
|||||||
import com.google.android.gms.appindexing.Action;
|
import com.google.android.gms.appindexing.Action;
|
||||||
import com.google.android.gms.appindexing.AppIndex;
|
import com.google.android.gms.appindexing.AppIndex;
|
||||||
import com.google.android.gms.appindexing.Thing;
|
import com.google.android.gms.appindexing.Thing;
|
||||||
import com.google.android.gms.common.ConnectionResult;
|
import com.google.android.gms.location.FusedLocationProviderClient;
|
||||||
import com.google.android.gms.common.GooglePlayServicesUtil;
|
import com.google.android.gms.location.LocationCallback;
|
||||||
import com.google.android.gms.common.api.GoogleApiClient;
|
|
||||||
import com.google.android.gms.location.LocationListener;
|
|
||||||
import com.google.android.gms.location.LocationRequest;
|
import com.google.android.gms.location.LocationRequest;
|
||||||
|
import com.google.android.gms.location.LocationResult;
|
||||||
import com.google.android.gms.location.LocationServices;
|
import com.google.android.gms.location.LocationServices;
|
||||||
import com.google.android.gms.maps.CameraUpdateFactory;
|
import com.google.android.gms.maps.CameraUpdateFactory;
|
||||||
import com.google.android.gms.maps.GoogleMap;
|
import com.google.android.gms.maps.GoogleMap;
|
||||||
@@ -40,9 +38,7 @@ import com.google.android.gms.maps.model.LatLngBounds;
|
|||||||
import com.google.android.gms.maps.model.MarkerOptions;
|
import com.google.android.gms.maps.model.MarkerOptions;
|
||||||
import com.google.android.gms.maps.model.PolylineOptions;
|
import com.google.android.gms.maps.model.PolylineOptions;
|
||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@@ -57,281 +53,136 @@ import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
|||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
|
||||||
public class StoreRouteActivity extends FragmentActivity implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
public class StoreRouteActivity extends FragmentActivity implements OnMapReadyCallback {
|
||||||
|
|
||||||
private Context context;
|
private Context context;
|
||||||
private GoogleMap mMap;
|
private GoogleMap mMap;
|
||||||
StoreBean store;
|
private StoreBean store;
|
||||||
LatLng origin, destination;
|
private LatLng origin, destination;
|
||||||
private final static int PLAY_SERVICES_RESOLUTION_REQUEST = 1000;
|
|
||||||
private GoogleApiClient mGoogleApiClient;
|
private FusedLocationProviderClient fusedLocationClient;
|
||||||
private LocationRequest mLocationRequest;
|
private LocationRequest locationRequest;
|
||||||
private static int UPDATE_INTERVAL = 500; // 5 sec
|
private LocationCallback locationCallback;
|
||||||
private static int FATEST_INTERVAL = 100; // 1 sec
|
|
||||||
private static int DISPLACEMENT = 5; // 10 meters
|
private static final int LOCATION_PERMISSION_REQUEST = 1001;
|
||||||
private Location mLastLocation;
|
|
||||||
double latitude = 0.0;
|
|
||||||
double longitude = 0.0;
|
|
||||||
Boolean markerflag = true;
|
|
||||||
FloatingActionButton fab_cancel;
|
FloatingActionButton fab_cancel;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_store_route);
|
setContentView(R.layout.activity_store_route);
|
||||||
fab_cancel = (FloatingActionButton) findViewById(R.id.fab_cancel);
|
|
||||||
context = this;
|
context = this;
|
||||||
fab_cancel.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
fab_cancel = findViewById(R.id.fab_cancel);
|
||||||
public void onClick(View v) {
|
fab_cancel.setOnClickListener(v -> {
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
store = (StoreBean) getIntent().getSerializableExtra(CommonString.KEY_STORE_LIST);
|
store = (StoreBean) getIntent().getSerializableExtra(CommonString.KEY_STORE_LIST);
|
||||||
/*store.setLATITUDE("28.5420901");
|
|
||||||
store.setLONGITUDE("77.2430997");*/
|
|
||||||
/*store.setLATITUDE("28.544055");
|
|
||||||
store.setLONGITUDE("77.264060");*/
|
|
||||||
|
|
||||||
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
|
fusedLocationClient = LocationServices.getFusedLocationProviderClient(this);
|
||||||
|
|
||||||
|
locationRequest = LocationRequest.create()
|
||||||
|
.setInterval(2000) // 2 sec
|
||||||
|
.setFastestInterval(1000) // 1 sec
|
||||||
|
.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
|
||||||
|
|
||||||
|
locationCallback = new LocationCallback() {
|
||||||
|
@Override
|
||||||
|
public void onLocationResult(@NonNull LocationResult locationResult) {
|
||||||
|
if (locationResult.getLastLocation() != null) {
|
||||||
|
Location loc = locationResult.getLastLocation();
|
||||||
|
updateMapWithCurrentLocation(loc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
|
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
|
||||||
.findFragmentById(R.id.map);
|
.findFragmentById(R.id.map);
|
||||||
|
if (mapFragment != null) {
|
||||||
mapFragment.getMapAsync(this);
|
mapFragment.getMapAsync(this);
|
||||||
|
|
||||||
if (checkPlayServices()) {
|
|
||||||
|
|
||||||
// Building the GoogleApi client
|
|
||||||
buildGoogleApiClient();
|
|
||||||
|
|
||||||
createLocationRequest();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkPlayServices() {
|
@Override
|
||||||
int resultCode = GooglePlayServicesUtil
|
public void onMapReady(GoogleMap googleMap) {
|
||||||
.isGooglePlayServicesAvailable(this);
|
mMap = googleMap;
|
||||||
if (resultCode != ConnectionResult.SUCCESS) {
|
|
||||||
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
|
// Enable zoom controls for user
|
||||||
GooglePlayServicesUtil.getErrorDialog(resultCode, this,
|
mMap.getUiSettings().setZoomControlsEnabled(true);
|
||||||
PLAY_SERVICES_RESOLUTION_REQUEST).show();
|
|
||||||
|
// Request permissions
|
||||||
|
if (checkLocationPermission()) {
|
||||||
|
startLocationUpdates();
|
||||||
|
fusedLocationClient.getLastLocation()
|
||||||
|
.addOnSuccessListener(this, location -> {
|
||||||
|
if (location != null) {
|
||||||
|
updateMapWithCurrentLocation(location); // show instantly with last known location
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(context, getResources().getString(R.string.notsuppoted)
|
Toast.makeText(this, "Waiting for current location...", Toast.LENGTH_SHORT).show();
|
||||||
, Toast.LENGTH_LONG)
|
|
||||||
.show();
|
|
||||||
finish();
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/* if (store != null) {
|
||||||
|
LatLng storeLoc = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
||||||
|
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(storeLoc, 15));
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean checkLocationPermission() {
|
||||||
|
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
|
||||||
|
!= PackageManager.PERMISSION_GRANTED) {
|
||||||
|
ActivityCompat.requestPermissions(
|
||||||
|
this,
|
||||||
|
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
|
||||||
|
LOCATION_PERMISSION_REQUEST
|
||||||
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected synchronized void buildGoogleApiClient() {
|
private void startLocationUpdates() {
|
||||||
mGoogleApiClient = new GoogleApiClient.Builder(this)
|
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
||||||
.addConnectionCallbacks(this)
|
fusedLocationClient.requestLocationUpdates(locationRequest, locationCallback, null);
|
||||||
.addOnConnectionFailedListener(this)
|
}
|
||||||
.addApi(LocationServices.API).build();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateMapWithCurrentLocation(Location location) {
|
||||||
protected void createLocationRequest() {
|
double latitude = location.getLatitude();
|
||||||
mLocationRequest = new LocationRequest();
|
double longitude = location.getLongitude();
|
||||||
mLocationRequest.setInterval(UPDATE_INTERVAL);
|
|
||||||
mLocationRequest.setFastestInterval(FATEST_INTERVAL);
|
|
||||||
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
|
|
||||||
mLocationRequest.setSmallestDisplacement(DISPLACEMENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void startLocationUpdates() {
|
|
||||||
|
|
||||||
|
|
||||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
|
||||||
|| ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
|
|
||||||
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Manipulates the map once available.
|
|
||||||
* This callback is triggered when the map is ready to be used.
|
|
||||||
* This is where we can add markers or lines, add listeners or move the camera. In this case,
|
|
||||||
* we just add a marker near Sydney, Australia.
|
|
||||||
* If Google Play services is not installed on the device, the user will be prompted to install
|
|
||||||
* it inside the SupportMapFragment. This method will only be triggered once the user has
|
|
||||||
* installed Google Play services and returned to the app.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onMapReady(GoogleMap googleMap) {
|
|
||||||
mMap = googleMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showMarker(double lat, double lon) {
|
|
||||||
// Add a marker and move the camera
|
|
||||||
LinearLayout tv = (LinearLayout) this.getLayoutInflater().inflate(R.layout.marker_view, null, false);
|
|
||||||
|
|
||||||
TextView desc = (TextView) tv.findViewById(R.id.tv_desc);
|
|
||||||
desc.setText(store.getSTORE_NAME());
|
|
||||||
|
|
||||||
tv.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
|
|
||||||
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
|
|
||||||
tv.layout(0, 0, tv.getMeasuredWidth(), tv.getMeasuredHeight());
|
|
||||||
|
|
||||||
tv.setDrawingCacheEnabled(true);
|
|
||||||
tv.buildDrawingCache();
|
|
||||||
Bitmap bm = tv.getDrawingCache();
|
|
||||||
LatLng loc = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
|
||||||
mMap.addMarker(new MarkerOptions().position(loc).anchor(0.5f, 0.5f).icon(BitmapDescriptorFactory.fromBitmap(bm)));
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getUrl(LatLng origin, LatLng dest) {
|
|
||||||
|
|
||||||
// Origin of route
|
|
||||||
String str_origin = "origin=" + origin.latitude + "," + origin.longitude;
|
|
||||||
|
|
||||||
// Destination of route
|
|
||||||
String str_dest = "destination=" + dest.latitude + "," + dest.longitude;
|
|
||||||
|
|
||||||
|
|
||||||
// Sensor enabled
|
|
||||||
String sensor = "sensor=false";
|
|
||||||
|
|
||||||
// Building the parameters to the web service
|
|
||||||
String parameters = str_origin + "&" + str_dest + "&" + sensor;
|
|
||||||
|
|
||||||
// Output format
|
|
||||||
String output = "json";
|
|
||||||
|
|
||||||
// Building the url to the web service
|
|
||||||
String url = "https://maps.googleapis.com/maps/api/directions/" + output + "?" + parameters+"&key=AIzaSyCPo-giwVv5h8AzsbE1IDRsFsPHjVlCm5A";
|
|
||||||
|
|
||||||
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A method to download json data from url
|
|
||||||
*/
|
|
||||||
private String downloadUrl(String strUrl) throws IOException {
|
|
||||||
String data = "";
|
|
||||||
InputStream iStream = null;
|
|
||||||
HttpURLConnection urlConnection = null;
|
|
||||||
try {
|
|
||||||
URL url = new URL(strUrl);
|
|
||||||
|
|
||||||
// Creating an http connection to communicate with url
|
|
||||||
urlConnection = (HttpURLConnection) url.openConnection();
|
|
||||||
|
|
||||||
// Connecting to url
|
|
||||||
urlConnection.connect();
|
|
||||||
|
|
||||||
// Reading data from url
|
|
||||||
iStream = urlConnection.getInputStream();
|
|
||||||
|
|
||||||
BufferedReader br = new BufferedReader(new InputStreamReader(iStream));
|
|
||||||
|
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
|
|
||||||
String line = "";
|
|
||||||
while ((line = br.readLine()) != null) {
|
|
||||||
sb.append(line);
|
|
||||||
}
|
|
||||||
|
|
||||||
data = sb.toString();
|
|
||||||
Log.d("downloadUrl", data.toString());
|
|
||||||
br.close();
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.d("Exception", e.toString());
|
|
||||||
} finally {
|
|
||||||
iStream.close();
|
|
||||||
urlConnection.disconnect();
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onConnected(@Nullable Bundle bundle) {
|
|
||||||
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
// TODO: Consider calling
|
|
||||||
// ActivityCompat#requestPermissions
|
|
||||||
// here to request the missing permissions, and then overriding
|
|
||||||
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
|
|
||||||
// int[] grantResults)
|
|
||||||
// to handle the case where the user grants the permission. See the documentation
|
|
||||||
// for ActivityCompat#requestPermissions for more details.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
|
|
||||||
|
|
||||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
|
||||||
|| ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
if (mLastLocation != null) {
|
|
||||||
latitude = mLastLocation.getLatitude();
|
|
||||||
longitude = mLastLocation.getLongitude();
|
|
||||||
|
|
||||||
mMap.setMyLocationEnabled(true);
|
|
||||||
|
|
||||||
origin = new LatLng(latitude, longitude);
|
origin = new LatLng(latitude, longitude);
|
||||||
destination = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
destination = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
||||||
|
|
||||||
StoreBean store1 = new StoreBean();
|
// Show markers
|
||||||
store1.setLATITUDE(latitude+"");
|
StoreBean currentStore = new StoreBean();
|
||||||
store1.setLONGITUDE(longitude+"");
|
currentStore.setLATITUDE(latitude + "");
|
||||||
store1.setSTORE_NAME("Current Location");
|
currentStore.setLONGITUDE(longitude + "");
|
||||||
showMarker(store1, R.layout.current_marker_view);
|
currentStore.setSTORE_NAME("Current Location");
|
||||||
|
showMarker(currentStore, R.layout.current_marker_view);
|
||||||
|
|
||||||
showMarker(store, R.layout.marker_view);
|
showMarker(store, R.layout.marker_view);
|
||||||
|
|
||||||
|
// Move camera to fit both points
|
||||||
LatLngBounds.Builder builder = new LatLngBounds.Builder();
|
LatLngBounds.Builder builder = new LatLngBounds.Builder();
|
||||||
builder.include(new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE())));
|
builder.include(origin);
|
||||||
builder.include(new LatLng(latitude, longitude));
|
builder.include(destination);
|
||||||
//mMap.moveCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 48));
|
mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 100));
|
||||||
mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 48));
|
|
||||||
|
|
||||||
//destination = new LatLng(mapLat[1], mapLon[1]);
|
// Fetch and draw route
|
||||||
/*mMap.moveCamera(CameraUpdateFactory.newLatLng(origin));
|
|
||||||
mMap.animateCamera(CameraUpdateFactory.zoomTo(17));*/
|
|
||||||
|
|
||||||
//new GetDirection().execute();
|
|
||||||
// Getting URL to the Google Directions API
|
|
||||||
String url = getUrl(origin, destination);
|
String url = getUrl(origin, destination);
|
||||||
Log.d("onMapClick", url.toString());
|
new FetchUrl().execute(url);
|
||||||
FetchUrl FetchUrl = new FetchUrl();
|
|
||||||
|
|
||||||
// Start downloading json data from Google Directions API
|
|
||||||
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) {
|
|
||||||
|
|
||||||
|
// Stop updates once we get location
|
||||||
|
fusedLocationClient.removeLocationUpdates(locationCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showMarker(StoreBean store, int layout_resource) {
|
public void showMarker(StoreBean store, int layout_resource) {
|
||||||
// Add a marker of latest location and move the camera
|
|
||||||
LinearLayout tv = (LinearLayout) this.getLayoutInflater().inflate(layout_resource, null, false);
|
LinearLayout tv = (LinearLayout) this.getLayoutInflater().inflate(layout_resource, null, false);
|
||||||
|
TextView desc = tv.findViewById(R.id.tv_desc);
|
||||||
TextView desc = (TextView) tv.findViewById(R.id.tv_desc);
|
|
||||||
desc.setText(store.getSTORE_NAME());
|
desc.setText(store.getSTORE_NAME());
|
||||||
|
|
||||||
tv.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
|
tv.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
|
||||||
@@ -339,143 +190,117 @@ public class StoreRouteActivity extends FragmentActivity implements OnMapReadyCa
|
|||||||
tv.layout(0, 0, tv.getMeasuredWidth(), tv.getMeasuredHeight());
|
tv.layout(0, 0, tv.getMeasuredWidth(), tv.getMeasuredHeight());
|
||||||
|
|
||||||
tv.setDrawingCacheEnabled(true);
|
tv.setDrawingCacheEnabled(true);
|
||||||
tv.buildDrawingCache();
|
|
||||||
Bitmap bm = tv.getDrawingCache();
|
Bitmap bm = tv.getDrawingCache();
|
||||||
|
|
||||||
LatLng loc = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
LatLng loc = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
||||||
mMap.addMarker(new MarkerOptions().position(loc).anchor(0.5f, 0.5f).icon(BitmapDescriptorFactory.fromBitmap(bm)));
|
mMap.addMarker(new MarkerOptions()
|
||||||
|
.position(loc)
|
||||||
|
.anchor(0.5f, 0.5f)
|
||||||
|
.icon(BitmapDescriptorFactory.fromBitmap(bm)));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onStart() {
|
private String getUrl(LatLng origin, LatLng dest) {
|
||||||
super.onStart();// ATTENTION: This was auto-generated to implement the App Indexing API.
|
String str_origin = "origin=" + origin.latitude + "," + origin.longitude;
|
||||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
String str_dest = "destination=" + dest.latitude + "," + dest.longitude;
|
||||||
mGoogleApiClient.connect();
|
String parameters = str_origin + "&" + str_dest + "&sensor=false";
|
||||||
if (mGoogleApiClient != null) {
|
String output = "json";
|
||||||
mGoogleApiClient.connect();
|
return "https://maps.googleapis.com/maps/api/directions/" + output + "?" + parameters + "&key=AIzaSyCPo-giwVv5h8AzsbE1IDRsFsPHjVlCm5A";
|
||||||
}
|
|
||||||
// ATTENTION: This was auto-generated to implement the App Indexing API.
|
|
||||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
|
||||||
// AppIndex.AppIndexApi.start(mGoogleApiClient, getIndexApiAction());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private String downloadUrl(String strUrl) throws IOException {
|
||||||
* ATTENTION: This was auto-generated to implement the App Indexing API.
|
StringBuilder sb = new StringBuilder();
|
||||||
* See https://g.co/AppIndexing/AndroidStudio for more information.
|
InputStream iStream = null;
|
||||||
*/
|
HttpURLConnection urlConnection = null;
|
||||||
public Action getIndexApiAction() {
|
try {
|
||||||
Thing object = new Thing.Builder()
|
URL url = new URL(strUrl);
|
||||||
.setName("GeoTag Page") // TODO: Define a title for the content shown.
|
urlConnection = (HttpURLConnection) url.openConnection();
|
||||||
// TODO: Make sure this auto-generated URL is correct.
|
urlConnection.connect();
|
||||||
.setUrl(Uri.parse("http://[ENTER-YOUR-URL-HERE]"))
|
iStream = urlConnection.getInputStream();
|
||||||
.build();
|
BufferedReader br = new BufferedReader(new InputStreamReader(iStream));
|
||||||
return new Action.Builder(Action.TYPE_VIEW)
|
String line;
|
||||||
.setObject(object)
|
while ((line = br.readLine()) != null) {
|
||||||
.setActionStatus(Action.STATUS_TYPE_COMPLETED)
|
sb.append(line);
|
||||||
.build();
|
}
|
||||||
|
br.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e("Exception", e.toString());
|
||||||
|
} finally {
|
||||||
|
if (iStream != null) iStream.close();
|
||||||
|
if (urlConnection != null) urlConnection.disconnect();
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetches data from url passed
|
// AsyncTask to fetch directions
|
||||||
private class FetchUrl extends AsyncTask<String, Void, String> {
|
private class FetchUrl extends AsyncTask<String, Void, String> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String doInBackground(String... url) {
|
protected String doInBackground(String... url) {
|
||||||
|
|
||||||
// For storing data from web service
|
|
||||||
String data = "";
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Fetching the data from web service
|
return downloadUrl(url[0]);
|
||||||
data = downloadUrl(url[0]);
|
} catch (IOException e) {
|
||||||
Log.d("Background Task data", data.toString());
|
Log.e("Background Task", e.toString());
|
||||||
} catch (Exception e) {
|
return "";
|
||||||
Log.d("Background Task", e.toString());
|
|
||||||
}
|
}
|
||||||
return data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(String result) {
|
protected void onPostExecute(String result) {
|
||||||
super.onPostExecute(result);
|
super.onPostExecute(result);
|
||||||
|
Log.d("DirectionsResponse", result);
|
||||||
ParserTask parserTask = new ParserTask();
|
new ParserTask().execute(result);
|
||||||
|
|
||||||
// Invokes the thread for parsing the JSON data
|
|
||||||
parserTask.execute(result);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* A class to parse the Google Places in JSON format
|
|
||||||
*/
|
|
||||||
private class ParserTask extends AsyncTask<String, Integer, List<List<HashMap<String, String>>>> {
|
private class ParserTask extends AsyncTask<String, Integer, List<List<HashMap<String, String>>>> {
|
||||||
|
|
||||||
// Parsing the data in non-ui thread
|
|
||||||
@Override
|
@Override
|
||||||
protected List<List<HashMap<String, String>>> doInBackground(String... jsonData) {
|
protected List<List<HashMap<String, String>>> doInBackground(String... jsonData) {
|
||||||
|
|
||||||
JSONObject jObject;
|
|
||||||
List<List<HashMap<String, String>>> routes = null;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
jObject = new JSONObject(jsonData[0]);
|
JSONObject jObject = new JSONObject(jsonData[0]);
|
||||||
Log.d("ParserTask",jsonData[0].toString());
|
|
||||||
DataParser parser = new DataParser();
|
DataParser parser = new DataParser();
|
||||||
Log.d("ParserTask", parser.toString());
|
return parser.parse(jObject);
|
||||||
|
|
||||||
// Starts parsing data
|
|
||||||
routes = parser.parse(jObject);
|
|
||||||
Log.d("ParserTask","Executing routes");
|
|
||||||
Log.d("ParserTask",routes.toString());
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.d("ParserTask",e.toString());
|
Log.e("ParserTask", e.toString());
|
||||||
e.printStackTrace();
|
return null;
|
||||||
}
|
}
|
||||||
return routes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Executes in UI thread, after the parsing process
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(List<List<HashMap<String, String>>> result) {
|
protected void onPostExecute(List<List<HashMap<String, String>>> result) {
|
||||||
|
if (result == null) return;
|
||||||
|
|
||||||
ArrayList<LatLng> points;
|
ArrayList<LatLng> points;
|
||||||
PolylineOptions lineOptions = null;
|
PolylineOptions lineOptions = null;
|
||||||
|
|
||||||
// Traversing through all the routes
|
for (List<HashMap<String, String>> path : result) {
|
||||||
for (int i = 0; i < result.size(); i++) {
|
|
||||||
points = new ArrayList<>();
|
points = new ArrayList<>();
|
||||||
lineOptions = new PolylineOptions();
|
lineOptions = new PolylineOptions();
|
||||||
|
|
||||||
// Fetching i-th route
|
for (HashMap<String, String> point : path) {
|
||||||
List<HashMap<String, String>> path = result.get(i);
|
|
||||||
|
|
||||||
// Fetching all the points in i-th route
|
|
||||||
for (int j = 0; j < path.size(); j++) {
|
|
||||||
HashMap<String, String> point = path.get(j);
|
|
||||||
|
|
||||||
double lat = Double.parseDouble(point.get("lat"));
|
double lat = Double.parseDouble(point.get("lat"));
|
||||||
double lng = Double.parseDouble(point.get("lng"));
|
double lng = Double.parseDouble(point.get("lng"));
|
||||||
LatLng position = new LatLng(lat, lng);
|
points.add(new LatLng(lat, lng));
|
||||||
|
|
||||||
points.add(position);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adding all the points in the route to LineOptions
|
|
||||||
lineOptions.addAll(points);
|
lineOptions.addAll(points);
|
||||||
lineOptions.width(12);
|
lineOptions.width(12);
|
||||||
lineOptions.color(Color.parseColor("#5ac614"));
|
lineOptions.color(Color.parseColor("#5ac614"));
|
||||||
|
|
||||||
Log.d("onPostExecute","onPostExecute lineoptions decoded");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Drawing polyline in the Google Map for the i-th route
|
|
||||||
if (lineOptions != null) {
|
if (lineOptions != null) {
|
||||||
mMap.addPolyline(lineOptions);
|
mMap.addPolyline(lineOptions);
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
Log.d("onPostExecute","without Polylines drawn");
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
|
||||||
|
@NonNull int[] grantResults) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
|
if (requestCode == LOCATION_PERMISSION_REQUEST) {
|
||||||
|
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||||
|
startLocationUpdates();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, "Location permission required", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+67
-32
@@ -1,5 +1,7 @@
|
|||||||
package cpm.com.gskmtorange.upload;
|
package cpm.com.gskmtorange.upload;
|
||||||
|
|
||||||
|
import static cpm.com.gskmtorange.constant.CommonFunctions.isInternetAvailable;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -14,15 +16,12 @@ import android.util.Log;
|
|||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
//import com.crashlytics.android.Crashlytics;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
import org.ksoap2.serialization.SoapObject;
|
import org.ksoap2.serialization.SoapObject;
|
||||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
import org.ksoap2.transport.HttpTransportSE;
|
|
||||||
import org.xml.sax.InputSource;
|
import org.xml.sax.InputSource;
|
||||||
import org.xml.sax.XMLReader;
|
import org.xml.sax.XMLReader;
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
@@ -48,6 +47,8 @@ import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
|||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.password.MPinActivity;
|
||||||
|
import cpm.com.gskmtorange.utils.OkHttpTransportSE;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CompetitonPromoGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.CompetitonPromoGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CounterfeitProductGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.CounterfeitProductGetterSetter;
|
||||||
@@ -121,8 +122,14 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
Path = CommonString.getImagesFolder(context);
|
Path = CommonString.getImagesFolder(context);
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
//start upload
|
//start upload
|
||||||
|
if(isInternetAvailable(context)){
|
||||||
new UploadTask(this).execute();
|
new UploadTask(this).execute();
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public String UploadImage(String path, String folder_name) throws Exception {
|
public String UploadImage(String path, String folder_name) throws Exception {
|
||||||
errormsg = "";
|
errormsg = "";
|
||||||
@@ -168,7 +175,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UPLOAD_IMAGE, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UPLOAD_IMAGE, envelope);
|
||||||
|
|
||||||
Object result = envelope.getResponse();
|
Object result = envelope.getResponse();
|
||||||
@@ -267,7 +274,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -350,7 +357,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + coverage_service, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + coverage_service, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -413,7 +420,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -475,7 +482,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -522,7 +529,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -567,7 +574,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -632,7 +639,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
}
|
}
|
||||||
@@ -689,7 +696,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -742,7 +749,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -820,7 +827,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -875,7 +882,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -975,7 +982,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1105,7 +1112,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1156,7 +1163,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1254,7 +1261,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1306,7 +1313,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1353,7 +1360,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1396,7 +1403,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1445,7 +1452,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1494,7 +1501,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1565,7 +1572,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1638,7 +1645,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1704,7 +1711,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1755,7 +1762,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1800,7 +1807,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
|
||||||
@@ -1810,6 +1817,34 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
data.name = getString(R.string.ir_data_upload);
|
data.name = getString(R.string.ir_data_upload);
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
|
////IRPDVisibility-Upload Data
|
||||||
|
String irPD_visi_xmlData = "";
|
||||||
|
onXML = "";
|
||||||
|
ArrayList<CategoryPictureGetterSetter> ir_visi_data = db.getIrPDVisibilityforUpload(coverageList.get(i).getStoreId(), coverageList.get(i).getVisitDate());
|
||||||
|
if (ir_visi_data != null && !ir_visi_data.isEmpty()) {
|
||||||
|
for (int j = 0; j < ir_visi_data.size(); j++) {
|
||||||
|
onXML = "[IR_VISIBILITY_DATA]" + "[MID]" + mid + "[/MID]" + "[USERID]" + userId + "[/USERID]" + "[CATEGORY_ID]" + ir_visi_data.get(j).getCategoryId() + "[/CATEGORY_ID]" + "[SUB_CATEGORY_ID]" + ir_visi_data.get(j).getSUB_CATEGORY_ID() + "[/SUB_CATEGORY_ID]" + "[SUB_CATEGORY_CODE]" + ir_visi_data.get(j).getSubCatCode() + "[/SUB_CATEGORY_CODE]" + "[IR_VISIBILITY_IMAGES]" + ir_visi_data.get(j).getSubCategoryCamera2() + "[/IR_VISIBILITY_IMAGES]" + "[/IR_VISIBILITY_DATA]";
|
||||||
|
irPD_visi_xmlData = irPD_visi_xmlData + onXML;
|
||||||
|
}
|
||||||
|
final String irpd_xml = "[DATA]" + irPD_visi_xmlData + "[/DATA]";
|
||||||
|
Log.e("irpd_visi_xml_data", irPD_visi_xmlData);
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
|
request.addProperty("XMLDATA", irpd_xml);
|
||||||
|
request.addProperty("KEYS", "IRPD_VISIBILITY_DATA_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();
|
||||||
|
}
|
||||||
|
data.value = 72;
|
||||||
|
data.name = getString(R.string.ir_visibility_data_upload);
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
String visit_xml = "";
|
String visit_xml = "";
|
||||||
onXML = "";
|
onXML = "";
|
||||||
ArrayList<Visit_Type_Master_GetterSetter> visittypelist = db.getUploadedVisitType(coverageList.get(i).getStoreId());
|
ArrayList<Visit_Type_Master_GetterSetter> visittypelist = db.getUploadedVisitType(coverageList.get(i).getStoreId());
|
||||||
@@ -1839,7 +1874,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
@@ -1875,7 +1910,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION + status_service, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION + status_service, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,7 @@
|
|||||||
package cpm.com.gskmtorange.upload;
|
package cpm.com.gskmtorange.upload;
|
||||||
|
|
||||||
|
import static cpm.com.gskmtorange.constant.CommonFunctions.isInternetAvailable;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
@@ -12,16 +14,13 @@ import android.graphics.Matrix;
|
|||||||
import android.graphics.RectF;
|
import android.graphics.RectF;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
//import com.crashlytics.android.Crashlytics;
|
|
||||||
import com.google.gson.JsonSyntaxException;
|
import com.google.gson.JsonSyntaxException;
|
||||||
import com.squareup.okhttp.MediaType;
|
import com.squareup.okhttp.MediaType;
|
||||||
import com.squareup.okhttp.MultipartBuilder;
|
import com.squareup.okhttp.MultipartBuilder;
|
||||||
import com.squareup.okhttp.OkHttpClient;
|
import com.squareup.okhttp.OkHttpClient;
|
||||||
import com.squareup.okhttp.Protocol;
|
|
||||||
import com.squareup.okhttp.RequestBody;
|
import com.squareup.okhttp.RequestBody;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
|
||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
import org.ksoap2.serialization.SoapObject;
|
import org.ksoap2.serialization.SoapObject;
|
||||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
@@ -46,16 +45,11 @@ import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
|||||||
import cpm.com.gskmtorange.MainActivity;
|
import cpm.com.gskmtorange.MainActivity;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.download.DownloadActivity;
|
||||||
import cpm.com.gskmtorange.retrofit.PostApiForFile;
|
import cpm.com.gskmtorange.retrofit.PostApiForFile;
|
||||||
import cpm.com.gskmtorange.retrofit.StringConverterFactory;
|
import cpm.com.gskmtorange.retrofit.StringConverterFactory;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
|
||||||
import retrofit.GsonConverterFactory;
|
|
||||||
import retrofit.Retrofit;
|
import retrofit.Retrofit;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by yadavendras on 4/5/2018.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class UploadImageWithRetrofit {
|
public class UploadImageWithRetrofit {
|
||||||
RequestBody body1;
|
RequestBody body1;
|
||||||
private Retrofit adapter;
|
private Retrofit adapter;
|
||||||
@@ -124,15 +118,18 @@ public class UploadImageWithRetrofit {
|
|||||||
foldername = "CounterFeitImages";
|
foldername = "CounterFeitImages";
|
||||||
} else if (file[i].getName().contains("POImage")) {//added 15.04.2019
|
} else if (file[i].getName().contains("POImage")) {//added 15.04.2019
|
||||||
foldername = "POImages";
|
foldername = "POImages";
|
||||||
} else if (file[i].getName().contains("_IRPDIMG-")) {//added 15.04.2019
|
}
|
||||||
foldername = "IRPD_Image";
|
else if (file[i].getName().contains("_IRPDIMG-")) {//added 15.04.2019
|
||||||
} else {
|
foldername = "IR_Images";
|
||||||
|
}
|
||||||
|
else if (file[i].getName().contains("_IRPD_VISI_IMG-")) {
|
||||||
|
foldername = "IR_VisibilityImages";
|
||||||
|
}
|
||||||
|
else {
|
||||||
foldername = "Bulkimages";
|
foldername = "Bulkimages";
|
||||||
}
|
}
|
||||||
|
|
||||||
filename = file[i].getName();
|
filename = file[i].getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,13 +138,10 @@ public class UploadImageWithRetrofit {
|
|||||||
if (finalFile == null) {
|
if (finalFile == null) {
|
||||||
finalFile = originalFile;
|
finalFile = originalFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
OkHttpClient okHttpClient = new OkHttpClient();
|
OkHttpClient okHttpClient = new OkHttpClient();
|
||||||
// okHttpClient.setProtocols(Arrays.asList(Protocol.HTTP_1_1));
|
|
||||||
okHttpClient.setConnectTimeout(20, TimeUnit.SECONDS);
|
okHttpClient.setConnectTimeout(20, TimeUnit.SECONDS);
|
||||||
okHttpClient.setWriteTimeout(20, TimeUnit.SECONDS);
|
okHttpClient.setWriteTimeout(20, TimeUnit.SECONDS);
|
||||||
okHttpClient.setReadTimeout(20, TimeUnit.SECONDS);
|
okHttpClient.setReadTimeout(20, TimeUnit.SECONDS);
|
||||||
// MediaType mediaType = MediaType.parse("text/plain");
|
|
||||||
|
|
||||||
RequestBody photo = RequestBody.create(MediaType.parse("application/octet-stream"), finalFile);
|
RequestBody photo = RequestBody.create(MediaType.parse("application/octet-stream"), finalFile);
|
||||||
body1 = new MultipartBuilder()
|
body1 = new MultipartBuilder()
|
||||||
@@ -174,7 +168,6 @@ public class UploadImageWithRetrofit {
|
|||||||
uploadedFiles++;
|
uploadedFiles++;
|
||||||
} else {
|
} else {
|
||||||
status = 0;
|
status = 0;
|
||||||
//uploadedFiles = 0;
|
|
||||||
}
|
}
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
pd.dismiss();
|
pd.dismiss();
|
||||||
@@ -199,13 +192,16 @@ public class UploadImageWithRetrofit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (totalFiles == uploadedFiles) {
|
if (totalFiles == uploadedFiles) {
|
||||||
//region Coverage upload status Data
|
//region Coverage upload status Data
|
||||||
|
if(isInternetAvailable(context)){
|
||||||
new StatusUpload().execute();
|
new StatusUpload().execute();
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (JsonSyntaxException e) {
|
} catch (JsonSyntaxException e) {
|
||||||
e.fillInStackTrace();
|
e.fillInStackTrace();
|
||||||
@@ -292,10 +288,8 @@ public class UploadImageWithRetrofit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
} else {
|
|
||||||
|
|
||||||
pd.dismiss();
|
pd.dismiss();
|
||||||
if (totalFiles == uploadedFiles) {
|
if (totalFiles == uploadedFiles) {
|
||||||
//region Coverage upload status Data
|
//region Coverage upload status Data
|
||||||
|
|||||||
@@ -0,0 +1,112 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package cpm.com.gskmtorange.utils
|
||||||
|
|
||||||
|
// ScoreItem.kt
|
||||||
|
sealed class ScoreItem {
|
||||||
|
data class OverallScore(
|
||||||
|
val osa: String,
|
||||||
|
val msl: String,
|
||||||
|
val posm: String,
|
||||||
|
val sosSku: String,
|
||||||
|
val sosBrand: String
|
||||||
|
) : ScoreItem()
|
||||||
|
|
||||||
|
data class CategoryScore(
|
||||||
|
val categoryName: String,
|
||||||
|
val msl: String,
|
||||||
|
val posm: String,
|
||||||
|
val sosSku: String,
|
||||||
|
val sosBrand: String,
|
||||||
|
val brandDetails: List<Pair<String, String>> // BrandName to Value
|
||||||
|
) : ScoreItem()
|
||||||
|
|
||||||
|
data class ImageItem(
|
||||||
|
val url: String
|
||||||
|
) : ScoreItem()
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package cpm.com.gskmtorange.utils;
|
||||||
|
|
||||||
|
import javax.net.ssl.SSLSocket;
|
||||||
|
import javax.net.ssl.SSLSocketFactory;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.Socket;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class TLSSocketFactory extends SSLSocketFactory {
|
||||||
|
private final SSLSocketFactory delegate;
|
||||||
|
|
||||||
|
public TLSSocketFactory() {
|
||||||
|
this.delegate = (SSLSocketFactory) SSLSocketFactory.getDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getDefaultCipherSuites() {
|
||||||
|
return delegate.getDefaultCipherSuites();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getSupportedCipherSuites() {
|
||||||
|
return delegate.getSupportedCipherSuites();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException {
|
||||||
|
return enableModernTLS(delegate.createSocket(s, host, port, autoClose));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Socket createSocket(String host, int port) throws IOException {
|
||||||
|
return enableModernTLS(delegate.createSocket(host, port));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException {
|
||||||
|
return enableModernTLS(delegate.createSocket(host, port, localHost, localPort));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Socket createSocket(InetAddress host, int port) throws IOException {
|
||||||
|
return enableModernTLS(delegate.createSocket(host, port));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException {
|
||||||
|
return enableModernTLS(delegate.createSocket(address, port, localAddress, localPort));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Socket enableModernTLS(Socket socket) {
|
||||||
|
if (socket instanceof SSLSocket) {
|
||||||
|
SSLSocket sslSocket = (SSLSocket) socket;
|
||||||
|
|
||||||
|
// Supported protocols on this device
|
||||||
|
String[] supported = sslSocket.getSupportedProtocols();
|
||||||
|
|
||||||
|
// Collect TLSv1.2 and TLSv1.3 if available
|
||||||
|
List<String> enabled = new ArrayList<>();
|
||||||
|
for (String proto : supported) {
|
||||||
|
if ("TLSv1.2".equals(proto) || "TLSv1.3".equals(proto)) {
|
||||||
|
enabled.add(proto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!enabled.isEmpty()) {
|
||||||
|
sslSocket.setEnabledProtocols(enabled.toArray(new String[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Debug log
|
||||||
|
System.out.println("Enabled protocols: " + Arrays.toString(sslSocket.getEnabledProtocols()));
|
||||||
|
}
|
||||||
|
return socket;
|
||||||
|
}
|
||||||
|
}
|
||||||
+15
@@ -25,6 +25,16 @@ public class MSL_AvailabilityStockFacingGetterSetter implements Serializable{
|
|||||||
String company_id;
|
String company_id;
|
||||||
String must_have;
|
String must_have;
|
||||||
|
|
||||||
|
public String getOrder_qty() {
|
||||||
|
return order_qty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrder_qty(String order_qty) {
|
||||||
|
this.order_qty = order_qty;
|
||||||
|
}
|
||||||
|
|
||||||
|
String order_qty ="";
|
||||||
|
|
||||||
public String getPOID() {
|
public String getPOID() {
|
||||||
return POID;
|
return POID;
|
||||||
}
|
}
|
||||||
@@ -268,4 +278,9 @@ public class MSL_AvailabilityStockFacingGetterSetter implements Serializable{
|
|||||||
this.warehouseStock = warehouseStock;
|
this.warehouseStock = warehouseStock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return getSku();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+138
@@ -0,0 +1,138 @@
|
|||||||
|
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class MasterDetailerGetterSetter {
|
||||||
|
String Table_MASTER_DETAILER;
|
||||||
|
|
||||||
|
ArrayList<String> DTID = new ArrayList<>();
|
||||||
|
ArrayList<String> DT_LEVEL = new ArrayList<>();
|
||||||
|
ArrayList<String> DT_NAME = new ArrayList<>();
|
||||||
|
ArrayList<String> CATEGORY_ID = new ArrayList<>();
|
||||||
|
ArrayList<String> DT_URL = new ArrayList<>();
|
||||||
|
ArrayList<String> DT_THUMBNAIL = new ArrayList<>();
|
||||||
|
|
||||||
|
public String getTable_MASTER_DETAILER() {
|
||||||
|
return Table_MASTER_DETAILER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTable_MASTER_DETAILER(String table_MASTER_DETAILER) {
|
||||||
|
Table_MASTER_DETAILER = table_MASTER_DETAILER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getDTID() {
|
||||||
|
return DTID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDTID(String DTID) {
|
||||||
|
this.DTID.add(DTID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getDT_LEVEL() {
|
||||||
|
return DT_LEVEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDT_LEVEL(String DT_LEVEL) {
|
||||||
|
this.DT_LEVEL.add(DT_LEVEL);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getDT_NAME() {
|
||||||
|
return DT_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDT_NAME(String DT_NAME) {
|
||||||
|
this.DT_NAME.add(DT_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getCATEGORY_ID() {
|
||||||
|
return CATEGORY_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCATEGORY_ID(String CATEGORY_ID) {
|
||||||
|
this.CATEGORY_ID.add(CATEGORY_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getDT_URL() {
|
||||||
|
return DT_URL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDT_URL(String DT_URL) {
|
||||||
|
this.DT_URL.add(DT_URL);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getDT_THUMBNAIL() {
|
||||||
|
return DT_THUMBNAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDT_THUMBNAIL(String DT_THUMBNAIL) {
|
||||||
|
this.DT_THUMBNAIL.add(DT_THUMBNAIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVisitdate() {
|
||||||
|
return visitdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVisitdate(String visitdate) {
|
||||||
|
this.visitdate = visitdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStart_time() {
|
||||||
|
return start_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStart_time(String start_time) {
|
||||||
|
this.start_time = start_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnd_time() {
|
||||||
|
return end_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnd_time(String end_time) {
|
||||||
|
this.end_time = end_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDuration() {
|
||||||
|
return duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDuration(String duration) {
|
||||||
|
this.duration = duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStoreId() {
|
||||||
|
return storeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStoreId(String storeId) {
|
||||||
|
this.storeId = storeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDetailerId() {
|
||||||
|
return detailerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDetailerId(String detailerId) {
|
||||||
|
this.detailerId = detailerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDt_level() {
|
||||||
|
return dt_level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDt_level(String dt_level) {
|
||||||
|
this.dt_level = dt_level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserId() {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserId(String userId) {
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
String visitdate,start_time,end_time,duration,storeId,detailerId,dt_level,userId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+177
@@ -0,0 +1,177 @@
|
|||||||
|
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class Master_Storelist_PDA_GetterSetter {
|
||||||
|
String table_master_storelist_pda;
|
||||||
|
ArrayList<String> StoreId = new ArrayList<>();
|
||||||
|
ArrayList<String> channel = new ArrayList<>();
|
||||||
|
ArrayList<String> format = new ArrayList<>();
|
||||||
|
ArrayList<String> region = new ArrayList<>();
|
||||||
|
ArrayList<String> bay_type = new ArrayList<>();
|
||||||
|
ArrayList<String> no_of_bays = new ArrayList<>();
|
||||||
|
ArrayList<String> category = new ArrayList<>();
|
||||||
|
ArrayList<String> user_id = new ArrayList<>();
|
||||||
|
ArrayList<String> Active = new ArrayList<>();
|
||||||
|
ArrayList<String> ASMArea = new ArrayList<>();
|
||||||
|
ArrayList<String> EmployeeName = new ArrayList<>();
|
||||||
|
ArrayList<String> DesignationName = new ArrayList<>();
|
||||||
|
ArrayList<String> SupervisorId = new ArrayList<>();
|
||||||
|
ArrayList<String> Supervisor = new ArrayList<>();
|
||||||
|
ArrayList<String> StoreCode = new ArrayList<>();
|
||||||
|
ArrayList<String> ChainId = new ArrayList<>();
|
||||||
|
ArrayList<String> StoreTypeId = new ArrayList<>();
|
||||||
|
ArrayList<String> SOName = new ArrayList<>();
|
||||||
|
|
||||||
|
public ArrayList<String> getRegion() {
|
||||||
|
return region;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegion(String region) {
|
||||||
|
this.region.add(region);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTable_master_storelist_pda() {
|
||||||
|
return table_master_storelist_pda;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTable_master_storelist_pda(String table_master_storelist_pda) {
|
||||||
|
this.table_master_storelist_pda = table_master_storelist_pda;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getStoreId() {
|
||||||
|
return StoreId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStoreId(String storeId) {
|
||||||
|
this.StoreId.add(storeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getChannel() {
|
||||||
|
return channel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChannel(String channel) {
|
||||||
|
this.channel.add(channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getFormat() {
|
||||||
|
return format;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFormat(String format) {
|
||||||
|
this.format.add(format);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getBay_type() {
|
||||||
|
return bay_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBay_type(String bay_type) {
|
||||||
|
this.bay_type.add(bay_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getNo_of_bays() {
|
||||||
|
return no_of_bays;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNo_of_bays(String no_of_bays) {
|
||||||
|
this.no_of_bays.add(no_of_bays);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getCategory() {
|
||||||
|
return category;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategory(String category) {
|
||||||
|
this.category.add(category);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getUser_id() {
|
||||||
|
return user_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser_id(String user_id) {
|
||||||
|
this.user_id.add(user_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getActive() {
|
||||||
|
return Active;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActive(String active) {
|
||||||
|
this.Active.add(active);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getASMArea() {
|
||||||
|
return ASMArea;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setASMArea(String ASMArea) {
|
||||||
|
this.ASMArea.add(ASMArea);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getEmployeeName() {
|
||||||
|
return EmployeeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmployeeName(String employeeName) {
|
||||||
|
this.EmployeeName.add(employeeName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getDesignationName() {
|
||||||
|
return DesignationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDesignationName(String designationName) {
|
||||||
|
this.DesignationName.add(designationName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getSupervisorId() {
|
||||||
|
return SupervisorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSupervisorId(String supervisorId) {
|
||||||
|
this.SupervisorId.add(supervisorId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getSupervisor() {
|
||||||
|
return Supervisor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSupervisor(String supervisor) {
|
||||||
|
this.Supervisor.add(supervisor);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getStoreCode() {
|
||||||
|
return StoreCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStoreCode(String storeCode) {
|
||||||
|
this.StoreCode.add(storeCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getChainId() {
|
||||||
|
return ChainId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChainId(String chainId) {
|
||||||
|
this.ChainId.add(chainId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getStoreTypeId() {
|
||||||
|
return StoreTypeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStoreTypeId(String storeTypeId) {
|
||||||
|
this.StoreTypeId.add(storeTypeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getSOName() {
|
||||||
|
return SOName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSOName(String SOName) {
|
||||||
|
this.SOName.add(SOName);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||||
|
|
||||||
|
public class NoticeItem {
|
||||||
|
String NoticeBoardId;
|
||||||
|
String NoticThumnail_Path;
|
||||||
|
String NoticeLink_Thumbnail;
|
||||||
|
|
||||||
|
String NoticeLink_FullPage;
|
||||||
|
String FullPageTarget;
|
||||||
|
|
||||||
|
public NoticeItem(String id, String path, String thumb, String full, String target) {
|
||||||
|
this.NoticeBoardId = id;
|
||||||
|
this.NoticThumnail_Path = path;
|
||||||
|
this.NoticeLink_Thumbnail = thumb;
|
||||||
|
this.NoticeLink_FullPage = full;
|
||||||
|
this.FullPageTarget = target;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNoticeBoardId() {
|
||||||
|
return NoticeBoardId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoticeBoardId(String noticeBoardId) {
|
||||||
|
NoticeBoardId = noticeBoardId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNoticThumnail_Path() {
|
||||||
|
return NoticThumnail_Path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoticThumnail_Path(String noticThumnail_Path) {
|
||||||
|
NoticThumnail_Path = noticThumnail_Path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNoticeLink_Thumbnail() {
|
||||||
|
return NoticeLink_Thumbnail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoticeLink_Thumbnail(String noticeLink_Thumbnail) {
|
||||||
|
NoticeLink_Thumbnail = noticeLink_Thumbnail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNoticeLink_FullPage() {
|
||||||
|
return NoticeLink_FullPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoticeLink_FullPage(String noticeLink_FullPage) {
|
||||||
|
NoticeLink_FullPage = noticeLink_FullPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFullPageTarget() {
|
||||||
|
return FullPageTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFullPageTarget(String fullPageTarget) {
|
||||||
|
FullPageTarget = fullPageTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+60
@@ -0,0 +1,60 @@
|
|||||||
|
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class NoticeboardGetterSetter {
|
||||||
|
String table_mer_noticeboard_detailer;
|
||||||
|
ArrayList<String> NoticeBoardId = new ArrayList<>();
|
||||||
|
ArrayList<String> NoticThumnail_Path = new ArrayList<>();
|
||||||
|
ArrayList<String> NoticeLink_Thumbnail = new ArrayList<>();
|
||||||
|
ArrayList<String> NoticeLink_FullPage = new ArrayList<>();
|
||||||
|
ArrayList<String> FullPageTarget = new ArrayList<>();
|
||||||
|
|
||||||
|
public String getTable_mer_noticeboard_detailer() {
|
||||||
|
return table_mer_noticeboard_detailer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTable_mer_noticeboard_detailer(String table_mer_noticeboard_detailer) {
|
||||||
|
this.table_mer_noticeboard_detailer = table_mer_noticeboard_detailer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getNoticeBoardId() {
|
||||||
|
return NoticeBoardId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoticeBoardId(String NoticeBoardId) {
|
||||||
|
this.NoticeBoardId.add(NoticeBoardId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getNoticThumnail_Path() {
|
||||||
|
return NoticThumnail_Path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoticThumnail_Path(String NoticThumnail_Path) {
|
||||||
|
this.NoticThumnail_Path.add(NoticThumnail_Path);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getNoticeLink_Thumbnail() {
|
||||||
|
return NoticeLink_Thumbnail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoticeLink_Thumbnail(String NoticeLink_Thumbnail) {
|
||||||
|
this.NoticeLink_Thumbnail.add(NoticeLink_Thumbnail);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getNoticeLink_FullPage() {
|
||||||
|
return NoticeLink_FullPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoticeLink_FullPage(String NoticeLink_FullPage) {
|
||||||
|
this.NoticeLink_FullPage.add(NoticeLink_FullPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getFullPageTarget() {
|
||||||
|
return FullPageTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFullPageTarget(String FullPageTarget) {
|
||||||
|
this.FullPageTarget.add(FullPageTarget);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,6 +19,26 @@ public class TableBean {
|
|||||||
public static String MAPPING_DISPLAY_CHECKLIST;
|
public static String MAPPING_DISPLAY_CHECKLIST;
|
||||||
public static String NON_WORKING_REASON;
|
public static String NON_WORKING_REASON;
|
||||||
public static String MAPPING_PROMOTION;
|
public static String MAPPING_PROMOTION;
|
||||||
|
public static String Master_StoreList_PDA;
|
||||||
|
public static String NoticeboardData;
|
||||||
|
|
||||||
|
public static String getNoticeboardData() {
|
||||||
|
return NoticeboardData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setNoticeboardData(String noticeboardData) {
|
||||||
|
NoticeboardData = noticeboardData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getMaster_StoreList_PDA() {
|
||||||
|
return Master_StoreList_PDA;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setMaster_StoreList_PDA(String master_StoreList_PDA) {
|
||||||
|
Master_StoreList_PDA = master_StoreList_PDA;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static String getCategoryWiseSos() {
|
public static String getCategoryWiseSos() {
|
||||||
return CATEGORY_WISE_SOS;
|
return CATEGORY_WISE_SOS;
|
||||||
@@ -39,6 +59,7 @@ public class TableBean {
|
|||||||
public static String MAPPING_SUB_CATEGORY_IMAGE_ALLOW;
|
public static String MAPPING_SUB_CATEGORY_IMAGE_ALLOW;
|
||||||
public static String SKUGROUP_MASTER;
|
public static String SKUGROUP_MASTER;
|
||||||
|
|
||||||
|
|
||||||
//YSY
|
//YSY
|
||||||
public static String MAPPING_CATEGORY_IMAGE_ALLOW;
|
public static String MAPPING_CATEGORY_IMAGE_ALLOW;
|
||||||
public static String MAPPING_COUNTRYWISE_PLANOGRAM;
|
public static String MAPPING_COUNTRYWISE_PLANOGRAM;
|
||||||
@@ -55,6 +76,25 @@ public class TableBean {
|
|||||||
public static String Table_MAPPING_PLANOGRAM_STORE_WISE;
|
public static String Table_MAPPING_PLANOGRAM_STORE_WISE;
|
||||||
public static String Table_PROMOTION_TYPE_MASTER;
|
public static String Table_PROMOTION_TYPE_MASTER;
|
||||||
public static String Table_ORDER_RECEIVED_STATUS;
|
public static String Table_ORDER_RECEIVED_STATUS;
|
||||||
|
public static String Table_MASTER_DETAILER;
|
||||||
|
|
||||||
|
public static String getTable_MASTER_DETAILER() {
|
||||||
|
return Table_MASTER_DETAILER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setTable_MASTER_DETAILER(String table_MASTER_DETAILER) {
|
||||||
|
Table_MASTER_DETAILER = table_MASTER_DETAILER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String Table_Master_PDA_STORE_LIST;
|
||||||
|
|
||||||
|
public static String getTable_Master_PDA_STORE_LIST() {
|
||||||
|
return Table_Master_PDA_STORE_LIST;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setTable_Master_PDA_STORE_LIST(String table_Master_PDA_STORE_LIST) {
|
||||||
|
Table_Master_PDA_STORE_LIST = table_Master_PDA_STORE_LIST;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getTable_VISIT_TYPE_STATUS() {
|
public static String getTable_VISIT_TYPE_STATUS() {
|
||||||
return Table_VISIT_TYPE_STATUS;
|
return Table_VISIT_TYPE_STATUS;
|
||||||
@@ -66,6 +106,7 @@ public class TableBean {
|
|||||||
|
|
||||||
public static String Table_VISIT_TYPE_STATUS;
|
public static String Table_VISIT_TYPE_STATUS;
|
||||||
|
|
||||||
|
|
||||||
public static String getTable_ORDER_RECEIVED_STATUS() {
|
public static String getTable_ORDER_RECEIVED_STATUS() {
|
||||||
return Table_ORDER_RECEIVED_STATUS;
|
return Table_ORDER_RECEIVED_STATUS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.PD_CONFIGURATION;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.AdditionalQuestiongetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.AdditionalQuestiongetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||||
@@ -23,6 +24,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGe
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SKU_PRICING_ENABLEGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SKU_PRICING_ENABLEGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SOS_TARGET_MasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SOS_TARGET_MasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MasterDetailerGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingCategoryImageAllowGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingCategoryImageAllowGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingPharmaMSLGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingPharmaMSLGetterSetter;
|
||||||
@@ -33,11 +35,13 @@ import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockStorewiseGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockStorewiseGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingSubCategoryImageAllowGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingSubCategoryImageAllowGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.Master_Storelist_PDA_GetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraDataGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraDataGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraLastVisitGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraLastVisitGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.NonT2pReasonGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.NonT2pReasonGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingSubReasonGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingSubReasonGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.NoticeboardGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.Order_Received_Status_GetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.Order_Received_Status_GetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.POGQuestionGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.POGQuestionGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.PROMOTION_TYPE_MASTERGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.PROMOTION_TYPE_MASTERGetterSetter;
|
||||||
@@ -357,6 +361,7 @@ public class XMLHandlers {
|
|||||||
category.setPD_SUB_CATEGORY_CODE(xpp.nextText());
|
category.setPD_SUB_CATEGORY_CODE(xpp.nextText());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
xpp.next();
|
xpp.next();
|
||||||
}
|
}
|
||||||
} catch (XmlPullParserException e) {
|
} catch (XmlPullParserException e) {
|
||||||
@@ -1796,4 +1801,182 @@ public class XMLHandlers {
|
|||||||
return visittype;
|
return visittype;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Master_Storelist_PDA_GetterSetter Master_Storelist_PDA_XMLHandler(XmlPullParser xpp,
|
||||||
|
int eventType) {
|
||||||
|
Master_Storelist_PDA_GetterSetter masterStorelistPda = new Master_Storelist_PDA_GetterSetter();
|
||||||
|
try {
|
||||||
|
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||||
|
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||||
|
if (xpp.getName().equals("META_DATA")) {
|
||||||
|
masterStorelistPda.setTable_master_storelist_pda(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("StoreId")) {
|
||||||
|
masterStorelistPda.setStoreId(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("channel")) {
|
||||||
|
masterStorelistPda.setChannel(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("format")) {
|
||||||
|
masterStorelistPda.setFormat(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("region")) {
|
||||||
|
masterStorelistPda.setRegion(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("bay_type")) {
|
||||||
|
masterStorelistPda.setBay_type(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("no_of_bays")) {
|
||||||
|
masterStorelistPda.setNo_of_bays(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("category")) {
|
||||||
|
masterStorelistPda.setCategory(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("user_id")) {
|
||||||
|
masterStorelistPda.setUser_id(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("Active")) {
|
||||||
|
masterStorelistPda.setActive(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("ASMArea")) {
|
||||||
|
masterStorelistPda.setASMArea(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("EmployeeName")) {
|
||||||
|
masterStorelistPda.setEmployeeName(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("DesignationName")) {
|
||||||
|
masterStorelistPda.setDesignationName(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("SupervisorId")) {
|
||||||
|
masterStorelistPda.setSupervisorId(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("Supervisor")) {
|
||||||
|
masterStorelistPda.setSupervisor(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("StoreCode")) {
|
||||||
|
masterStorelistPda.setStoreCode(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("ChainId")) {
|
||||||
|
masterStorelistPda.setChainId(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("StoreTypeId")) {
|
||||||
|
masterStorelistPda.setStoreTypeId(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("SOName")) {
|
||||||
|
masterStorelistPda.setSOName(xpp.nextText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xpp.next();
|
||||||
|
}
|
||||||
|
} catch (XmlPullParserException e) {
|
||||||
|
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return masterStorelistPda;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static NoticeboardGetterSetter Noticeboard_XMLHandler(XmlPullParser xpp,
|
||||||
|
int eventType) {
|
||||||
|
NoticeboardGetterSetter noticeboardGetterSetter = new NoticeboardGetterSetter();
|
||||||
|
try {
|
||||||
|
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||||
|
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||||
|
if (xpp.getName().equals("META_DATA")) {
|
||||||
|
noticeboardGetterSetter.setTable_mer_noticeboard_detailer(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("NoticeBoardId")) {
|
||||||
|
noticeboardGetterSetter.setNoticeBoardId(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("NoticThumnail_Path")) {
|
||||||
|
noticeboardGetterSetter.setNoticThumnail_Path(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("NoticeLink_Thumbnail")) {
|
||||||
|
noticeboardGetterSetter.setNoticeLink_Thumbnail(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("NoticeLink_FullPage")) {
|
||||||
|
noticeboardGetterSetter.setNoticeLink_FullPage(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("FullPageTarget")) {
|
||||||
|
noticeboardGetterSetter.setFullPageTarget(xpp.nextText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xpp.next();
|
||||||
|
}
|
||||||
|
} catch (XmlPullParserException e) {
|
||||||
|
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return noticeboardGetterSetter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MasterDetailerGetterSetter MasterDetailer_XMLHandler(XmlPullParser xpp,
|
||||||
|
int eventType) {
|
||||||
|
MasterDetailerGetterSetter masterDetailerGetterSetter = new MasterDetailerGetterSetter();
|
||||||
|
try {
|
||||||
|
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||||
|
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||||
|
if (xpp.getName().equals("META_DATA")) {
|
||||||
|
masterDetailerGetterSetter.setTable_MASTER_DETAILER(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("DTID")) {
|
||||||
|
masterDetailerGetterSetter.setDTID(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("DT_LEVEL")) {
|
||||||
|
masterDetailerGetterSetter.setDT_LEVEL(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("DT_NAME")) {
|
||||||
|
masterDetailerGetterSetter.setDT_NAME(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("CATEGORY_ID")) {
|
||||||
|
masterDetailerGetterSetter.setCATEGORY_ID(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("DT_URL")) {
|
||||||
|
masterDetailerGetterSetter.setDT_URL(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("DT_THUMBNAIL")) {
|
||||||
|
masterDetailerGetterSetter.setDT_THUMBNAIL(xpp.nextText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xpp.next();
|
||||||
|
}
|
||||||
|
} catch (XmlPullParserException e) {
|
||||||
|
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return masterDetailerGetterSetter;
|
||||||
|
}
|
||||||
|
|
||||||
|
// JCP XML HANDLER
|
||||||
|
public static PD_CONFIGURATION PDConfigXMLHandler(XmlPullParser xpp) {
|
||||||
|
PD_CONFIGURATION jcpGetterSetter = new PD_CONFIGURATION();
|
||||||
|
|
||||||
|
try {
|
||||||
|
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||||
|
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||||
|
|
||||||
|
if (xpp.getName().equals("PROJECT_ID")) {
|
||||||
|
jcpGetterSetter.setPROJECT_ID(xpp.nextText());
|
||||||
|
}
|
||||||
|
if (xpp.getName().equals("USER_ID")) {
|
||||||
|
jcpGetterSetter.setUSER_ID(xpp.nextText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xpp.next();
|
||||||
|
}
|
||||||
|
} catch (XmlPullParserException | IOException e) {
|
||||||
|
e.fillInStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return jcpGetterSetter;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="oval">
|
||||||
|
|
||||||
|
<size
|
||||||
|
android:width="10dp"
|
||||||
|
android:height="10dp" />
|
||||||
|
|
||||||
|
<solid android:color="@color/green"/>
|
||||||
|
|
||||||
|
</shape>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user