yes_no_permission_pd

This commit is contained in:
2026-03-28 18:37:46 +05:30
parent 903b281f8c
commit aaec7b4768
627 changed files with 26611 additions and 773 deletions
+3
View File
@@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml
+554 -25
View File
@@ -51,18 +51,6 @@
<option name="screenX" value="1080" /> <option name="screenX" value="1080" />
<option name="screenY" value="2412" /> <option name="screenY" value="2412" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="35" />
<option name="brand" value="OnePlus" />
<option name="codename" value="OP5552L1" />
<option name="id" value="OP5552L1" />
<option name="labId" value="google" />
<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> <PersistentDeviceSelectionData>
<option name="api" value="34" /> <option name="api" value="34" />
<option name="brand" value="OPPO" /> <option name="brand" value="OPPO" />
@@ -100,6 +88,30 @@
<option name="screenX" value="1200" /> <option name="screenX" value="1200" />
<option name="screenY" value="1920" /> <option name="screenY" value="1920" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="samsung" />
<option name="codename" value="a03su" />
<option name="id" value="a03su" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy A03s" />
<option name="screenDensity" value="280" />
<option name="screenX" value="720" />
<option name="screenY" value="1600" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="35" />
<option name="brand" value="samsung" />
<option name="codename" value="a05s" />
<option name="id" value="a05s" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="A05s" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="35" /> <option name="api" value="35" />
<option name="brand" value="samsung" /> <option name="brand" value="samsung" />
@@ -112,6 +124,18 @@
<option name="screenX" value="720" /> <option name="screenX" value="720" />
<option name="screenY" value="1600" /> <option name="screenY" value="1600" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="a13" />
<option name="id" value="a13" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy A13" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2408" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="34" /> <option name="api" value="34" />
<option name="brand" value="samsung" /> <option name="brand" value="samsung" />
@@ -124,6 +148,30 @@
<option name="screenX" value="1080" /> <option name="screenX" value="1080" />
<option name="screenY" value="2408" /> <option name="screenY" value="2408" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="35" />
<option name="brand" value="samsung" />
<option name="codename" value="a14xmsq" />
<option name="id" value="a14xmsq" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy A14 5G" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2408" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="35" />
<option name="brand" value="samsung" />
<option name="codename" value="a14xmtfn" />
<option name="id" value="a14xmtfn" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy A14 5G" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2408" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="34" /> <option name="api" value="34" />
<option name="brand" value="samsung" /> <option name="brand" value="samsung" />
@@ -148,6 +196,30 @@
<option name="screenX" value="1080" /> <option name="screenX" value="1080" />
<option name="screenY" value="2340" /> <option name="screenY" value="2340" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="a15x" />
<option name="id" value="a15x" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="A15 5G" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="a15xtfn" />
<option name="id" value="a15xtfn" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy A15 5G" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="35" /> <option name="api" value="35" />
<option name="brand" value="samsung" /> <option name="brand" value="samsung" />
@@ -172,6 +244,66 @@
<option name="screenX" value="1080" /> <option name="screenX" value="1080" />
<option name="screenY" value="2340" /> <option name="screenY" value="2340" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="a16x" />
<option name="id" value="a16x" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="A16 5G" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="35" />
<option name="brand" value="samsung" />
<option name="codename" value="a16xeea" />
<option name="id" value="a16xeea" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="A16 5G" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="31" />
<option name="brand" value="samsung" />
<option name="codename" value="a21" />
<option name="id" value="a21" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy A21" />
<option name="screenDensity" value="300" />
<option name="screenX" value="720" />
<option name="screenY" value="1600" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="a26x" />
<option name="id" value="a26x" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="SM-A266B" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="a34x" />
<option name="id" value="a34x" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="SM-A346N" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="34" /> <option name="api" value="34" />
<option name="brand" value="samsung" /> <option name="brand" value="samsung" />
@@ -184,6 +316,30 @@
<option name="screenX" value="1080" /> <option name="screenX" value="1080" />
<option name="screenY" value="2340" /> <option name="screenY" value="2340" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="35" />
<option name="brand" value="samsung" />
<option name="codename" value="a35x" />
<option name="id" value="a35x" />
<option name="labId" value="google" />
<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="36" />
<option name="brand" value="samsung" />
<option name="codename" value="a35x" />
<option name="id" value="a35x" />
<option name="labId" value="google" />
<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> <PersistentDeviceSelectionData>
<option name="api" value="35" /> <option name="api" value="35" />
<option name="brand" value="samsung" /> <option name="brand" value="samsung" />
@@ -196,6 +352,30 @@
<option name="screenX" value="1080" /> <option name="screenX" value="1080" />
<option name="screenY" value="2340" /> <option name="screenY" value="2340" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="a36xq" />
<option name="id" value="a36xq" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="SM-A366E" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="35" />
<option name="brand" value="samsung" />
<option name="codename" value="a56x" />
<option name="id" value="a56x" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="SM-A566E" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="34" /> <option name="api" value="34" />
<option name="brand" value="google" /> <option name="brand" value="google" />
@@ -256,6 +436,30 @@
<option name="screenX" value="1440" /> <option name="screenX" value="1440" />
<option name="screenY" value="3088" /> <option name="screenY" value="3088" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="b0q" />
<option name="id" value="b0q" />
<option name="labId" value="google" />
<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="36" />
<option name="brand" value="samsung" />
<option name="codename" value="b5qsqw" />
<option name="id" value="b5qsqw" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Z Flip 5" />
<option name="screenDensity" value="340" />
<option name="screenX" value="748" />
<option name="screenY" value="720" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="34" /> <option name="api" value="34" />
<option name="brand" value="samsung" /> <option name="brand" value="samsung" />
@@ -263,11 +467,23 @@
<option name="id" value="b6q" /> <option name="id" value="b6q" />
<option name="labId" value="google" /> <option name="labId" value="google" />
<option name="manufacturer" value="Samsung" /> <option name="manufacturer" value="Samsung" />
<option name="name" value="Flip 6" /> <option name="name" value="Galaxy Z Flip 6" />
<option name="screenDensity" value="340" /> <option name="screenDensity" value="340" />
<option name="screenX" value="1080" /> <option name="screenX" value="1080" />
<option name="screenY" value="2640" /> <option name="screenY" value="2640" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="b6qsqw" />
<option name="id" value="b6qsqw" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Z Flip 6" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1080" />
<option name="screenY" value="2640" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="36" /> <option name="api" value="36" />
<option name="brand" value="google" /> <option name="brand" value="google" />
@@ -292,6 +508,18 @@
<option name="screenX" value="1080" /> <option name="screenX" value="1080" />
<option name="screenY" value="2400" /> <option name="screenY" value="2400" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="samsung" />
<option name="codename" value="c1q" />
<option name="id" value="c1q" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Note 20 5G" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="34" /> <option name="api" value="34" />
<option name="brand" value="google" /> <option name="brand" value="google" />
@@ -343,16 +571,16 @@
<option name="screenY" value="2152" /> <option name="screenY" value="2152" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="29" /> <option name="api" value="35" />
<option name="brand" value="samsung" /> <option name="brand" value="motorola" />
<option name="codename" value="crownqlteue" /> <option name="codename" value="cuscoi" />
<option name="id" value="crownqlteue" /> <option name="id" value="cuscoi" />
<option name="labId" value="google" /> <option name="labId" value="google" />
<option name="manufacturer" value="Samsung" /> <option name="manufacturer" value="Motorola" />
<option name="name" value="Galaxy Note9" /> <option name="name" value="edge 50 fusion" />
<option name="screenDensity" value="420" /> <option name="screenDensity" value="400" />
<option name="screenX" value="2220" /> <option name="screenX" value="1080" />
<option name="screenY" value="1080" /> <option name="screenY" value="2400" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="35" /> <option name="api" value="35" />
@@ -366,6 +594,30 @@
<option name="screenX" value="1080" /> <option name="screenX" value="1080" />
<option name="screenY" value="2340" /> <option name="screenY" value="2340" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="dm1q-SM-S911U" />
<option name="id" value="dm1q-SM-S911U" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="S23" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="dm1qcsx" />
<option name="id" value="dm1qcsx" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S23" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="34" /> <option name="api" value="34" />
<option name="brand" value="samsung" /> <option name="brand" value="samsung" />
@@ -415,6 +667,43 @@
<option name="screenX" value="1080" /> <option name="screenX" value="1080" />
<option name="screenY" value="2340" /> <option name="screenY" value="2340" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="e1q" />
<option name="default" value="true" />
<option name="id" value="e1q" />
<option name="labId" value="google" />
<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="36" />
<option name="brand" value="samsung" />
<option name="codename" value="e2q" />
<option name="id" value="e2q" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S24 +" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="e2s" />
<option name="id" value="e2s" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S24+" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="34" /> <option name="api" value="34" />
<option name="brand" value="samsung" /> <option name="brand" value="samsung" />
@@ -427,6 +716,42 @@
<option name="screenX" value="1440" /> <option name="screenX" value="1440" />
<option name="screenY" value="3120" /> <option name="screenY" value="3120" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="e3q" />
<option name="id" value="e3q" />
<option name="labId" value="google" />
<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="36" />
<option name="brand" value="samsung" />
<option name="codename" value="e3qcsx" />
<option name="id" value="e3qcsx" />
<option name="labId" value="google" />
<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="36" />
<option name="brand" value="samsung" />
<option name="codename" value="e3qksx" />
<option name="id" value="e3qksx" />
<option name="labId" value="google" />
<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> <PersistentDeviceSelectionData>
<option name="api" value="33" /> <option name="api" value="33" />
<option name="brand" value="google" /> <option name="brand" value="google" />
@@ -487,6 +812,18 @@
<option name="screenX" value="720" /> <option name="screenX" value="720" />
<option name="screenY" value="1600" /> <option name="screenY" value="1600" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="motorola" />
<option name="codename" value="fogorow" />
<option name="id" value="fogorow" />
<option name="labId" value="google" />
<option name="manufacturer" value="Motorola" />
<option name="name" value="moto g24" />
<option name="screenDensity" value="280" />
<option name="screenX" value="720" />
<option name="screenY" value="1612" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="34" /> <option name="api" value="34" />
<option name="brand" value="motorola" /> <option name="brand" value="motorola" />
@@ -523,6 +860,30 @@
<option name="screenX" value="1080" /> <option name="screenX" value="1080" />
<option name="screenY" value="2340" /> <option name="screenY" value="2340" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="g0q" />
<option name="id" value="g0q" />
<option name="labId" value="google" />
<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="33" />
<option name="brand" value="motorola" />
<option name="codename" value="gnevan" />
<option name="id" value="gnevan" />
<option name="labId" value="google" />
<option name="manufacturer" value="Motorola" />
<option name="name" value="moto g stylus (2023)" />
<option name="screenDensity" value="280" />
<option name="screenX" value="720" />
<option name="screenY" value="1600" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="34" /> <option name="api" value="34" />
<option name="brand" value="samsung" /> <option name="brand" value="samsung" />
@@ -621,6 +982,18 @@
<option name="screenX" value="1008" /> <option name="screenX" value="1008" />
<option name="screenY" value="2244" /> <option name="screenY" value="2244" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="35" />
<option name="brand" value="google" />
<option name="codename" value="husky" />
<option name="id" value="husky" />
<option name="labId" value="google" />
<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> <PersistentDeviceSelectionData>
<option name="api" value="30" /> <option name="api" value="30" />
<option name="brand" value="motorola" /> <option name="brand" value="motorola" />
@@ -669,6 +1042,18 @@
<option name="screenX" value="1008" /> <option name="screenX" value="1008" />
<option name="screenY" value="2244" /> <option name="screenY" value="2244" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="35" />
<option name="brand" value="motorola" />
<option name="codename" value="lamul" />
<option name="id" value="lamul" />
<option name="labId" value="google" />
<option name="manufacturer" value="Motorola" />
<option name="name" value="moto g05" />
<option name="screenDensity" value="280" />
<option name="screenX" value="720" />
<option name="screenY" value="1604" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="34" /> <option name="api" value="34" />
<option name="brand" value="motorola" /> <option name="brand" value="motorola" />
@@ -753,6 +1138,18 @@
<option name="screenX" value="1080" /> <option name="screenX" value="1080" />
<option name="screenY" value="2400" /> <option name="screenY" value="2400" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="35" />
<option name="brand" value="samsung" />
<option name="codename" value="o1q" />
<option name="id" value="o1q" />
<option name="labId" value="google" />
<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> <PersistentDeviceSelectionData>
<option name="api" value="31" /> <option name="api" value="31" />
<option name="brand" value="google" /> <option name="brand" value="google" />
@@ -765,6 +1162,42 @@
<option name="screenX" value="1080" /> <option name="screenX" value="1080" />
<option name="screenY" value="2400" /> <option name="screenY" value="2400" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="35" />
<option name="brand" value="samsung" />
<option name="codename" value="p3q" />
<option name="id" value="p3q" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S21 Ultra" />
<option name="screenDensity" value="600" />
<option name="screenX" value="1440" />
<option name="screenY" value="3200" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="pa2q" />
<option name="id" value="pa2q" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="S25+" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="pa2qxxx" />
<option name="id" value="pa2qxxx" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S25+" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="35" /> <option name="api" value="35" />
<option name="brand" value="samsung" /> <option name="brand" value="samsung" />
@@ -773,9 +1206,21 @@
<option name="labId" value="google" /> <option name="labId" value="google" />
<option name="manufacturer" value="Samsung" /> <option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S25 Ultra" /> <option name="name" value="Galaxy S25 Ultra" />
<option name="screenDensity" value="600" /> <option name="screenDensity" value="450" />
<option name="screenX" value="1440" /> <option name="screenX" value="1080" />
<option name="screenY" value="3120" /> <option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="pa3q" />
<option name="id" value="pa3q" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S25 Ultra" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="33" /> <option name="api" value="33" />
@@ -825,6 +1270,18 @@
<option name="screenX" value="1856" /> <option name="screenX" value="1856" />
<option name="screenY" value="2160" /> <option name="screenY" value="2160" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="r0qcsx" />
<option name="id" value="r0qcsx" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="S22" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="30" /> <option name="api" value="30" />
<option name="brand" value="google" /> <option name="brand" value="google" />
@@ -851,6 +1308,54 @@
<option name="screenX" value="1080" /> <option name="screenX" value="1080" />
<option name="screenY" value="2340" /> <option name="screenY" value="2340" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="r11s" />
<option name="id" value="r11s" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="SM-S711N" />
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="samsung" />
<option name="codename" value="r8q" />
<option name="id" value="r8q" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S20 FE 5G" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="r9q" />
<option name="id" value="r9q" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S21 FE 5G" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="r9q-SM-G990U" />
<option name="id" value="r9q-SM-G990U" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S21 FE 5G" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData> <PersistentDeviceSelectionData>
<option name="api" value="36" /> <option name="api" value="36" />
<option name="brand" value="google" /> <option name="brand" value="google" />
@@ -899,6 +1404,18 @@
<option name="screenX" value="1080" /> <option name="screenX" value="1080" />
<option name="screenY" value="2400" /> <option name="screenY" value="2400" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="35" />
<option name="brand" value="samsung" />
<option name="codename" value="t2q" />
<option name="id" value="t2q" />
<option name="labId" value="google" />
<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> <PersistentDeviceSelectionData>
<option name="api" value="33" /> <option name="api" value="33" />
<option name="brand" value="google" /> <option name="brand" value="google" />
@@ -975,6 +1492,18 @@
<option name="screenX" value="1080" /> <option name="screenX" value="1080" />
<option name="screenY" value="2408" /> <option name="screenY" value="2408" />
</PersistentDeviceSelectionData> </PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="samsung" />
<option name="codename" value="y2q" />
<option name="id" value="y2q" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="S20 Plus 5G" />
<option name="screenDensity" value="600" />
<option name="screenX" value="1440" />
<option name="screenY" value="3200" />
</PersistentDeviceSelectionData>
</list> </list>
</option> </option>
</component> </component>
+13
View File
@@ -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>
+1 -1
View File
@@ -6,7 +6,7 @@
<GradleProjectSettings> <GradleProjectSettings>
<option name="testRunner" value="CHOOSE_PER_TEST" /> <option name="testRunner" value="CHOOSE_PER_TEST" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="17" /> <option name="gradleJvm" value="jbr-21" />
<option name="modules"> <option name="modules">
<set> <set>
<option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$" />
+8 -1
View File
@@ -43,10 +43,17 @@
</option> </option>
</component> </component>
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="ms-17" project-jdk-type="JavaSDK"> <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.16609374999999998" />
</ProjectState>
</option>
</component>
</project> </project>
+2 -4
View File
@@ -26,13 +26,12 @@ android {
minSdkVersion 26 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 38 versionCode 39
versionName "4.9" versionName "5.0"
//For UAE //For UAE
/*versionCode 29 /*versionCode 29
versionName "4.1"*/ versionName "4.1"*/
@@ -146,7 +145,6 @@ dependencies {
implementation 'com.google.code.gson:gson:2.11.0' implementation 'com.google.code.gson:gson:2.11.0'
implementation 'com.github.bumptech.glide:glide:4.16.0' implementation 'com.github.bumptech.glide:glide:4.16.0'
implementation platform('com.google.firebase:firebase-bom:33.14.0') implementation platform('com.google.firebase:firebase-bom:33.14.0')
implementation 'com.google.firebase:firebase-crashlytics' implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-messaging' implementation 'com.google.firebase:firebase-messaging'
+2 -2
View File
@@ -11,8 +11,8 @@
"type": "SINGLE", "type": "SINGLE",
"filters": [], "filters": [],
"attributes": [], "attributes": [],
"versionCode": 38, "versionCode": 39,
"versionName": "4.9", "versionName": "5.0",
"outputFile": "GSKMTOrange-release.apk" "outputFile": "GSKMTOrange-release.apk"
} }
], ],
+60
View File
@@ -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"
}
]
}
@@ -2829,15 +2829,19 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
public void deleteStockEntryMainTable(String storeid, String categoryid) { public void deleteStockEntryMainTable(String storeid, String categoryid) {
try { try {
db.delete(CommonString.TABLE_INSERT_STOCK_ADDITIONAL_MAIN, "Store_Id" + "='" + storeid + "'AND categoryId" + "='" + categoryid + "'", null); db.delete(CommonString.TABLE_INSERT_STOCK_ADDITIONAL_MAIN, "Store_Id" + "='" + storeid + "'AND categoryId" + "='" + categoryid + "'", null);
db.delete(CommonString.TABLE_INSERT_STOCK_DIALOG_MAIN, "Store_Id" + "='" + storeid + "'AND categoryId" + "='" + categoryid + "'", null); db.delete(CommonString.TABLE_INSERT_STOCK_DIALOG_MAIN, "Store_Id" + "='" + storeid + "'AND categoryId" + "='" + categoryid + "'", null);
} catch (Exception e) { } catch (Exception e) {
System.out.println("" + e); System.out.println("" + e);
} }
}
public void deletePdImagedata(String storeid, String categoryid) {
try {
db.delete(CommonString.TABLE_IRPD, "STORE_ID" + "='" + storeid + "'AND CATEGORY_ID" + "='" + categoryid + "'", null);
} catch (Exception e) {
System.out.println("" + e);
}
} }
@@ -4549,7 +4553,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
if (dbcursor != null) { if (dbcursor != null) {
dbcursor.moveToFirst(); dbcursor.moveToFirst();
String value = dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IRPD_IMAGES)); String value = dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IRPD_IMAGES));
if (value != null && !value.isEmpty()) { String value2 = dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_TOGGLE_VALUE));
if (value != null && !value.isEmpty() || value2.equals("0")){
filled = true; filled = true;
} }
dbcursor.close(); dbcursor.close();
@@ -4771,7 +4776,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
Cursor dbcursor = null; Cursor dbcursor = null;
try { try {
if (key_account_id != null) { if (key_account_id != null) {
dbcursor = db.rawQuery("SELECT DISTINCT ifnull(T.IRPD_IMAGES,'')as IRPD_IMAGES,ifnull(T.IRPD_IMAGES_MODIFY,'')as IRPD_IMAGES_MODIFY, ifnull(SB.PD_SUB_CATEGORY_CODE,'')AS PD_SUB_CATEGORY_CODE,SB.SUB_CATEGORY_ID, MIA.IMAGE_ALLOW,SB.SUB_CATEGORY FROM " dbcursor = db.rawQuery("SELECT DISTINCT ifnull(T.IRPD_IMAGES,'')as IRPD_IMAGES,ifnull(T.IRPD_IMAGES_MODIFY,'')as IRPD_IMAGES_MODIFY, ifnull(SB.PD_SUB_CATEGORY_CODE,'')AS PD_SUB_CATEGORY_CODE,ifnull(T.TOGGLE_VALUE,'1')AS TOGGLE_VALUE,SB.SUB_CATEGORY_ID, MIA.IMAGE_ALLOW,SB.SUB_CATEGORY FROM "
+ tableName + " M INNER JOIN SKU_MASTER SK ON M.SKU_ID = SK.SKU_ID" + + tableName + " M INNER JOIN SKU_MASTER SK ON M.SKU_ID = SK.SKU_ID" +
" INNER JOIN BRAND_MASTER BR ON SK.BRAND_ID = BR.BRAND_ID" + " INNER JOIN BRAND_MASTER BR ON SK.BRAND_ID = BR.BRAND_ID" +
" INNER JOIN SUB_CATEGORY_MASTER SB ON BR.SUB_CATEGORY_ID = SB.SUB_CATEGORY_ID" + " INNER JOIN SUB_CATEGORY_MASTER SB ON BR.SUB_CATEGORY_ID = SB.SUB_CATEGORY_ID" +
@@ -4784,7 +4789,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
"' AND M.CLASS_ID = '" + class_id + "' AND CA.CATEGORY_ID = '" + categoryId + "'", null); "' AND M.CLASS_ID = '" + class_id + "' AND CA.CATEGORY_ID = '" + categoryId + "'", null);
} else { } else {
dbcursor = db.rawQuery("SELECT DISTINCT ifnull(T.IRPD_IMAGES,'')as IRPD_IMAGES,ifnull(T.IRPD_IMAGES_MODIFY,'')as IRPD_IMAGES_MODIFY,ifnull(SB.PD_SUB_CATEGORY_CODE,'')AS PD_SUB_CATEGORY_CODE,SB.SUB_CATEGORY_ID, MIA.IMAGE_ALLOW,SB.SUB_CATEGORY FROM MAPPING_STOCK_STOREWISE M INNER JOIN SKU_MASTER SK ON M.SKU_ID = SK.SKU_ID" + dbcursor = db.rawQuery("SELECT DISTINCT ifnull(T.IRPD_IMAGES,'')as IRPD_IMAGES,ifnull(T.IRPD_IMAGES_MODIFY,'')as IRPD_IMAGES_MODIFY,ifnull(SB.PD_SUB_CATEGORY_CODE,'')AS PD_SUB_CATEGORY_CODE,SB.SUB_CATEGORY_ID,ifnull(T.TOGGLE_VALUE,'1')AS TOGGLE_VALUE, MIA.IMAGE_ALLOW,SB.SUB_CATEGORY FROM MAPPING_STOCK_STOREWISE M INNER JOIN SKU_MASTER SK ON M.SKU_ID = SK.SKU_ID" +
" INNER JOIN BRAND_MASTER BR ON SK.BRAND_ID = BR.BRAND_ID" + " INNER JOIN BRAND_MASTER BR ON SK.BRAND_ID = BR.BRAND_ID" +
" INNER JOIN SUB_CATEGORY_MASTER SB ON BR.SUB_CATEGORY_ID = SB.SUB_CATEGORY_ID" + " INNER JOIN SUB_CATEGORY_MASTER SB ON BR.SUB_CATEGORY_ID = SB.SUB_CATEGORY_ID" +
" INNER JOIN CATEGORY_MASTER CA ON SB.CATEGORY_ID = CA.CATEGORY_ID" + " INNER JOIN CATEGORY_MASTER CA ON SB.CATEGORY_ID = CA.CATEGORY_ID" +
@@ -4824,7 +4829,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
} }
CPGS.setImageUris(imageUriList); CPGS.setImageUris(imageUriList);
CPGS.setToggle_value(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_TOGGLE_VALUE)));
CPGS.setSubCategoryCamera1(""); CPGS.setSubCategoryCamera1("");
CPGS.setSubCategoryCamera2(""); CPGS.setSubCategoryCamera2("");
list.add(CPGS); list.add(CPGS);
@@ -10694,6 +10699,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
"SELECT DISTINCT SB.SUB_CATEGORY_ID, SB.SUB_CATEGORY, " + "SELECT DISTINCT SB.SUB_CATEGORY_ID, SB.SUB_CATEGORY, " +
"IFNULL(BR.PD_SUB_CATEGORY_CODE, '') AS PD_SUB_CATEGORY_CODE, " + "IFNULL(BR.PD_SUB_CATEGORY_CODE, '') AS PD_SUB_CATEGORY_CODE, " +
"IFNULL(T.IRPD_VISIBILITY_IMAGES, '') AS IRPD_VISIBILITY_IMAGES, " + "IFNULL(T.IRPD_VISIBILITY_IMAGES, '') AS IRPD_VISIBILITY_IMAGES, " +
"IFNULL(T.TOGGLE_VALUE, '1') AS TOGGLE_VALUE, " +
"IFNULL(T.IRPD_VISIBILITY_IMAGES_MODIFY, '') AS IRPD_VISIBILITY_IMAGES_MODIFY " + "IFNULL(T.IRPD_VISIBILITY_IMAGES_MODIFY, '') AS IRPD_VISIBILITY_IMAGES_MODIFY " +
"FROM STOCK_DIALOG_MAIN SB " + "FROM STOCK_DIALOG_MAIN SB " +
"INNER JOIN SUB_CATEGORY_MASTER BR ON SB.SUB_CATEGORY_ID = BR.SUB_CATEGORY_ID " + "INNER JOIN SUB_CATEGORY_MASTER BR ON SB.SUB_CATEGORY_ID = BR.SUB_CATEGORY_ID " +
@@ -10731,6 +10737,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
imageUriList.add(new ImageUri(uri, modifyUri)); imageUriList.add(new ImageUri(uri, modifyUri));
} }
CPGS.setImageUris(imageUriList); CPGS.setImageUris(imageUriList);
CPGS.setToggle_value(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_TOGGLE_VALUE)));
CPGS.setSubCategoryCamera1(""); CPGS.setSubCategoryCamera1("");
CPGS.setSubCategoryCamera2(""); CPGS.setSubCategoryCamera2("");
list.add(CPGS); list.add(CPGS);
@@ -10792,7 +10799,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
public long InsertPdImageData( public long InsertPdImageData(
String visit_date, String storeId, String categoryId, List<CategoryPictureGetterSetter> _list,String savemode) { String visit_date, String storeId, String categoryId, List<CategoryPictureGetterSetter> _list,String toggle,String savemode) {
ContentValues values = new ContentValues(); ContentValues values = new ContentValues();
long l = 0; long l = 0;
try { try {
@@ -10805,6 +10812,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
values.put(CommonString.KEY_SAVE_MODE, savemode); values.put(CommonString.KEY_SAVE_MODE, savemode);
values.put(CommonString.KEY_STORE_ID, storeId); values.put(CommonString.KEY_STORE_ID, storeId);
values.put(CommonString.KEY_VISIT_DATE, visit_date); values.put(CommonString.KEY_VISIT_DATE, visit_date);
values.put("toggle_value", toggle);
values.put(CommonString.KEY_CATEGORY_ID, categoryId);
values.put(CommonString.KEY_CATEGORY_ID, categoryId); values.put(CommonString.KEY_CATEGORY_ID, categoryId);
values.put(CommonString.KEY_SUB_CATEGORY_ID, _list.get(i).getSUB_CATEGORY_ID()); values.put(CommonString.KEY_SUB_CATEGORY_ID, _list.get(i).getSUB_CATEGORY_ID());
values.put(CommonString.KEY_SUB_CATEGORY_CODE, _list.get(i).getSubCatCode()); values.put(CommonString.KEY_SUB_CATEGORY_CODE, _list.get(i).getSubCatCode());
@@ -10854,7 +10863,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
} }
public long InsertPdImageVisibilityData( public long InsertPdImageVisibilityData(
String visit_date, String storeId, String categoryId, List<CategoryPictureGetterSetter> _list,String savemode) { String visit_date, String storeId, String categoryId, List<CategoryPictureGetterSetter> _list,String toggle,String savemode) {
ContentValues values = new ContentValues(); ContentValues values = new ContentValues();
long l = 0; long l = 0;
try { try {
@@ -10866,6 +10875,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
for (int i = 0; i < _list.size(); i++) { for (int i = 0; i < _list.size(); i++) {
values.put(CommonString.KEY_SAVE_MODE, savemode); values.put(CommonString.KEY_SAVE_MODE, savemode);
values.put(CommonString.KEY_STORE_ID, storeId); values.put(CommonString.KEY_STORE_ID, storeId);
values.put(CommonString.KEY_TOGGLE_VALUE, toggle);
values.put(CommonString.KEY_VISIT_DATE, visit_date); values.put(CommonString.KEY_VISIT_DATE, visit_date);
values.put(CommonString.KEY_CATEGORY_ID, categoryId); values.put(CommonString.KEY_CATEGORY_ID, categoryId);
values.put(CommonString.KEY_SUB_CATEGORY_ID, _list.get(i).getSUB_CATEGORY_ID()); values.put(CommonString.KEY_SUB_CATEGORY_ID, _list.get(i).getSUB_CATEGORY_ID());
@@ -11088,6 +11098,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
cd.setSUB_CATEGORY_ID(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_SUB_CATEGORY_ID))); cd.setSUB_CATEGORY_ID(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_SUB_CATEGORY_ID)));
cd.setSubCatCode(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_SUB_CATEGORY_CODE))); cd.setSubCatCode(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_SUB_CATEGORY_CODE)));
cd.setSubCategoryCamera2(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IRPD_MODIFY_IMAGES))); cd.setSubCategoryCamera2(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IRPD_MODIFY_IMAGES)));
cd.setToggle_value(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_TOGGLE_VALUE)));
String imgs = dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IRPD_IMAGES)); String imgs = dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IRPD_IMAGES));
cd.setImageUris(imgs != null && !imgs.isEmpty() ? (ArrayList<ImageUri>) Arrays.stream(imgs.split(", ")) cd.setImageUris(imgs != null && !imgs.isEmpty() ? (ArrayList<ImageUri>) Arrays.stream(imgs.split(", "))
@@ -11128,6 +11139,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
.collect(Collectors.toList()) : new ArrayList<>()); .collect(Collectors.toList()) : new ArrayList<>());
cd.setSubCategoryCamera1(imgs); cd.setSubCategoryCamera1(imgs);
cd.setToggle_value(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_TOGGLE_VALUE)));
list.add(cd); list.add(cd);
dbcursor.moveToNext(); dbcursor.moveToNext();
} }
@@ -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 = "";
new GeoTagUpload(GeoTagActivity.this).execute(); if(isInternetAvailable(context)){
new GeoTagUpload(GeoTagActivity.this).execute();
}
else{
Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
}
} else { } else {
@@ -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() {
@@ -94,6 +94,7 @@ import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
import static android.Manifest.permission.READ_CONTACTS; import static android.Manifest.permission.READ_CONTACTS;
import static com.google.android.gms.location.LocationRequest.Builder.IMPLICIT_MIN_UPDATE_INTERVAL; 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 {
@@ -450,7 +451,12 @@ 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 {
new AuthenticateTask().execute(); if(isInternetAvailable(context)){
new AuthenticateTask().execute();
}
else{
Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
}
} }
} }
@@ -464,7 +470,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
if (!u_id.equals("") && !userid.equalsIgnoreCase(u_id)) { if (!u_id.equals("") && !userid.equalsIgnoreCase(u_id)) {
flag = false; flag = false;
} }
return flag; return flag;
} }
@@ -673,7 +678,12 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
runOnUiThread(() -> { runOnUiThread(() -> {
// TODO Auto-generated method stub // TODO Auto-generated method stub
if (counter < 3) { if (counter < 3) {
new AuthenticateTask().execute(); if(isInternetAvailable(context)){
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;
@@ -892,7 +902,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)
@@ -973,7 +982,6 @@ 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() {
@@ -1004,26 +1012,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
@@ -1125,7 +1114,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
} }
} }
} }
//return ; //return ;
} }
} }
@@ -1,27 +1,30 @@
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.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 com.crashlytics.android.Crashlytics;
@@ -32,12 +35,22 @@ import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat; 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.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.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator;
import com.google.gson.Gson;
import org.json.JSONObject;
import java.io.File; import java.io.File;
import java.io.InputStream;
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,6 +65,7 @@ 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.PharmaActivity;
@@ -65,6 +79,10 @@ public class MainActivity extends AppCompatActivity
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<>();
String date; String date;
String app_ver; String app_ver;
private SharedPreferences preferences = null; private SharedPreferences preferences = null;
@@ -75,6 +93,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")
@@ -83,19 +102,62 @@ 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);
webView.setWebViewClient(new MyWebViewClient()); webView.setWebViewClient(new MyWebViewClient());
webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setJavaScriptEnabled(true);
String json = loadJSONFromAsset();
Gson gson = new Gson();
NoticeResponse response = gson.fromJson(json, NoticeResponse.class);
List<NoticeItem> list = response.getMer_NoticeBoard();
Log.d("listdata", String.valueOf(list.size()));
setupDots(list.size());
viewPager.setAdapter(new NoticeAdapter(list, item -> handleClick(item)));
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);
// TabLayout tabLayout = findViewById(R.id.tabDots);
/*new TabLayoutMediator(tabLayout, viewPager,
(tab, position) -> {
// no title, just dots
}
).attach();*/
if (!url.isEmpty()) { if (!url.isEmpty()) {
webView.loadUrl(url); webView.loadUrl(url);
} }
@@ -122,6 +184,148 @@ 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 = item.getNoticeLink_FullPage();
String type = item.getFullPageTarget();
if (type == null) return;
switch (type.toLowerCase()) {
case "html-webview":
Intent webIntent = new Intent(this, WebViewActivity.class);
webIntent.putExtra("url", url);
webIntent.putExtra("type", item.getFullPageTarget());
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());
startActivity(videoIntent);
break;
case "image":
Intent imageIntent = new Intent(this, WebViewActivity.class);
imageIntent.putExtra("url", url);
imageIntent.putExtra("type", item.getFullPageTarget());
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();
@@ -131,6 +335,7 @@ 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 { try {
app_ver = String.valueOf(getPackageManager().getPackageInfo(getPackageName(), 0).versionName); app_ver = String.valueOf(getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
// login_version.setText("Parinaam Version " + app_ver); // login_version.setText("Parinaam Version " + app_ver);
@@ -223,6 +428,30 @@ 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() {
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
@@ -377,7 +606,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);
@@ -502,4 +731,57 @@ 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);
Glide.with(holder.itemView.getContext())
.load(item.getNoticeLink_Thumbnail())
.into(holder.image);
holder.itemView.setOnClickListener(v -> {
if (listener != null) {
listener.onClick(item);
}
});
}
@Override
public int getItemCount() {
return list != null ? list.size() : 0;
}
}
} }
@@ -0,0 +1,22 @@
package cpm.com.gskmtorange;
import java.util.List;
public class NoticeResponse {
List<NoticeItem> Mer_NoticeBoard;
public List<NoticeItem> getMer_NoticeBoard() {
return Mer_NoticeBoard;
}
}
class NoticeItem {
int NoticeBoardId;
String NoticeLink_Thumbnail;
String NoticeLink_FullPage;
String FullPageTarget;
public String getNoticeLink_Thumbnail() { return NoticeLink_Thumbnail; }
public String getNoticeLink_FullPage() { return NoticeLink_FullPage; }
public String getFullPageTarget() { return FullPageTarget; }
}
@@ -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;
} }
@@ -211,4 +209,28 @@ 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);
}
} }
@@ -1556,6 +1556,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
@@ -1576,6 +1577,8 @@ public class CommonString {
+ " VARCHAR," + " VARCHAR,"
+ KEY_IRPD_MODIFY_IMAGES + KEY_IRPD_MODIFY_IMAGES
+ " VARCHAR," + " VARCHAR,"
+ KEY_TOGGLE_VALUE
+ " VARCHAR,"
+ KEY_IRPD_IMAGES + KEY_IRPD_IMAGES
+ " VARCHAR)"; + " VARCHAR)";
@@ -1625,6 +1628,8 @@ public class CommonString {
+ " VARCHAR," + " VARCHAR,"
+ KEY_IRPD_VISIBILITY_MODIFY_IMAGES + KEY_IRPD_VISIBILITY_MODIFY_IMAGES
+ " VARCHAR," + " VARCHAR,"
+ KEY_TOGGLE_VALUE
+ " VARCHAR,"
+ KEY_IRPD_VISIBILITY_IMAGES + KEY_IRPD_VISIBILITY_IMAGES
+ " VARCHAR)"; + " VARCHAR)";
@@ -270,14 +270,12 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
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")) {
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);
} 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();
} }
@@ -390,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);
@@ -524,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();
@@ -556,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() {
@@ -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
@@ -1,5 +1,7 @@
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;
@@ -16,12 +18,9 @@ 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.util.ArrayList; import java.util.ArrayList;
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;
@@ -30,6 +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.upload.UploadActivity;
import cpm.com.gskmtorange.utils.OkHttpTransportSE;
public class CheckoutActivity extends AppCompatActivity { public class CheckoutActivity extends AppCompatActivity {
private Context context; private Context context;
@@ -64,7 +65,12 @@ public class CheckoutActivity extends AppCompatActivity {
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);
new BackgroundTask(CheckoutActivity.this).execute(); if(isInternetAvailable(context)){
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> {
@@ -113,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();
@@ -11,6 +11,7 @@ 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 android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
@@ -56,6 +57,7 @@ class PDVisibilityActivity : AppCompatActivity() {
var listdat: ArrayList<CategoryPictureGetterSetter>? = ArrayList() var listdat: ArrayList<CategoryPictureGetterSetter>? = ArrayList()
var masterStoreListPd: ArrayList<Master_Storelist_PDA_GetterSetter>? = 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: ActivityPdvisibilityBinding private lateinit var binding: ActivityPdvisibilityBinding
private var adapter: SubCatPdAdapter? = null private var adapter: SubCatPdAdapter? = null
@@ -120,7 +122,19 @@ class PDVisibilityActivity : AppCompatActivity() {
"DataSaved", "did-receive-queue-data", "did-receive-image-upload-status" "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 { binding.apply {
fab.setOnClickListener { fab.setOnClickListener {
if (validate()) { if (validate()) {
@@ -134,6 +148,7 @@ class PDVisibilityActivity : AppCompatActivity() {
store_id, store_id,
categoryId, categoryId,
listdat, listdat,
toggle,
CommonString.KEY_COMPELETE CommonString.KEY_COMPELETE
)?.let { )?.let {
if (it > 0) { if (it > 0) {
@@ -170,12 +185,16 @@ class PDVisibilityActivity : AppCompatActivity() {
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
@@ -349,7 +368,7 @@ class PDVisibilityActivity : AppCompatActivity() {
db?.open() db?.open()
listdat = db?.getirVisibilityData(date,store_id,categoryId) listdat = db?.getirVisibilityData(date,store_id,categoryId)
Log.d("listdatsize", listdat?.size.toString()) // Log.d("listdatsize", listdat?.size.toString() +","+listdat?.get(0)?.toggle_value)
adapter = SubCatPdAdapter( adapter = SubCatPdAdapter(
category = categoryName, category = categoryName,
context = this, context = this,
@@ -357,12 +376,6 @@ class PDVisibilityActivity : AppCompatActivity() {
btnlistener = object : SubCatPdAdapter.BtnClickListener { btnlistener = object : SubCatPdAdapter.BtnClickListener {
override fun onStartSessionClick(_pos: Int, data: CategoryPictureGetterSetter) { override fun onStartSessionClick(_pos: Int, data: CategoryPictureGetterSetter) {
this@PDVisibilityActivity._pos = _pos this@PDVisibilityActivity._pos = _pos
/* if (isNetworkAvailable(this@PDVisibilityActivity)) {
launchCamera(data.subCatCode,data.suB_CATEGORY,data.suB_CATEGORY_ID)
Log.d("subCatCode", data.subCatCode)
} else {
Toast.makeText(context, "No internet connection", Toast.LENGTH_SHORT).show()
}*/
launchCamera(data.subCatCode,data.suB_CATEGORY,data.suB_CATEGORY_ID) launchCamera(data.subCatCode,data.suB_CATEGORY,data.suB_CATEGORY_ID)
} }
}) })
@@ -371,12 +384,22 @@ class PDVisibilityActivity : AppCompatActivity() {
recyclerViewSubCat.layoutManager = LinearLayoutManager(this@PDVisibilityActivity) recyclerViewSubCat.layoutManager = LinearLayoutManager(this@PDVisibilityActivity)
adapter?.addsubCatItems(listdat) 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() { override fun onPause() {
super.onPause() super.onPause()
db?.open() db?.open()
if (!db!!.isPdVisibility(store_id, date, CommonString.KEY_COMPELETE, categoryId)) { if (!db!!.isPdVisibility(store_id, date, CommonString.KEY_COMPELETE, categoryId)) {
db?.InsertPdImageVisibilityData(date, store_id, categoryId, listdat, CommonString.KEY_DRAFT) db?.InsertPdImageVisibilityData(date, store_id, categoryId, listdat,toggle, CommonString.KEY_DRAFT)
} }
} }
fun isNetworkAvailable(context: Context): Boolean { fun isNetworkAvailable(context: Context): Boolean {
@@ -197,77 +197,6 @@ class PD_Realtime_Report : AppCompatActivity() {
} }
} }
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());
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() { private fun callAdapter() {
if (country_id == "8") { if (country_id == "8") {
db?.open() db?.open()
@@ -9,6 +9,7 @@ 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.net.toUri import androidx.core.net.toUri
@@ -43,6 +44,7 @@ class PDimageActivity : AppCompatActivity() {
var store_id: String? = null; var store_id: String? = null;
var date: String? = null; var date: String? = null;
var lang: 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
@@ -53,6 +55,7 @@ class PDimageActivity : AppCompatActivity() {
var listdat: ArrayList<CategoryPictureGetterSetter>? = ArrayList() var listdat: ArrayList<CategoryPictureGetterSetter>? = ArrayList()
var masterStoreListPd: ArrayList<Master_Storelist_PDA_GetterSetter>? = 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
@@ -101,10 +104,24 @@ class PDimageActivity : AppCompatActivity() {
masterStoreListPd = db?.getMasterStoreListPd(store_id,CommonString.TABLE_MASTER_STORELIST_PD) masterStoreListPd = db?.getMasterStoreListPd(store_id,CommonString.TABLE_MASTER_STORELIST_PD)
// Log.d("master_store_list_size",masterStoreListPd.toString()) // 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 -> preferences?.getString(CommonString.KEY_PD_PROJECT_Id, "")?.let { projectId ->
val userId = preferences?.getString(CommonString.KEY_PD_USER_Id, "") userId = preferences?.getString(CommonString.KEY_PD_USER_Id, "")
.takeIf { !it.isNullOrBlank() } ?: username .takeIf { !it.isNullOrBlank() } ?: username
Log.d("pd_user_id",userId.toString()); // Log.d("pd_user_id",userId.toString());
CommonUtils.initializePDSDK( CommonUtils.initializePDSDK(
this@PDimageActivity, this@PDimageActivity,
@@ -112,7 +129,6 @@ class PDimageActivity : AppCompatActivity() {
_userId = userId _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"
@@ -132,6 +148,7 @@ class PDimageActivity : AppCompatActivity() {
store_id, store_id,
categoryId, categoryId,
listdat, listdat,
toggle,
CommonString.KEY_COMPELETE CommonString.KEY_COMPELETE
)?.let { )?.let {
if (it > 0) { if (it > 0) {
@@ -173,12 +190,17 @@ class PDimageActivity : AppCompatActivity() {
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
@@ -289,54 +311,13 @@ class PDimageActivity : AppCompatActivity() {
put("StoreTypeId", masterstorelistpddata?.storeTypeId?.getOrNull(0) ?: "NA") put("StoreTypeId", masterstorelistpddata?.storeTypeId?.getOrNull(0) ?: "NA")
put("SOName", masterstorelistpddata?.soName?.getOrNull(0) ?: "NA") put("SOName", masterstorelistpddata?.soName?.getOrNull(0) ?: "NA")
} }
/* val uploadParams = JSONObject(
"""
{
"shop_id": 62475,
"store_name": "abc",
"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": $devicename,"User_name": $username,
"StoreId":${masterstorelistpddata?.storeId?.get(0)},
"channel":${masterstorelistpddata?.channel?.get(0)},
"format":${masterstorelistpddata?.format?.get(0)},
"region":${masterstorelistpddata?.region?.get(0)},
"bay_type":"NA",
"no_of_bays":"NA",
"category":${masterstorelistpddata?.category?.get(0)},
"user_id":$username,
"Active":${masterstorelistpddata?.active?.get(0)},
"ASMArea":"NA",
"EmployeeName":${masterstorelistpddata?.employeeName?.get(0)},
"DesignationName":${masterstorelistpddata?.designationName?.get(0)},
"SupervisorId":${masterstorelistpddata?.supervisorId?.get(0)},
"Supervisor":${masterstorelistpddata?.supervisor?.get(0)},
"StoreCode":${masterstorelistpddata?.storeCode?.get(0)},
"ChainId":${masterstorelistpddata?.chainId?.get(0)},
"StoreTypeId":${masterstorelistpddata?.storeTypeId?.get(0)},
"SOName":${masterstorelistpddata?.soName?.get(0)}
}
"""
)*/
val uploadParams = JSONObject().apply { val uploadParams = JSONObject().apply {
put("shop_id", store_id) put("shop_id", store_id)
put("project_id", preferences?.getString(CommonString.KEY_PD_PROJECT_Id, "")) put("project_id", preferences?.getString(CommonString.KEY_PD_PROJECT_Id, ""))
put("shelf_type", "Primary Shelf") put("shelf_type", "Primary Shelf")
put("category_id", subCat_code) put("category_id", subCat_code)
put("user_id", username) put("user_id", userId)
// put("user_id", userId)
put("metadata", metadata) put("metadata", metadata)
} }
@@ -421,7 +402,6 @@ class PDimageActivity : AppCompatActivity() {
CommonString.TABLE_MAPPING_STOCK CommonString.TABLE_MAPPING_STOCK
) )
} }
adapter = SubCatPdAdapter( adapter = SubCatPdAdapter(
category = categoryName, category = categoryName,
context = this, context = this,
@@ -433,17 +413,27 @@ class PDimageActivity : AppCompatActivity() {
} }
}) })
binding.rlContent.apply { binding.rlContent.apply {
recyclerViewSubCat.adapter = adapter recyclerViewSubCat.adapter = adapter
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()
if (!db!!.isSOSCategory(store_id, date, CommonString.KEY_COMPELETE, categoryId)) { if (!db!!.isSOSCategory(store_id, date, CommonString.KEY_COMPELETE, categoryId)) {
db?.InsertPdImageData(date, store_id, categoryId, listdat, CommonString.KEY_DRAFT) db?.InsertPdImageData(date, store_id, categoryId, listdat,toggle, CommonString.KEY_DRAFT)
} }
} }
} }
@@ -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;
@@ -477,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);
@@ -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;
@@ -708,101 +710,153 @@ 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() {
@Override
public void onClick(View v) {
store_id = current.getSTORE_ID();
store_facing_hide = current.getFACING_HIDE();
storeCurrentObj = current;
viewHolder.parent_layout.setOnClickListener(new View.OnClickListener() { if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_U) || current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_UN)) {
@Override Snackbar.make(v, R.string.title_store_list_activity_store_already_done, Snackbar.LENGTH_LONG).setAction("Action", null).show();
public void onClick(View v) { }
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();
} else if (current.getCHECKOUT_STATUS().equalsIgnoreCase(CommonString.KEY_Y)) {
store_id = current.getSTORE_ID(); Snackbar.make(v, R.string.title_store_list_activity_store_already_checkout, Snackbar.LENGTH_LONG).setAction("Action", null).show();
store_facing_hide = current.getFACING_HIDE(); }
storeCurrentObj = current; 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();
} 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();
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.STORE_STATUS_LEAVE)) {
Snackbar.make(v, R.string.title_store_list_activity_already_store_closed, Snackbar.LENGTH_LONG).setAction("Action", null).show();
} else if (checkleavestatus(store_id)) {
if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_U) || current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_UN)) { Snackbar.make(v, R.string.title_store_list_activity_already_store_closed, 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)) {
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)) {
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)) {
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)) {
Snackbar.make(v, R.string.title_store_list_activity_store_closed, Snackbar.LENGTH_LONG).setAction("Action", null).show();
} else if (current.getUPLOAD_STATUS().equalsIgnoreCase(CommonString.STORE_STATUS_LEAVE)) {
Snackbar.make(v, R.string.title_store_list_activity_already_store_closed, Snackbar.LENGTH_LONG).setAction("Action", null).show();
} else if (checkleavestatus(store_id)) {
Snackbar.make(v, R.string.title_store_list_activity_already_store_closed, Snackbar.LENGTH_LONG).setAction("Action", null).show();
} else {
// PUT IN PREFERENCES
if (checkotherCheckedIn(store_flag_str)) {
Snackbar.make(v, getString(R.string.title_store_list_checkout_current) + " - " + from_checkedIn, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
} else { } else {
if (!setCheckedMethod(store_id)) { // PUT IN PREFERENCES
boolean enteryflag = true; if (checkotherCheckedIn(store_flag_str)) {
if (coverage.size() > 0) { Snackbar.make(v, getString(R.string.title_store_list_checkout_current) + " - " + from_checkedIn, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
int i; } else {
for (i = 0; i < coverage.size(); i++) { if (!setCheckedMethod(store_id)) {
boolean enteryflag = true;
if (coverage.size() > 0) {
int i;
for (i = 0; i < coverage.size(); i++) {
if (coverage.get(i).getInTime() != null) { if (coverage.get(i).getInTime() != null) {
if (coverage.get(i).getOutTime() == null) { if (coverage.get(i).getOutTime() == null) {
if (!store_id.equals(coverage.get(i).getStoreId())) { if (!store_id.equals(coverage.get(i).getStoreId())) {
Snackbar.make(v, R.string.title_store_list_checkout_current, Snackbar.LENGTH_SHORT).setAction("Action", null).show(); Snackbar.make(v, R.string.title_store_list_checkout_current, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
enteryflag = false; enteryflag = false;
}
break;
} }
break;
} }
} }
} }
}
if (enteryflag) { if (enteryflag) {
if (store_flag_str.equals(CommonString.FROM_PHARMA) && coverageObj.getStatus() != null && coverageObj.getStatus().equalsIgnoreCase(CommonString.KEY_VALID)) { if (store_flag_str.equals(CommonString.FROM_PHARMA) && coverageObj.getStatus() != null && coverageObj.getStatus().equalsIgnoreCase(CommonString.KEY_VALID)) {
Snackbar.make(v, R.string.title_store_list_checkout_Already_filled, Snackbar.LENGTH_SHORT).setAction("Action", null).show(); Snackbar.make(v, R.string.title_store_list_checkout_Already_filled, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
} /*if((store_flag_str.equals(CommonString.FROM_ADDITIONAL_ADHOC) || store_flag_str.equals(CommonString.FROM_ADDITIONAL)) && coverageObj.getStatus()!=null && coverageObj.getStatus().equalsIgnoreCase(CommonString.KEY_VALID)){ } /*if((store_flag_str.equals(CommonString.FROM_ADDITIONAL_ADHOC) || store_flag_str.equals(CommonString.FROM_ADDITIONAL)) && coverageObj.getStatus()!=null && coverageObj.getStatus().equalsIgnoreCase(CommonString.KEY_VALID)){
Snackbar.make(v, R.string.title_store_list_checkout_Already_filled, Snackbar.LENGTH_SHORT).setAction("Action", null).show(); Snackbar.make(v, R.string.title_store_list_checkout_Already_filled, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
}*/ else if (store_flag_str.equals(CommonString.FROM_JCP) || store_flag_str.equals(CommonString.FROM_PHARMA) || store_flag_str.equals(CommonString.FROM_ADDITIONAL_ADHOC) || store_flag_str.equals(CommonString.FROM_ADDITIONAL)) { }*/ else if (store_flag_str.equals(CommonString.FROM_JCP) || store_flag_str.equals(CommonString.FROM_PHARMA) || store_flag_str.equals(CommonString.FROM_ADDITIONAL_ADHOC) || store_flag_str.equals(CommonString.FROM_ADDITIONAL)) {
showMyDialog(store_id, current.getSTORE_NAME(), "Yes", current.getVISIT_DATE(), current.getCHECKOUT_STATUS(), current.getGEO_TAG(), current); showMyDialog(store_id, current.getSTORE_NAME(), "Yes", current.getVISIT_DATE(), current.getCHECKOUT_STATUS(), current.getGEO_TAG(), current);
} else { } else {
if (country_id.equalsIgnoreCase("5") || country_id.equalsIgnoreCase("15") || country_id.equalsIgnoreCase("2") || country_id.equalsIgnoreCase(CommonString.COUNTRY_ID_EGYPT + "")) { if (country_id.equalsIgnoreCase("5") || country_id.equalsIgnoreCase("15") || country_id.equalsIgnoreCase("2") || country_id.equalsIgnoreCase(CommonString.COUNTRY_ID_EGYPT + "")) {
if (!current.getGEO_TAG().equalsIgnoreCase("N")) { if (!current.getGEO_TAG().equalsIgnoreCase("N")) {
boolean flag = true; boolean flag = true;
if (coverage.size() > 0) { if (coverage.size() > 0) {
for (int i = 0; i < coverage.size(); i++) { for (int i = 0; i < coverage.size(); i++) {
if (store_id.equals(coverage.get(i).getStoreId())) { if (store_id.equals(coverage.get(i).getStoreId())) {
flag = false; flag = false;
break; break;
}
} }
} }
} boolean flag_entry = true;
boolean flag_entry = true; int distance = 0;
int distance = 0; //geo fencing enabled only if GEO_FENCING equals 1 for COUNTRY_ID
//geo fencing enabled only if GEO_FENCING equals 1 for COUNTRY_ID if (flag && geoFencingGetterSetters.size() > 0 && geoFencingGetterSetters.get(0).getGEO_FENCING().get(0).equals("1")) {
if (flag && geoFencingGetterSetters.size() > 0 && geoFencingGetterSetters.get(0).getGEO_FENCING().get(0).equals("1")) { distanceGeoPhence = Integer.parseInt(geoFencingGetterSetters.get(0).getDISTANCE_MTR().get(0));
distanceGeoPhence = Integer.parseInt(geoFencingGetterSetters.get(0).getDISTANCE_MTR().get(0));
double store_lat = Double.parseDouble(current.getLATITUDE()); double store_lat = Double.parseDouble(current.getLATITUDE());
double store_lon = Double.parseDouble(current.getLONGITUDE()); double store_lon = Double.parseDouble(current.getLONGITUDE());
if (store_lat != 0.0 && store_lon != 0.0) { if (store_lat != 0.0 && store_lon != 0.0) {
distance = distFrom(store_lat, store_lon, lat, lon); distance = distFrom(store_lat, store_lon, lat, lon);
if (distance > distanceGeoPhence) { if (distance > distanceGeoPhence) {
flag_entry = false; flag_entry = false;
} else {
String msg = getString(R.string.distance_from_the_store) + " " + distance + " meters";
Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
}
}
}
if (flag_entry) {
// Log.e("flag_entrydata","flagdata");
editor = preferences.edit();
editor.putString(CommonString.KEY_STORE_FLAG, store_flag_str);
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_NAME, current.getSTORE_NAME());
editor.putString(CommonString.KEY_VISIT_DATE, current.getVISIT_DATE());
editor.putString(CommonString.KEY_CAMERA_ALLOW, current.getCAMERA_ALLOW());
editor.putString(CommonString.KEY_CHECKOUT_STATUS, current.getCHECKOUT_STATUS());
editor.putString(CommonString.KEY_EMP_ID, current.getEMP_ID());
editor.putString(CommonString.KEY_GEO_TAG, current.getGEO_TAG());
editor.putString(CommonString.KEY_KEYACCOUNT_ID, current.getKEYACCOUNT_ID());
editor.putString(CommonString.KEY_STORETYPE_ID, current.getSTORETYPE_ID());
editor.putString(CommonString.KEY_CLASS_ID, current.getCLASS_ID());
editor.putString(CommonString.KEY_POG_TYPE_ID, current.getPOG_TYPE_ID());
editor.putString(CommonString.KEY_UPLOAD_STATUS, current.getUPLOAD_STATUS());
editor.commit();
if (!coverageObj.getStatus().equalsIgnoreCase("N")) {
//if(db.isFilledAdhoc(store_id, visit_date)){
Intent in = new Intent(StoreListActivity.this, StoreWisePerformanceActivity.class);
startActivity(in);
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
} else { } else {
String msg = getString(R.string.distance_from_the_store) + " " + distance + " meters"; if(isInternetAvailable(context)){
Toast.makeText(context, msg, Toast.LENGTH_SHORT).show(); new UploadTask(StoreListActivity.this, store_id).execute();
}
else{
Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
}
} }
} } 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);
//dialog.cancel();
AlertDialog.Builder builder = new AlertDialog.Builder(StoreListActivity.this);
builder.setTitle(getResources().getString(R.string.dialog_title));
builder.setMessage(msg).setCancelable(false).setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog1, int id) {
dialog1.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
}
} else {
if (flag_entry) {
// Log.e("flag_entrydata","flagdata");
editor = preferences.edit(); editor = preferences.edit();
editor.putString(CommonString.KEY_STORE_FLAG, store_flag_str); editor.putString(CommonString.KEY_STORE_FLAG, store_flag_str);
editor.putString(CommonString.KEY_STORE_FLAG_FACING_HIDE, current.getFACING_HIDE()); editor.putString(CommonString.KEY_STORE_FLAG_FACING_HIDE, current.getFACING_HIDE());
@@ -811,85 +865,46 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
editor.putString(CommonString.KEY_VISIT_DATE, current.getVISIT_DATE()); editor.putString(CommonString.KEY_VISIT_DATE, current.getVISIT_DATE());
editor.putString(CommonString.KEY_CAMERA_ALLOW, current.getCAMERA_ALLOW()); editor.putString(CommonString.KEY_CAMERA_ALLOW, current.getCAMERA_ALLOW());
editor.putString(CommonString.KEY_CHECKOUT_STATUS, current.getCHECKOUT_STATUS()); editor.putString(CommonString.KEY_CHECKOUT_STATUS, current.getCHECKOUT_STATUS());
editor.putString(CommonString.KEY_CLASS_ID, current.getCLASS_ID());
editor.putString(CommonString.KEY_EMP_ID, current.getEMP_ID()); editor.putString(CommonString.KEY_EMP_ID, current.getEMP_ID());
editor.putString(CommonString.KEY_GEO_TAG, current.getGEO_TAG()); editor.putString(CommonString.KEY_GEO_TAG, current.getGEO_TAG());
editor.putString(CommonString.KEY_KEYACCOUNT_ID, current.getKEYACCOUNT_ID()); editor.putString(CommonString.KEY_KEYACCOUNT_ID, current.getKEYACCOUNT_ID());
editor.putString(CommonString.KEY_STORETYPE_ID, current.getSTORETYPE_ID()); editor.putString(CommonString.KEY_STORETYPE_ID, current.getSTORETYPE_ID());
editor.putString(CommonString.KEY_CLASS_ID, current.getCLASS_ID());
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)){
if (!coverageObj.getStatus().equalsIgnoreCase("N")) {
//if(db.isFilledAdhoc(store_id, visit_date)){
Intent in = new Intent(StoreListActivity.this, StoreWisePerformanceActivity.class);
startActivity(in);
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
} else {
new UploadTask(StoreListActivity.this, store_id).execute(); new UploadTask(StoreListActivity.this, store_id).execute();
} }
} 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); Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
}
//dialog.cancel(); //dialog.cancel();
AlertDialog.Builder builder = new AlertDialog.Builder(StoreListActivity.this);
builder.setTitle(getResources().getString(R.string.dialog_title));
builder.setMessage(msg).setCancelable(false).setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog1, int id) {
dialog1.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
} }
} else { } else {
if (coverageObj.getStatus().equals("N")) {
editor = preferences.edit(); Intent in = new Intent(StoreListActivity.this, StoreimageActivity.class);
editor.putString(CommonString.KEY_STORE_FLAG, store_flag_str); in.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
editor.putString(CommonString.KEY_STORE_FLAG_FACING_HIDE, current.getFACING_HIDE()); in.putExtra(CommonString.KEY_STORE_ID, store_id);
editor.putString(CommonString.KEY_STORE_ID, current.getSTORE_ID()); in.putExtra(CommonString.KEY_STORE_FLAG_FACING_HIDE, store_facing_hide);
editor.putString(CommonString.KEY_STORE_NAME, current.getSTORE_NAME()); startActivity(in);
editor.putString(CommonString.KEY_VISIT_DATE, current.getVISIT_DATE()); overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
editor.putString(CommonString.KEY_CAMERA_ALLOW, current.getCAMERA_ALLOW()); } else {
editor.putString(CommonString.KEY_CHECKOUT_STATUS, current.getCHECKOUT_STATUS()); Snackbar.make(v, R.string.title_store_list_checkout_Already_filled, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
editor.putString(CommonString.KEY_CLASS_ID, current.getCLASS_ID()); }
editor.putString(CommonString.KEY_EMP_ID, current.getEMP_ID());
editor.putString(CommonString.KEY_GEO_TAG, current.getGEO_TAG());
editor.putString(CommonString.KEY_KEYACCOUNT_ID, current.getKEYACCOUNT_ID());
editor.putString(CommonString.KEY_STORETYPE_ID, current.getSTORETYPE_ID());
editor.putString(CommonString.KEY_POG_TYPE_ID, current.getPOG_TYPE_ID());
editor.putString(CommonString.KEY_UPLOAD_STATUS, current.getUPLOAD_STATUS());
editor.commit();
new UploadTask(StoreListActivity.this, store_id).execute();
//dialog.cancel();
}
} else {
if (coverageObj.getStatus().equals("N")) {
Intent in = new Intent(StoreListActivity.this, StoreimageActivity.class);
in.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
in.putExtra(CommonString.KEY_STORE_ID, store_id);
in.putExtra(CommonString.KEY_STORE_FLAG_FACING_HIDE, store_facing_hide);
startActivity(in);
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
} else {
Snackbar.make(v, R.string.title_store_list_checkout_Already_filled, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
} }
} }
} }
} else {
Snackbar.make(v, R.string.title_store_list_checkout_Already_filled, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
} }
} else {
Snackbar.make(v, R.string.title_store_list_checkout_Already_filled, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
} }
} }
} }
} });
});
viewHolder.imgview_navigation.setOnClickListener(new View.OnClickListener() { viewHolder.imgview_navigation.setOnClickListener(new View.OnClickListener() {
@Override @Override
@@ -912,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) {
@@ -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;
@@ -333,21 +336,11 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
@Override @Override
protected void onStop() { protected void onStop() {
super.onStop(); super.onStop();
// ATTENTION: This was auto-generated to implement the App Indexing API.
// 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
@@ -537,7 +530,12 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
database.updateCheckoutStatus(store_id, status, table); database.updateCheckoutStatus(store_id, status, table);
new GeoTagUpload(StoreimageActivity.this).execute(); if(isInternetAvailable(context)){
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() {
@@ -802,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(
@@ -1,24 +1,52 @@
package cpm.com.gskmtorange.dailyentry package cpm.com.gskmtorange.dailyentry
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Dialog import android.content.Intent
import android.graphics.BitmapFactory
import android.graphics.drawable.Drawable
import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.os.Message import android.provider.MediaStore
import android.util.Base64
import android.util.Log import android.util.Log
import android.view.ViewGroup import android.view.View
import android.webkit.* 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 android.widget.ImageView
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import com.bumptech.glide.request.target.ViewTarget
import cpm.com.gskmtorange.databinding.ActivityWebviewBinding import cpm.com.gskmtorange.databinding.ActivityWebviewBinding
import org.json.JSONObject
class WebViewActivity : AppCompatActivity() { class WebViewActivity : AppCompatActivity() {
private lateinit var binding: ActivityWebviewBinding private lateinit var binding: ActivityWebviewBinding
var toolbar: Toolbar? = null
private lateinit var type : String
@SuppressLint("SetJavaScriptEnabled") @SuppressLint("SetJavaScriptEnabled")
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
binding = ActivityWebviewBinding.inflate(layoutInflater) binding = ActivityWebviewBinding.inflate(layoutInflater)
setContentView(binding.root) setContentView(binding.root)
val url = intent.getStringExtra("url") ?: "" val url = intent.getStringExtra("url") ?: ""
// Configure WebView settings type = intent.getStringExtra("type") ?: "html-webview"
type = intent.getStringExtra("type") ?: "html-webview"
handleContent(type, url)
binding.toolbar.setTitle("Banner Detail")
setSupportActionBar(binding.toolbar)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
/* // ✅ SETTINGS
with(binding.webView.settings) { with(binding.webView.settings) {
javaScriptEnabled = true javaScriptEnabled = true
domStorageEnabled = true domStorageEnabled = true
@@ -27,104 +55,374 @@ class WebViewActivity : AppCompatActivity() {
loadWithOverviewMode = true loadWithOverviewMode = true
useWideViewPort = true useWideViewPort = true
mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW
// ✅ Force desktop mode by dynamically modifying user-agent
val defaultUA = WebSettings.getDefaultUserAgent(this@WebViewActivity)
val desktopUA = defaultUA.replace("Mobile", "").replace("Android", "").trim()
userAgentString = desktopUA
Log.d("UserAgent", "Final User-Agent: $desktopUA")
} }
// Keep navigation inside WebView // ✅ JS INTERFACE
binding.webView.addJavascriptInterface(WebAppInterface(), "Android")
// ✅ WEBVIEW CLIENT
binding.webView.webViewClient = object : WebViewClient() { binding.webView.webViewClient = object : WebViewClient() {
override fun shouldOverrideUrlLoading(
view: WebView?, override fun onPageStarted(view: WebView?, url: String?, favicon: android.graphics.Bitmap?) {
request: WebResourceRequest? super.onPageStarted(view, url, favicon)
): Boolean { injectJS(view) // 🔥 early injection
return false
} }
override fun onPageFinished(view: WebView?, url: String?) { override fun onPageFinished(view: WebView?, url: String?) {
super.onPageFinished(view, url) super.onPageFinished(view, url)
// Inject JS to simulate mouseover/mouseenter on tap injectJS(view) // 🔥 safe injection again
view?.evaluateJavascript(
"""
(function() {
function findAncestorWithAttr(el, attr) {
while (el && el !== document.body) {
if (el.hasAttribute && el.hasAttribute(attr)) {
return el;
}
el = el.parentElement;
} }
return null;
} }
document.addEventListener('touchend', function(e) { // ✅ JS LOGS
var point = e.changedTouches[0];
var el = document.elementFromPoint(point.clientX, point.clientY);
var target = findAncestorWithAttr(el, 'data-annotation-id') || el;
console.log('Touch at element:', target.getAttribute('data-annotation-id') || target.className);
function dispatchMouseEvent(type) {
var event = new MouseEvent(type, {
view: window,
bubbles: true,
cancelable: true,
clientX: point.clientX,
clientY: point.clientY
});
target.dispatchEvent(event);
}
dispatchMouseEvent('mouseover');
dispatchMouseEvent('mouseenter');
dispatchMouseEvent('mousemove');
target.click();
});
})();
""".trimIndent(), null
)
}
}
// Handle JS dialogs, popups, and log console messages
binding.webView.webChromeClient = object : WebChromeClient() { binding.webView.webChromeClient = object : WebChromeClient() {
@SuppressLint("SetJavaScriptEnabled") override fun onConsoleMessage(consoleMessage: ConsoleMessage?): Boolean {
override fun onCreateWindow( Log.e("JS_LOG", consoleMessage?.message() ?: "")
view: WebView?,
isDialog: Boolean,
isUserGesture: Boolean,
resultMsg: Message?
): Boolean {
val popupWebView = WebView(this@WebViewActivity)
popupWebView.settings.javaScriptEnabled = true
popupWebView.settings.domStorageEnabled = true
val dialog = Dialog(this@WebViewActivity)
dialog.setContentView(popupWebView)
dialog.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
dialog.show()
popupWebView.webViewClient = object : WebViewClient() {
override fun onPageFinished(view: WebView?, url: String?) {
super.onPageFinished(view, url)
}
}
val transport = resultMsg?.obj as WebView.WebViewTransport
transport.webView = popupWebView
resultMsg.sendToTarget()
return true return true
} }
} }
binding.webView.loadUrl(url)
*/
}
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) {
val uri = Uri.parse(url)
binding.videoView.setVideoURI(uri)
val controller = android.widget.MediaController(this)
controller.setAnchorView(binding.videoView)
binding.videoView.setMediaController(controller)
binding.videoView.start()
}
@SuppressLint("SetJavaScriptEnabled")
private fun setupWebView(url: String) {
with(binding.webView.settings) {
javaScriptEnabled = true
domStorageEnabled = true
javaScriptCanOpenWindowsAutomatically = true
setSupportMultipleWindows(true)
loadWithOverviewMode = true
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?) {
injectJS(view)
}
override fun onPageFinished(view: WebView?, url: String?) {
injectJS(view)
}
}
binding.webView.webChromeClient = object : WebChromeClient() {
override fun onConsoleMessage(consoleMessage: ConsoleMessage?): Boolean {
Log.e("JS_LOG", consoleMessage?.message() ?: "")
return true
}
}
// Load URL
binding.webView.loadUrl(url) binding.webView.loadUrl(url)
} }
// 🔥 JS INJECTION (RN BRIDGE + FIXES)
private fun injectJS(view: WebView?) {
view?.evaluateJavascript(
"""
(function() {
console.log("🔥 JS INJECTED");
// ✅ 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()
}
}
} }
@@ -1,5 +1,7 @@
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;
@@ -37,6 +39,7 @@ import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.R; import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonFunctions; import cpm.com.gskmtorange.constant.CommonFunctions;
import cpm.com.gskmtorange.constant.CommonString; import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.dailyentry.StoreListActivity;
import cpm.com.gskmtorange.utils.OkHttpTransportSE; import cpm.com.gskmtorange.utils.OkHttpTransportSE;
import cpm.com.gskmtorange.utils.TLSSocketFactory; import cpm.com.gskmtorange.utils.TLSSocketFactory;
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
@@ -167,7 +170,13 @@ public class DownloadActivity extends AppCompatActivity {
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);
new UploadTask(DownloadActivity.this).execute(); if(isInternetAvailable(context)){
new UploadTask(DownloadActivity.this).execute();
}
else{
Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
}
} }
private void checkTLSVersion() { private void checkTLSVersion() {
@@ -1914,6 +1923,8 @@ public class DownloadActivity extends AppCompatActivity {
} }
if (order_received_status_getterSetter.getSTORE_ID().size() > 0) { if (order_received_status_getterSetter.getSTORE_ID().size() > 0) {
// if (masterStorelistPdaGetterSetter.getStoreId().size() > 0) {
Log.d("mastetpdadata","download");
data.value = 99; data.value = 99;
data.name = "Master_StoreList_PDA" + getResources().getString(R.string.download_data); data.name = "Master_StoreList_PDA" + getResources().getString(R.string.download_data);
} else { } else {
@@ -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;
@@ -119,10 +113,10 @@ public class ServiceActivityFragment extends Fragment {
public void onClick(View v) { public void onClick(View v) {
Fragment nextFrag= mItem.getFragment(); Fragment nextFrag= mItem.getFragment();
if(position==0){ if(position==0){
showExportDialog(); showExportDialog();
// restoreBackup(); // restoreBackup();
} }
/* else if(position==1){ /* else if(position==1){
File f = new File(CommonString.getImagesFolder(context)); File f = new File(CommonString.getImagesFolder(context));
@@ -257,7 +251,7 @@ public class ServiceActivityFragment extends Fragment {
String backupDBPath = "GSKMT_ORANGE_Database_backup" + "_"+username+"_"+ visit_date.replace("/", "") + "_" + String backupDBPath = "GSKMT_ORANGE_Database_backup" + "_"+username+"_"+ visit_date.replace("/", "") + "_" +
CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") ; CommonFunctions.getCurrentTimeWithLanguage(getActivity()).replace(":", "") ;
// String path = Environment.getExternalStorageDirectory().getPath()+ "/gsk_orange_backup"; // String path = Environment.getExternalStorageDirectory().getPath()+ "/gsk_orange_backup";
String path = CommonString.getBackupFolder(context); String path = CommonString.getBackupFolder(context);
File currentDB = new File(data, currentDBPath); File currentDB = new File(data, currentDBPath);
@@ -277,14 +271,14 @@ public class ServiceActivityFragment extends Fragment {
} }
//usk //usk
// File dir = new File(CommonString.BACKUP_PATH); // File dir = new File(CommonString.BACKUP_PATH);
File dir = new File(CommonString.getBackupFolder(context)); File dir = new File(CommonString.getBackupFolder(context));
ArrayList<String> list = new ArrayList(); ArrayList<String> list = new ArrayList();
list = getFileNames(dir.listFiles()); list = getFileNames(dir.listFiles());
if (list.size() > 0) { if (list.size() > 0) {
for (int i1 = 0; i1 < list.size(); i1++) { for (int i1 = 0; i1 < list.size(); i1++) {
if (list.get(i1).contains("GSKMT_ORANGE_Database_backup")) { if (list.get(i1).contains("GSKMT_ORANGE_Database_backup")) {
// File originalFile = new File(CommonString.BACKUP_PATH + list.get(i1)); // File originalFile = new File(CommonString.BACKUP_PATH + list.get(i1));
Object result = uploadBackup(getActivity(), list.get(i1), "DBBackup"); Object result = uploadBackup(getActivity(), list.get(i1), "DBBackup");
if (result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) { if (result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
Toast.makeText(getActivity(), getString(R.string.databasexported), Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), getString(R.string.databasexported), Toast.LENGTH_SHORT).show();
@@ -296,9 +290,9 @@ public class ServiceActivityFragment extends Fragment {
} catch (Exception e) { } catch (Exception e) {
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString()); // Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
// Crashlytics.logException(e.getCause()); // Crashlytics.logException(e.getCause());
// Crashlytics.logException(new Exception(e.getCause())); // Crashlytics.logException(new Exception(e.getCause()));
System.out.println(e.getMessage()); System.out.println(e.getMessage());
} }
} }
@@ -357,8 +351,8 @@ public class ServiceActivityFragment extends Fragment {
@Override @Override
public void onFailure(Throwable t) { public void onFailure(Throwable t) {
// Crashlytics.logException(t); // Crashlytics.logException(t);
// Crashlytics.logException(new Exception(t.getCause())); // Crashlytics.logException(new Exception(t.getCause()));
isvalid = true; isvalid = true;
if (t instanceof UnknownHostException) { if (t instanceof UnknownHostException) {
@@ -71,6 +71,7 @@ public class CategoryListActivity extends AppCompatActivity {
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, ""); storeType_id = preferences.getString(CommonString.KEY_STORETYPE_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);
Log.d("countrydata",country_id);
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, "");
preferences.getString(CommonString.KEY_VISIT_ID, ""); preferences.getString(CommonString.KEY_VISIT_ID, "");
@@ -106,14 +107,11 @@ public class CategoryListActivity extends AppCompatActivity {
int imageRes = getImageRes(flag_filled, category_id); int imageRes = getImageRes(flag_filled, category_id);
categoryList.get(i).setCategory_img(imageRes); categoryList.get(i).setCategory_img(imageRes);
} }
adapter = new CategoryListAdapter(this, categoryList); adapter = new CategoryListAdapter(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) { private int getImageRes(boolean flag_filled, String category_id) {
@@ -388,7 +386,7 @@ public class CategoryListActivity extends AppCompatActivity {
} else { } else {
isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION); isMappingPromotion_Flag = db.isMappingPromotionData(store_id, category_id, CommonString.TABLE_MAPPING_PROMOTION);
} }
if (isMappingPromotion_Flag) { if (isMappingPromotion_Flag ) {
if (!db.checkPromoComplianceData(store_id, category_id)) { if (!db.checkPromoComplianceData(store_id, category_id)) {
flag_filled = false; flag_filled = false;
break; break;
@@ -540,7 +538,6 @@ public class CategoryListActivity extends AppCompatActivity {
private boolean isCategoryComplete(String category_id) { private boolean isCategoryComplete(String category_id) {
boolean flag_filled = true; boolean flag_filled = true;
if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) { if (store_flag_str.equalsIgnoreCase(CommonString.FROM_ADDITIONAL)) {
flag_filled = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id, flag_filled = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id,
CommonString.TABLE_MAPPING_STOCK_ADDITIONAL) CommonString.TABLE_MAPPING_STOCK_ADDITIONAL)
@@ -598,6 +595,25 @@ public class CategoryListActivity extends AppCompatActivity {
return false; 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 // POG Upload
if (!db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).isEmpty() if (!db.getSubCategoryMasterForPOG(category_id, storeType_id, pog_type_id, null).isEmpty()
&& db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).isEmpty()) { && db.getAfterSavePOGUploadQuestionAnswerData(store_id, category_id).isEmpty()) {
@@ -614,11 +630,14 @@ public class CategoryListActivity extends AppCompatActivity {
} }
} }
// Order Taking for country 15 // Order Taking for country 15
if (country_id.equals("15") && !db.checkOrder_taking_Data(store_id, category_id)) { if (country_id.equals("15") && !db.checkOrder_taking_Data(store_id, category_id)) {
return false; return false;
} }
// IR-PD Image Check // IR-PD Image Check
ArrayList<CategoryPictureGetterSetter> irList = isPdIRMapping(category_id); ArrayList<CategoryPictureGetterSetter> irList = isPdIRMapping(category_id);
if (irList != null && !irList.isEmpty() && camera_allow.equals("1")) { if (irList != null && !irList.isEmpty() && camera_allow.equals("1")) {
@@ -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);
@@ -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;
@@ -61,7 +63,6 @@ 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;
@@ -86,6 +87,8 @@ 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.dailyentry.CheckoutActivity;
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.xmlHandlers.XMLHandlers; import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
@@ -108,9 +111,9 @@ public class MPinActivity extends AppCompatActivity implements BlurLockView.OnPa
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
@@ -342,7 +345,13 @@ public class MPinActivity extends AppCompatActivity implements BlurLockView.OnPa
userId = preferences.getString(CommonString.KEY_USERNAME, ""); userId = preferences.getString(CommonString.KEY_USERNAME, "");
password = preferences.getString(CommonString.KEY_PASSWORD, ""); password = preferences.getString(CommonString.KEY_PASSWORD, "");
new AuthenticateTask().execute(); if(isInternetAvailable(context)){
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();
} }
@@ -480,7 +489,7 @@ public class MPinActivity extends AppCompatActivity implements BlurLockView.OnPa
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true; envelope.dotNet = true;
envelope.setOutputSoapObject(request); envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL); OkHttpTransportSE androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_LOGIN, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION_LOGIN, envelope);
Object result = (Object) envelope.getResponse(); Object result = (Object) envelope.getResponse();
@@ -519,7 +528,7 @@ public class MPinActivity extends AppCompatActivity implements BlurLockView.OnPa
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true; envelope.dotNet = true;
envelope.setOutputSoapObject(request); envelope.setOutputSoapObject(request);
androidHttpTransport = new HttpTransportSE(CommonString.URL); androidHttpTransport = new OkHttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope); androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
result = envelope.getResponse(); result = envelope.getResponse();
xpp.setInput(new StringReader(result.toString())); xpp.setInput(new StringReader(result.toString()));
@@ -565,7 +574,12 @@ public class MPinActivity extends AppCompatActivity implements BlurLockView.OnPa
runOnUiThread(() -> { runOnUiThread(() -> {
// TODO Auto-generated method stub // TODO Auto-generated method stub
if (counter < 3) { if (counter < 3) {
new AuthenticateTask().execute(); if(isInternetAvailable(context)){
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;
@@ -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() {
} }
@@ -31,24 +22,24 @@ public class StringConverterFactory implements Converter.Factory {
} }
class StringConverter implements Converter<String> { class StringConverter implements Converter<String> {
private static final MediaType PLAIN_TEXT = MediaType.parse("text/plain; charset=UTF-8"); private static final MediaType PLAIN_TEXT = MediaType.parse("text/plain; charset=UTF-8");
@Override @Override
public String fromBody(ResponseBody body) throws IOException { public String fromBody(ResponseBody body) throws IOException {
return new String(body.bytes()); return new String(body.bytes());
} }
@Override @Override
public RequestBody toBody(String value) { public RequestBody toBody(String value) {
return RequestBody.create(PLAIN_TEXT, convertToBytes(value)); return RequestBody.create(PLAIN_TEXT, convertToBytes(value));
} }
private static byte[] convertToBytes(String string) { private static byte[] convertToBytes(String string) {
try { try {
return string.getBytes("UTF-8"); return string.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} }
} }
@@ -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,6 +16,8 @@ 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 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;
@@ -43,6 +47,7 @@ import cpm.com.gskmtorange.GetterSetter.StoreBean;
import cpm.com.gskmtorange.R; import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonFunctions; import cpm.com.gskmtorange.constant.CommonFunctions;
import cpm.com.gskmtorange.constant.CommonString; import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.password.MPinActivity;
import cpm.com.gskmtorange.utils.OkHttpTransportSE; 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;
@@ -117,7 +122,13 @@ 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
new UploadTask(this).execute(); if(isInternetAvailable(context)){
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 {
@@ -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;
@@ -11,6 +13,7 @@ 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 androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
@@ -30,6 +33,7 @@ import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
import cpm.com.gskmtorange.GetterSetter.CoachingVisitGetterSetter; import cpm.com.gskmtorange.GetterSetter.CoachingVisitGetterSetter;
import cpm.com.gskmtorange.GetterSetter.CoverageBean; import cpm.com.gskmtorange.GetterSetter.CoverageBean;
import cpm.com.gskmtorange.GetterSetter.StoreBean; import cpm.com.gskmtorange.GetterSetter.StoreBean;
import cpm.com.gskmtorange.LoginActivity;
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;
@@ -112,7 +116,13 @@ public class UploadActivity extends AppCompatActivity {
Path = CommonString.getImagesFolder(context); Path = CommonString.getImagesFolder(context);
//start upload //start upload
new UploadTask(this).execute(); if(isInternetAvailable(context)){
new UploadTask(this).execute();
}
else{
Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
}
} }
class Data { class Data {
@@ -140,7 +150,6 @@ public class UploadActivity extends AppCompatActivity {
percentage = (TextView) dialog.findViewById(R.id.percentage); percentage = (TextView) dialog.findViewById(R.id.percentage);
message = (TextView) dialog.findViewById(R.id.message); message = (TextView) dialog.findViewById(R.id.message);
((TextView) dialog.findViewById(R.id.tv_title)).setText(getString(R.string.uploaddata)); ((TextView) dialog.findViewById(R.id.tv_title)).setText(getString(R.string.uploaddata));
} }
@Override @Override
@@ -1500,14 +1509,14 @@ public class UploadActivity extends AppCompatActivity {
ArrayList<CategoryPictureGetterSetter> irdata = db.getIrPDforUpload(coverageList.get(i).getStoreId(), coverageList.get(i).getVisitDate()); ArrayList<CategoryPictureGetterSetter> irdata = db.getIrPDforUpload(coverageList.get(i).getStoreId(), coverageList.get(i).getVisitDate());
if (irdata != null && !irdata.isEmpty()) { if (irdata != null && !irdata.isEmpty()) {
for (int j = 0; j < irdata.size(); j++) { for (int j = 0; j < irdata.size(); j++) {
onXML = "[IR_DATA]" + "[MID]" + mid + "[/MID]" + "[USERID]" + userId + "[/USERID]" + "[CATEGORY_ID]" + irdata.get(j).getCategoryId() + "[/CATEGORY_ID]" + "[SUB_CATEGORY_ID]" + irdata.get(j).getSUB_CATEGORY_ID() + "[/SUB_CATEGORY_ID]" + "[SUB_CATEGORY_CODE]" + irdata.get(j).getSubCatCode() + "[/SUB_CATEGORY_CODE]" + "[IR_IMAGES]" + irdata.get(j).getSubCategoryCamera2() + "[/IR_IMAGES]" + "[/IR_DATA]"; onXML = "[IR_DATA]" + "[MID]" + mid + "[/MID]" + "[USERID]" + userId + "[/USERID]" + "[CAM_ALLOW]" +irdata.get(j).getToggle_value() + "[/CAM_ALLOW]"+ "[CATEGORY_ID]" + irdata.get(j).getCategoryId() + "[/CATEGORY_ID]" + "[SUB_CATEGORY_ID]" + irdata.get(j).getSUB_CATEGORY_ID() + "[/SUB_CATEGORY_ID]" + "[SUB_CATEGORY_CODE]" + irdata.get(j).getSubCatCode() + "[/SUB_CATEGORY_CODE]" + "[IR_IMAGES]" + irdata.get(j).getSubCategoryCamera2() + "[/IR_IMAGES]" + "[/IR_DATA]";
irPD_xmlData = irPD_xmlData + onXML; irPD_xmlData = irPD_xmlData + onXML;
} }
final String irpd_xml = "[DATA]" + irPD_xmlData + "[/DATA]"; final String irpd_xml = "[DATA]" + irPD_xmlData + "[/DATA]";
Log.e("irp_xml_data", irpd_xml); Log.e("irp_xml_data", irpd_xml);
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA); request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
request.addProperty("XMLDATA", irpd_xml); request.addProperty("XMLDATA", irpd_xml);
request.addProperty("KEYS", "IR_DATA_XML"); request.addProperty("KEYS", "IR_DATA_NEW_XML");
request.addProperty("USERNAME", userId); request.addProperty("USERNAME", userId);
request.addProperty("MID", mid); request.addProperty("MID", mid);
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
@@ -1528,14 +1537,14 @@ public class UploadActivity extends AppCompatActivity {
ArrayList<CategoryPictureGetterSetter> ir_visi_data = db.getIrPDVisibilityforUpload(coverageList.get(i).getStoreId(), coverageList.get(i).getVisitDate()); ArrayList<CategoryPictureGetterSetter> ir_visi_data = db.getIrPDVisibilityforUpload(coverageList.get(i).getStoreId(), coverageList.get(i).getVisitDate());
if (ir_visi_data != null && !ir_visi_data.isEmpty()) { if (ir_visi_data != null && !ir_visi_data.isEmpty()) {
for (int j = 0; j < ir_visi_data.size(); j++) { 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]"; onXML = "[IR_VISIBILITY_DATA]" + "[MID]" + mid + "[/MID]" + "[USERID]" + userId + "[/USERID]" + "[CAM_ALLOW]" +ir_visi_data.get(j).getToggle_value() + "[/CAM_ALLOW]" + "[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; irPD_visi_xmlData = irPD_visi_xmlData + onXML;
} }
final String irpd_xml = "[DATA]" + irPD_visi_xmlData + "[/DATA]"; final String irpd_xml = "[DATA]" + irPD_visi_xmlData + "[/DATA]";
Log.e("irpd_visi_xml_data", irPD_visi_xmlData); Log.e("irpd_visi_xml_data", irPD_visi_xmlData);
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA); request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
request.addProperty("XMLDATA", irpd_xml); request.addProperty("XMLDATA", irpd_xml);
request.addProperty("KEYS", "IRPD_VISIBILITY_DATA_XML"); request.addProperty("KEYS", "IRPD_VISIBILITY_DATA_NEW_XML");
request.addProperty("USERNAME", userId); request.addProperty("USERNAME", userId);
request.addProperty("MID", mid); request.addProperty("MID", mid);
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
@@ -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,18 +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.ConnectionSpec;
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 com.squareup.okhttp.TlsVersion;
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;
@@ -48,6 +45,7 @@ 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 retrofit.Retrofit; import retrofit.Retrofit;
@@ -197,7 +195,12 @@ public class UploadImageWithRetrofit {
} else { } else {
if (totalFiles == uploadedFiles) { if (totalFiles == uploadedFiles) {
//region Coverage upload status Data //region Coverage upload status Data
new StatusUpload().execute(); if(isInternetAvailable(context)){
new StatusUpload().execute();
}
else{
Toast.makeText(context, "No internet connection. Please try again", Toast.LENGTH_SHORT).show();
}
} }
} }
} catch (JsonSyntaxException e) { } catch (JsonSyntaxException e) {
@@ -285,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,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>
@@ -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="#BDBDBD"/>
</shape>
@@ -0,0 +1,4 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/dot_active" android:state_selected="true"/>
<item android:drawable="@drawable/dot_inactive"/>
</selector>
@@ -16,7 +16,9 @@
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="@color/grey_background" android:background="@color/white"
android:elevation="8dp"
app:theme="@style/ThemeOverlay.AppCompat.Light"
app:popupTheme="@style/AppTheme.PopupOverlay" /> app:popupTheme="@style/AppTheme.PopupOverlay" />
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
@@ -9,8 +9,6 @@
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
tools:openDrawer="start"> tools:openDrawer="start">
<include <include
layout="@layout/app_bar_main" layout="@layout/app_bar_main"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -1,4 +1,65 @@
<WebView xmlns:android="http://schemas.android.com/apk/res/android" <!--<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webView" android:id="@+id/webView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"/> android:layout_height="match_parent"/>-->
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:id="@+id/coordinate"
tools:context="cpm.com.gskmtorange.MainActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white"
android:elevation="8dp"
app:theme="@style/ThemeOverlay.AppCompat.Light"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</com.google.android.material.appbar.AppBarLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="55dp">
<!-- WebView -->
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/custom_margin"
android:visibility="gone"/>
<!-- Image -->
<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/custom_margin"
android:scaleType="fitCenter"
android:visibility="gone"/>
<!-- Video -->
<VideoView
android:id="@+id/videoView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/custom_margin"
android:visibility="gone"/>
</FrameLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -26,5 +27,4 @@
<include layout="@layout/content_main" /> <include layout="@layout/content_main" />
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>
@@ -59,10 +59,10 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:focusable="true" android:focusable="true"
android:visibility="gone" android:visibility="gone"
android:imeOptions="actionDone"
android:inputType="number" android:inputType="number"
android:maxLength="5" /> android:maxLength="5" />
</LinearLayout> </LinearLayout>
<TextView <TextView
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
card_view:cardCornerRadius="12dp"
card_view:cardElevation="0dp">
<ImageView
android:id="@+id/bannerImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
</androidx.cardview.widget.CardView>
@@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:background="@color/grey_background" android:background="@color/grey_background"
android:orientation="vertical" android:orientation="vertical"
android:padding="@dimen/activity_horizontal_margin" android:padding="@dimen/activity_horizontal_margin"
@@ -12,6 +13,44 @@
tools:context="cpm.com.gskmtorange.dailyentry.PDimageActivity" tools:context="cpm.com.gskmtorange.dailyentry.PDimageActivity"
tools:showIn="@layout/activity_pdimage"> tools:showIn="@layout/activity_pdimage">
<androidx.cardview.widget.CardView
android:id="@+id/cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey_background"
card_view:cardCornerRadius="5dp"
android:elevation="5dp"
android:layout_margin="5dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:id="@+id/tv"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.5"
android:textColor="@color/colorAccent"
android:fontFamily="sans-serif-medium"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:text="@string/iscamallowed" />
<ToggleButton
android:id="@+id/btntoggle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".5"
android:background="@drawable/toggle_selector_background"
android:textOff="@string/no"
android:textOn="@string/yes" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerViewSubCat" android:id="@+id/recyclerViewSubCat"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/grey_background" android:background="@color/grey_background"
@@ -12,6 +13,44 @@
tools:context="cpm.com.gskmtorange.dailyentry.PDVisibilityActivity" tools:context="cpm.com.gskmtorange.dailyentry.PDVisibilityActivity"
tools:showIn="@layout/activity_pdvisibility"> tools:showIn="@layout/activity_pdvisibility">
<androidx.cardview.widget.CardView
android:id="@+id/cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey_background"
card_view:cardCornerRadius="5dp"
android:elevation="5dp"
android:layout_margin="5dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:id="@+id/tv"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.5"
android:gravity="center_vertical"
android:textColor="@color/colorAccent"
android:fontFamily="sans-serif-medium"
android:paddingLeft="5dp"
android:text="@string/iscamallowed" />
<ToggleButton
android:id="@+id/btntoggle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".5"
android:background="@drawable/toggle_selector_background"
android:textOff="@string/no"
android:textOn="@string/yes" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerViewSubCat" android:id="@+id/recyclerViewSubCat"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -23,29 +23,33 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
card_view:cardBackgroundColor="@color/white" card_view:cardBackgroundColor="@color/white"
card_view:cardCornerRadius="5dp" > card_view:cardCornerRadius="12dp" >
<RelativeLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical">
>
<!-- <ImageView <!-- ViewPager + Dots -->
android:layout_width="match_parent" <FrameLayout
android:layout_height="200dp" android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@android:color/transparent">
android:layout_marginTop="40dp" <androidx.viewpager2.widget.ViewPager2
android:src="@drawable/chings" android:id="@+id/viewPager"
android:visibility="invisible"/> android:layout_width="match_parent"
android:layout_height="match_parent"
<ImageView android:background="@android:color/transparent"/>
android:layout_width="match_parent" <!-- ✅ Custom Dots -->
android:layout_height="200dp" </FrameLayout>
android:layout_marginLeft="5dp" <LinearLayout
android:layout_marginRight="5dp" android:id="@+id/dotsLayout"
android:layout_marginTop="20dp" android:layout_width="wrap_content"
android:src="@drawable/baking_chocolates" />--> android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="10dp"/>
<ImageView <ImageView
android:id="@+id/img_main" android:id="@+id/img_main"
@@ -53,17 +57,19 @@
android:layout_height="150dp" android:layout_height="150dp"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:visibility="gone"
android:src="@drawable/gsklogo" android:src="@drawable/gsklogo"
android:layout_centerInParent="true"
/> />
<WebView <WebView
android:id="@+id/webview" android:id="@+id/webview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:visibility="invisible"></WebView> android:layout_margin="@dimen/custom_margin"
android:visibility="gone">
</WebView>
</RelativeLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
</RelativeLayout> </RelativeLayout>
@@ -236,4 +236,5 @@
<string name="competition_promotion">تعليق</string> <string name="competition_promotion">تعليق</string>
<string name="exists">التواجد</string> <string name="exists">التواجد</string>
<string name="view_report_pd">عرض التقرير</string> <string name="view_report_pd">عرض التقرير</string>
<string name="iscamallowed">هل يسمح بالتصوير داخل الصيدلية/المتجر ؟</string>
</resources> </resources>
@@ -363,5 +363,6 @@
<string name="order_status_polist">حالة الطلب- قائمة طالبات الشراء</string> <string name="order_status_polist">حالة الطلب- قائمة طالبات الشراء</string>
<string name="order_status_entry">حالة الطلب-الادخال</string> <string name="order_status_entry">حالة الطلب-الادخال</string>
<string name="po_qty">كمية طلب الشراء </string> <string name="po_qty">كمية طلب الشراء </string>
<string name="iscamallowed">هل يسمح بالتصوير داخل الصيدلية/المتجر ؟</string>
</resources> </resources>
+2
View File
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>
@@ -119,6 +119,7 @@
<!--Gagan end new code 1--> <!--Gagan end new code 1-->
<string name="AdditionalDisplay">Is there any Additional Display</string> <string name="AdditionalDisplay">Is there any Additional Display</string>
<string name="iscamallowed">Is the Camera Allowed in store?</string>
<string name="Display">Display</string> <string name="Display">Display</string>
<string name="Photo">Photo</string> <string name="Photo">Photo</string>
<string name="title_activity_Additional_visibility">Additional Visibility</string> <string name="title_activity_Additional_visibility">Additional Visibility</string>
@@ -0,0 +1 @@
o/bundleLibRuntimeToDirDebug
@@ -0,0 +1 @@
o/bundleLibRuntimeToDirDebug

Some files were not shown because too many files have changed in this diff Show More