initial_commit
This commit is contained in:
Generated
+14
File diff suppressed because one or more lines are too long
Generated
+50
-12
@@ -51,6 +51,18 @@
|
|||||||
<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" />
|
||||||
@@ -75,6 +87,19 @@
|
|||||||
<option name="screenX" value="1080" />
|
<option name="screenX" value="1080" />
|
||||||
<option name="screenY" value="2160" />
|
<option name="screenY" value="2160" />
|
||||||
</PersistentDeviceSelectionData>
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="35" />
|
||||||
|
<option name="brand" value="Lenovo" />
|
||||||
|
<option name="codename" value="TB330FU" />
|
||||||
|
<option name="formFactor" value="Tablet" />
|
||||||
|
<option name="id" value="TB330FU" />
|
||||||
|
<option name="labId" value="google" />
|
||||||
|
<option name="manufacturer" value="Lenovo" />
|
||||||
|
<option name="name" value="Tab M11" />
|
||||||
|
<option name="screenDensity" value="240" />
|
||||||
|
<option name="screenX" value="1200" />
|
||||||
|
<option name="screenY" value="1920" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
<PersistentDeviceSelectionData>
|
<PersistentDeviceSelectionData>
|
||||||
<option name="api" value="34" />
|
<option name="api" value="34" />
|
||||||
<option name="brand" value="samsung" />
|
<option name="brand" value="samsung" />
|
||||||
@@ -354,18 +379,6 @@
|
|||||||
<option name="screenX" value="384" />
|
<option name="screenX" value="384" />
|
||||||
<option name="screenY" value="384" />
|
<option name="screenY" value="384" />
|
||||||
</PersistentDeviceSelectionData>
|
</PersistentDeviceSelectionData>
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="35" />
|
|
||||||
<option name="brand" value="motorola" />
|
|
||||||
<option name="codename" value="eqe" />
|
|
||||||
<option name="id" value="eqe" />
|
|
||||||
<option name="labId" value="google" />
|
|
||||||
<option name="manufacturer" value="Motorola" />
|
|
||||||
<option name="name" value="edge 50 pro" />
|
|
||||||
<option name="screenDensity" value="450" />
|
|
||||||
<option name="screenX" value="1220" />
|
|
||||||
<option name="screenY" value="2712" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
<PersistentDeviceSelectionData>
|
||||||
<option name="api" value="33" />
|
<option name="api" value="33" />
|
||||||
<option name="brand" value="google" />
|
<option name="brand" value="google" />
|
||||||
@@ -548,6 +561,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="35" />
|
||||||
|
<option name="brand" value="motorola" />
|
||||||
|
<option name="codename" value="kansas" />
|
||||||
|
<option name="id" value="kansas" />
|
||||||
|
<option name="labId" value="google" />
|
||||||
|
<option name="manufacturer" value="Motorola" />
|
||||||
|
<option name="name" value="moto g - 2025" />
|
||||||
|
<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="google" />
|
<option name="brand" value="google" />
|
||||||
@@ -817,6 +842,19 @@
|
|||||||
<option name="screenX" value="1080" />
|
<option name="screenX" value="1080" />
|
||||||
<option name="screenY" value="2424" />
|
<option name="screenY" value="2424" />
|
||||||
</PersistentDeviceSelectionData>
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="36" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="tokay" />
|
||||||
|
<option name="default" value="true" />
|
||||||
|
<option name="id" value="tokay" />
|
||||||
|
<option name="labId" value="google" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 9" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2424" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
<PersistentDeviceSelectionData>
|
<PersistentDeviceSelectionData>
|
||||||
<option name="api" value="34" />
|
<option name="api" value="34" />
|
||||||
<option name="brand" value="samsung" />
|
<option name="brand" value="samsung" />
|
||||||
|
|||||||
Generated
+8
@@ -4,6 +4,14 @@
|
|||||||
<selectionStates>
|
<selectionStates>
|
||||||
<SelectionState runConfigName="GSKMTOrange">
|
<SelectionState runConfigName="GSKMTOrange">
|
||||||
<option name="selectionMode" value="DROPDOWN" />
|
<option name="selectionMode" value="DROPDOWN" />
|
||||||
|
<DropdownSelection timestamp="2025-09-02T04:28:16.393738700Z">
|
||||||
|
<Target type="DEFAULT_BOOT">
|
||||||
|
<handle>
|
||||||
|
<DeviceId pluginId="PhysicalDevice" identifier="serial=RZCWC0NSMLP" />
|
||||||
|
</handle>
|
||||||
|
</Target>
|
||||||
|
</DropdownSelection>
|
||||||
|
<DialogSelection />
|
||||||
</SelectionState>
|
</SelectionState>
|
||||||
</selectionStates>
|
</selectionStates>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
+22
-17
@@ -13,27 +13,26 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
all*.exclude module: 'support-v4'
|
// all*.exclude module: 'okio'
|
||||||
// This removes all other versions of `support-v4` if gets duplicated from all the artifacts.
|
//all*.exclude group: 'com.squareup.okhttp3', module: 'okhttp'
|
||||||
|
all*.exclude module: 'support-v4' // This removes all other versions of `support-v4` if gets duplicated from all the artifacts.
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "cpm.com.gskmtorange"
|
|
||||||
minSdkVersion 24
|
|
||||||
targetSdk(35)
|
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
useLibrary 'org.apache.http.legacy'
|
useLibrary 'org.apache.http.legacy'
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
ndk { abiFilters.add("armeabi-v7a")
|
applicationId "cpm.com.gskmtorange"
|
||||||
abiFilters.add("arm64-v8a")
|
minSdkVersion 26
|
||||||
}
|
targetSdk(34)
|
||||||
|
|
||||||
|
|
||||||
// For Lebanon
|
// For Lebanon
|
||||||
/*versionCode 1
|
/*versionCode 1
|
||||||
versionName "1.0"*/
|
versionName "1.0"*/
|
||||||
//For Egypt
|
//For Egypt
|
||||||
versionCode 35
|
versionCode 37
|
||||||
versionName "4.6"
|
versionName "4.8"
|
||||||
//For UAE
|
//For UAE
|
||||||
/*versionCode 29
|
/*versionCode 29
|
||||||
versionName "4.1"*/
|
versionName "4.1"*/
|
||||||
@@ -47,7 +46,7 @@ android {
|
|||||||
/*versionCode 28
|
/*versionCode 28
|
||||||
versionName "4.0"*/
|
versionName "4.0"*/
|
||||||
|
|
||||||
// aading price facing
|
// adding price facing
|
||||||
/* versionCode 27
|
/* versionCode 27
|
||||||
versionName "3.8"*/
|
versionName "3.8"*/
|
||||||
//sa
|
//sa
|
||||||
@@ -80,6 +79,7 @@ android {
|
|||||||
//For Oman
|
//For Oman
|
||||||
/*versionCode 1
|
/*versionCode 1
|
||||||
versionName "1.0"*/
|
versionName "1.0"*/
|
||||||
|
ndk {abiFilters "armeabi-v7a", "arm64-v8a"}
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
@@ -128,6 +128,8 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
implementation files('libs/ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar')
|
implementation files('libs/ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar')
|
||||||
|
// implementation files('libs/ksoap2-android-assembly-3.6.4.jar')
|
||||||
|
// implementation files('libs/ksoap2-android-3.3.0.jar')
|
||||||
implementation 'androidx.cardview:cardview:1.0.0'
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
implementation 'com.google.android.material:material:1.12.0'
|
implementation 'com.google.android.material:material:1.12.0'
|
||||||
implementation project(path: ':library')
|
implementation project(path: ':library')
|
||||||
@@ -136,9 +138,11 @@ dependencies {
|
|||||||
implementation 'androidx.activity:activity:1.10.1'
|
implementation 'androidx.activity:activity:1.10.1'
|
||||||
implementation 'androidx.appcompat:appcompat:1.7.1'
|
implementation 'androidx.appcompat:appcompat:1.7.1'
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
implementation 'android.arch.navigation:navigation-fragment:1.0.0'
|
implementation "androidx.navigation:navigation-fragment-ktx:2.9.0"
|
||||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
androidTestImplementation "androidx.test:core:1.6.1"
|
||||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
androidTestImplementation "androidx.test:espresso:espresso-core:3.5.1"
|
||||||
|
androidTestImplementation "androidx.test.ext:junit:1.2.1"
|
||||||
|
androidTestImplementation "androidx.test:annotation:1.0.1"
|
||||||
implementation 'com.google.code.gson:gson:2.11.0'
|
implementation 'com.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'
|
||||||
|
|
||||||
@@ -150,18 +154,19 @@ dependencies {
|
|||||||
implementation 'com.google.android.gms:play-services-maps:19.2.0'
|
implementation 'com.google.android.gms:play-services-maps:19.2.0'
|
||||||
implementation 'com.google.firebase:firebase-analytics:22.4.0'
|
implementation 'com.google.firebase:firebase-analytics:22.4.0'
|
||||||
implementation 'com.google.firebase:firebase-appindexing:20.0.0'
|
implementation 'com.google.firebase:firebase-appindexing:20.0.0'
|
||||||
implementation 'com.google.firebase:firebase-crashlytics:19.4.3'
|
// implementation 'com.google.firebase:firebase-crashlytics:19.4.3'
|
||||||
implementation 'com.google.firebase:firebase-auth:23.2.1'
|
implementation 'com.google.firebase:firebase-auth:23.2.1'
|
||||||
|
|
||||||
|
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
implementation 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
|
implementation 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
|
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
|
||||||
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.22"))
|
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.22"))
|
||||||
implementation 'androidx.multidex:multidex:2.0.1'
|
implementation 'androidx.multidex:multidex:2.0.1'
|
||||||
// Main SDK dependency
|
// Main SDK dependency
|
||||||
// implementation("com.github.pratham-PDots:camera_lib:1.5.1.1")
|
// implementation("com.github.pratham-PDots:camera_lib:1.5.1.1")
|
||||||
implementation("com.github.pratham-PDots:camera_lib:1.5.3.2")
|
implementation("com.github.pratham-PDots:camera_lib:1.5.3.2")
|
||||||
|
implementation "androidx.core:core-splashscreen:1.0.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
@@ -11,11 +11,11 @@
|
|||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 35,
|
"versionCode": 37,
|
||||||
"versionName": "4.6",
|
"versionName": "4.8",
|
||||||
"outputFile": "GSKMTOrange-release.apk"
|
"outputFile": "GSKMTOrange-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"elementType": "File",
|
"elementType": "File",
|
||||||
"minSdkVersionForDexing": 24
|
"minSdkVersionForDexing": 26
|
||||||
}
|
}
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
|
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
|
||||||
string in this file.
|
string in this file.
|
||||||
-->
|
-->
|
||||||
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyDdgvyAY0_pb-k7PLPJoG6wR-KN0xnhkRE</string>
|
<!--<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyDdgvyAY0_pb-k7PLPJoG6wR-KN0xnhkRE</string>-->
|
||||||
|
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyCs2VZqLl4OgStAraUHr8012cUc7vf3Uo8</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -48,9 +48,40 @@
|
|||||||
android:largeHeap="true"
|
android:largeHeap="true"
|
||||||
android:requestLegacyExternalStorage="true"
|
android:requestLegacyExternalStorage="true"
|
||||||
android:supportsRtl="false"
|
android:supportsRtl="false"
|
||||||
|
android:networkSecurityConfig="@xml/network_security_config"
|
||||||
android:theme="@style/AppTheme"
|
android:theme="@style/AppTheme"
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true"
|
||||||
|
|
||||||
|
|
||||||
tools:replace="android:supportsRtl">
|
tools:replace="android:supportsRtl">
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.PD_Realtime_Report_Detail"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.PD_Realtime_Report"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.WebViewActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".dailyentry.PD_Pog_Activity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.PDVisibilityActivity"
|
android:name=".dailyentry.PDVisibilityActivity"
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
|||||||
@@ -225,6 +225,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
db.execSQL(TableBean.getTable_ORDER_RECEIVED_STATUS());//--Added 08.12.2022
|
db.execSQL(TableBean.getTable_ORDER_RECEIVED_STATUS());//--Added 08.12.2022
|
||||||
db.execSQL(TableBean.getAdhocJourneyplanAdditional());//--Added 7.10.2019
|
db.execSQL(TableBean.getAdhocJourneyplanAdditional());//--Added 7.10.2019
|
||||||
db.execSQL(CommonString.CREATE_TABLE_IRPD);
|
db.execSQL(CommonString.CREATE_TABLE_IRPD);
|
||||||
|
db.execSQL(CommonString.CREATE_TABLE_IRPD_POG);
|
||||||
db.execSQL(CommonString.CREATE_TABLE_IRPD_VISIBILITY);
|
db.execSQL(CommonString.CREATE_TABLE_IRPD_VISIBILITY);
|
||||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_STOCK_DATA);
|
db.execSQL(CommonString.CREATE_TABLE_INSERT_STOCK_DATA);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
@@ -290,6 +291,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
db.delete(CommonString.TABLE_INSERT_COMPETIOTIONN_PROMO_EXISTS, "STORE_ID" + "='" + storeid + "'", null);
|
db.delete(CommonString.TABLE_INSERT_COMPETIOTIONN_PROMO_EXISTS, "STORE_ID" + "='" + storeid + "'", null);
|
||||||
db.delete(CommonString.TABLE_INSERT_COMPETIOTIONN_PROMO, "STORE_ID" + "='" + storeid + "'", null);
|
db.delete(CommonString.TABLE_INSERT_COMPETIOTIONN_PROMO, "STORE_ID" + "='" + storeid + "'", null);
|
||||||
db.delete(CommonString.TABLE_IRPD, CommonString.KEY_STORE_ID + "='" + storeid + "'", null);
|
db.delete(CommonString.TABLE_IRPD, CommonString.KEY_STORE_ID + "='" + storeid + "'", null);
|
||||||
|
db.delete(CommonString.TABLE_IRPD_POG, CommonString.KEY_STORE_ID + "='" + storeid + "'", null);
|
||||||
db.delete(CommonString.TABLE_IRPD_VISIBILITY, CommonString.KEY_STORE_ID + "='" + storeid + "'", null);
|
db.delete(CommonString.TABLE_IRPD_VISIBILITY, CommonString.KEY_STORE_ID + "='" + storeid + "'", null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
@@ -337,11 +339,11 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
db.delete(CommonString.TABLE_INSERT_ORDER_TAKING_DATA, null, null);
|
db.delete(CommonString.TABLE_INSERT_ORDER_TAKING_DATA, null, null);
|
||||||
db.delete(CommonString.TABLE_INSERT_STOCK, null, null);
|
db.delete(CommonString.TABLE_INSERT_STOCK, null, null);
|
||||||
db.delete(CommonString.TABLE_IRPD, null, null);
|
db.delete(CommonString.TABLE_IRPD, null, null);
|
||||||
|
db.delete(CommonString.TABLE_IRPD_POG, null, null);
|
||||||
db.delete(CommonString.TABLE_IRPD_VISIBILITY, null, null);
|
db.delete(CommonString.TABLE_IRPD_VISIBILITY, null, null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InsertJCP(JourneyPlanGetterSetter data) {
|
public void InsertJCP(JourneyPlanGetterSetter data) {
|
||||||
@@ -1745,7 +1747,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
values.put(CommonString.KEY_GEO_TAG, data.getGEO_TAG());
|
values.put(CommonString.KEY_GEO_TAG, data.getGEO_TAG());
|
||||||
values.put(CommonString.KEY_CHECKOUT_IMAGE, data.getCheckOut_Image());
|
values.put(CommonString.KEY_CHECKOUT_IMAGE, data.getCheckOut_Image());
|
||||||
values.put(CommonString.KEY_STORE_FLAG, data.getFlag_from());
|
values.put(CommonString.KEY_STORE_FLAG, data.getFlag_from());
|
||||||
|
|
||||||
values.put(CommonString.KEY_KEYACCOUNT_ID, data.getKeyAccountId());
|
values.put(CommonString.KEY_KEYACCOUNT_ID, data.getKeyAccountId());
|
||||||
values.put(CommonString.KEY_CLASS_ID, data.getClassId());
|
values.put(CommonString.KEY_CLASS_ID, data.getClassId());
|
||||||
values.put(CommonString.KEY_STORETYPE_ID, data.getStoreTypeId());
|
values.put(CommonString.KEY_STORETYPE_ID, data.getStoreTypeId());
|
||||||
@@ -4755,11 +4756,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
CPGS.setSUB_CATEGORY_ID(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SUB_CATEGORY_ID")));
|
CPGS.setSUB_CATEGORY_ID(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SUB_CATEGORY_ID")));
|
||||||
CPGS.setImage_allow(dbcursor.getString(dbcursor.getColumnIndexOrThrow("IMAGE_ALLOW")));
|
CPGS.setImage_allow(dbcursor.getString(dbcursor.getColumnIndexOrThrow("IMAGE_ALLOW")));
|
||||||
CPGS.setSubCatCode(dbcursor.getString(dbcursor.getColumnIndexOrThrow("PD_SUB_CATEGORY_CODE")));
|
CPGS.setSubCatCode(dbcursor.getString(dbcursor.getColumnIndexOrThrow("PD_SUB_CATEGORY_CODE")));
|
||||||
/* String imgs = dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IRPD_IMAGES));
|
|
||||||
// String imgs_modify = dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IRPD_MODIFY_IMAGES));
|
|
||||||
CPGS.setImageUris(imgs != null && !imgs.isEmpty() ? (ArrayList<ImageUri>) Arrays.stream(imgs.split(", "))
|
|
||||||
.map(img -> new ImageUri(img, new File(img).getName())) // Extract file name as second parameter
|
|
||||||
.collect(Collectors.toList()) : new ArrayList<>());*/
|
|
||||||
|
|
||||||
// Retrieve image URIs from database
|
// Retrieve image URIs from database
|
||||||
String imgs = dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IRPD_IMAGES));
|
String imgs = dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IRPD_IMAGES));
|
||||||
@@ -4798,6 +4794,83 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// get CATEGORY PICTURE data
|
||||||
|
public ArrayList<CategoryPictureGetterSetter> getCategoryPicturePogdata(String visit_date, String categoryId, String key_account_id, String store_type_id, String class_id, String store_id, String tableName) {
|
||||||
|
ArrayList<CategoryPictureGetterSetter> list = new ArrayList<>();
|
||||||
|
Cursor dbcursor = null;
|
||||||
|
try {
|
||||||
|
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 "
|
||||||
|
+ 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 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 MAPPING_SUB_CATEGORY_IMAGE_ALLOW MIA ON SB.SUB_CATEGORY_ID=MIA.SUB_CATEGORY_ID " +
|
||||||
|
" LEFT JOIN (SELECT * FROM " + CommonString.TABLE_IRPD_POG + " WHERE " + CommonString.KEY_STORE_ID + "=" + store_id +
|
||||||
|
" AND " + CommonString.KEY_CATEGORY_ID + "=" + categoryId + " AND " + CommonString.KEY_VISIT_DATE + "='" + visit_date +
|
||||||
|
"')AS T ON T.CATEGORY_ID=CA.CATEGORY_ID AND T.SUB_CATEGORY_ID=SB.SUB_CATEGORY_ID " +
|
||||||
|
"WHERE M.KEYACCOUNT_ID = '" + key_account_id + " ' AND M.STORETYPE_ID = '" + store_type_id +
|
||||||
|
"' AND M.CLASS_ID = '" + class_id + "' AND CA.CATEGORY_ID = '" + categoryId + "'", null);
|
||||||
|
|
||||||
|
} 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" +
|
||||||
|
" 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 CATEGORY_MASTER CA ON SB.CATEGORY_ID = CA.CATEGORY_ID" +
|
||||||
|
" INNER JOIN MAPPING_SUB_CATEGORY_IMAGE_ALLOW MIA ON SB.SUB_CATEGORY_ID=MIA.SUB_CATEGORY_ID " +
|
||||||
|
" LEFT JOIN (SELECT * FROM " + CommonString.TABLE_IRPD_POG + " WHERE " + CommonString.KEY_STORE_ID + "=" + store_id +
|
||||||
|
" AND " + CommonString.KEY_CATEGORY_ID + "=" + categoryId + " AND " + CommonString.KEY_VISIT_DATE + "='" + visit_date +
|
||||||
|
"') AS T ON T.CATEGORY_ID=CA.CATEGORY_ID AND T.SUB_CATEGORY_ID=SB.SUB_CATEGORY_ID " +
|
||||||
|
"WHERE M.STORE_ID = '" + store_id + "' AND CA.CATEGORY_ID = '" + categoryId + "'", null);
|
||||||
|
}
|
||||||
|
if (dbcursor != null) {
|
||||||
|
dbcursor.moveToFirst();
|
||||||
|
while (!dbcursor.isAfterLast()) {
|
||||||
|
CategoryPictureGetterSetter CPGS = new CategoryPictureGetterSetter();
|
||||||
|
CPGS.setSUB_CATEGORY(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SUB_CATEGORY")));
|
||||||
|
CPGS.setSUB_CATEGORY_ID(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SUB_CATEGORY_ID")));
|
||||||
|
CPGS.setImage_allow(dbcursor.getString(dbcursor.getColumnIndexOrThrow("IMAGE_ALLOW")));
|
||||||
|
CPGS.setSubCatCode(dbcursor.getString(dbcursor.getColumnIndexOrThrow("PD_SUB_CATEGORY_CODE")));
|
||||||
|
|
||||||
|
// Retrieve image URIs from database
|
||||||
|
String imgs = dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IRPD_IMAGES));
|
||||||
|
String imgs_modify = dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IRPD_MODIFY_IMAGES));
|
||||||
|
|
||||||
|
// Split and map URIs and Modify URIs separately
|
||||||
|
List<String> imageUris = imgs != null && !imgs.isEmpty()
|
||||||
|
? Arrays.stream(imgs.split(", ")).collect(Collectors.toList())
|
||||||
|
: new ArrayList<>();
|
||||||
|
List<String> modifyUris = imgs_modify != null && !imgs_modify.isEmpty()
|
||||||
|
? Arrays.stream(imgs_modify.split(", ")).collect(Collectors.toList())
|
||||||
|
: new ArrayList<>();
|
||||||
|
|
||||||
|
// Create ImageUri objects with original URI and Modify URI
|
||||||
|
ArrayList<ImageUri> imageUriList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < imageUris.size(); i++) {
|
||||||
|
String uri = imageUris.get(i);
|
||||||
|
String modifyUri = (i < modifyUris.size()) ? modifyUris.get(i) : uri; // Fallback to original if no modify URI
|
||||||
|
imageUriList.add(new ImageUri(uri, modifyUri));
|
||||||
|
}
|
||||||
|
|
||||||
|
CPGS.setImageUris(imageUriList);
|
||||||
|
|
||||||
|
CPGS.setSubCategoryCamera1("");
|
||||||
|
CPGS.setSubCategoryCamera2("");
|
||||||
|
list.add(CPGS);
|
||||||
|
dbcursor.moveToNext();
|
||||||
|
}
|
||||||
|
dbcursor.close();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.d("Exception ", "get Planogram Shelf Header After Save !" + e.toString());
|
||||||
|
// return list;
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> getPlanogramAddShelfHeaderAfterSaveData(
|
public ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> getPlanogramAddShelfHeaderAfterSaveData(
|
||||||
String store_id, String category_id) {
|
String store_id, String category_id) {
|
||||||
|
|
||||||
@@ -7837,24 +7910,22 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
try {
|
try {
|
||||||
|
|
||||||
for (int l = 0; l < headerDataList.size(); l++) {
|
for (int l = 0; l < headerDataList.size(); l++) {
|
||||||
List<POGGetterSetter> childList = hashMapListChildData.get(headerDataList.get(l));
|
List<POGGetterSetter> childList = hashMapListChildData.get(headerDataList.get(l));
|
||||||
for (int i = 0; i < childList.size(); i++) {
|
for (int i = 0; i < childList.size(); i++) {
|
||||||
POGGetterSetter data = childList.get(i);
|
POGGetterSetter data = childList.get(i);
|
||||||
|
|
||||||
values.put("STORE_CD", store_cd);
|
values.put("STORE_CD", store_cd);
|
||||||
values.put("QUESTION_ID", data.getQUESTION_ID());
|
values.put("QUESTION_ID", data.getQUESTION_ID());
|
||||||
values.put("QUESTION", data.getQUESTION());
|
values.put("QUESTION", data.getQUESTION());
|
||||||
values.put("ANSWER_ID", data.getANSWER_ID());
|
values.put("ANSWER_ID", data.getANSWER_ID());
|
||||||
|
values.put("ANSWER", data.getANSWER());
|
||||||
values.put("SUB_CATEGORY_ID", headerDataList.get(l).getSub_category_id());
|
values.put("SUB_CATEGORY_ID", headerDataList.get(l).getSub_category_id());
|
||||||
|
values.put("SUB_CATEGORY", headerDataList.get(l).getSub_category());
|
||||||
values.put("QTYPE", data.getQTYPE());
|
values.put("QTYPE", data.getQTYPE());
|
||||||
values.put("CATEGORY_ID", category_cd);
|
values.put("CATEGORY_ID", category_cd);
|
||||||
|
|
||||||
db.insert(CommonString.TABLE_POG_DATA_SAVE, null, values);
|
db.insert(CommonString.TABLE_POG_DATA_SAVE, null, values);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Log.d("Database ", "Exception while Insert Audit Data " + ex.toString());
|
Log.d("Database ", "Exception while Insert Audit Data " + ex.toString());
|
||||||
}
|
}
|
||||||
@@ -9393,7 +9464,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
Log.d("Exception ", "when fetching Records!!!!!!!!!!!!!!!!!!!!!" + e.toString());
|
Log.d("Exception ", "when fetching Records!!!!!!!!!!!!!!!!!!!!!" + e.toString());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.d("MSL_Availability_StockFacing ", "midday---------------------->Stop<-----------");
|
Log.d("MSL_Availability_StockFacing ", "midday---------------------->Stop<-----------");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -10672,6 +10742,37 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long InsertPdPogImageData(
|
||||||
|
String visit_date, String storeId, String categoryId, List<CategoryPictureGetterSetter> _list,String savemode) {
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
long l = 0;
|
||||||
|
try {
|
||||||
|
db.delete(CommonString.TABLE_IRPD_POG,
|
||||||
|
CommonString.KEY_STORE_ID + "=" + storeId + " AND " + CommonString.KEY_VISIT_DATE + "='" + visit_date + "' AND " +
|
||||||
|
CommonString.KEY_CATEGORY_ID + "=" + categoryId, null);
|
||||||
|
|
||||||
|
db.beginTransaction();
|
||||||
|
for (int i = 0; i < _list.size(); i++) {
|
||||||
|
values.put(CommonString.KEY_SAVE_MODE, savemode);
|
||||||
|
values.put(CommonString.KEY_STORE_ID, storeId);
|
||||||
|
values.put(CommonString.KEY_VISIT_DATE, visit_date);
|
||||||
|
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_CODE, _list.get(i).getSubCatCode());
|
||||||
|
List<String> info = _list.get(i).getImageUris().stream().map(ImageUri::getModify_uri).collect(Collectors.toList());
|
||||||
|
values.put(CommonString.KEY_IRPD_IMAGES, _list.get(i).getImageUris().stream().map(ImageUri::getUri).collect(Collectors.toList()).stream().collect(Collectors.joining(", ")));
|
||||||
|
values.put(CommonString.KEY_IRPD_MODIFY_IMAGES, _list.get(i).getImageUris().stream().map(ImageUri::getModify_uri).collect(Collectors.toList()).stream().collect(Collectors.joining(", ")));
|
||||||
|
l = db.insert(CommonString.TABLE_IRPD_POG, null, values);
|
||||||
|
Log.e("data_d", info.toString() + ","+_list.get(i).getImageUris().size());
|
||||||
|
}
|
||||||
|
db.setTransactionSuccessful();
|
||||||
|
db.endTransaction();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Log.d("data_d ", " in Insert TABLE_IRPD " + ex);
|
||||||
|
}
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
|
||||||
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 savemode) {
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
@@ -10779,6 +10880,44 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
return filled;
|
return filled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isSOSPogCategory(String store_id, String date, String mode, String categoryId) {
|
||||||
|
boolean filled = false;
|
||||||
|
Cursor dbcursor = null;
|
||||||
|
try {
|
||||||
|
String query = "";
|
||||||
|
if (mode != null) {
|
||||||
|
query = "SELECT * FROM " + CommonString.TABLE_IRPD_POG + " WHERE "
|
||||||
|
+ CommonString.KEY_STORE_ID + " =" + store_id + " AND "
|
||||||
|
+ CommonString.KEY_CATEGORY_ID + " =" + categoryId + " AND "
|
||||||
|
+ CommonString.KEY_VISIT_DATE + " ='" + date + "'";
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
dbcursor = db.rawQuery(query, null);
|
||||||
|
|
||||||
|
if (dbcursor != null) {
|
||||||
|
dbcursor.moveToFirst();
|
||||||
|
while (!dbcursor.isAfterLast()) {
|
||||||
|
String common_status = dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_SAVE_MODE));
|
||||||
|
if (mode != null) {
|
||||||
|
if (common_status != null && !common_status.equals("") && common_status.equalsIgnoreCase(CommonString.KEY_COMPELETE)) {
|
||||||
|
filled = true;
|
||||||
|
} else {
|
||||||
|
filled = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dbcursor.moveToNext();
|
||||||
|
}
|
||||||
|
dbcursor.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
return filled;
|
||||||
|
}
|
||||||
|
return filled;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isPdVisibility(String store_id, String date, String mode, String categoryId) {
|
public boolean isPdVisibility(String store_id, String date, String mode, String categoryId) {
|
||||||
boolean filled = false;
|
boolean filled = false;
|
||||||
Cursor dbcursor = null;
|
Cursor dbcursor = null;
|
||||||
@@ -10817,6 +10956,44 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
return filled;
|
return filled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isPdPogImages(String store_id, String date, String mode, String categoryId) {
|
||||||
|
boolean filled = false;
|
||||||
|
Cursor dbcursor = null;
|
||||||
|
try {
|
||||||
|
String query = "";
|
||||||
|
if (mode != null) {
|
||||||
|
query = "SELECT * FROM " + CommonString.TABLE_IRPD_POG + " WHERE "
|
||||||
|
+ CommonString.KEY_STORE_ID + " =" + store_id + " AND "
|
||||||
|
+ CommonString.KEY_CATEGORY_ID + " =" + categoryId + " AND "
|
||||||
|
+ CommonString.KEY_VISIT_DATE + " ='" + date + "'";
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
dbcursor = db.rawQuery(query, null);
|
||||||
|
|
||||||
|
if (dbcursor != null) {
|
||||||
|
dbcursor.moveToFirst();
|
||||||
|
while (!dbcursor.isAfterLast()) {
|
||||||
|
String common_status = dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_SAVE_MODE));
|
||||||
|
if (mode != null) {
|
||||||
|
if (common_status != null && !common_status.equals("") && common_status.equalsIgnoreCase(CommonString.KEY_COMPELETE)) {
|
||||||
|
filled = true;
|
||||||
|
} else {
|
||||||
|
filled = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dbcursor.moveToNext();
|
||||||
|
}
|
||||||
|
dbcursor.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
return filled;
|
||||||
|
}
|
||||||
|
return filled;
|
||||||
|
}
|
||||||
|
|
||||||
public ArrayList<CategoryPictureGetterSetter> getIrPDforUpload(String store_id, String visit_date) {
|
public ArrayList<CategoryPictureGetterSetter> getIrPDforUpload(String store_id, String visit_date) {
|
||||||
ArrayList<CategoryPictureGetterSetter> list = new ArrayList<>();
|
ArrayList<CategoryPictureGetterSetter> list = new ArrayList<>();
|
||||||
Cursor dbcursor = null;
|
Cursor dbcursor = null;
|
||||||
|
|||||||
@@ -95,7 +95,6 @@ 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;
|
||||||
|
|
||||||
|
|
||||||
public class LoginActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks,
|
public class LoginActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks,
|
||||||
GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
||||||
private static final int MY_PERMISSIONS_REQUEST_CAMERA = 10;
|
private static final int MY_PERMISSIONS_REQUEST_CAMERA = 10;
|
||||||
@@ -161,7 +160,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
tv_version.setText("Version/Versiyon - " + app_ver);
|
tv_version.setText("Version/Versiyon - " + app_ver + "-T5");
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
editor = preferences.edit();
|
editor = preferences.edit();
|
||||||
// Set up the login form.
|
// Set up the login form.
|
||||||
@@ -518,39 +517,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* @Override
|
|
||||||
public Loader<Cursor> onCreateLoader(int i, Bundle bundle) {
|
|
||||||
return new CursorLoader(this,
|
|
||||||
// Retrieve data rows for the device user's 'profile' contact.
|
|
||||||
Uri.withAppendedPath(ContactsContract.Profile.CONTENT_URI,
|
|
||||||
ContactsContract.Contacts.Data.CONTENT_DIRECTORY), ProfileQuery.PROJECTION,
|
|
||||||
|
|
||||||
// Select only userid addresses.
|
|
||||||
ContactsContract.Contacts.Data.MIMETYPE +
|
|
||||||
" = ?", new String[]{ContactsContract.CommonDataKinds.userid
|
|
||||||
.CONTENT_ITEM_TYPE},
|
|
||||||
|
|
||||||
// Show primary userid addresses first. Note that there won't be
|
|
||||||
// a primary userid address if the user hasn't specified one.
|
|
||||||
ContactsContract.Contacts.Data.IS_PRIMARY + " DESC");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) {
|
|
||||||
List<String> userids = new ArrayList<>();
|
|
||||||
cursor.moveToFirst();
|
|
||||||
while (!cursor.isAfterLast()) {
|
|
||||||
userids.add(cursor.getString(ProfileQuery.ADDRESS));
|
|
||||||
cursor.moveToNext();
|
|
||||||
}
|
|
||||||
|
|
||||||
adduseridsToAutoComplete(userids);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoaderReset(Loader<Cursor> cursorLoader) {
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
private void adduseridsToAutoComplete(List<String> useridAddressCollection) {
|
private void adduseridsToAutoComplete(List<String> useridAddressCollection) {
|
||||||
//Create adapter to tell the AutoCompleteTextView what to show in its dropdown list.
|
//Create adapter to tell the AutoCompleteTextView what to show in its dropdown list.
|
||||||
@@ -562,21 +528,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* private interface ProfileQuery {
|
|
||||||
String[] PROJECTION = {
|
|
||||||
ContactsContract.CommonDataKinds.userid.ADDRESS,
|
|
||||||
ContactsContract.CommonDataKinds.userid.IS_PRIMARY,
|
|
||||||
};
|
|
||||||
|
|
||||||
int ADDRESS = 0;
|
|
||||||
int IS_PRIMARY = 1;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents an asynchronous login/registration task used to authenticate
|
|
||||||
* the user.
|
|
||||||
*/
|
|
||||||
|
|
||||||
private class AuthenticateTask extends AsyncTask<Void, Void, String> {
|
private class AuthenticateTask extends AsyncTask<Void, Void, String> {
|
||||||
private ProgressDialog dialog = null;
|
private ProgressDialog dialog = null;
|
||||||
|
|
||||||
@@ -600,7 +551,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
+ "[/PASSWORD]" + "[IN_TIME]" + CommonFunctions.getCurrentTimeWithLanguage(context)
|
+ "[/PASSWORD]" + "[IN_TIME]" + CommonFunctions.getCurrentTimeWithLanguage(context)
|
||||||
+ "[/IN_TIME]" + "[LATITUDE]" + lat
|
+ "[/IN_TIME]" + "[LATITUDE]" + lat
|
||||||
+ "[/LATITUDE]" + "[LONGITUDE]" + lon
|
+ "[/LATITUDE]" + "[LONGITUDE]" + lon
|
||||||
+ "[/LONGITUDE]" + "[APP_VERSION]" + app_ver
|
+ "[/LONGITUDE]" + "[APP_VERSION]" + app_ver + "-T5"
|
||||||
+ "[/APP_VERSION]" + "[ATT_MODE]OnLine[/ATT_MODE]"
|
+ "[/APP_VERSION]" + "[ATT_MODE]OnLine[/ATT_MODE]"
|
||||||
+ "[NETWORK_STATUS]" + "LoginStatus"
|
+ "[NETWORK_STATUS]" + "LoginStatus"
|
||||||
+ "[/NETWORK_STATUS]" + "[/USER_DATA][/DATA]";
|
+ "[/NETWORK_STATUS]" + "[/USER_DATA][/DATA]";
|
||||||
@@ -654,7 +605,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
||||||
// For String source
|
// For String source
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
xpp.next();
|
xpp.next();
|
||||||
@@ -794,9 +744,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
/* Intent i = new Intent(activity, StorelistActivity.class);
|
|
||||||
activity.startActivity(i);
|
|
||||||
activity.finish();*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -977,29 +924,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
|
|||||||
fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, Looper.getMainLooper());
|
fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, Looper.getMainLooper());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
|
||||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
|
||||||
|
|
||||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
|
||||||
checkAppPermission(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA);
|
|
||||||
|
|
||||||
if (checkPlayServices()) {
|
|
||||||
// Building the GoogleApi client
|
|
||||||
buildGoogleApiClient();
|
|
||||||
createLocationRequest();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create an instance of GoogleAPIClient.
|
|
||||||
if (mGoogleApiClient == null) {
|
|
||||||
mGoogleApiClient = new GoogleApiClient.Builder(this)
|
|
||||||
.addConnectionCallbacks(this)
|
|
||||||
.addOnConnectionFailedListener(this)
|
|
||||||
.addApi(LocationServices.API)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
private boolean checkPlayServices() {
|
private boolean checkPlayServices() {
|
||||||
int resultCode = GooglePlayServicesUtil
|
int resultCode = GooglePlayServicesUtil
|
||||||
.isGooglePlayServicesAvailable(this);
|
.isGooglePlayServicesAvailable(this);
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
WebView webView;
|
WebView webView;
|
||||||
ImageView imageView;
|
ImageView imageView;
|
||||||
String date;
|
String date;
|
||||||
|
String app_ver;
|
||||||
private SharedPreferences preferences = null;
|
private SharedPreferences preferences = null;
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
String user_name, country_id;
|
String user_name, country_id;
|
||||||
@@ -130,6 +131,13 @@ 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);
|
||||||
|
try {
|
||||||
|
app_ver = String.valueOf(getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
|
||||||
|
// login_version.setText("Parinaam Version " + app_ver);
|
||||||
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
// get menu from navigationView
|
// get menu from navigationView
|
||||||
Menu menu = navigationView.getMenu();
|
Menu menu = navigationView.getMenu();
|
||||||
// find MenuItem you want to change
|
// find MenuItem you want to change
|
||||||
@@ -163,6 +171,9 @@ public class MainActivity extends AppCompatActivity
|
|||||||
nav_route_plan13.setTitle(getResources().getString(R.string.menu_setting));
|
nav_route_plan13.setTitle(getResources().getString(R.string.menu_setting));
|
||||||
MenuItem nav_route_plan14 = menu.findItem(R.id.nav_services);
|
MenuItem nav_route_plan14 = menu.findItem(R.id.nav_services);
|
||||||
nav_route_plan14.setTitle(getResources().getString(R.string.menu_services));
|
nav_route_plan14.setTitle(getResources().getString(R.string.menu_services));
|
||||||
|
|
||||||
|
MenuItem nav_route_plan15 = menu.findItem(R.id.nav_version);
|
||||||
|
nav_route_plan15.setTitle("Version/Versiyon - " + app_ver + "-T5");
|
||||||
//Enable disable According to Configuration
|
//Enable disable According to Configuration
|
||||||
ArrayList<ConfigurationMasterGetterSetter> configurationData = db.getConfigurationMasterData(country_id);
|
ArrayList<ConfigurationMasterGetterSetter> configurationData = db.getConfigurationMasterData(country_id);
|
||||||
if (!configurationData.isEmpty()) {
|
if (!configurationData.isEmpty()) {
|
||||||
|
|||||||
@@ -1,30 +1,16 @@
|
|||||||
package cpm.com.gskmtorange;
|
package cpm.com.gskmtorange;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.PixelFormat;
|
import android.graphics.PixelFormat;
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.Window;
|
|
||||||
import android.view.WindowManager;
|
|
||||||
import android.view.animation.Animation;
|
|
||||||
import android.view.animation.AnimationUtils;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.password.MPinActivity;
|
import cpm.com.gskmtorange.password.MPinActivity;
|
||||||
|
|
||||||
@@ -35,11 +21,11 @@ public class SplashScreenActivity extends AppCompatActivity {
|
|||||||
private Context context;
|
private Context context;
|
||||||
private SharedPreferences preferences = null;
|
private SharedPreferences preferences = null;
|
||||||
|
|
||||||
public void onAttachedToWindow() {
|
/* public void onAttachedToWindow() {
|
||||||
super.onAttachedToWindow();
|
super.onAttachedToWindow();
|
||||||
Window window = getWindow();
|
Window window = getWindow();
|
||||||
window.setFormat(PixelFormat.RGBA_8888);
|
window.setFormat(PixelFormat.RGBA_8888);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the activity is first created.
|
* Called when the activity is first created.
|
||||||
@@ -47,103 +33,50 @@ public class SplashScreenActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
|
||||||
setContentView(R.layout.activity_splash_main_layout);
|
|
||||||
|
|
||||||
linearLayout = findViewById(R.id.lin_lay);
|
|
||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
|
||||||
context = this;
|
context = this;
|
||||||
//StartAnimations();
|
|
||||||
|
|
||||||
sendToLogin();
|
|
||||||
|
|
||||||
/* File f = new File(CommonString.getImagesFolder(context)_OLD);
|
|
||||||
if(f!=null){
|
|
||||||
File file[] = f.listFiles();
|
|
||||||
if(file!=null){
|
|
||||||
|
|
||||||
for (int i=0;i<file.length;i++){
|
|
||||||
Date lastModDate = new Date(file[0].lastModified());
|
|
||||||
String day = lastModDate.toString();
|
|
||||||
|
|
||||||
*//*SimpleDateFormat spf= new SimpleDateFormat("MM/dd/yyyy");
|
|
||||||
date = spf.format(newDate);
|
|
||||||
System.out.println(date);*//*
|
|
||||||
}
|
|
||||||
*//* if(file.length>0){
|
|
||||||
UploadImageWithRetrofit.uploadedFiles = 0;
|
|
||||||
UploadImageWithRetrofit.totalFiles = file.length;
|
|
||||||
UploadImageWithRetrofit uploadImg = new UploadImageWithRetrofit( SplashScreenActivity.this);
|
|
||||||
uploadImg.UploadImageRecursive(SplashScreenActivity.this);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
sendToLogin();
|
|
||||||
}*//*
|
|
||||||
}else {
|
|
||||||
sendToLogin();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
sendToLogin();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
|
||||||
/* private void StartAnimations() {
|
|
||||||
Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);
|
|
||||||
anim.reset();
|
|
||||||
LinearLayout l=(LinearLayout) findViewById(R.id.lin_lay);
|
|
||||||
l.clearAnimation();
|
|
||||||
l.startAnimation(anim);
|
|
||||||
|
|
||||||
anim = AnimationUtils.loadAnimation(this, R.anim.translate);
|
|
||||||
anim.reset();
|
|
||||||
ImageView iv = (ImageView) findViewById(R.id.logo);
|
|
||||||
iv.clearAnimation();
|
|
||||||
iv.startAnimation(anim);
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
public void sendToLogin() {
|
|
||||||
new Handler().postDelayed(new Runnable() {
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Showing splash screen with a timer. This will be useful when you
|
|
||||||
* want to show case your app logo / company
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
//after Mpin
|
|
||||||
String mpin = preferences.getString(CommonString.MPIN, null);
|
|
||||||
if (mpin != null) {
|
|
||||||
Intent in = new Intent(context, MPinActivity.class);
|
|
||||||
in.putExtra(CommonString.IS_PASSWORD_CHECK, true);
|
|
||||||
startActivity(in);
|
|
||||||
finish();
|
|
||||||
} else {
|
|
||||||
Intent i = new Intent(context, LoginActivity.class);
|
|
||||||
startActivity(i);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}, SPLASH_TIME_OUT);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getCalculatedDate(String date, String dateFormat, int days) {
|
|
||||||
Calendar cal = Calendar.getInstance();
|
|
||||||
@SuppressLint("SimpleDateFormat") SimpleDateFormat s = new SimpleDateFormat(dateFormat);
|
|
||||||
cal.add(Calendar.DAY_OF_YEAR, days);
|
|
||||||
try {
|
try {
|
||||||
return s.format(new Date(s.parse(date).getTime()));
|
// Optional: hide the status bar safely
|
||||||
} catch (ParseException e) {
|
getWindow().getDecorView().setSystemUiVisibility(
|
||||||
// TODO Auto-generated catch block
|
View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||||
Log.e("TAG", "Error in Parsing Date : " + e.getMessage());
|
);
|
||||||
|
}catch (Exception ignored){}
|
||||||
|
setContentView(R.layout.activity_splash_main_layout);
|
||||||
|
linearLayout = findViewById(R.id.lin_lay);
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
startSplashTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void sendToLogin() {
|
||||||
|
try {
|
||||||
|
String mpin = preferences.getString(CommonString.MPIN, null);
|
||||||
|
Intent intent;
|
||||||
|
if (mpin != null) {
|
||||||
|
intent = new Intent(this, MPinActivity.class);
|
||||||
|
intent.putExtra(CommonString.IS_PASSWORD_CHECK, true);
|
||||||
|
} else {
|
||||||
|
intent = new Intent(this, LoginActivity.class);
|
||||||
|
}
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
} catch (Exception ignored) {} finally {
|
||||||
|
String mpin = preferences.getString(CommonString.MPIN, null);
|
||||||
|
Intent intent;
|
||||||
|
if (mpin != null) {
|
||||||
|
intent = new Intent(this, MPinActivity.class);
|
||||||
|
intent.putExtra(CommonString.IS_PASSWORD_CHECK, true);
|
||||||
|
} else {
|
||||||
|
intent = new Intent(this, LoginActivity.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startSplashTimer() {
|
||||||
|
new Handler(Looper.getMainLooper()).postDelayed(this::sendToLogin, 3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package cpm.com.gskmtorange.adapter
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.Context
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter
|
||||||
|
import cpm.com.gskmtorange.R
|
||||||
|
import cpm.com.gskmtorange.adapter.data.ImageUri
|
||||||
|
import cpm.com.gskmtorange.databinding.ItemRealtimePdBinding
|
||||||
|
|
||||||
|
class RealtimeAdapter(
|
||||||
|
val category: String?,
|
||||||
|
var context: Context,
|
||||||
|
private var subcates: ArrayList<CategoryPictureGetterSetter>?,
|
||||||
|
private val btnlistener: BtnClickListener,
|
||||||
|
) : RecyclerView.Adapter<RealtimeAdapter.CustomViewHolder>() {
|
||||||
|
class CustomViewHolder(view: View) : RecyclerView.ViewHolder(view)
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = CustomViewHolder(
|
||||||
|
ItemRealtimePdBinding.inflate(LayoutInflater.from(context), parent, false).root
|
||||||
|
)
|
||||||
|
|
||||||
|
@SuppressLint(
|
||||||
|
"NotifyDataSetChanged", "ClickableViewAccessibility",
|
||||||
|
"UseCompatLoadingForDrawables", "SetTextI18n"
|
||||||
|
)
|
||||||
|
override fun onBindViewHolder(holder: CustomViewHolder, position: Int) {
|
||||||
|
ItemRealtimePdBinding.bind(holder.itemView).apply {
|
||||||
|
val subcat = subcates!![position]
|
||||||
|
tvSubCategory.text = "$category-${subcat.suB_CATEGORY}"
|
||||||
|
analyticBT.text = context.getString(R.string.view_report_pd)
|
||||||
|
analyticBT.setOnClickListener {
|
||||||
|
btnlistener.onStartSessionClick(position, subcat)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount(): Int {
|
||||||
|
return subcates!!.size
|
||||||
|
}
|
||||||
|
|
||||||
|
interface BtnClickListener {
|
||||||
|
fun onStartSessionClick(_pos: Int, data: CategoryPictureGetterSetter)
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
fun addsubCatItems(langList: ArrayList<CategoryPictureGetterSetter>?) {
|
||||||
|
subcates = langList
|
||||||
|
notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun updateItem(position: Int, uris: List<ImageUri>) {
|
||||||
|
subcates!![position].imageUris = (subcates!![position].imageUris
|
||||||
|
?: ArrayList()).apply { addAll(uris as ArrayList<ImageUri>) }
|
||||||
|
notifyItemChanged(position)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package cpm.com.gskmtorange.adapter
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.net.Uri
|
||||||
|
import android.util.Log
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.bumptech.glide.Glide
|
||||||
|
import cpm.com.gskmtorange.dailyentry.WebViewActivity
|
||||||
|
import cpm.com.gskmtorange.databinding.ItemCategoryScoreBinding
|
||||||
|
import cpm.com.gskmtorange.databinding.ItemOverallScoreBinding
|
||||||
|
import cpm.com.gskmtorange.databinding.ItemPdImageBinding
|
||||||
|
import cpm.com.gskmtorange.utils.ScoreItem
|
||||||
|
|
||||||
|
class ScoreAdapter(private val items: List<ScoreItem>) :
|
||||||
|
RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||||
|
|
||||||
|
private val TYPE_OVERALL = 0
|
||||||
|
private val TYPE_CATEGORY = 1
|
||||||
|
private val TYPE_IMAGE = 2
|
||||||
|
|
||||||
|
override fun getItemViewType(position: Int): Int {
|
||||||
|
return when (items[position]) {
|
||||||
|
is ScoreItem.OverallScore -> TYPE_OVERALL
|
||||||
|
is ScoreItem.CategoryScore -> TYPE_CATEGORY
|
||||||
|
is ScoreItem.ImageItem -> TYPE_IMAGE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||||
|
val inflater = LayoutInflater.from(parent.context)
|
||||||
|
return when (viewType) {
|
||||||
|
TYPE_OVERALL -> {
|
||||||
|
val binding = ItemOverallScoreBinding.inflate(inflater, parent, false)
|
||||||
|
OverallViewHolder(binding)
|
||||||
|
}
|
||||||
|
TYPE_CATEGORY -> {
|
||||||
|
val binding = ItemCategoryScoreBinding.inflate(inflater, parent, false)
|
||||||
|
CategoryViewHolder(binding)
|
||||||
|
}
|
||||||
|
TYPE_IMAGE -> {
|
||||||
|
val binding = ItemPdImageBinding.inflate(inflater, parent, false)
|
||||||
|
ImageViewHolder(binding)
|
||||||
|
}
|
||||||
|
else -> throw IllegalArgumentException("Invalid view type")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||||
|
when (val item = items[position]) {
|
||||||
|
is ScoreItem.OverallScore -> (holder as OverallViewHolder).bind(item)
|
||||||
|
is ScoreItem.CategoryScore -> (holder as CategoryViewHolder).bind(item)
|
||||||
|
is ScoreItem.ImageItem -> (holder as ImageViewHolder).bind(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount(): Int = items.size
|
||||||
|
|
||||||
|
class OverallViewHolder(private val binding: ItemOverallScoreBinding) :
|
||||||
|
RecyclerView.ViewHolder(binding.root) {
|
||||||
|
|
||||||
|
fun bind(item: ScoreItem.OverallScore) {
|
||||||
|
binding.tvOsa.text = "OSA: ${item.osa}"
|
||||||
|
binding.tvMsl.text = "MSL: ${item.msl}"
|
||||||
|
binding.tvPosm.text = "POSM: ${item.posm}"
|
||||||
|
binding.tvSosSku.text = "SOS (SKU): ${item.sosSku}"
|
||||||
|
binding.tvSosBrand.text = "SOS (Brand): ${item.sosBrand}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CategoryViewHolder(private val binding: ItemCategoryScoreBinding) :
|
||||||
|
RecyclerView.ViewHolder(binding.root) {
|
||||||
|
|
||||||
|
fun bind(item: ScoreItem.CategoryScore) {
|
||||||
|
binding.tvCategory.text = item.categoryName
|
||||||
|
binding.tvMsl.text = "MSL: ${item.msl}"
|
||||||
|
binding.tvPosm.text = "POSM: ${item.posm}"
|
||||||
|
binding.tvSosSku.text = "SOS (SKU): ${item.sosSku}"
|
||||||
|
binding.tvSosBrand.text = "SOS (Brand): ${item.sosBrand}"
|
||||||
|
|
||||||
|
binding.layoutBrands.removeAllViews()
|
||||||
|
for (brand in item.brandDetails) {
|
||||||
|
val tv = TextView(binding.root.context)
|
||||||
|
tv.text = "${brand.first}: ${brand.second}"
|
||||||
|
binding.layoutBrands.addView(tv)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ImageViewHolder(private val binding: ItemPdImageBinding) :
|
||||||
|
RecyclerView.ViewHolder(binding.root) {
|
||||||
|
|
||||||
|
fun bind(item: ScoreItem.ImageItem) {
|
||||||
|
Log.d("itemuri",item.url)
|
||||||
|
/* binding.btnViewImage.setOnClickListener {
|
||||||
|
val context = binding.root.context
|
||||||
|
val intent = Intent(context, WebViewActivity::class.java)
|
||||||
|
intent.putExtra("url", item.url)
|
||||||
|
context.startActivity(intent)
|
||||||
|
}*/
|
||||||
|
val actualUrl = if (item.url.contains("?url=")) {
|
||||||
|
item.url.substringAfter("?url=") // extract the real image link
|
||||||
|
} else item.url
|
||||||
|
|
||||||
|
Glide.with(binding.ivRawImage.context)
|
||||||
|
.load(actualUrl)
|
||||||
|
//.placeholder(R.drawable.ic_placeholder) // optional
|
||||||
|
// .error(R.drawable.ic_broken_image) // fallback if fail
|
||||||
|
.into(binding.ivRawImage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -210,4 +210,5 @@ public class CommonFunctions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,16 +151,14 @@ public class CommonString {
|
|||||||
public static final int UNIT_VERTICAL = 50;
|
public static final int UNIT_VERTICAL = 50;
|
||||||
public static final int UNIT_HORIZONTAL = 200;
|
public static final int UNIT_HORIZONTAL = 200;
|
||||||
|
|
||||||
// public static String URL = "http://gskme.parinaam.in/Gskwebservice.asmx";
|
// public static String URL = "http://gskme.parinaam.in/Gskwebservice.asmx";
|
||||||
public static String URL = "http://gskmeIR.parinaam.in/Gskwebservice.asmx";
|
// public static String URL = "http://gskmeIR.parinaam.in/Gskwebservice.asmx";
|
||||||
// public static String URL = "https://gskme1.parinaam.in/Gskwebservice.asmx";
|
// public static String URL = "https://gskme2.parinaam.in/Gskwebservice.asmx";
|
||||||
//Added new Test url for Turkey
|
//Added new Test url for Turkey
|
||||||
// public static String URL = "http://gskmetest.parinaam.in/Gskwebservice.asmx";
|
// public static String URL = "http://gskmetest.parinaam.in/Gskwebservice.asmx";
|
||||||
|
|
||||||
// public static String URL = "https://haleonme.parinaam.in/Gskwebservice.asmx";
|
public static String URL = "https://haleonme.parinaam.in/Gskwebservice.asmx";
|
||||||
//public static String URL = " https://gskme1.parinaam.in/Gskwebservice.asmx";
|
// public static String URL = "https://gskme2.parinaam.in/Gskwebservice.asmx";
|
||||||
//public static String URL = "https://gskme-test.parinaam.in/Gskwebservice.asmx";
|
|
||||||
|
|
||||||
public static final String NAMESPACE = "http://tempuri.org/";
|
public static final String NAMESPACE = "http://tempuri.org/";
|
||||||
public static final String METHOD_LOGIN = "UserLoginDetail";
|
public static final String METHOD_LOGIN = "UserLoginDetail";
|
||||||
public static final String SOAP_ACTION_LOGIN = "http://tempuri.org/"
|
public static final String SOAP_ACTION_LOGIN = "http://tempuri.org/"
|
||||||
@@ -1138,6 +1136,12 @@ public class CommonString {
|
|||||||
+ "QTYPE"
|
+ "QTYPE"
|
||||||
+ " VARCHAR,"
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "SUB_CATEGORY"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "ANSWER"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
+ "ANSWER_ID"
|
+ "ANSWER_ID"
|
||||||
+ " INTEGER,"
|
+ " INTEGER,"
|
||||||
|
|
||||||
@@ -1574,6 +1578,30 @@ public class CommonString {
|
|||||||
+ KEY_IRPD_IMAGES
|
+ KEY_IRPD_IMAGES
|
||||||
+ " VARCHAR)";
|
+ " VARCHAR)";
|
||||||
|
|
||||||
|
|
||||||
|
public static final String TABLE_IRPD_POG = "DR_IRPD_POG";
|
||||||
|
public static final String CREATE_TABLE_IRPD_POG = "CREATE TABLE IF NOT EXISTS "
|
||||||
|
+ TABLE_IRPD_POG
|
||||||
|
+ " ("
|
||||||
|
+ "KEY_ID"
|
||||||
|
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||||
|
+ KEY_STORE_ID
|
||||||
|
+ " INTEGER,"
|
||||||
|
+ KEY_VISIT_DATE
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ KEY_SAVE_MODE
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ KEY_CATEGORY_ID
|
||||||
|
+ " INTEGER,"
|
||||||
|
+ KEY_SUB_CATEGORY_ID
|
||||||
|
+ " INTEGER,"
|
||||||
|
+ KEY_SUB_CATEGORY_CODE
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ KEY_IRPD_MODIFY_IMAGES
|
||||||
|
+ " VARCHAR,"
|
||||||
|
+ KEY_IRPD_IMAGES
|
||||||
|
+ " VARCHAR)";
|
||||||
|
|
||||||
public static final String KEY_IRPD_VISIBILITY_IMAGES = "IRPD_VISIBILITY_IMAGES";
|
public static final String KEY_IRPD_VISIBILITY_IMAGES = "IRPD_VISIBILITY_IMAGES";
|
||||||
public static final String KEY_IRPD_VISIBILITY_MODIFY_IMAGES = "IRPD_VISIBILITY_IMAGES_MODIFY";
|
public static final String KEY_IRPD_VISIBILITY_MODIFY_IMAGES = "IRPD_VISIBILITY_IMAGES_MODIFY";
|
||||||
public static final String TABLE_IRPD_VISIBILITY = "DR_IRPD_VISIBILITY";
|
public static final String TABLE_IRPD_VISIBILITY = "DR_IRPD_VISIBILITY";
|
||||||
|
|||||||
@@ -235,7 +235,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
img_planogram.setEnabled(false);
|
img_planogram.setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNothingSelected(AdapterView<?> parent) {
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
|
|
||||||
@@ -694,7 +693,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
defdata.clear();
|
defdata.clear();
|
||||||
btnsku.setBackgroundResource(R.color.colorPrimary);
|
btnsku.setBackgroundResource(R.color.colorPrimary);
|
||||||
if (camera_allow.equals("1")) {
|
if (camera_allow.equals("1")) {
|
||||||
btnimage.setBackgroundResource(country_id.equals("6") ? R.mipmap.camera_orange : R.drawable.camera_orange_star_green);
|
btnimage.setBackgroundResource(country_id.equals("6") ? R.mipmap.camera_orange_star_green : R.mipmap.camera_orange);
|
||||||
btnimage1.setBackgroundResource(R.mipmap.camera_orange);
|
btnimage1.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
btnimage2.setBackgroundResource(R.mipmap.camera_orange);
|
btnimage2.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -167,68 +167,32 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
db.InsertCategoryPictureData(CP, listdat, categoryId);
|
db.InsertCategoryPictureData(CP, listdat, categoryId);
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
|
||||||
/* AlertDialog.Builder builder = new AlertDialog.Builder(CategoryPicture.this);
|
|
||||||
builder.setMessage(getResources().getString(R.string.check_save_message))
|
|
||||||
.setCancelable(false)
|
|
||||||
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
db.open();
|
|
||||||
|
|
||||||
db.InsertCategoryPictureData(CP, listdat, categoryId);
|
|
||||||
finish();
|
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
dialog.cancel();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
AlertDialog alert = builder.create();
|
|
||||||
alert.show();*/
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(view, R.string.title_activity_take_image, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(view, R.string.title_activity_take_image, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
im1.setOnClickListener(new View.OnClickListener() {
|
im1.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
|
|
||||||
_pathforcheck1 = store_id + "CategoryPicture1" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck1 = store_id + "CategoryPicture1" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck1;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck1;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
im2.setOnClickListener(view -> {
|
im2.setOnClickListener(view -> {
|
||||||
|
|
||||||
_pathforcheck2 = store_id + "CategoryPicture2" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck2 = store_id + "CategoryPicture2" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck2;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck2;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
});
|
});
|
||||||
im3.setOnClickListener(view -> {
|
im3.setOnClickListener(view -> {
|
||||||
|
|
||||||
_pathforcheck3 = store_id + "CategoryPicture3" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
_pathforcheck3 = store_id + "CategoryPicture3" + categoryId + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck3;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck3;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
im4.setOnClickListener(view -> {
|
im4.setOnClickListener(view -> {
|
||||||
|
|
||||||
@@ -237,8 +201,6 @@ public class CategoryPicture extends AppCompatActivity {
|
|||||||
_path = CommonString.getImagesFolder(context) + _pathforcheck4;
|
_path = CommonString.getImagesFolder(context) + _pathforcheck4;
|
||||||
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
lat = getIntent().getStringExtra(CommonString.KEY_LATITUDE);
|
lat = getIntent().getStringExtra(CommonString.KEY_LATITUDE);
|
||||||
lon = getIntent().getStringExtra(CommonString.KEY_LONGITUDE);
|
lon = getIntent().getStringExtra(CommonString.KEY_LONGITUDE);
|
||||||
coverageBean = db.getCoverageSpecificData(visit_date, store_id);
|
coverageBean = db.getCoverageSpecificData(visit_date, store_id);
|
||||||
|
|
||||||
new BackgroundTask(CheckoutActivity.this).execute();
|
new BackgroundTask(CheckoutActivity.this).execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,7 +168,6 @@ public class CheckoutActivity extends AppCompatActivity {
|
|||||||
table = CommonString.KEY_ADHOC_JOURNEY_PLAN;
|
table = CommonString.KEY_ADHOC_JOURNEY_PLAN;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
db.updateCheckoutStatus(store_id, CommonString.KEY_Y, table);
|
db.updateCheckoutStatus(store_id, CommonString.KEY_Y, table);
|
||||||
} else {
|
} else {
|
||||||
if (result.toString().equalsIgnoreCase(CommonString.KEY_FALSE)) {
|
if (result.toString().equalsIgnoreCase(CommonString.KEY_FALSE)) {
|
||||||
|
|||||||
@@ -1,22 +1,19 @@
|
|||||||
package cpm.com.gskmtorange.dailyentry
|
package cpm.com.gskmtorange.dailyentry
|
||||||
|
|
||||||
import android.Manifest
|
|
||||||
import android.content.BroadcastReceiver
|
import android.content.BroadcastReceiver
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.DialogInterface
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.IntentFilter
|
import android.content.IntentFilter
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.content.pm.PackageManager
|
import android.net.ConnectivityManager
|
||||||
import android.os.Build
|
import android.net.NetworkCapabilities
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.preference.PreferenceManager
|
import android.preference.PreferenceManager
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
|
import android.widget.Toast
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.app.ActivityCompat
|
|
||||||
import androidx.core.content.ContextCompat
|
|
||||||
import androidx.core.net.toUri
|
import androidx.core.net.toUri
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||||
@@ -35,7 +32,6 @@ import cpm.com.gskmtorange.constant.CommonFunctions
|
|||||||
import cpm.com.gskmtorange.constant.CommonFunctions.savefile
|
import cpm.com.gskmtorange.constant.CommonFunctions.savefile
|
||||||
import cpm.com.gskmtorange.constant.CommonString
|
import cpm.com.gskmtorange.constant.CommonString
|
||||||
import cpm.com.gskmtorange.constant.CommonUtils
|
import cpm.com.gskmtorange.constant.CommonUtils
|
||||||
import cpm.com.gskmtorange.databinding.ActivityPdimageBinding
|
|
||||||
import cpm.com.gskmtorange.databinding.ActivityPdvisibilityBinding
|
import cpm.com.gskmtorange.databinding.ActivityPdvisibilityBinding
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
@@ -47,6 +43,7 @@ class PDVisibilityActivity : AppCompatActivity() {
|
|||||||
var categoryName: String? = null
|
var categoryName: String? = null
|
||||||
var categoryId: String? = null
|
var categoryId: String? = null
|
||||||
var store_id: String? = null;
|
var store_id: String? = null;
|
||||||
|
var lang: String? = null;
|
||||||
var date: String? = null;
|
var date: String? = null;
|
||||||
var store_type_id: String? = null
|
var store_type_id: String? = null
|
||||||
var class_id: String? = null
|
var class_id: String? = null
|
||||||
@@ -62,6 +59,8 @@ class PDVisibilityActivity : AppCompatActivity() {
|
|||||||
private var adapter: SubCatPdAdapter? = null
|
private var adapter: SubCatPdAdapter? = null
|
||||||
val PERMISSION_ALL: Int = 99
|
val PERMISSION_ALL: Int = 99
|
||||||
private var _pos = -1;
|
private var _pos = -1;
|
||||||
|
var devicename : String? = ""
|
||||||
|
var store_name : String? = ""
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
@@ -73,7 +72,9 @@ class PDVisibilityActivity : AppCompatActivity() {
|
|||||||
preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
db?.open()
|
db?.open()
|
||||||
preferences?.let {
|
preferences?.let {
|
||||||
|
lang = it.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
store_id = it.getString(CommonString.KEY_STORE_ID, "")
|
store_id = it.getString(CommonString.KEY_STORE_ID, "")
|
||||||
|
store_name = it.getString(CommonString.KEY_STORE_NAME, "")
|
||||||
username = it.getString(CommonString.KEY_USERNAME, "")
|
username = it.getString(CommonString.KEY_USERNAME, "")
|
||||||
store_type_id = it.getString(CommonString.KEY_STORETYPE_ID, "")
|
store_type_id = it.getString(CommonString.KEY_STORETYPE_ID, "")
|
||||||
class_id = it.getString(CommonString.KEY_CLASS_ID, "")
|
class_id = it.getString(CommonString.KEY_CLASS_ID, "")
|
||||||
@@ -81,7 +82,9 @@ class PDVisibilityActivity : AppCompatActivity() {
|
|||||||
country_id = it.getString(CommonString.KEY_COUNTRY_ID, "")
|
country_id = it.getString(CommonString.KEY_COUNTRY_ID, "")
|
||||||
store_flag_str = it.getString(CommonString.KEY_STORE_FLAG, "")
|
store_flag_str = it.getString(CommonString.KEY_STORE_FLAG, "")
|
||||||
date = it.getString(CommonString.KEY_DATE, "")
|
date = it.getString(CommonString.KEY_DATE, "")
|
||||||
|
//Log.d("languagedata", lang.toString());
|
||||||
}
|
}
|
||||||
|
devicename = android.os.Build.MANUFACTURER
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(
|
CommonFunctions.updateLangResources(
|
||||||
context, preferences?.getString(CommonString.KEY_LANGUAGE, "")
|
context, preferences?.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
@@ -158,7 +161,7 @@ class PDVisibilityActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
callAdapter()
|
callAdapter()
|
||||||
checkAndRequestPermissions()
|
// checkAndRequestPermissions()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
@@ -196,7 +199,6 @@ class PDVisibilityActivity : AppCompatActivity() {
|
|||||||
if (id == R.id.action_settings) {
|
if (id == R.id.action_settings) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item)
|
return super.onOptionsItemSelected(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,12 +257,15 @@ class PDVisibilityActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun launchCamera(subCat_code: String) {
|
private fun launchCamera(subCat_code: String, subCategory: String, subCategoryId: String) {
|
||||||
val uploadFrom = "TestApp"
|
val uploadFrom = "TestApp"
|
||||||
|
var shelftype = "posm_$subCategory" +"_"+subCategoryId
|
||||||
|
shelftype = shelftype.lowercase().replace("[^a-z0-9_]".toRegex(), "")
|
||||||
val uploadParams = JSONObject(
|
val uploadParams = JSONObject(
|
||||||
"""
|
"""
|
||||||
{
|
{
|
||||||
"shop_id": 62475,
|
"shop_id": 62475,
|
||||||
|
"store_name": "abc",
|
||||||
"project_id": "4f57635b-6b07-45bf-bfba-c61c2826b6db",
|
"project_id": "4f57635b-6b07-45bf-bfba-c61c2826b6db",
|
||||||
"td_version_id": 178,
|
"td_version_id": 178,
|
||||||
"shelf_image_id": null,
|
"shelf_image_id": null,
|
||||||
@@ -275,32 +280,56 @@ class PDVisibilityActivity : AppCompatActivity() {
|
|||||||
"level": 1,
|
"level": 1,
|
||||||
"uploadOnlyOnWifi": 0,
|
"uploadOnlyOnWifi": 0,
|
||||||
"app_session_id": "8e2faa6b-d6fe-413a-a693-76a0cbe0ce71",
|
"app_session_id": "8e2faa6b-d6fe-413a-a693-76a0cbe0ce71",
|
||||||
"metadata": { "Device_Name": "Samsung" }
|
"metadata": { "Device_Name": $devicename,"User_name": $username }
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
uploadParams.put("shelf_type", shelftype)
|
||||||
|
uploadParams.put("store_name", store_name)
|
||||||
uploadParams.put("shop_id", store_id)
|
uploadParams.put("shop_id", store_id)
|
||||||
uploadParams.put("user_id", username)
|
uploadParams.put("user_id", username)
|
||||||
uploadParams.put("category_id", subCat_code)
|
uploadParams.put("category_id", subCat_code)
|
||||||
uploadParams.put("project_id", preferences?.getString(CommonString.KEY_PD_PROJECT_Id, ""))
|
uploadParams.put("project_id", preferences?.getString(CommonString.KEY_PD_PROJECT_Id, ""))
|
||||||
|
Log.d("uploadparams",uploadParams.toString());
|
||||||
|
|
||||||
CameraSDK.startCamera(
|
if(!lang.equals("ENGLISH",ignoreCase = true)){
|
||||||
context = this,
|
CameraSDK.startCamera(
|
||||||
orientation = "",
|
context = this,
|
||||||
widthPercentage = 20,
|
orientation = "",
|
||||||
uploadParams = uploadParams,
|
widthPercentage = 20,
|
||||||
resolution = 3000,
|
uploadParams = uploadParams,
|
||||||
referenceUrl = "",
|
resolution = 3000,
|
||||||
allowBlurCheck = true,
|
referenceUrl = "",
|
||||||
allowCrop = true,
|
allowBlurCheck = true,
|
||||||
uploadFrom = uploadFrom,
|
allowCrop = true,
|
||||||
isRetake = false,
|
uploadFrom = uploadFrom,
|
||||||
showOverlapToggleButton = false,
|
isRetake = false,
|
||||||
showGridLines = true,
|
showOverlapToggleButton = false,
|
||||||
zoomLevel = 1.0,
|
showGridLines = true,
|
||||||
language_code = "en",
|
zoomLevel = 1.0,
|
||||||
isLambda = false
|
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() {
|
||||||
@@ -315,9 +344,13 @@ 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
|
||||||
launchCamera(data.subCatCode)
|
/* if (isNetworkAvailable(this@PDVisibilityActivity)) {
|
||||||
Log.d("subCatCode", data.subCatCode)
|
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)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
binding.rlContent.apply {
|
binding.rlContent.apply {
|
||||||
@@ -333,98 +366,18 @@ class PDVisibilityActivity : AppCompatActivity() {
|
|||||||
db?.InsertPdImageVisibilityData(date, store_id, categoryId, listdat, CommonString.KEY_DRAFT)
|
db?.InsertPdImageVisibilityData(date, store_id, categoryId, listdat, CommonString.KEY_DRAFT)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fun isNetworkAvailable(context: Context): Boolean {
|
||||||
|
val connectivityManager =
|
||||||
|
context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
|
||||||
|
|
||||||
private fun checkAndRequestPermissions() {
|
val network = connectivityManager.activeNetwork ?: return false
|
||||||
var read_phone_state = 0
|
val activeNetwork = connectivityManager.getNetworkCapabilities(network) ?: return false
|
||||||
var write_storage = 0
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
return when {
|
||||||
write_storage =
|
activeNetwork.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) -> true
|
||||||
ContextCompat.checkSelfPermission(this, Manifest.permission.READ_MEDIA_IMAGES)
|
activeNetwork.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR) -> true
|
||||||
} else {
|
activeNetwork.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET) -> true
|
||||||
read_phone_state =
|
else -> false
|
||||||
ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE)
|
|
||||||
write_storage =
|
|
||||||
ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val listPermissionsNeeded: MutableList<String> = java.util.ArrayList()
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
||||||
if (write_storage != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
listPermissionsNeeded.add(Manifest.permission.READ_MEDIA_IMAGES)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (write_storage != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
listPermissionsNeeded.add(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (listPermissionsNeeded.isNotEmpty()) {
|
|
||||||
ActivityCompat.requestPermissions(
|
|
||||||
this,
|
|
||||||
listPermissionsNeeded.toTypedArray<String>(),
|
|
||||||
PERMISSION_ALL
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onRequestPermissionsResult(
|
|
||||||
requestCode: Int,
|
|
||||||
permissions: Array<String>,
|
|
||||||
grantResults: IntArray
|
|
||||||
) {
|
|
||||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
|
||||||
if (requestCode == PERMISSION_ALL) {
|
|
||||||
val perms: MutableMap<String, Int> = HashMap()
|
|
||||||
// Initialize the map with both permissions
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
||||||
perms[Manifest.permission.READ_MEDIA_IMAGES] = PackageManager.PERMISSION_GRANTED
|
|
||||||
} else {
|
|
||||||
perms[Manifest.permission.WRITE_EXTERNAL_STORAGE] =
|
|
||||||
PackageManager.PERMISSION_GRANTED
|
|
||||||
}
|
|
||||||
// Fill with actual results from user
|
|
||||||
if (grantResults.isNotEmpty()) {
|
|
||||||
for (i in permissions.indices) perms[permissions[i]] = grantResults[i]
|
|
||||||
// Check for both permissions//
|
|
||||||
if (perms[Manifest.permission.READ_MEDIA_IMAGES] == PackageManager.PERMISSION_GRANTED &&
|
|
||||||
perms[Manifest.permission.WRITE_EXTERNAL_STORAGE] == PackageManager.PERMISSION_GRANTED
|
|
||||||
) {
|
|
||||||
Log.d("", "sms & location services permission granted")
|
|
||||||
} else {
|
|
||||||
Log.d("", "Some permissions are not granted ask again ")
|
|
||||||
if (ActivityCompat.shouldShowRequestPermissionRationale(
|
|
||||||
this,
|
|
||||||
Manifest.permission.READ_MEDIA_IMAGES
|
|
||||||
) ||
|
|
||||||
ActivityCompat.shouldShowRequestPermissionRationale(
|
|
||||||
this,
|
|
||||||
Manifest.permission.WRITE_EXTERNAL_STORAGE
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
showDialogOK(
|
|
||||||
"Photos or media Service Permission required for this app"
|
|
||||||
) { _: DialogInterface?, which: Int ->
|
|
||||||
when (which) {
|
|
||||||
DialogInterface.BUTTON_POSITIVE -> checkAndRequestPermissions()
|
|
||||||
DialogInterface.BUTTON_NEGATIVE -> {
|
|
||||||
// proceed with logic by disabling the related features or quit the app.
|
|
||||||
val startMain =
|
|
||||||
Intent(Intent.ACTION_MAIN)
|
|
||||||
startMain.addCategory(Intent.CATEGORY_HOME)
|
|
||||||
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
|
||||||
startActivity(startMain)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun showDialogOK(message: String, okListener: DialogInterface.OnClickListener) {
|
|
||||||
AlertDialog.Builder(this).setMessage(message).setPositiveButton("OK", okListener)
|
|
||||||
.setNegativeButton("Cancel", okListener).create().show()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,465 @@
|
|||||||
|
package cpm.com.gskmtorange.dailyentry
|
||||||
|
|
||||||
|
import android.Manifest
|
||||||
|
import android.content.BroadcastReceiver
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.DialogInterface
|
||||||
|
import android.content.Intent
|
||||||
|
import android.content.IntentFilter
|
||||||
|
import android.content.SharedPreferences
|
||||||
|
import android.content.pm.PackageManager
|
||||||
|
import android.os.Build
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.preference.PreferenceManager
|
||||||
|
import android.util.Log
|
||||||
|
import android.view.MenuItem
|
||||||
|
import androidx.appcompat.app.AlertDialog
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.core.app.ActivityCompat
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
|
import androidx.core.net.toUri
|
||||||
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.google.android.material.snackbar.Snackbar
|
||||||
|
import com.sj.camera_lib_android.Database.ReactPendingData
|
||||||
|
import com.sj.camera_lib_android.Database.ReactSingleImage
|
||||||
|
import com.sj.camera_lib_android.models.ImageUploadModel
|
||||||
|
import com.sj.camera_lib_android.utils.CameraSDK
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter
|
||||||
|
import cpm.com.gskmtorange.R
|
||||||
|
import cpm.com.gskmtorange.adapter.SubCatPdAdapter
|
||||||
|
import cpm.com.gskmtorange.adapter.data.ImageUri
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions.savefile
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString
|
||||||
|
import cpm.com.gskmtorange.constant.CommonUtils
|
||||||
|
import cpm.com.gskmtorange.databinding.ActivityPdPogBinding
|
||||||
|
import cpm.com.gskmtorange.databinding.ActivityPdimageBinding
|
||||||
|
import kotlinx.coroutines.delay
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
import org.json.JSONObject
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
class PD_Pog_Activity : AppCompatActivity() {
|
||||||
|
private var context: Context? = null
|
||||||
|
var categoryName: String? = null
|
||||||
|
var categoryId: String? = null
|
||||||
|
var store_id: String? = null;
|
||||||
|
var date: String? = null;
|
||||||
|
var store_type_id: String? = null
|
||||||
|
var class_id: String? = null
|
||||||
|
var key_account_id: String? = null
|
||||||
|
var country_id: String? = null
|
||||||
|
var store_flag_str: String? = null
|
||||||
|
private var preferences: SharedPreferences? = null
|
||||||
|
var db: GSKOrangeDB? = null
|
||||||
|
var listdat: ArrayList<CategoryPictureGetterSetter>? = ArrayList()
|
||||||
|
var username: String? = ""
|
||||||
|
private var kpi_name: String? = ""
|
||||||
|
private lateinit var binding: ActivityPdPogBinding
|
||||||
|
private var adapter: SubCatPdAdapter? = null
|
||||||
|
val PERMISSION_ALL: Int = 99
|
||||||
|
private var _pos = -1;
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
binding = ActivityPdPogBinding.inflate(layoutInflater)
|
||||||
|
setContentView(binding.root)
|
||||||
|
setSupportActionBar(binding.toolbar)
|
||||||
|
context = this
|
||||||
|
|
||||||
|
db = GSKOrangeDB(context)
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
|
db?.open()
|
||||||
|
preferences?.let {
|
||||||
|
store_id = it.getString(CommonString.KEY_STORE_ID, "")
|
||||||
|
username = it.getString(CommonString.KEY_USERNAME, "")
|
||||||
|
store_type_id = it.getString(CommonString.KEY_STORETYPE_ID, "")
|
||||||
|
class_id = it.getString(CommonString.KEY_CLASS_ID, "")
|
||||||
|
key_account_id = it.getString(CommonString.KEY_KEYACCOUNT_ID, "")
|
||||||
|
country_id = it.getString(CommonString.KEY_COUNTRY_ID, "")
|
||||||
|
store_flag_str = it.getString(CommonString.KEY_STORE_FLAG, "")
|
||||||
|
date = it.getString(CommonString.KEY_DATE, "")
|
||||||
|
}
|
||||||
|
|
||||||
|
CommonFunctions.updateLangResources(
|
||||||
|
context, preferences?.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
|
)
|
||||||
|
intent?.let {
|
||||||
|
categoryName = it.getStringExtra("categoryName")
|
||||||
|
categoryId = it.getStringExtra("categoryId")
|
||||||
|
kpi_name = it.getStringExtra("kpi_name")
|
||||||
|
}
|
||||||
|
supportActionBar?.apply {
|
||||||
|
setHomeButtonEnabled(true)
|
||||||
|
setDisplayHomeAsUpEnabled(true)
|
||||||
|
title = kpi_name
|
||||||
|
}
|
||||||
|
preferences?.getString(CommonString.KEY_PD_PROJECT_Id, "")?.let { projectId ->
|
||||||
|
val userId = preferences?.getString(CommonString.KEY_PD_USER_Id, "")
|
||||||
|
.takeIf { !it.isNullOrBlank() } ?: username
|
||||||
|
Log.d("pd_user_id",userId.toString());
|
||||||
|
|
||||||
|
CommonUtils.initializePDSDK(
|
||||||
|
this@PD_Pog_Activity,
|
||||||
|
projectId = projectId,
|
||||||
|
_userId = userId
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
registerIntentFilter(
|
||||||
|
listOf(
|
||||||
|
"DataSaved", "did-receive-queue-data", "did-receive-image-upload-status"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
binding.apply {
|
||||||
|
fab.setOnClickListener {
|
||||||
|
if (validate()) {
|
||||||
|
val builder = AlertDialog.Builder(this@PD_Pog_Activity)
|
||||||
|
builder.setMessage(getString(R.string.check_save_message)).setCancelable(false)
|
||||||
|
.setPositiveButton(getString(R.string.yes)) { dialog, _ ->
|
||||||
|
// Handle Yes button click
|
||||||
|
db?.open()
|
||||||
|
db?.InsertPdPogImageData(
|
||||||
|
date,
|
||||||
|
store_id,
|
||||||
|
categoryId,
|
||||||
|
listdat,
|
||||||
|
CommonString.KEY_COMPELETE
|
||||||
|
)?.let {
|
||||||
|
if (it > 0) {
|
||||||
|
Snackbar.make(
|
||||||
|
binding.fab,
|
||||||
|
resources.getString(R.string.save_message),
|
||||||
|
Snackbar.LENGTH_LONG
|
||||||
|
).setAction("Action", null).show()
|
||||||
|
lifecycleScope.launch {
|
||||||
|
delay(3000) // 3 seconds delay
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Snackbar.make(
|
||||||
|
binding.fab,
|
||||||
|
resources.getString(R.string.save_message),
|
||||||
|
Snackbar.LENGTH_LONG
|
||||||
|
).setAction("Action", null).show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dialog.dismiss()
|
||||||
|
}.setNegativeButton(getString(R.string.no)) { dialog, _ ->
|
||||||
|
dialog.cancel()
|
||||||
|
}
|
||||||
|
val alert = builder.create()
|
||||||
|
alert.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
callAdapter()
|
||||||
|
checkAndRequestPermissions()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
db?.open()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun validate(): Boolean {
|
||||||
|
var checkFlag = true // Use local variable to avoid issues
|
||||||
|
if (!listdat.isNullOrEmpty()) {
|
||||||
|
for (data in listdat!!) { // Use standard loop for better control
|
||||||
|
if (data.imageUris.isNullOrEmpty()) {
|
||||||
|
checkFlag = false // Set false if validation fails
|
||||||
|
Snackbar.make(
|
||||||
|
binding.fab,
|
||||||
|
"Please capture IR images of ${data.suB_CATEGORY}",
|
||||||
|
Snackbar.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
break // Stop further checks once an issue is found
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return checkFlag // Correctly return validation result
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
val id = item.itemId
|
||||||
|
if (id == android.R.id.home) {
|
||||||
|
//showDataLossAlert();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
if (id == R.id.action_settings) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
super.onDestroy()
|
||||||
|
LocalBroadcastManager.getInstance(this@PD_Pog_Activity)
|
||||||
|
.unregisterReceiver(myBroadcastReceiver) // onDestroy
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun registerIntentFilter(filters: List<String> = listOf()) {
|
||||||
|
filters.forEach { filter ->
|
||||||
|
LocalBroadcastManager.getInstance(this@PD_Pog_Activity)
|
||||||
|
.registerReceiver(myBroadcastReceiver, IntentFilter(filter))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private val savedImages = mutableListOf<ImageUri>()
|
||||||
|
private var myBroadcastReceiver: BroadcastReceiver = object : BroadcastReceiver() {
|
||||||
|
override fun onReceive(context: Context?, intent: Intent?) {
|
||||||
|
when (intent?.action) {
|
||||||
|
"did-receive-queue-data" -> {
|
||||||
|
val receivedList =
|
||||||
|
intent.getParcelableArrayListExtra<ReactPendingData>("imageList")
|
||||||
|
Log.d("DEBUG-LOG did-receive-queue-data", "$receivedList")
|
||||||
|
if (receivedList.isNullOrEmpty()) {
|
||||||
|
CameraSDK.uploadFailedImage(this@PD_Pog_Activity)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
"did-receive-image-upload-status" -> {
|
||||||
|
val receivedImage = intent.getParcelableExtra<ReactSingleImage>("image")
|
||||||
|
Log.d("DEBUG-LOG did-receive-image-upload-status", "$receivedImage")
|
||||||
|
}
|
||||||
|
|
||||||
|
"DataSaved" -> {
|
||||||
|
val receivedList =
|
||||||
|
intent.getParcelableArrayListExtra<ImageUploadModel>("imageListSaved")
|
||||||
|
Log.d("DEBUG-LOG DataSaved", "$receivedList")
|
||||||
|
receivedList?.let {
|
||||||
|
savedImages.clear()
|
||||||
|
it.forEach { item ->
|
||||||
|
val dir = CommonString.getImagesFolder(context)
|
||||||
|
val setName =
|
||||||
|
store_id + "_" + username?.replace(".", "") + "_IRPDIMG-" + File(
|
||||||
|
item.uri
|
||||||
|
).getName()
|
||||||
|
savedImages.add(ImageUri(uri = item.uri, modify_uri = setName))
|
||||||
|
savefile(item.uri.toUri(), "$dir $setName")
|
||||||
|
}
|
||||||
|
adapter?.updateItem(position = _pos, savedImages)
|
||||||
|
Log.e("savedImages", savedImages.toString())
|
||||||
|
_pos = -1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun launchCamera(subCat_code: String) {
|
||||||
|
val uploadFrom = "TestApp"
|
||||||
|
val uploadParams = JSONObject(
|
||||||
|
"""
|
||||||
|
{
|
||||||
|
"shop_id": 62475,
|
||||||
|
"project_id": "4f57635b-6b07-45bf-bfba-c61c2826b6db",
|
||||||
|
"td_version_id": 178,
|
||||||
|
"shelf_image_id": null,
|
||||||
|
"asset_image_id": null,
|
||||||
|
"shelf_type": "Primary Shelf",
|
||||||
|
"category_id": 123,
|
||||||
|
"user_id": 133,
|
||||||
|
"isConnected": true,
|
||||||
|
"sn_image_type": "skus",
|
||||||
|
"image_type": "multiple",
|
||||||
|
"seq_no": 1,
|
||||||
|
"level": 1,
|
||||||
|
"uploadOnlyOnWifi": 0,
|
||||||
|
"app_session_id": "8e2faa6b-d6fe-413a-a693-76a0cbe0ce71",
|
||||||
|
"metadata": { "Device_Name": "Samsung" }
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
uploadParams.put("shop_id", store_id)
|
||||||
|
uploadParams.put("user_id", username)
|
||||||
|
uploadParams.put("category_id", subCat_code)
|
||||||
|
uploadParams.put("project_id", preferences?.getString(CommonString.KEY_PD_PROJECT_Id, ""))
|
||||||
|
Log.d("uploadparamdata",uploadParams.toString());
|
||||||
|
|
||||||
|
CameraSDK.startCamera(
|
||||||
|
context = this,
|
||||||
|
orientation = "",
|
||||||
|
widthPercentage = 20,
|
||||||
|
uploadParams = uploadParams,
|
||||||
|
resolution = 3000,
|
||||||
|
referenceUrl = "",
|
||||||
|
allowBlurCheck = true,
|
||||||
|
allowCrop = true,
|
||||||
|
uploadFrom = uploadFrom,
|
||||||
|
isRetake = false,
|
||||||
|
showOverlapToggleButton = false,
|
||||||
|
showGridLines = true,
|
||||||
|
zoomLevel = 1.0,
|
||||||
|
language_code = "en",
|
||||||
|
isLambda = false
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun callAdapter() {
|
||||||
|
if (country_id == "8") {
|
||||||
|
db?.open()
|
||||||
|
listdat = db?.getCategoryPicturePogdata(
|
||||||
|
date,
|
||||||
|
categoryId,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_STOREWISE
|
||||||
|
)
|
||||||
|
} else if (store_flag_str.equals(CommonString.FROM_DEVIATION, ignoreCase = true)) {
|
||||||
|
db?.open()
|
||||||
|
listdat = db?.getCategoryPicturePogdata(
|
||||||
|
date,
|
||||||
|
categoryId,
|
||||||
|
key_account_id,
|
||||||
|
store_type_id,
|
||||||
|
class_id,
|
||||||
|
store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADHOC
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
db?.open()
|
||||||
|
listdat = db?.getCategoryPicturePogdata(
|
||||||
|
date,
|
||||||
|
categoryId,
|
||||||
|
key_account_id,
|
||||||
|
store_type_id,
|
||||||
|
class_id,
|
||||||
|
store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
Log.d("listdatsize", listdat?.size.toString())
|
||||||
|
adapter = SubCatPdAdapter(
|
||||||
|
category = categoryName,
|
||||||
|
context = this,
|
||||||
|
subcates = ArrayList(),
|
||||||
|
btnlistener = object : SubCatPdAdapter.BtnClickListener {
|
||||||
|
override fun onStartSessionClick(_pos: Int, data: CategoryPictureGetterSetter) {
|
||||||
|
this@PD_Pog_Activity._pos = _pos
|
||||||
|
launchCamera(data.subCatCode)
|
||||||
|
Log.d("subCatCode", data.subCatCode)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
binding.rlContent.apply {
|
||||||
|
recyclerViewSubCat.adapter = adapter
|
||||||
|
recyclerViewSubCat.layoutManager = LinearLayoutManager(this@PD_Pog_Activity)
|
||||||
|
adapter?.addsubCatItems(listdat)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
super.onPause()
|
||||||
|
db?.open()
|
||||||
|
if (!db!!.isSOSPogCategory(store_id, date, CommonString.KEY_COMPELETE, categoryId)) {
|
||||||
|
db?.InsertPdPogImageData(date, store_id, categoryId, listdat, CommonString.KEY_DRAFT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun checkAndRequestPermissions() {
|
||||||
|
var read_phone_state = 0
|
||||||
|
var write_storage = 0
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
|
write_storage =
|
||||||
|
ContextCompat.checkSelfPermission(this, Manifest.permission.READ_MEDIA_IMAGES)
|
||||||
|
} else {
|
||||||
|
read_phone_state =
|
||||||
|
ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE)
|
||||||
|
write_storage =
|
||||||
|
ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||||
|
}
|
||||||
|
|
||||||
|
val listPermissionsNeeded: MutableList<String> = java.util.ArrayList()
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
|
if (write_storage != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
listPermissionsNeeded.add(Manifest.permission.READ_MEDIA_IMAGES)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (write_storage != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
listPermissionsNeeded.add(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (listPermissionsNeeded.isNotEmpty()) {
|
||||||
|
ActivityCompat.requestPermissions(
|
||||||
|
this,
|
||||||
|
listPermissionsNeeded.toTypedArray<String>(),
|
||||||
|
PERMISSION_ALL
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override fun onRequestPermissionsResult(
|
||||||
|
requestCode: Int,
|
||||||
|
permissions: Array<String>,
|
||||||
|
grantResults: IntArray
|
||||||
|
) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
||||||
|
if (requestCode == PERMISSION_ALL) {
|
||||||
|
val perms: MutableMap<String, Int> = HashMap()
|
||||||
|
// Initialize the map with both permissions
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
|
perms[Manifest.permission.READ_MEDIA_IMAGES] = PackageManager.PERMISSION_GRANTED
|
||||||
|
} else {
|
||||||
|
perms[Manifest.permission.WRITE_EXTERNAL_STORAGE] =
|
||||||
|
PackageManager.PERMISSION_GRANTED
|
||||||
|
}
|
||||||
|
// Fill with actual results from user
|
||||||
|
if (grantResults.isNotEmpty()) {
|
||||||
|
for (i in permissions.indices) perms[permissions[i]] = grantResults[i]
|
||||||
|
// Check for both permissions//
|
||||||
|
if (perms[Manifest.permission.READ_MEDIA_IMAGES] == PackageManager.PERMISSION_GRANTED &&
|
||||||
|
perms[Manifest.permission.WRITE_EXTERNAL_STORAGE] == PackageManager.PERMISSION_GRANTED
|
||||||
|
) {
|
||||||
|
Log.d("", "sms & location services permission granted")
|
||||||
|
} else {
|
||||||
|
Log.d("", "Some permissions are not granted ask again ")
|
||||||
|
if (ActivityCompat.shouldShowRequestPermissionRationale(
|
||||||
|
this,
|
||||||
|
Manifest.permission.READ_MEDIA_IMAGES
|
||||||
|
) ||
|
||||||
|
ActivityCompat.shouldShowRequestPermissionRationale(
|
||||||
|
this,
|
||||||
|
Manifest.permission.WRITE_EXTERNAL_STORAGE
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
showDialogOK(
|
||||||
|
"Photos or media Service Permission required for this app"
|
||||||
|
) { _: DialogInterface?, which: Int ->
|
||||||
|
when (which) {
|
||||||
|
DialogInterface.BUTTON_POSITIVE -> checkAndRequestPermissions()
|
||||||
|
DialogInterface.BUTTON_NEGATIVE -> {
|
||||||
|
// proceed with logic by disabling the related features or quit the app.
|
||||||
|
val startMain =
|
||||||
|
Intent(Intent.ACTION_MAIN)
|
||||||
|
startMain.addCategory(Intent.CATEGORY_HOME)
|
||||||
|
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
|
startActivity(startMain)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showDialogOK(message: String, okListener: DialogInterface.OnClickListener) {
|
||||||
|
AlertDialog.Builder(this).setMessage(message).setPositiveButton("OK", okListener)
|
||||||
|
.setNegativeButton("Cancel", okListener).create().show()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,331 @@
|
|||||||
|
package cpm.com.gskmtorange.dailyentry
|
||||||
|
|
||||||
|
import android.Manifest
|
||||||
|
import android.content.BroadcastReceiver
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.content.IntentFilter
|
||||||
|
import android.content.SharedPreferences
|
||||||
|
import android.content.pm.PackageManager
|
||||||
|
import android.os.Build
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.preference.PreferenceManager
|
||||||
|
import android.util.Log
|
||||||
|
import android.view.MenuItem
|
||||||
|
import androidx.activity.enableEdgeToEdge
|
||||||
|
import androidx.appcompat.app.AlertDialog
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.core.app.ActivityCompat
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
|
import androidx.core.net.toUri
|
||||||
|
import androidx.core.view.ViewCompat
|
||||||
|
import androidx.core.view.WindowInsetsCompat
|
||||||
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.google.android.material.snackbar.Snackbar
|
||||||
|
import com.sj.camera_lib_android.Database.ReactPendingData
|
||||||
|
import com.sj.camera_lib_android.Database.ReactSingleImage
|
||||||
|
import com.sj.camera_lib_android.models.ImageUploadModel
|
||||||
|
import com.sj.camera_lib_android.utils.CameraSDK
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter
|
||||||
|
import cpm.com.gskmtorange.R
|
||||||
|
import cpm.com.gskmtorange.adapter.RealtimeAdapter
|
||||||
|
import cpm.com.gskmtorange.adapter.SubCatPdAdapter
|
||||||
|
import cpm.com.gskmtorange.adapter.data.ImageUri
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions.savefile
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString
|
||||||
|
import cpm.com.gskmtorange.constant.CommonUtils
|
||||||
|
import cpm.com.gskmtorange.databinding.ActivityPdRealtimeReportBinding
|
||||||
|
import cpm.com.gskmtorange.databinding.ActivityPdimageBinding
|
||||||
|
import kotlinx.coroutines.delay
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
import org.json.JSONObject
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
class PD_Realtime_Report : AppCompatActivity() {
|
||||||
|
private var context: Context? = null
|
||||||
|
var categoryName: String? = null
|
||||||
|
var categoryId: String? = null
|
||||||
|
var store_id: String? = null;
|
||||||
|
var date: String? = null;
|
||||||
|
var lang: String? = null;
|
||||||
|
var store_type_id: String? = null
|
||||||
|
var class_id: String? = null
|
||||||
|
var key_account_id: String? = null
|
||||||
|
var country_id: String? = null
|
||||||
|
var store_flag_str: String? = null
|
||||||
|
private var preferences: SharedPreferences? = null
|
||||||
|
var db: GSKOrangeDB? = null
|
||||||
|
var listdat: ArrayList<CategoryPictureGetterSetter>? = ArrayList()
|
||||||
|
var username: String? = ""
|
||||||
|
private var kpi_name: String? = ""
|
||||||
|
private lateinit var binding: ActivityPdRealtimeReportBinding
|
||||||
|
private var adapter: RealtimeAdapter? = null
|
||||||
|
val PERMISSION_ALL: Int = 99
|
||||||
|
private var _pos = -1;
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
binding = ActivityPdRealtimeReportBinding.inflate(layoutInflater)
|
||||||
|
setContentView(binding.root)
|
||||||
|
setSupportActionBar(binding.toolbar)
|
||||||
|
context = this
|
||||||
|
db = GSKOrangeDB(context)
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
|
db?.open()
|
||||||
|
preferences?.let {
|
||||||
|
lang = it.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
|
store_id = it.getString(CommonString.KEY_STORE_ID, "")
|
||||||
|
username = it.getString(CommonString.KEY_USERNAME, "")
|
||||||
|
store_type_id = it.getString(CommonString.KEY_STORETYPE_ID, "")
|
||||||
|
class_id = it.getString(CommonString.KEY_CLASS_ID, "")
|
||||||
|
key_account_id = it.getString(CommonString.KEY_KEYACCOUNT_ID, "")
|
||||||
|
country_id = it.getString(CommonString.KEY_COUNTRY_ID, "")
|
||||||
|
store_flag_str = it.getString(CommonString.KEY_STORE_FLAG, "")
|
||||||
|
date = it.getString(CommonString.KEY_DATE, "")
|
||||||
|
}
|
||||||
|
|
||||||
|
CommonFunctions.updateLangResources(
|
||||||
|
context, preferences?.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
|
)
|
||||||
|
intent?.let {
|
||||||
|
categoryName = it.getStringExtra("categoryName")
|
||||||
|
categoryId = it.getStringExtra("categoryId")
|
||||||
|
kpi_name = it.getStringExtra("kpi_name")
|
||||||
|
}
|
||||||
|
supportActionBar?.apply {
|
||||||
|
setHomeButtonEnabled(true)
|
||||||
|
setDisplayHomeAsUpEnabled(true)
|
||||||
|
title = kpi_name
|
||||||
|
}
|
||||||
|
preferences?.getString(CommonString.KEY_PD_PROJECT_Id, "")?.let { projectId ->
|
||||||
|
val userId = preferences?.getString(CommonString.KEY_PD_USER_Id, "")
|
||||||
|
.takeIf { !it.isNullOrBlank() } ?: username
|
||||||
|
Log.d("pd_user_id",userId.toString());
|
||||||
|
|
||||||
|
CommonUtils.initializePDSDK(
|
||||||
|
this@PD_Realtime_Report,
|
||||||
|
projectId = projectId,
|
||||||
|
_userId = userId
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
registerIntentFilter(
|
||||||
|
listOf(
|
||||||
|
"DataSaved", "did-receive-queue-data", "did-receive-image-upload-status"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
callAdapter()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
db?.open()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
val id = item.itemId
|
||||||
|
if (id == android.R.id.home) {
|
||||||
|
//showDataLossAlert();
|
||||||
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
if (id == R.id.action_settings) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
super.onDestroy()
|
||||||
|
LocalBroadcastManager.getInstance(this@PD_Realtime_Report)
|
||||||
|
.unregisterReceiver(myBroadcastReceiver) // onDestroy
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun registerIntentFilter(filters: List<String> = listOf()) {
|
||||||
|
filters.forEach { filter ->
|
||||||
|
LocalBroadcastManager.getInstance(this@PD_Realtime_Report)
|
||||||
|
.registerReceiver(myBroadcastReceiver, IntentFilter(filter))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private val savedImages = mutableListOf<ImageUri>()
|
||||||
|
private var myBroadcastReceiver: BroadcastReceiver = object : BroadcastReceiver() {
|
||||||
|
override fun onReceive(context: Context?, intent: Intent?) {
|
||||||
|
when (intent?.action) {
|
||||||
|
"did-receive-queue-data" -> {
|
||||||
|
val receivedList =
|
||||||
|
intent.getParcelableArrayListExtra<ReactPendingData>("imageList")
|
||||||
|
Log.d("DEBUG-LOG did-receive-queue-data", "$receivedList")
|
||||||
|
if (receivedList.isNullOrEmpty()) {
|
||||||
|
CameraSDK.uploadFailedImage(this@PD_Realtime_Report)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
"did-receive-image-upload-status" -> {
|
||||||
|
val receivedImage = intent.getParcelableExtra<ReactSingleImage>("image")
|
||||||
|
Log.d("DEBUG-LOG did-receive-image-upload-status", "$receivedImage")
|
||||||
|
}
|
||||||
|
|
||||||
|
"DataSaved" -> {
|
||||||
|
val receivedList =
|
||||||
|
intent.getParcelableArrayListExtra<ImageUploadModel>("imageListSaved")
|
||||||
|
Log.d("DEBUG-LOG DataSaved", "$receivedList")
|
||||||
|
receivedList?.let {
|
||||||
|
savedImages.clear()
|
||||||
|
it.forEach { item ->
|
||||||
|
val dir = CommonString.getImagesFolder(context)
|
||||||
|
val setName =
|
||||||
|
store_id + "_" + username?.replace(".", "") + "_IRPDIMG-" + File(
|
||||||
|
item.uri
|
||||||
|
).getName()
|
||||||
|
savedImages.add(ImageUri(uri = item.uri, modify_uri = setName))
|
||||||
|
savefile(item.uri.toUri(), "$dir $setName")
|
||||||
|
}
|
||||||
|
adapter?.updateItem(position = _pos, savedImages)
|
||||||
|
Log.e("savedImages", savedImages.toString())
|
||||||
|
_pos = -1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun 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() {
|
||||||
|
if (country_id == "8") {
|
||||||
|
db?.open()
|
||||||
|
listdat = db?.getCategoryPicturedata(
|
||||||
|
date,
|
||||||
|
categoryId,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_STOREWISE
|
||||||
|
)
|
||||||
|
} else if (store_flag_str.equals(CommonString.FROM_DEVIATION, ignoreCase = true)) {
|
||||||
|
db?.open()
|
||||||
|
listdat = db?.getCategoryPicturedata(
|
||||||
|
date,
|
||||||
|
categoryId,
|
||||||
|
key_account_id,
|
||||||
|
store_type_id,
|
||||||
|
class_id,
|
||||||
|
store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADHOC
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
db?.open()
|
||||||
|
listdat = db?.getCategoryPicturedata(
|
||||||
|
date,
|
||||||
|
categoryId,
|
||||||
|
key_account_id,
|
||||||
|
store_type_id,
|
||||||
|
class_id,
|
||||||
|
store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK
|
||||||
|
)
|
||||||
|
}
|
||||||
|
adapter = RealtimeAdapter(
|
||||||
|
category = categoryName,
|
||||||
|
context = this,
|
||||||
|
subcates = ArrayList(),
|
||||||
|
btnlistener = object : RealtimeAdapter.BtnClickListener {
|
||||||
|
override fun onStartSessionClick(_pos: Int, data: CategoryPictureGetterSetter) {
|
||||||
|
this@PD_Realtime_Report._pos = _pos
|
||||||
|
val intent = Intent(this@PD_Realtime_Report, PD_Realtime_Report_Detail::class.java)
|
||||||
|
intent.putExtra("categoryName", categoryName)
|
||||||
|
intent.putExtra("categoryId", categoryId)
|
||||||
|
intent.putExtra("pd_subcat_code", data.subCatCode)
|
||||||
|
intent.putExtra("subcat_name", data.suB_CATEGORY)
|
||||||
|
intent.putExtra("kpi_name", "IR Realtime Report")
|
||||||
|
startActivity(intent)
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out)
|
||||||
|
// launchCamera(data.subCatCode)
|
||||||
|
// Log.d("subCatCode", data.subCatCode)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
binding.rlContent.apply {
|
||||||
|
recyclerViewSubCat.adapter = adapter
|
||||||
|
recyclerViewSubCat.layoutManager = LinearLayoutManager(this@PD_Realtime_Report)
|
||||||
|
adapter?.addsubCatItems(listdat)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+281
@@ -0,0 +1,281 @@
|
|||||||
|
package cpm.com.gskmtorange.dailyentry
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.SharedPreferences
|
||||||
|
import android.net.ConnectivityManager
|
||||||
|
import android.net.NetworkCapabilities
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.preference.PreferenceManager
|
||||||
|
import android.util.Log
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.squareup.okhttp.Callback
|
||||||
|
import com.squareup.okhttp.HttpUrl
|
||||||
|
import com.squareup.okhttp.OkHttpClient
|
||||||
|
import com.squareup.okhttp.Request
|
||||||
|
import com.squareup.okhttp.Response
|
||||||
|
import cpm.com.gskmtorange.Database.GSKOrangeDB
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter
|
||||||
|
import cpm.com.gskmtorange.adapter.ScoreAdapter
|
||||||
|
import cpm.com.gskmtorange.constant.CommonFunctions
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString
|
||||||
|
import cpm.com.gskmtorange.databinding.ActivityPdRealtimeReportDetailBinding
|
||||||
|
import cpm.com.gskmtorange.utils.ScoreItem
|
||||||
|
import org.json.JSONObject
|
||||||
|
import android.os.Handler
|
||||||
|
import android.os.Looper
|
||||||
|
import android.view.MenuItem
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.Toast
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.Locale
|
||||||
|
|
||||||
|
class PD_Realtime_Report_Detail : AppCompatActivity() {
|
||||||
|
private var context: Context? = null
|
||||||
|
var categoryName: String? = null
|
||||||
|
var categoryId: String? = null
|
||||||
|
var store_id: String? = null;
|
||||||
|
var date: String? = null;
|
||||||
|
var lang: String? = null;
|
||||||
|
var store_type_id: String? = null
|
||||||
|
var class_id: String? = null
|
||||||
|
var key_account_id: String? = null
|
||||||
|
var country_id: String? = null
|
||||||
|
var pd_categoryId: String? = null
|
||||||
|
var subcat_name: String? = null
|
||||||
|
var store_flag_str: String? = null
|
||||||
|
private var preferences: SharedPreferences? = null
|
||||||
|
var db: GSKOrangeDB? = null
|
||||||
|
var listdat: ArrayList<CategoryPictureGetterSetter>? = ArrayList()
|
||||||
|
var username: String? = ""
|
||||||
|
private var kpi_name: String? = ""
|
||||||
|
private lateinit var binding: ActivityPdRealtimeReportDetailBinding
|
||||||
|
val PERMISSION_ALL: Int = 99
|
||||||
|
private var _pos = -1;
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
binding = ActivityPdRealtimeReportDetailBinding.inflate(layoutInflater)
|
||||||
|
setContentView(binding.root)
|
||||||
|
setSupportActionBar(binding.toolbar)
|
||||||
|
context = this
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
|
preferences?.let {
|
||||||
|
lang = it.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
|
store_id = it.getString(CommonString.KEY_STORE_ID, "")
|
||||||
|
username = it.getString(CommonString.KEY_USERNAME, "")
|
||||||
|
store_type_id = it.getString(CommonString.KEY_STORETYPE_ID, "")
|
||||||
|
class_id = it.getString(CommonString.KEY_CLASS_ID, "")
|
||||||
|
key_account_id = it.getString(CommonString.KEY_KEYACCOUNT_ID, "")
|
||||||
|
country_id = it.getString(CommonString.KEY_COUNTRY_ID, "")
|
||||||
|
store_flag_str = it.getString(CommonString.KEY_STORE_FLAG, "")
|
||||||
|
date = it.getString(CommonString.KEY_DATE, "")
|
||||||
|
}
|
||||||
|
CommonFunctions.updateLangResources(
|
||||||
|
context, preferences?.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
|
)
|
||||||
|
intent?.let {
|
||||||
|
categoryName = it.getStringExtra("categoryName")
|
||||||
|
categoryId = it.getStringExtra("categoryId")
|
||||||
|
kpi_name = it.getStringExtra("kpi_name")
|
||||||
|
pd_categoryId = it.getStringExtra("pd_subcat_code")
|
||||||
|
subcat_name = it.getStringExtra("subcat_name")
|
||||||
|
Log.d("pdcode",pd_categoryId.toString())
|
||||||
|
}
|
||||||
|
supportActionBar?.apply {
|
||||||
|
setHomeButtonEnabled(true)
|
||||||
|
setDisplayHomeAsUpEnabled(true)
|
||||||
|
title = kpi_name
|
||||||
|
}
|
||||||
|
preferences?.getString(CommonString.KEY_PD_PROJECT_Id, "")?.let { projectId ->
|
||||||
|
val userId = preferences?.getString(CommonString.KEY_PD_USER_Id, "")
|
||||||
|
.takeIf { !it.isNullOrBlank() } ?: username
|
||||||
|
Log.d("pd_user_id", userId.toString());
|
||||||
|
|
||||||
|
}
|
||||||
|
if (isNetworkAvailable(this@PD_Realtime_Report_Detail)) {
|
||||||
|
fetchlivedata()
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, "No internet connection", Toast.LENGTH_SHORT).show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private fun fetchlivedata() {
|
||||||
|
Log.d("apidata",date +","+store_id+","+pd_categoryId+","+preferences?.getString(CommonString.KEY_PD_PROJECT_Id, ""))
|
||||||
|
|
||||||
|
Handler(Looper.getMainLooper()).post {
|
||||||
|
binding.progressBar.visibility = View.VISIBLE
|
||||||
|
binding.recyclerView.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
|
val client = OkHttpClient()
|
||||||
|
val formattedDate = formatDate(date)
|
||||||
|
val urlBuilder = HttpUrl.Builder()
|
||||||
|
.scheme("https")
|
||||||
|
.host("apis.shelfwatch.io")
|
||||||
|
.addPathSegment("get_haleon_insights")
|
||||||
|
.addQueryParameter("visit_date", formattedDate)
|
||||||
|
.addQueryParameter("store_id", store_id)
|
||||||
|
.addQueryParameter("category_id", pd_categoryId)
|
||||||
|
.addQueryParameter("project_id", preferences?.getString(CommonString.KEY_PD_PROJECT_Id, ""))
|
||||||
|
|
||||||
|
val request = Request.Builder()
|
||||||
|
.url(urlBuilder.build())
|
||||||
|
.build()
|
||||||
|
Log.d("apiparams",request.toString() + ","+urlBuilder)
|
||||||
|
|
||||||
|
client.newCall(request).enqueue(object : Callback {
|
||||||
|
override fun onFailure(request: Request?, e: java.io.IOException?) {
|
||||||
|
Log.e("RealtimeReport", "API call failed", e)
|
||||||
|
Handler(Looper.getMainLooper()).post {
|
||||||
|
binding.progressBar.visibility = View.GONE
|
||||||
|
binding.recyclerView.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResponse(response: Response?) {
|
||||||
|
Handler(Looper.getMainLooper()).post {
|
||||||
|
binding.progressBar.visibility = View.GONE
|
||||||
|
binding.recyclerView.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
val responseData = response?.body()?.string()
|
||||||
|
Log.d("responsedata", responseData.toString())
|
||||||
|
|
||||||
|
responseData?.let { jsonStr ->
|
||||||
|
try {
|
||||||
|
val json = JSONObject(jsonStr)
|
||||||
|
val output = json.getJSONObject("output")
|
||||||
|
val report = output.getJSONObject("report")
|
||||||
|
val overallArray = report.getJSONArray("overall")
|
||||||
|
val imagelist = output.getJSONArray("images")
|
||||||
|
|
||||||
|
var osa = "0%"
|
||||||
|
var msl = "0%"
|
||||||
|
var posm = "0%"
|
||||||
|
var sosSku = "0%"
|
||||||
|
var sosBrand = "0%"
|
||||||
|
|
||||||
|
for (i in 0 until overallArray.length()) {
|
||||||
|
val obj = overallArray.getJSONObject(i)
|
||||||
|
when (obj.getString("kpi_name")) {
|
||||||
|
"OSA" -> osa = obj.getString("value")
|
||||||
|
"MSL OSA" -> msl = obj.getString("value")
|
||||||
|
"POSM" -> posm = obj.getString("value")
|
||||||
|
"SOS - SKU Level" -> sosSku = obj.getString("value")
|
||||||
|
"SOS - Brand Level" -> sosBrand = obj.getString("value")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build OverallScore
|
||||||
|
val scoreItems = mutableListOf<ScoreItem>()
|
||||||
|
scoreItems.add(
|
||||||
|
ScoreItem.OverallScore(
|
||||||
|
osa = osa,
|
||||||
|
msl = msl,
|
||||||
|
posm = posm,
|
||||||
|
sosSku = sosSku,
|
||||||
|
sosBrand = sosBrand
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
// ===== Brand Details for "Toothpaste" =====
|
||||||
|
val detailedArray = report.getJSONArray("detailed")
|
||||||
|
var brandDetails: List<Pair<String, String>> = emptyList()
|
||||||
|
|
||||||
|
for (i in 0 until detailedArray.length()) {
|
||||||
|
val detail = detailedArray.getJSONObject(i)
|
||||||
|
if (detail.getString("kpi_name") == "SOS - Brand Level") {
|
||||||
|
val dataArray = detail.getJSONArray("data")
|
||||||
|
val brands = mutableListOf<Pair<String, String>>()
|
||||||
|
for (j in 0 until dataArray.length()) {
|
||||||
|
val brandObj = dataArray.getJSONObject(j)
|
||||||
|
val brandName = brandObj.optString("brand_name", "Unknown")
|
||||||
|
val value = brandObj.getString("value")
|
||||||
|
if (brandName.isNotEmpty() && brandName != "null") {
|
||||||
|
brands.add(brandName to value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
brandDetails = brands
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
scoreItems.add(
|
||||||
|
ScoreItem.CategoryScore(
|
||||||
|
categoryName = subcat_name.toString(),
|
||||||
|
msl = msl,
|
||||||
|
posm = posm,
|
||||||
|
sosSku = sosSku,
|
||||||
|
sosBrand = sosBrand,
|
||||||
|
brandDetails = brandDetails
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
// ===== IMAGE ITEMS =====
|
||||||
|
if (imagelist.length()>0) {
|
||||||
|
for (i in 0 until imagelist.length()) {
|
||||||
|
val imgObj = imagelist.getJSONObject(i)
|
||||||
|
val rawImages = imgObj.getJSONArray("raw_images")
|
||||||
|
for (j in 0 until rawImages.length()) {
|
||||||
|
val imgObjnew = rawImages.getJSONObject(j)
|
||||||
|
val url = imgObjnew.getString("url")
|
||||||
|
Log.d("imgurl",url);
|
||||||
|
scoreItems.add(ScoreItem.ImageItem(url))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update UI on main thread
|
||||||
|
Handler(Looper.getMainLooper()).post {
|
||||||
|
binding.recyclerView.layoutManager = LinearLayoutManager(context)
|
||||||
|
binding.recyclerView.adapter = ScoreAdapter(scoreItems)
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e("RealtimeReport", "Parse error", e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun formatDate(inputDate: String?): String {
|
||||||
|
return try {
|
||||||
|
// Parse input date (from "MM/dd/yyyy")
|
||||||
|
val inputFormat = SimpleDateFormat("MM/dd/yyyy", Locale.US)
|
||||||
|
val date = inputFormat.parse(inputDate ?: "")
|
||||||
|
|
||||||
|
// Format to "yyyy-MM-dd" for API, using Locale.US to avoid locale-specific digits
|
||||||
|
val outputFormat = SimpleDateFormat("yyyy-MM-dd", Locale.US)
|
||||||
|
if (date != null) outputFormat.format(date) else ""
|
||||||
|
} catch (e: Exception) {
|
||||||
|
""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
|
return when (item.itemId) {
|
||||||
|
android.R.id.home -> {
|
||||||
|
// Finish the current activity and go back
|
||||||
|
finish()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
else -> super.onOptionsItemSelected(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fun isNetworkAvailable(context: Context): Boolean {
|
||||||
|
val connectivityManager =
|
||||||
|
context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
|
||||||
|
|
||||||
|
val network = connectivityManager.activeNetwork ?: return false
|
||||||
|
val activeNetwork = connectivityManager.getNetworkCapabilities(network) ?: return false
|
||||||
|
|
||||||
|
return when {
|
||||||
|
activeNetwork.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) -> true
|
||||||
|
activeNetwork.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR) -> true
|
||||||
|
activeNetwork.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET) -> true
|
||||||
|
else -> false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,22 +1,19 @@
|
|||||||
package cpm.com.gskmtorange.dailyentry
|
package cpm.com.gskmtorange.dailyentry
|
||||||
|
|
||||||
import android.Manifest
|
|
||||||
import android.content.BroadcastReceiver
|
import android.content.BroadcastReceiver
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.DialogInterface
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.IntentFilter
|
import android.content.IntentFilter
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.content.pm.PackageManager
|
import android.net.ConnectivityManager
|
||||||
import android.os.Build
|
import android.net.NetworkCapabilities
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.preference.PreferenceManager
|
import android.preference.PreferenceManager
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
|
import android.widget.Toast
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.app.ActivityCompat
|
|
||||||
import androidx.core.content.ContextCompat
|
|
||||||
import androidx.core.net.toUri
|
import androidx.core.net.toUri
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||||
@@ -47,6 +44,7 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
var categoryId: String? = null
|
var categoryId: String? = null
|
||||||
var store_id: String? = null;
|
var store_id: String? = null;
|
||||||
var date: String? = null;
|
var date: String? = null;
|
||||||
|
var lang: String? = null;
|
||||||
var 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
|
||||||
@@ -61,6 +59,8 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
private var adapter: SubCatPdAdapter? = null
|
private var adapter: SubCatPdAdapter? = null
|
||||||
val PERMISSION_ALL: Int = 99
|
val PERMISSION_ALL: Int = 99
|
||||||
private var _pos = -1;
|
private var _pos = -1;
|
||||||
|
var devicename : String? = ""
|
||||||
|
var store_name : String? = ""
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
@@ -72,7 +72,9 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
db?.open()
|
db?.open()
|
||||||
preferences?.let {
|
preferences?.let {
|
||||||
|
lang = it.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
store_id = it.getString(CommonString.KEY_STORE_ID, "")
|
store_id = it.getString(CommonString.KEY_STORE_ID, "")
|
||||||
|
store_name = it.getString(CommonString.KEY_STORE_NAME, "")
|
||||||
username = it.getString(CommonString.KEY_USERNAME, "")
|
username = it.getString(CommonString.KEY_USERNAME, "")
|
||||||
store_type_id = it.getString(CommonString.KEY_STORETYPE_ID, "")
|
store_type_id = it.getString(CommonString.KEY_STORETYPE_ID, "")
|
||||||
class_id = it.getString(CommonString.KEY_CLASS_ID, "")
|
class_id = it.getString(CommonString.KEY_CLASS_ID, "")
|
||||||
@@ -81,6 +83,8 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
store_flag_str = it.getString(CommonString.KEY_STORE_FLAG, "")
|
store_flag_str = it.getString(CommonString.KEY_STORE_FLAG, "")
|
||||||
date = it.getString(CommonString.KEY_DATE, "")
|
date = it.getString(CommonString.KEY_DATE, "")
|
||||||
}
|
}
|
||||||
|
devicename = android.os.Build.MANUFACTURER
|
||||||
|
Log.d("device_name",devicename.toString())
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(
|
CommonFunctions.updateLangResources(
|
||||||
context, preferences?.getString(CommonString.KEY_LANGUAGE, "")
|
context, preferences?.getString(CommonString.KEY_LANGUAGE, "")
|
||||||
@@ -98,6 +102,7 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
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, "")
|
val userId = preferences?.getString(CommonString.KEY_PD_USER_Id, "")
|
||||||
.takeIf { !it.isNullOrBlank() } ?: username
|
.takeIf { !it.isNullOrBlank() } ?: username
|
||||||
|
Log.d("pd_user_id",userId.toString());
|
||||||
|
|
||||||
CommonUtils.initializePDSDK(
|
CommonUtils.initializePDSDK(
|
||||||
this@PDimageActivity,
|
this@PDimageActivity,
|
||||||
@@ -135,6 +140,12 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
).setAction("Action", null).show()
|
).setAction("Action", null).show()
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
delay(3000) // 3 seconds delay
|
delay(3000) // 3 seconds delay
|
||||||
|
val intent = Intent(this@PDimageActivity, PD_Realtime_Report::class.java)
|
||||||
|
intent.putExtra("categoryName", categoryName)
|
||||||
|
intent.putExtra("categoryId", categoryId)
|
||||||
|
intent.putExtra("kpi_name", "IR Realtime Analytics")
|
||||||
|
startActivity(intent)
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out)
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -154,9 +165,8 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
callAdapter()
|
callAdapter()
|
||||||
checkAndRequestPermissions()
|
// checkAndRequestPermissions()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
@@ -182,7 +192,6 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
return checkFlag // Correctly return validation result
|
return checkFlag // Correctly return validation result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
// as you specify a parent activity in AndroidManifest.xml.
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
val id = item.itemId
|
val id = item.itemId
|
||||||
@@ -194,7 +203,6 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
if (id == R.id.action_settings) {
|
if (id == R.id.action_settings) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item)
|
return super.onOptionsItemSelected(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -259,6 +267,7 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
"""
|
"""
|
||||||
{
|
{
|
||||||
"shop_id": 62475,
|
"shop_id": 62475,
|
||||||
|
"store_name": "abc",
|
||||||
"project_id": "4f57635b-6b07-45bf-bfba-c61c2826b6db",
|
"project_id": "4f57635b-6b07-45bf-bfba-c61c2826b6db",
|
||||||
"td_version_id": 178,
|
"td_version_id": 178,
|
||||||
"shelf_image_id": null,
|
"shelf_image_id": null,
|
||||||
@@ -273,32 +282,56 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
"level": 1,
|
"level": 1,
|
||||||
"uploadOnlyOnWifi": 0,
|
"uploadOnlyOnWifi": 0,
|
||||||
"app_session_id": "8e2faa6b-d6fe-413a-a693-76a0cbe0ce71",
|
"app_session_id": "8e2faa6b-d6fe-413a-a693-76a0cbe0ce71",
|
||||||
"metadata": { "Device_Name": "Samsung" }
|
"metadata": { "Device_Name": $devicename,"User_name": $username }
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
// "metadata": { "Device_Name": $devicename,"Username": $username }
|
||||||
|
uploadParams.put("store_name", store_name)
|
||||||
uploadParams.put("shop_id", store_id)
|
uploadParams.put("shop_id", store_id)
|
||||||
uploadParams.put("user_id", username)
|
uploadParams.put("user_id", username)
|
||||||
uploadParams.put("category_id", subCat_code)
|
uploadParams.put("category_id", subCat_code)
|
||||||
uploadParams.put("project_id", preferences?.getString(CommonString.KEY_PD_PROJECT_Id, ""))
|
uploadParams.put("project_id", preferences?.getString(CommonString.KEY_PD_PROJECT_Id, ""))
|
||||||
|
Log.d("uploadparamdata",uploadParams.toString());
|
||||||
|
|
||||||
CameraSDK.startCamera(
|
if(!lang.equals("ENGLISH",ignoreCase = true)){
|
||||||
context = this,
|
CameraSDK.startCamera(
|
||||||
orientation = "",
|
context = this,
|
||||||
widthPercentage = 20,
|
orientation = "",
|
||||||
uploadParams = uploadParams,
|
widthPercentage = 20,
|
||||||
resolution = 3000,
|
uploadParams = uploadParams,
|
||||||
referenceUrl = "",
|
resolution = 3000,
|
||||||
allowBlurCheck = true,
|
referenceUrl = "",
|
||||||
allowCrop = true,
|
allowBlurCheck = true,
|
||||||
uploadFrom = uploadFrom,
|
allowCrop = true,
|
||||||
isRetake = false,
|
uploadFrom = uploadFrom,
|
||||||
showOverlapToggleButton = false,
|
isRetake = false,
|
||||||
showGridLines = true,
|
showOverlapToggleButton = false,
|
||||||
zoomLevel = 1.0,
|
showGridLines = true,
|
||||||
language_code = "en",
|
zoomLevel = 1.0,
|
||||||
isLambda = false
|
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() {
|
||||||
@@ -337,7 +370,7 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.d("listdatsize", listdat?.size.toString())
|
// Log.d("listdatsize", listdat?.size.toString())
|
||||||
adapter = SubCatPdAdapter(
|
adapter = SubCatPdAdapter(
|
||||||
category = categoryName,
|
category = categoryName,
|
||||||
context = this,
|
context = this,
|
||||||
@@ -345,8 +378,23 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
btnlistener = object : SubCatPdAdapter.BtnClickListener {
|
btnlistener = object : SubCatPdAdapter.BtnClickListener {
|
||||||
override fun onStartSessionClick(_pos: Int, data: CategoryPictureGetterSetter) {
|
override fun onStartSessionClick(_pos: Int, data: CategoryPictureGetterSetter) {
|
||||||
this@PDimageActivity._pos = _pos
|
this@PDimageActivity._pos = _pos
|
||||||
|
/* val intent = Intent(this@PDimageActivity, PD_Realtime_Report::class.java)
|
||||||
|
intent.putExtra("categoryName", categoryName)
|
||||||
|
intent.putExtra("categoryId", categoryId)
|
||||||
|
intent.putExtra("kpi_name", "IR Realtime Analytics")
|
||||||
|
startActivity(intent)
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out)*/
|
||||||
|
|
||||||
|
// launchCamera(data.subCatCode)
|
||||||
|
/* if (isNetworkAvailable(this@PDimageActivity)) {
|
||||||
|
launchCamera(data.subCatCode)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Toast.makeText(context, "No internet connection", Toast.LENGTH_SHORT).show()
|
||||||
|
}*/
|
||||||
launchCamera(data.subCatCode)
|
launchCamera(data.subCatCode)
|
||||||
Log.d("subCatCode", data.subCatCode)
|
|
||||||
|
// Log.d("subCatCode", data.subCatCode)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
binding.rlContent.apply {
|
binding.rlContent.apply {
|
||||||
@@ -364,98 +412,18 @@ class PDimageActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkAndRequestPermissions() {
|
fun isNetworkAvailable(context: Context): Boolean {
|
||||||
var read_phone_state = 0
|
val connectivityManager =
|
||||||
var write_storage = 0
|
context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
||||||
write_storage =
|
val network = connectivityManager.activeNetwork ?: return false
|
||||||
ContextCompat.checkSelfPermission(this, Manifest.permission.READ_MEDIA_IMAGES)
|
val activeNetwork = connectivityManager.getNetworkCapabilities(network) ?: return false
|
||||||
} else {
|
|
||||||
read_phone_state =
|
return when {
|
||||||
ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE)
|
activeNetwork.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) -> true
|
||||||
write_storage =
|
activeNetwork.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR) -> true
|
||||||
ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
activeNetwork.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET) -> true
|
||||||
|
else -> false
|
||||||
}
|
}
|
||||||
|
|
||||||
val listPermissionsNeeded: MutableList<String> = java.util.ArrayList()
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
||||||
if (write_storage != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
listPermissionsNeeded.add(Manifest.permission.READ_MEDIA_IMAGES)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (write_storage != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
listPermissionsNeeded.add(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (listPermissionsNeeded.isNotEmpty()) {
|
|
||||||
ActivityCompat.requestPermissions(
|
|
||||||
this,
|
|
||||||
listPermissionsNeeded.toTypedArray<String>(),
|
|
||||||
PERMISSION_ALL
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
override fun onRequestPermissionsResult(
|
|
||||||
requestCode: Int,
|
|
||||||
permissions: Array<String>,
|
|
||||||
grantResults: IntArray
|
|
||||||
) {
|
|
||||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
|
||||||
if (requestCode == PERMISSION_ALL) {
|
|
||||||
val perms: MutableMap<String, Int> = HashMap()
|
|
||||||
// Initialize the map with both permissions
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
||||||
perms[Manifest.permission.READ_MEDIA_IMAGES] = PackageManager.PERMISSION_GRANTED
|
|
||||||
} else {
|
|
||||||
perms[Manifest.permission.WRITE_EXTERNAL_STORAGE] =
|
|
||||||
PackageManager.PERMISSION_GRANTED
|
|
||||||
}
|
|
||||||
// Fill with actual results from user
|
|
||||||
if (grantResults.isNotEmpty()) {
|
|
||||||
for (i in permissions.indices) perms[permissions[i]] = grantResults[i]
|
|
||||||
// Check for both permissions//
|
|
||||||
if (perms[Manifest.permission.READ_MEDIA_IMAGES] == PackageManager.PERMISSION_GRANTED &&
|
|
||||||
perms[Manifest.permission.WRITE_EXTERNAL_STORAGE] == PackageManager.PERMISSION_GRANTED
|
|
||||||
) {
|
|
||||||
Log.d("", "sms & location services permission granted")
|
|
||||||
} else {
|
|
||||||
Log.d("", "Some permissions are not granted ask again ")
|
|
||||||
if (ActivityCompat.shouldShowRequestPermissionRationale(
|
|
||||||
this,
|
|
||||||
Manifest.permission.READ_MEDIA_IMAGES
|
|
||||||
) ||
|
|
||||||
ActivityCompat.shouldShowRequestPermissionRationale(
|
|
||||||
this,
|
|
||||||
Manifest.permission.WRITE_EXTERNAL_STORAGE
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
showDialogOK(
|
|
||||||
"Photos or media Service Permission required for this app"
|
|
||||||
) { _: DialogInterface?, which: Int ->
|
|
||||||
when (which) {
|
|
||||||
DialogInterface.BUTTON_POSITIVE -> checkAndRequestPermissions()
|
|
||||||
DialogInterface.BUTTON_NEGATIVE -> {
|
|
||||||
// proceed with logic by disabling the related features or quit the app.
|
|
||||||
val startMain =
|
|
||||||
Intent(Intent.ACTION_MAIN)
|
|
||||||
startMain.addCategory(Intent.CATEGORY_HOME)
|
|
||||||
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
|
||||||
startActivity(startMain)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun showDialogOK(message: String, okListener: DialogInterface.OnClickListener) {
|
|
||||||
AlertDialog.Builder(this).setMessage(message).setPositiveButton("OK", okListener)
|
|
||||||
.setNegativeButton("Cancel", okListener).create().show()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -118,32 +118,10 @@ public class POGQuestionsActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
if (validateData()) {
|
if (validateData()) {
|
||||||
|
|
||||||
db.savePOGQuestionAnswerData(hashMapListChildData, headerDataList, store_id, categoryId);
|
db.savePOGQuestionAnswerData(hashMapListChildData, headerDataList, store_id, categoryId);
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
|
||||||
/* AlertDialog.Builder builder = new AlertDialog.Builder(POGQuestionsActivity.this);
|
|
||||||
builder.setMessage(R.string.title_activity_Want_save)
|
|
||||||
.setCancelable(false)
|
|
||||||
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
|
|
||||||
db.savePOGQuestionAnswerData(hashMapListChildData, headerDataList,store_id, categoryId);
|
|
||||||
finish();
|
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
dialog.cancel();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
AlertDialog alert = builder.create();
|
|
||||||
alert.show();*/
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if(adapter!=null){
|
if(adapter!=null){
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
expandableListView.invalidateViews();
|
expandableListView.invalidateViews();
|
||||||
|
|||||||
@@ -500,7 +500,7 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
for (Location location : locationResult.getLocations()) {
|
for (Location location : locationResult.getLocations()) {
|
||||||
lat = location.getLatitude();
|
lat = location.getLatitude();
|
||||||
lon = location.getLongitude();
|
lon = location.getLongitude();
|
||||||
// Log.e("latitude_inside",location.getLatitude() + "," +location.getLongitude());
|
Log.e("latitude_inside",location.getLatitude() + "," +location.getLongitude());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -597,6 +597,7 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
|
|
||||||
} else if (id == R.id.iconMap) {
|
} else if (id == R.id.iconMap) {
|
||||||
|
|
||||||
|
Log.d("Mapdata", "latitude is :" +" " +lat + "," + lon);
|
||||||
Intent in = new Intent(context, StoreListRouteActivity.class);
|
Intent in = new Intent(context, StoreListRouteActivity.class);
|
||||||
in.putExtra(CommonString.KEY_STORE_LIST, storelist);
|
in.putExtra(CommonString.KEY_STORE_LIST, storelist);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
@@ -899,6 +900,7 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
viewHolder.imgview_navigation.setOnClickListener(new View.OnClickListener() {
|
viewHolder.imgview_navigation.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
Log.e("mapdata",lat + ","+lon);
|
||||||
Intent in = new Intent(context, StoreRouteActivity.class);
|
Intent in = new Intent(context, StoreRouteActivity.class);
|
||||||
in.putExtra(CommonString.KEY_STORE_LIST, current);
|
in.putExtra(CommonString.KEY_STORE_LIST, current);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
@@ -1466,7 +1468,6 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
|||||||
} else {
|
} else {
|
||||||
// return "MAPPING_STOCK";
|
// return "MAPPING_STOCK";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
|||||||
@@ -303,33 +303,6 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
@Override
|
@Override
|
||||||
public void onConnected(Bundle bundle) {
|
public void onConnected(Bundle bundle) {
|
||||||
|
|
||||||
/*if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
// TODO: Consider calling
|
|
||||||
// ActivityCompat#requestPermissions
|
|
||||||
// here to request the missing permissions, and then overriding
|
|
||||||
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
|
|
||||||
// int[] grantResults)
|
|
||||||
// to handle the case where the user grants the permission. See the documentation
|
|
||||||
// for ActivityCompat#requestPermissions for more details.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
|
|
||||||
|
|
||||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
|
||||||
|| ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
if (mLastLocation != null) {
|
|
||||||
lat = mLastLocation.getLatitude();
|
|
||||||
lon = mLastLocation.getLongitude();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// if (mRequestingLocationUpdates) {
|
|
||||||
startLocationUpdates();*/
|
|
||||||
// }
|
|
||||||
|
|
||||||
// startLocationUpdates();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -359,10 +332,11 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
super.onStop();// ATTENTION: This was auto-generated to implement the App Indexing API.
|
super.onStop();
|
||||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
// 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());
|
// AppIndex.AppIndexApi.end(client, getIndexApiAction());
|
||||||
/* if (mGoogleApiClient.isConnected()) {
|
/* if (mGoogleApiClient.isConnected()) {
|
||||||
mGoogleApiClient.disconnect();
|
mGoogleApiClient.disconnect();
|
||||||
}*/
|
}*/
|
||||||
// ATTENTION: This was auto-generated to implement the App Indexing API.
|
// ATTENTION: This was auto-generated to implement the App Indexing API.
|
||||||
|
|||||||
@@ -0,0 +1,130 @@
|
|||||||
|
package cpm.com.gskmtorange.dailyentry
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.app.Dialog
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.os.Message
|
||||||
|
import android.util.Log
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.webkit.*
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import cpm.com.gskmtorange.databinding.ActivityWebviewBinding
|
||||||
|
class WebViewActivity : AppCompatActivity() {
|
||||||
|
private lateinit var binding: ActivityWebviewBinding
|
||||||
|
|
||||||
|
@SuppressLint("SetJavaScriptEnabled")
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
binding = ActivityWebviewBinding.inflate(layoutInflater)
|
||||||
|
setContentView(binding.root)
|
||||||
|
val url = intent.getStringExtra("url") ?: ""
|
||||||
|
// Configure WebView settings
|
||||||
|
with(binding.webView.settings) {
|
||||||
|
javaScriptEnabled = true
|
||||||
|
domStorageEnabled = true
|
||||||
|
javaScriptCanOpenWindowsAutomatically = true
|
||||||
|
setSupportMultipleWindows(true)
|
||||||
|
loadWithOverviewMode = true
|
||||||
|
useWideViewPort = true
|
||||||
|
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
|
||||||
|
binding.webView.webViewClient = object : WebViewClient() {
|
||||||
|
override fun shouldOverrideUrlLoading(
|
||||||
|
view: WebView?,
|
||||||
|
request: WebResourceRequest?
|
||||||
|
): Boolean {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPageFinished(view: WebView?, url: String?) {
|
||||||
|
super.onPageFinished(view, url)
|
||||||
|
// Inject JS to simulate mouseover/mouseenter on tap
|
||||||
|
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) {
|
||||||
|
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() {
|
||||||
|
@SuppressLint("SetJavaScriptEnabled")
|
||||||
|
override fun onCreateWindow(
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Load URL
|
||||||
|
binding.webView.loadUrl(url)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,7 +5,6 @@ import android.app.Dialog;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -14,9 +13,9 @@ import android.util.Log;
|
|||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
|
||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
import org.ksoap2.serialization.SoapObject;
|
import org.ksoap2.serialization.SoapObject;
|
||||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
@@ -24,7 +23,6 @@ import org.ksoap2.transport.HttpTransportSE;
|
|||||||
import org.xmlpull.v1.XmlPullParser;
|
import org.xmlpull.v1.XmlPullParser;
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
import org.xmlpull.v1.XmlPullParserFactory;
|
import org.xmlpull.v1.XmlPullParserFactory;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -36,11 +34,11 @@ import java.net.MalformedURLException;
|
|||||||
import java.net.SocketTimeoutException;
|
import java.net.SocketTimeoutException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.utils.TLSSocketFactory;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.AdditionalQuestiongetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.AdditionalQuestiongetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||||
@@ -83,6 +81,11 @@ import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;
|
|||||||
import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.Visit_Type_Master_GetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
||||||
|
import javax.net.ssl.HttpsURLConnection;
|
||||||
|
import javax.net.ssl.SSLContext;
|
||||||
|
import javax.net.ssl.SSLSession;
|
||||||
|
import javax.net.ssl.SSLSocket;
|
||||||
|
import javax.net.ssl.SSLSocketFactory;
|
||||||
|
|
||||||
public class DownloadActivity extends AppCompatActivity {
|
public class DownloadActivity extends AppCompatActivity {
|
||||||
private Context context;
|
private Context context;
|
||||||
@@ -136,7 +139,6 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
Order_Received_Status_GetterSetter order_received_status_getterSetter;
|
Order_Received_Status_GetterSetter order_received_status_getterSetter;
|
||||||
Visit_Type_Master_GetterSetter visit_type_master_getterSetter;
|
Visit_Type_Master_GetterSetter visit_type_master_getterSetter;
|
||||||
|
|
||||||
|
|
||||||
private Dialog dialog;
|
private Dialog dialog;
|
||||||
private ProgressBar pb;
|
private ProgressBar pb;
|
||||||
private TextView percentage, message;
|
private TextView percentage, message;
|
||||||
@@ -149,22 +151,51 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_download);
|
setContentView(R.layout.activity_download);
|
||||||
|
|
||||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
db = new GSKOrangeDB(this);
|
db = new GSKOrangeDB(this);
|
||||||
context = this;
|
context = this;
|
||||||
|
// ✅ Enable old TLS versions for SOAP
|
||||||
|
//enableOldTLS();
|
||||||
|
// checkTLSVersion();
|
||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
userId = preferences.getString(CommonString.KEY_USERNAME, null);
|
userId = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
culture_id = preferences.getString(CommonString.KEY_CULTURE_ID, "");
|
culture_id = preferences.getString(CommonString.KEY_CULTURE_ID, "");
|
||||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||||
|
|
||||||
new UploadTask(DownloadActivity.this).execute();
|
new UploadTask(DownloadActivity.this).execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkTLSVersion() {
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
String host = "gskme2.parinaam.in";
|
||||||
|
int port = 443;
|
||||||
|
|
||||||
|
// Create SSL context with default settings
|
||||||
|
SSLContext sslContext = SSLContext.getInstance("TLS");
|
||||||
|
sslContext.init(null, null, null);
|
||||||
|
|
||||||
|
SSLSocketFactory factory = sslContext.getSocketFactory();
|
||||||
|
|
||||||
|
try (SSLSocket sslSocket = (SSLSocket) factory.createSocket(host, port)) {
|
||||||
|
sslSocket.startHandshake(); // do handshake
|
||||||
|
|
||||||
|
SSLSession session = sslSocket.getSession();
|
||||||
|
Log.d("TLS_CHECK", "Protocol: " + session.getProtocol());
|
||||||
|
runOnUiThread(() ->
|
||||||
|
Toast.makeText(this, "protocol: " + session.getProtocol(), Toast.LENGTH_SHORT).show()
|
||||||
|
);
|
||||||
|
Log.d("TLS_CHECK", "CipherSuite: " + session.getCipherSuite());
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e("TLS_CHECK", "Error checking TLS", e);
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
class Data {
|
class Data {
|
||||||
int value;
|
int value;
|
||||||
@@ -194,6 +225,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
dialog.setCancelable(false);
|
dialog.setCancelable(false);
|
||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String doInBackground(Void... voids) {
|
protected String doInBackground(Void... voids) {
|
||||||
try {
|
try {
|
||||||
@@ -221,23 +253,21 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
// HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
Log.d("requestdata",request.toString());
|
/* if (androidHttpTransport.responseDump != null) {
|
||||||
|
Log.e("SOAP_RESPONSE", androidHttpTransport.responseDump);
|
||||||
Object result = envelope.getResponse();
|
} else {
|
||||||
Log.d("resultdata",result.toString());
|
Log.e("SOAP_RESPONSE", "No response received");
|
||||||
|
}*/
|
||||||
|
Object result = envelope.getResponse();
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
|
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
// xpp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
|
|
||||||
// xpp.setInput(stream,"UTF-8");
|
|
||||||
xpp.next();
|
xpp.next();
|
||||||
eventType = xpp.getEventType();
|
eventType = xpp.getEventType();
|
||||||
|
|
||||||
jcpgettersetter = XMLHandlers.JCPXMLHandler(xpp, eventType);
|
jcpgettersetter = XMLHandlers.JCPXMLHandler(xpp, eventType);
|
||||||
|
|
||||||
String jcpTable = jcpgettersetter.getTable_journey_plan();
|
String jcpTable = jcpgettersetter.getTable_journey_plan();
|
||||||
if (jcpTable != null)
|
if (jcpTable != null)
|
||||||
TableBean.setJourneyPlan(jcpTable);
|
TableBean.setJourneyPlan(jcpTable);
|
||||||
@@ -248,7 +278,6 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
//return "JOURNEY_PLAN";
|
//return "JOURNEY_PLAN";
|
||||||
no_jcp_flag = true;
|
no_jcp_flag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
data.value = 10;
|
data.value = 10;
|
||||||
data.name = "JCP " + getResources().getString(R.string.download_data);
|
data.name = "JCP " + getResources().getString(R.string.download_data);
|
||||||
}
|
}
|
||||||
@@ -267,13 +296,9 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
|
||||||
Log.d("resultdata",result.toString());
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
// xpp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
|
|
||||||
// xpp.setInput(stream,"UTF-8");
|
|
||||||
xpp.next();
|
xpp.next();
|
||||||
eventType = xpp.getEventType();
|
eventType = xpp.getEventType();
|
||||||
|
|
||||||
@@ -291,9 +316,6 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
data.name = "ADHOC JOURNEYPLAN " + getResources().getString(R.string.download_data);
|
data.name = "ADHOC JOURNEYPLAN " + getResources().getString(R.string.download_data);
|
||||||
} else {
|
} else {
|
||||||
no_adhoc_flag = true;
|
no_adhoc_flag = true;
|
||||||
/*if (no_jcp_flag) {
|
|
||||||
return "JOURNEY_PLAN";
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
@@ -307,12 +329,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
xpp.next();
|
xpp.next();
|
||||||
@@ -322,51 +343,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
if (additionalJcpGetterSetter.getSTORE_ID().size() > 0) {
|
if (additionalJcpGetterSetter.getSTORE_ID().size() > 0) {
|
||||||
resultHttp = CommonString.KEY_SUCCESS;
|
resultHttp = CommonString.KEY_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
no_addtional_jcp_flag = true;
|
no_addtional_jcp_flag = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String additional_jcpTable = additionalJcpGetterSetter.getTable_journey_plan();
|
String additional_jcpTable = additionalJcpGetterSetter.getTable_journey_plan();
|
||||||
TableBean.setAdditionalJourneyPlan(additional_jcpTable);
|
TableBean.setAdditionalJourneyPlan(additional_jcpTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
//SUPERVISOR_LIST
|
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
|
||||||
request.addProperty("UserName", userId);
|
|
||||||
request.addProperty("Type", "SUPERVISOR_LIST");
|
|
||||||
request.addProperty("cultureid", culture_id);
|
|
||||||
|
|
||||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
|
||||||
envelope.dotNet = true;
|
|
||||||
envelope.setOutputSoapObject(request);
|
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
|
||||||
|
|
||||||
result = envelope.getResponse();
|
|
||||||
Log.d("resultdata",result.toString());
|
|
||||||
|
|
||||||
if (result.toString() != null) {
|
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
|
||||||
xpp.next();
|
|
||||||
eventType = xpp.getEventType();
|
|
||||||
supervisorListGetterSetter = XMLHandlers.supervisorListXMLHandler(xpp, eventType);
|
|
||||||
|
|
||||||
String table_sup_list = supervisorListGetterSetter.getTable_SUPERVISOR_LIST();
|
|
||||||
if (table_sup_list != null) {
|
|
||||||
resultHttp = CommonString.KEY_SUCCESS;
|
|
||||||
TableBean.setTable_SUPERVISOR_LIST(table_sup_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supervisorListGetterSetter.getEMP_ID().size() > 0) {
|
|
||||||
data.value = 97;
|
|
||||||
data.name = "SUPERVISOR LIST DATA" + getResources().getString(R.string.download_data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
publishProgress(data);
|
|
||||||
|
|
||||||
|
|
||||||
//ADHOC_JOURNEYPLAN_ADDITIONAL
|
//ADHOC_JOURNEYPLAN_ADDITIONAL
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
request.addProperty("UserName", userId);
|
request.addProperty("UserName", userId);
|
||||||
@@ -378,10 +359,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -397,7 +379,6 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
return "JOURNEY_PLAN";
|
return "JOURNEY_PLAN";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String additional_jcpTable = additionalAdhocJcpGetterSetter.getTable_journey_plan();
|
String additional_jcpTable = additionalAdhocJcpGetterSetter.getTable_journey_plan();
|
||||||
TableBean.setAdhocJourneyplanAdditional(additional_jcpTable);
|
TableBean.setAdhocJourneyplanAdditional(additional_jcpTable);
|
||||||
}
|
}
|
||||||
@@ -413,10 +394,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -450,10 +432,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -487,10 +470,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -524,10 +508,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -560,10 +545,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -596,10 +582,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -633,8 +620,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -660,7 +647,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
//Added on 04/12/2018
|
//Added on 04/12/2018
|
||||||
// MAPPING_STOCK_STOREWISE
|
// MAPPING_STOCK_STOREWISE
|
||||||
if (country_id.equals("7")||country_id.equals("8") || country_id.equals("17")) {
|
if (country_id.equals("7") || country_id.equals("8") || country_id.equals("17")) {
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
request.addProperty("UserName", userId);
|
request.addProperty("UserName", userId);
|
||||||
request.addProperty("Type", "MAPPING_STOCK_STOREWISE");
|
request.addProperty("Type", "MAPPING_STOCK_STOREWISE");
|
||||||
@@ -671,10 +658,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -711,10 +699,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -749,11 +738,12 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);;
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -780,16 +770,17 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
request.addProperty("Type", "MAPPING_DISPLAY_CHECKLIST");
|
request.addProperty("Type", "MAPPING_DISPLAY_CHECKLIST");
|
||||||
request.addProperty("cultureid", culture_id);
|
request.addProperty("cultureid", culture_id);
|
||||||
|
|
||||||
Log.d("requestdata",request.toString());
|
Log.d("requestdata", request.toString());
|
||||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
envelope.dotNet = true;
|
envelope.dotNet = true;
|
||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -824,10 +815,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -859,10 +851,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -897,10 +890,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -934,10 +928,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -973,8 +968,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -998,6 +993,44 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
|
request.addProperty("UserName", userId);
|
||||||
|
request.addProperty("Type", "CATEGORYWISE_SOS_TARGET");
|
||||||
|
request.addProperty("cultureid", culture_id);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
|
if (result.toString() != null) {
|
||||||
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
|
xpp.next();
|
||||||
|
eventType = xpp.getEventType();
|
||||||
|
store_category_wiseGetterSetter = XMLHandlers.CATEGORYWISE_SOS_TARGETXMLHandler(xpp, eventType);
|
||||||
|
|
||||||
|
String table_store_performace = store_category_wiseGetterSetter.getTable_CATEGORYWISE_SOS_TARGET();
|
||||||
|
if (table_store_performace != null) {
|
||||||
|
resultHttp = CommonString.KEY_SUCCESS;
|
||||||
|
TableBean.setCategoryWiseSos(table_store_performace);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (store_category_wiseGetterSetter.getSTORE_ID().size() > 0) {
|
||||||
|
data.value = 85;
|
||||||
|
data.name = "CATEGORYWISE_SOS_TARGET Data Download";
|
||||||
|
} else {
|
||||||
|
//return "CATEGORYWISE_SOS_TARGET";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
//ADDITIONAL_DISPLAY_MASTER
|
//ADDITIONAL_DISPLAY_MASTER
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
@@ -1010,10 +1043,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1047,10 +1081,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1083,10 +1118,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1120,10 +1156,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1146,43 +1183,6 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
//CATEGORYWISE_SOS_TARGET
|
//CATEGORYWISE_SOS_TARGET
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
|
||||||
request.addProperty("UserName", userId);
|
|
||||||
request.addProperty("Type", "CATEGORYWISE_SOS_TARGET");
|
|
||||||
request.addProperty("cultureid", culture_id);
|
|
||||||
|
|
||||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
|
||||||
envelope.dotNet = true;
|
|
||||||
envelope.setOutputSoapObject(request);
|
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
|
||||||
|
|
||||||
result = envelope.getResponse();
|
|
||||||
Log.d("resultdata",result.toString());
|
|
||||||
|
|
||||||
if (result.toString() != null) {
|
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
|
||||||
xpp.next();
|
|
||||||
eventType = xpp.getEventType();
|
|
||||||
store_category_wiseGetterSetter = XMLHandlers.CATEGORYWISE_SOS_TARGETXMLHandler(xpp, eventType);
|
|
||||||
|
|
||||||
String table_store_performace = store_category_wiseGetterSetter.getTable_CATEGORYWISE_SOS_TARGET();
|
|
||||||
if (table_store_performace != null) {
|
|
||||||
resultHttp = CommonString.KEY_SUCCESS;
|
|
||||||
TableBean.setCategoryWiseSos(table_store_performace);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (store_category_wiseGetterSetter.getSTORE_ID().size() > 0) {
|
|
||||||
data.value = 85;
|
|
||||||
data.name = "CATEGORYWISE_SOS_TARGET Data Download";
|
|
||||||
} else {
|
|
||||||
//return "CATEGORYWISE_SOS_TARGET";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
publishProgress(data);
|
|
||||||
|
|
||||||
|
|
||||||
//SHELF_MASTER
|
//SHELF_MASTER
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
@@ -1195,10 +1195,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1231,10 +1232,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1267,10 +1269,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1291,6 +1294,42 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
|
//SUPERVISOR_LIST
|
||||||
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
|
request.addProperty("UserName", userId);
|
||||||
|
request.addProperty("Type", "SUPERVISOR_LIST");
|
||||||
|
request.addProperty("cultureid", culture_id);
|
||||||
|
|
||||||
|
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
envelope.dotNet = true;
|
||||||
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
|
result = envelope.getResponse();
|
||||||
|
|
||||||
|
if (result.toString() != null) {
|
||||||
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
|
xpp.next();
|
||||||
|
eventType = xpp.getEventType();
|
||||||
|
supervisorListGetterSetter = XMLHandlers.supervisorListXMLHandler(xpp, eventType);
|
||||||
|
|
||||||
|
String table_sup_list = supervisorListGetterSetter.getTable_SUPERVISOR_LIST();
|
||||||
|
if (table_sup_list != null) {
|
||||||
|
resultHttp = CommonString.KEY_SUCCESS;
|
||||||
|
TableBean.setTable_SUPERVISOR_LIST(table_sup_list);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supervisorListGetterSetter.getEMP_ID().size() > 0) {
|
||||||
|
data.value = 97;
|
||||||
|
data.name = "SUPERVISOR LIST DATA" + getResources().getString(R.string.download_data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
publishProgress(data);
|
||||||
|
|
||||||
//MAPPING_CATEGORY_IMAGE_ALLOW
|
//MAPPING_CATEGORY_IMAGE_ALLOW
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
request.addProperty("UserName", userId);
|
request.addProperty("UserName", userId);
|
||||||
@@ -1302,10 +1341,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1337,10 +1377,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1374,10 +1415,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1409,10 +1451,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1444,10 +1487,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1479,10 +1523,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1514,10 +1559,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
// Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1550,10 +1596,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1588,10 +1635,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1618,10 +1666,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1650,8 +1699,8 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1687,10 +1736,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1727,10 +1777,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1764,10 +1815,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1791,7 +1843,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
//VISIT_TYPE_MASTER
|
//VISIT_TYPE_MASTER
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||||
request.addProperty("UserName", userId);
|
request.addProperty("UserName", userId);
|
||||||
request.addProperty("Type", "VISIT_TYPE_MASTER");
|
request.addProperty("Type", "VISIT_TYPE_MASTER");
|
||||||
@@ -1802,10 +1854,11 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
envelope.setOutputSoapObject(request);
|
envelope.setOutputSoapObject(request);
|
||||||
|
|
||||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||||
|
;
|
||||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||||
|
|
||||||
result = envelope.getResponse();
|
result = envelope.getResponse();
|
||||||
Log.d("resultdata",result.toString());
|
Log.d("resultdata", result.toString());
|
||||||
|
|
||||||
if (result.toString() != null) {
|
if (result.toString() != null) {
|
||||||
xpp.setInput(new StringReader(result.toString()));
|
xpp.setInput(new StringReader(result.toString()));
|
||||||
@@ -1829,8 +1882,6 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
publishProgress(data);
|
publishProgress(data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Images DownLoads
|
//Images DownLoads
|
||||||
|
|
||||||
//MAPPING_PLANOGRAM Image save into folder
|
//MAPPING_PLANOGRAM Image save into folder
|
||||||
@@ -1852,7 +1903,7 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
file.mkdir();
|
file.mkdir();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!new File(PATH + image_name).exists()) {
|
if (!new File(PATH + image_name).exists()) {
|
||||||
if (!image_name.equalsIgnoreCase("NA") && !image_name.equalsIgnoreCase("")) {
|
if (!image_name.equalsIgnoreCase("NA") && !image_name.equalsIgnoreCase("")) {
|
||||||
URL url = new URL(path + "/" + image_name);
|
URL url = new URL(path + "/" + image_name);
|
||||||
HttpURLConnection c = (HttpURLConnection) url.openConnection();
|
HttpURLConnection c = (HttpURLConnection) url.openConnection();
|
||||||
@@ -2066,34 +2117,35 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
db.InsertPROMOTION_TYPE_MASTER(promotion_type_masterGetterSetter);
|
db.InsertPROMOTION_TYPE_MASTER(promotion_type_masterGetterSetter);
|
||||||
db.InsertCATEGORYWISE_SOS_TARGET(store_category_wiseGetterSetter);
|
db.InsertCATEGORYWISE_SOS_TARGET(store_category_wiseGetterSetter);
|
||||||
db.InsertMAPPING_SKU_PRICING_ENABLE(mapping_sku_pricing_enableGetterSetter);
|
db.InsertMAPPING_SKU_PRICING_ENABLE(mapping_sku_pricing_enableGetterSetter);
|
||||||
}
|
} catch (MalformedURLException e) {
|
||||||
catch (MalformedURLException e) {
|
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
str = CommonString.MESSAGE_EXCEPTION;
|
str = CommonString.MESSAGE_EXCEPTION;
|
||||||
|
Log.d("exceptiondata", e.getMessage());
|
||||||
return CommonString.MESSAGE_EXCEPTION;
|
return CommonString.MESSAGE_EXCEPTION;
|
||||||
} catch (SocketTimeoutException e) {
|
} catch (SocketTimeoutException e) {
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
str = CommonString.MESSAGE_SOCKETEXCEPTION;
|
str = CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||||
|
Log.d("exceptiondata1", e.getMessage());
|
||||||
return CommonString.MESSAGE_SOCKETEXCEPTION;
|
return CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||||
} catch (InterruptedIOException e) {
|
} catch (InterruptedIOException e) {
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
str = CommonString.MESSAGE_EXCEPTION;
|
str = CommonString.MESSAGE_EXCEPTION;
|
||||||
|
Log.d("exceptiondata2", e.getMessage());
|
||||||
return CommonString.MESSAGE_EXCEPTION;
|
return CommonString.MESSAGE_EXCEPTION;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
str = CommonString.MESSAGE_SOCKETEXCEPTION;
|
str = CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||||
|
Log.d("exceptiondata3", e.getMessage());
|
||||||
return CommonString.MESSAGE_SOCKETEXCEPTION;
|
return CommonString.MESSAGE_SOCKETEXCEPTION;
|
||||||
} catch (XmlPullParserException e) {
|
} catch (XmlPullParserException e) {
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
Log.d("exceptiondata",e.getMessage() + ","+data.name );
|
Log.d("exceptiondata4", e.getMessage() + "," + data.name);
|
||||||
str = CommonString.MESSAGE_XmlPull;
|
str = CommonString.MESSAGE_XmlPull;
|
||||||
return CommonString.MESSAGE_XmlPull;
|
return CommonString.MESSAGE_XmlPull;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
|
||||||
// Crashlytics.logException(e.getCause());
|
|
||||||
// Crashlytics.logException(new Exception(e.getCause()));
|
|
||||||
ResultFlag = false;
|
ResultFlag = false;
|
||||||
str = CommonString.MESSAGE_EXCEPTION;
|
str = CommonString.MESSAGE_EXCEPTION;
|
||||||
|
Log.d("exceptiondata5", e.getMessage());
|
||||||
return CommonString.MESSAGE_EXCEPTION;
|
return CommonString.MESSAGE_EXCEPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2153,4 +2205,13 @@ public class DownloadActivity extends AppCompatActivity {
|
|||||||
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void enableOldTLS() {
|
||||||
|
try {
|
||||||
|
SSLSocketFactory tlsSocketFactory = new TLSSocketFactory();
|
||||||
|
HttpsURLConnection.setDefaultSSLSocketFactory(tlsSocketFactory);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.fillInStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+74
-8
@@ -51,6 +51,7 @@ import cpm.com.gskmtorange.dailyentry.CreateSelfActivity;
|
|||||||
import cpm.com.gskmtorange.dailyentry.NewStockDataActivity;
|
import cpm.com.gskmtorange.dailyentry.NewStockDataActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.OrderTakingActivity;
|
import cpm.com.gskmtorange.dailyentry.OrderTakingActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.PDVisibilityActivity;
|
import cpm.com.gskmtorange.dailyentry.PDVisibilityActivity;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.PD_Pog_Activity;
|
||||||
import cpm.com.gskmtorange.dailyentry.PDimageActivity;
|
import cpm.com.gskmtorange.dailyentry.PDimageActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.POGQuestionsActivity;
|
import cpm.com.gskmtorange.dailyentry.POGQuestionsActivity;
|
||||||
import cpm.com.gskmtorange.dailyentry.StockActivity;
|
import cpm.com.gskmtorange.dailyentry.StockActivity;
|
||||||
@@ -113,7 +114,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
db.open();
|
db.open();
|
||||||
// deleteIRURl(context);
|
// deleteIRURl(context);
|
||||||
visittypelist = db.getInsertedVisitType(store_id, visit_date, "3");
|
visittypelist = db.getInsertedVisitType(store_id, visit_date, "3");
|
||||||
if (visittypelist.size() > 0) {
|
if (visittypelist.size() > 0) {
|
||||||
if (visittypelist.get(0).getVISIT_TYPE_ID().equals("3")) {
|
if (visittypelist.get(0).getVISIT_TYPE_ID().equals("3")) {
|
||||||
@@ -134,7 +135,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
ArrayList<ImageUri> uris = irList.get(i).getImageUris();
|
ArrayList<ImageUri> uris = irList.get(i).getImageUris();
|
||||||
if (uris != null && !uris.isEmpty()) {
|
if (uris != null && !uris.isEmpty()) {
|
||||||
for (int k = 0; k < uris.size(); k++) {
|
for (int k = 0; k < uris.size(); k++) {
|
||||||
// CommonUtils.INSTANCE.deleteSpecificImage(this,uris.get(k).getUri());
|
// CommonUtils.INSTANCE.deleteSpecificImage(this,uris.get(k).getUri());
|
||||||
deleteSpecificImage(context,uris.get(k).getUri());
|
deleteSpecificImage(context,uris.get(k).getUri());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -522,12 +523,25 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
data.setCategory_img(R.mipmap.picturecatogory_grey);
|
data.setCategory_img(R.mipmap.picturecatogory_grey);
|
||||||
}
|
}
|
||||||
|
data.setCategory_name(getResources().getString(R.string.title_activity_ir_visibility));
|
||||||
}
|
|
||||||
data.setCategory_name(getResources()
|
|
||||||
.getString(R.string.title_activity_ir_visibility));
|
|
||||||
categoryList.add(data);
|
categoryList.add(data);
|
||||||
|
|
||||||
|
//IR POG
|
||||||
|
/*data = new DailyDataMenuGetterSetter();
|
||||||
|
ArrayList<CategoryPictureGetterSetter> ir_pog = isPdPogIRMapping();
|
||||||
|
if (ir_pog != null && !ir_pog.isEmpty() && camera_allow.equals("1")) {
|
||||||
|
data.setCategory_img(R.mipmap.picturecatogory);
|
||||||
|
db.open();
|
||||||
|
if (db.isPdPogImages(store_id, visit_date, CommonString.KEY_COMPELETE, categoryId)) {
|
||||||
|
data.setCategory_img(R.mipmap.picturecatogory_done);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
data.setCategory_img(R.mipmap.picturecatogory_grey);
|
||||||
|
}
|
||||||
|
data.setCategory_name(getResources().getString(R.string.title_activity_ir_pog));
|
||||||
|
categoryList.add(data);*/
|
||||||
|
}
|
||||||
|
|
||||||
adapter = new DailyDataMenuAdapter(DailyDataMenuActivity.this, categoryList);
|
adapter = new DailyDataMenuAdapter(DailyDataMenuActivity.this, categoryList);
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
recyclerView.setLayoutManager(new GridLayoutManager(context, 2));
|
recyclerView.setLayoutManager(new GridLayoutManager(context, 2));
|
||||||
@@ -738,6 +752,10 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
holder.categoryName.setTextColor(isPdVisibiltyMapping() != null && !isPdVisibiltyMapping().isEmpty() && camera_allow.equals("1")
|
holder.categoryName.setTextColor(isPdVisibiltyMapping() != null && !isPdVisibiltyMapping().isEmpty() && camera_allow.equals("1")
|
||||||
? ContextCompat.getColor(context, R.color.black) : ContextCompat.getColor(context, R.color.grey_background));
|
? ContextCompat.getColor(context, R.color.black) : ContextCompat.getColor(context, R.color.grey_background));
|
||||||
}
|
}
|
||||||
|
/*else if (dailyData.getCategory_name().equalsIgnoreCase(getString(R.string.title_activity_ir_pog))) {
|
||||||
|
holder.categoryName.setTextColor(isPdPogIRMapping() != null && !isPdPogIRMapping().isEmpty() && camera_allow.equals("1")
|
||||||
|
? ContextCompat.getColor(context, R.color.black) : ContextCompat.getColor(context, R.color.grey_background));
|
||||||
|
}*/
|
||||||
else{
|
else{
|
||||||
holder.irview.setVisibility(View.GONE);
|
holder.irview.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
@@ -807,7 +825,8 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
}
|
}
|
||||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.title_activity_ir_image))) {
|
}
|
||||||
|
else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.title_activity_ir_image))) {
|
||||||
if (isPdIRMapping() != null && !isPdIRMapping().isEmpty() && camera_allow.equals("1")) {
|
if (isPdIRMapping() != null && !isPdIRMapping().isEmpty() && camera_allow.equals("1")) {
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, PDimageActivity.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, PDimageActivity.class);
|
||||||
intent.putExtra("kpi_name", dailyData.getCategory_name());
|
intent.putExtra("kpi_name", dailyData.getCategory_name());
|
||||||
@@ -817,8 +836,18 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.title_activity_ir_pog))) {
|
||||||
|
if (isPdPogIRMapping() != null && !isPdPogIRMapping().isEmpty() && camera_allow.equals("1")) {
|
||||||
|
Intent intent = new Intent(DailyDataMenuActivity.this, PD_Pog_Activity.class);
|
||||||
|
intent.putExtra("kpi_name", dailyData.getCategory_name());
|
||||||
|
intent.putExtra("categoryName", categoryName);
|
||||||
|
intent.putExtra("categoryId", categoryId);
|
||||||
|
startActivity(intent);
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
}
|
||||||
|
}*/
|
||||||
else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.title_activity_ir_visibility))) {
|
else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.title_activity_ir_visibility))) {
|
||||||
if (isPdIRMapping() != null && !isPdIRMapping().isEmpty() && camera_allow.equals("1")) {
|
if (isPdVisibiltyMapping() != null && !isPdVisibiltyMapping().isEmpty() && camera_allow.equals("1")) {
|
||||||
Intent intent = new Intent(DailyDataMenuActivity.this, PDVisibilityActivity.class);
|
Intent intent = new Intent(DailyDataMenuActivity.this, PDVisibilityActivity.class);
|
||||||
intent.putExtra("kpi_name", dailyData.getCategory_name());
|
intent.putExtra("kpi_name", dailyData.getCategory_name());
|
||||||
intent.putExtra("categoryName", categoryName);
|
intent.putExtra("categoryName", categoryName);
|
||||||
@@ -1009,6 +1038,43 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
return ir_list;
|
return ir_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ArrayList<CategoryPictureGetterSetter> isPdPogIRMapping() {
|
||||||
|
ArrayList<CategoryPictureGetterSetter> ir_list;
|
||||||
|
if (country_id.equals("8")) {
|
||||||
|
ir_list = db.getCategoryPicturePogdata(
|
||||||
|
date,
|
||||||
|
categoryId,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_STOREWISE
|
||||||
|
);
|
||||||
|
} else if (store_flag_str != null && store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
|
||||||
|
ir_list = db.getCategoryPicturePogdata(
|
||||||
|
date,
|
||||||
|
categoryId,
|
||||||
|
keyAccount_id,
|
||||||
|
storeType_id,
|
||||||
|
class_id,
|
||||||
|
store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK_ADHOC
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
ir_list = db.getCategoryPicturePogdata(
|
||||||
|
date,
|
||||||
|
categoryId,
|
||||||
|
keyAccount_id,
|
||||||
|
storeType_id,
|
||||||
|
class_id,
|
||||||
|
store_id,
|
||||||
|
CommonString.TABLE_MAPPING_STOCK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ir_list;
|
||||||
|
}
|
||||||
|
|
||||||
private ArrayList<CategoryPictureGetterSetter> isPdVisibiltyMapping() {
|
private ArrayList<CategoryPictureGetterSetter> isPdVisibiltyMapping() {
|
||||||
ArrayList<CategoryPictureGetterSetter> ir_list;
|
ArrayList<CategoryPictureGetterSetter> ir_list;
|
||||||
if (country_id.equals("6")) {
|
if (country_id.equals("6")) {
|
||||||
|
|||||||
@@ -474,7 +474,7 @@ public class MPinActivity extends AppCompatActivity implements BlurLockView.OnPa
|
|||||||
protected String doInBackground(Void... params) {
|
protected String doInBackground(Void... params) {
|
||||||
try {
|
try {
|
||||||
versionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
|
versionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
|
||||||
String userauth_xml = "[DATA]" + "[USER_DATA][USER_ID]" + userId + "[/USER_ID]" + "[PASSWORD]" + password + "[/PASSWORD]" + "[IN_TIME]" + CommonFunctions.getCurrentTimeWithLanguage(context) + "[/IN_TIME]" + "[LATITUDE]" + lat + "[/LATITUDE]" + "[LONGITUDE]" + lon + "[/LONGITUDE]" + "[APP_VERSION]" + app_ver + "[/APP_VERSION]" + "[ATT_MODE]OnLine[/ATT_MODE]" + "[NETWORK_STATUS]" + "LoginStatus" + "[/NETWORK_STATUS]" + "[/USER_DATA][/DATA]";
|
String userauth_xml = "[DATA]" + "[USER_DATA][USER_ID]" + userId + "[/USER_ID]" + "[PASSWORD]" + password + "[/PASSWORD]" + "[IN_TIME]" + CommonFunctions.getCurrentTimeWithLanguage(context) + "[/IN_TIME]" + "[LATITUDE]" + lat + "[/LATITUDE]" + "[LONGITUDE]" + lon + "[/LONGITUDE]" + "[APP_VERSION]" + app_ver+"-T5" + "[/APP_VERSION]" + "[ATT_MODE]OnLine[/ATT_MODE]" + "[NETWORK_STATUS]" + "LoginStatus" + "[/NETWORK_STATUS]" + "[/USER_DATA][/DATA]";
|
||||||
SoapObject request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_LOGIN);
|
SoapObject request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_LOGIN);
|
||||||
request.addProperty("onXML", userauth_xml);
|
request.addProperty("onXML", userauth_xml);
|
||||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||||
|
|||||||
+10
-14
@@ -1,5 +1,7 @@
|
|||||||
package cpm.com.gskmtorange.storeinmap;
|
package cpm.com.gskmtorange.storeinmap;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
@@ -10,6 +12,7 @@ import android.view.View;
|
|||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import com.google.android.gms.maps.CameraUpdateFactory;
|
import com.google.android.gms.maps.CameraUpdateFactory;
|
||||||
@@ -56,34 +59,23 @@ public class StoreListRouteActivity extends FragmentActivity implements OnMapRea
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_store_list_route);
|
setContentView(R.layout.activity_store_list_route);
|
||||||
storelist = (ArrayList<StoreBean>)getIntent().getSerializableExtra(CommonString.KEY_STORE_LIST);
|
storelist = (ArrayList<StoreBean>)getIntent().getSerializableExtra(CommonString.KEY_STORE_LIST);
|
||||||
|
|
||||||
|
|
||||||
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
|
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
|
||||||
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
|
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
|
||||||
.findFragmentById(R.id.map);
|
.findFragmentById(R.id.map);
|
||||||
mapFragment.getMapAsync(this);
|
|
||||||
|
|
||||||
|
mapFragment.getMapAsync(this);
|
||||||
color_list.add("#f44336");
|
color_list.add("#f44336");
|
||||||
color_list.add("#1e88e5");
|
color_list.add("#1e88e5");
|
||||||
color_list.add("#2e7d32");
|
color_list.add("#2e7d32");
|
||||||
color_list.add("#ab47bc");
|
color_list.add("#ab47bc");
|
||||||
color_list.add("#ffcc80");
|
color_list.add("#ffcc80");
|
||||||
color_list.add("#fdd835");
|
color_list.add("#fdd835");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Manipulates the map once available.
|
|
||||||
* This callback is triggered when the map is ready to be used.
|
|
||||||
* This is where we can add markers or lines, add listeners or move the camera. In this case,
|
|
||||||
* we just add a marker near Sydney, Australia.
|
|
||||||
* If Google Play services is not installed on the device, the user will be prompted to install
|
|
||||||
* it inside the SupportMapFragment. This method will only be triggered once the user has
|
|
||||||
* installed Google Play services and returned to the app.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void onMapReady(GoogleMap googleMap) {
|
public void onMapReady(GoogleMap googleMap) {
|
||||||
mMap = googleMap;
|
mMap = googleMap;
|
||||||
|
|
||||||
showRoute(global_index);
|
showRoute(global_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,6 +94,10 @@ public class StoreListRouteActivity extends FragmentActivity implements OnMapRea
|
|||||||
Bitmap bm = tv.getDrawingCache();
|
Bitmap bm = tv.getDrawingCache();
|
||||||
lat = Double.parseDouble(storelist.get(index).getLATITUDE());
|
lat = Double.parseDouble(storelist.get(index).getLATITUDE());
|
||||||
lon = Double.parseDouble(storelist.get(index).getLONGITUDE());
|
lon = Double.parseDouble(storelist.get(index).getLONGITUDE());
|
||||||
|
/*lat = 28.5275;
|
||||||
|
lon = 77.2781;*/
|
||||||
|
|
||||||
|
Log.e("directiondata",lat +","+lon);
|
||||||
LatLng loc = new LatLng(lat, lon);
|
LatLng loc = new LatLng(lat, lon);
|
||||||
|
|
||||||
mMap.addMarker(new MarkerOptions().position(loc).anchor(0.5f, 0.5f).icon(BitmapDescriptorFactory.fromBitmap(bm)));
|
mMap.addMarker(new MarkerOptions().position(loc).anchor(0.5f, 0.5f).icon(BitmapDescriptorFactory.fromBitmap(bm)));
|
||||||
|
|||||||
+147
-322
@@ -6,7 +6,6 @@ import android.content.pm.PackageManager;
|
|||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -24,11 +23,10 @@ import androidx.fragment.app.FragmentActivity;
|
|||||||
import com.google.android.gms.appindexing.Action;
|
import com.google.android.gms.appindexing.Action;
|
||||||
import com.google.android.gms.appindexing.AppIndex;
|
import com.google.android.gms.appindexing.AppIndex;
|
||||||
import com.google.android.gms.appindexing.Thing;
|
import com.google.android.gms.appindexing.Thing;
|
||||||
import com.google.android.gms.common.ConnectionResult;
|
import com.google.android.gms.location.FusedLocationProviderClient;
|
||||||
import com.google.android.gms.common.GooglePlayServicesUtil;
|
import com.google.android.gms.location.LocationCallback;
|
||||||
import com.google.android.gms.common.api.GoogleApiClient;
|
|
||||||
import com.google.android.gms.location.LocationListener;
|
|
||||||
import com.google.android.gms.location.LocationRequest;
|
import com.google.android.gms.location.LocationRequest;
|
||||||
|
import com.google.android.gms.location.LocationResult;
|
||||||
import com.google.android.gms.location.LocationServices;
|
import com.google.android.gms.location.LocationServices;
|
||||||
import com.google.android.gms.maps.CameraUpdateFactory;
|
import com.google.android.gms.maps.CameraUpdateFactory;
|
||||||
import com.google.android.gms.maps.GoogleMap;
|
import com.google.android.gms.maps.GoogleMap;
|
||||||
@@ -40,9 +38,7 @@ import com.google.android.gms.maps.model.LatLngBounds;
|
|||||||
import com.google.android.gms.maps.model.MarkerOptions;
|
import com.google.android.gms.maps.model.MarkerOptions;
|
||||||
import com.google.android.gms.maps.model.PolylineOptions;
|
import com.google.android.gms.maps.model.PolylineOptions;
|
||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@@ -57,122 +53,136 @@ import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
|||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
|
||||||
public class StoreRouteActivity extends FragmentActivity implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
public class StoreRouteActivity extends FragmentActivity implements OnMapReadyCallback {
|
||||||
|
|
||||||
private Context context;
|
private Context context;
|
||||||
private GoogleMap mMap;
|
private GoogleMap mMap;
|
||||||
StoreBean store;
|
private StoreBean store;
|
||||||
LatLng origin, destination;
|
private LatLng origin, destination;
|
||||||
private final static int PLAY_SERVICES_RESOLUTION_REQUEST = 1000;
|
|
||||||
private GoogleApiClient mGoogleApiClient;
|
private FusedLocationProviderClient fusedLocationClient;
|
||||||
private LocationRequest mLocationRequest;
|
private LocationRequest locationRequest;
|
||||||
private static int UPDATE_INTERVAL = 500; // 5 sec
|
private LocationCallback locationCallback;
|
||||||
private static int FATEST_INTERVAL = 100; // 1 sec
|
|
||||||
private static int DISPLACEMENT = 5; // 10 meters
|
private static final int LOCATION_PERMISSION_REQUEST = 1001;
|
||||||
private Location mLastLocation;
|
|
||||||
double latitude = 0.0;
|
|
||||||
double longitude = 0.0;
|
|
||||||
Boolean markerflag = true;
|
|
||||||
FloatingActionButton fab_cancel;
|
FloatingActionButton fab_cancel;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_store_route);
|
setContentView(R.layout.activity_store_route);
|
||||||
fab_cancel = (FloatingActionButton) findViewById(R.id.fab_cancel);
|
|
||||||
context = this;
|
context = this;
|
||||||
fab_cancel.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
fab_cancel = findViewById(R.id.fab_cancel);
|
||||||
public void onClick(View v) {
|
fab_cancel.setOnClickListener(v -> {
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
store = (StoreBean) getIntent().getSerializableExtra(CommonString.KEY_STORE_LIST);
|
store = (StoreBean) getIntent().getSerializableExtra(CommonString.KEY_STORE_LIST);
|
||||||
/*store.setLATITUDE("28.5420901");
|
|
||||||
store.setLONGITUDE("77.2430997");*/
|
|
||||||
/*store.setLATITUDE("28.544055");
|
|
||||||
store.setLONGITUDE("77.264060");*/
|
|
||||||
|
|
||||||
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
|
fusedLocationClient = LocationServices.getFusedLocationProviderClient(this);
|
||||||
|
|
||||||
|
locationRequest = LocationRequest.create()
|
||||||
|
.setInterval(2000) // 2 sec
|
||||||
|
.setFastestInterval(1000) // 1 sec
|
||||||
|
.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
|
||||||
|
|
||||||
|
locationCallback = new LocationCallback() {
|
||||||
|
@Override
|
||||||
|
public void onLocationResult(@NonNull LocationResult locationResult) {
|
||||||
|
if (locationResult.getLastLocation() != null) {
|
||||||
|
Location loc = locationResult.getLastLocation();
|
||||||
|
updateMapWithCurrentLocation(loc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
|
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
|
||||||
.findFragmentById(R.id.map);
|
.findFragmentById(R.id.map);
|
||||||
mapFragment.getMapAsync(this);
|
if (mapFragment != null) {
|
||||||
|
mapFragment.getMapAsync(this);
|
||||||
if (checkPlayServices()) {
|
|
||||||
|
|
||||||
// Building the GoogleApi client
|
|
||||||
buildGoogleApiClient();
|
|
||||||
|
|
||||||
createLocationRequest();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkPlayServices() {
|
@Override
|
||||||
int resultCode = GooglePlayServicesUtil
|
public void onMapReady(GoogleMap googleMap) {
|
||||||
.isGooglePlayServicesAvailable(this);
|
mMap = googleMap;
|
||||||
if (resultCode != ConnectionResult.SUCCESS) {
|
|
||||||
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
|
// Enable zoom controls for user
|
||||||
GooglePlayServicesUtil.getErrorDialog(resultCode, this,
|
mMap.getUiSettings().setZoomControlsEnabled(true);
|
||||||
PLAY_SERVICES_RESOLUTION_REQUEST).show();
|
|
||||||
} else {
|
// Request permissions
|
||||||
Toast.makeText(context, getResources().getString(R.string.notsuppoted)
|
if (checkLocationPermission()) {
|
||||||
, Toast.LENGTH_LONG)
|
startLocationUpdates();
|
||||||
.show();
|
fusedLocationClient.getLastLocation()
|
||||||
finish();
|
.addOnSuccessListener(this, location -> {
|
||||||
}
|
if (location != null) {
|
||||||
|
updateMapWithCurrentLocation(location); // show instantly with last known location
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, "Waiting for current location...", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/* if (store != null) {
|
||||||
|
LatLng storeLoc = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
||||||
|
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(storeLoc, 15));
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean checkLocationPermission() {
|
||||||
|
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
|
||||||
|
!= PackageManager.PERMISSION_GRANTED) {
|
||||||
|
ActivityCompat.requestPermissions(
|
||||||
|
this,
|
||||||
|
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
|
||||||
|
LOCATION_PERMISSION_REQUEST
|
||||||
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected synchronized void buildGoogleApiClient() {
|
private void startLocationUpdates() {
|
||||||
mGoogleApiClient = new GoogleApiClient.Builder(this)
|
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
||||||
.addConnectionCallbacks(this)
|
fusedLocationClient.requestLocationUpdates(locationRequest, locationCallback, null);
|
||||||
.addOnConnectionFailedListener(this)
|
|
||||||
.addApi(LocationServices.API).build();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
protected void createLocationRequest() {
|
|
||||||
mLocationRequest = new LocationRequest();
|
|
||||||
mLocationRequest.setInterval(UPDATE_INTERVAL);
|
|
||||||
mLocationRequest.setFastestInterval(FATEST_INTERVAL);
|
|
||||||
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
|
|
||||||
mLocationRequest.setSmallestDisplacement(DISPLACEMENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void startLocationUpdates() {
|
|
||||||
|
|
||||||
|
|
||||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
|
||||||
|| ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
|
|
||||||
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private void updateMapWithCurrentLocation(Location location) {
|
||||||
* Manipulates the map once available.
|
double latitude = location.getLatitude();
|
||||||
* This callback is triggered when the map is ready to be used.
|
double longitude = location.getLongitude();
|
||||||
* This is where we can add markers or lines, add listeners or move the camera. In this case,
|
|
||||||
* we just add a marker near Sydney, Australia.
|
origin = new LatLng(latitude, longitude);
|
||||||
* If Google Play services is not installed on the device, the user will be prompted to install
|
destination = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
||||||
* it inside the SupportMapFragment. This method will only be triggered once the user has
|
|
||||||
* installed Google Play services and returned to the app.
|
// Show markers
|
||||||
*/
|
StoreBean currentStore = new StoreBean();
|
||||||
@Override
|
currentStore.setLATITUDE(latitude + "");
|
||||||
public void onMapReady(GoogleMap googleMap) {
|
currentStore.setLONGITUDE(longitude + "");
|
||||||
mMap = googleMap;
|
currentStore.setSTORE_NAME("Current Location");
|
||||||
|
showMarker(currentStore, R.layout.current_marker_view);
|
||||||
|
|
||||||
|
showMarker(store, R.layout.marker_view);
|
||||||
|
|
||||||
|
// Move camera to fit both points
|
||||||
|
LatLngBounds.Builder builder = new LatLngBounds.Builder();
|
||||||
|
builder.include(origin);
|
||||||
|
builder.include(destination);
|
||||||
|
mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 100));
|
||||||
|
|
||||||
|
// Fetch and draw route
|
||||||
|
String url = getUrl(origin, destination);
|
||||||
|
new FetchUrl().execute(url);
|
||||||
|
|
||||||
|
// Stop updates once we get location
|
||||||
|
fusedLocationClient.removeLocationUpdates(locationCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showMarker(double lat, double lon) {
|
public void showMarker(StoreBean store, int layout_resource) {
|
||||||
// Add a marker and move the camera
|
LinearLayout tv = (LinearLayout) this.getLayoutInflater().inflate(layout_resource, null, false);
|
||||||
LinearLayout tv = (LinearLayout) this.getLayoutInflater().inflate(R.layout.marker_view, null, false);
|
TextView desc = tv.findViewById(R.id.tv_desc);
|
||||||
|
|
||||||
TextView desc = (TextView) tv.findViewById(R.id.tv_desc);
|
|
||||||
desc.setText(store.getSTORE_NAME());
|
desc.setText(store.getSTORE_NAME());
|
||||||
|
|
||||||
tv.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
|
tv.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
|
||||||
@@ -180,302 +190,117 @@ public class StoreRouteActivity extends FragmentActivity implements OnMapReadyCa
|
|||||||
tv.layout(0, 0, tv.getMeasuredWidth(), tv.getMeasuredHeight());
|
tv.layout(0, 0, tv.getMeasuredWidth(), tv.getMeasuredHeight());
|
||||||
|
|
||||||
tv.setDrawingCacheEnabled(true);
|
tv.setDrawingCacheEnabled(true);
|
||||||
tv.buildDrawingCache();
|
|
||||||
Bitmap bm = tv.getDrawingCache();
|
Bitmap bm = tv.getDrawingCache();
|
||||||
|
|
||||||
LatLng loc = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
LatLng loc = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
||||||
mMap.addMarker(new MarkerOptions().position(loc).anchor(0.5f, 0.5f).icon(BitmapDescriptorFactory.fromBitmap(bm)));
|
mMap.addMarker(new MarkerOptions()
|
||||||
|
.position(loc)
|
||||||
|
.anchor(0.5f, 0.5f)
|
||||||
|
.icon(BitmapDescriptorFactory.fromBitmap(bm)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getUrl(LatLng origin, LatLng dest) {
|
private String getUrl(LatLng origin, LatLng dest) {
|
||||||
|
|
||||||
// Origin of route
|
|
||||||
String str_origin = "origin=" + origin.latitude + "," + origin.longitude;
|
String str_origin = "origin=" + origin.latitude + "," + origin.longitude;
|
||||||
|
|
||||||
// Destination of route
|
|
||||||
String str_dest = "destination=" + dest.latitude + "," + dest.longitude;
|
String str_dest = "destination=" + dest.latitude + "," + dest.longitude;
|
||||||
|
String parameters = str_origin + "&" + str_dest + "&sensor=false";
|
||||||
|
|
||||||
// Sensor enabled
|
|
||||||
String sensor = "sensor=false";
|
|
||||||
|
|
||||||
// Building the parameters to the web service
|
|
||||||
String parameters = str_origin + "&" + str_dest + "&" + sensor;
|
|
||||||
|
|
||||||
// Output format
|
|
||||||
String output = "json";
|
String output = "json";
|
||||||
|
return "https://maps.googleapis.com/maps/api/directions/" + output + "?" + parameters + "&key=AIzaSyCPo-giwVv5h8AzsbE1IDRsFsPHjVlCm5A";
|
||||||
// Building the url to the web service
|
|
||||||
String url = "https://maps.googleapis.com/maps/api/directions/" + output + "?" + parameters+"&key=AIzaSyCPo-giwVv5h8AzsbE1IDRsFsPHjVlCm5A";
|
|
||||||
|
|
||||||
|
|
||||||
return url;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* A method to download json data from url
|
|
||||||
*/
|
|
||||||
private String downloadUrl(String strUrl) throws IOException {
|
private String downloadUrl(String strUrl) throws IOException {
|
||||||
String data = "";
|
StringBuilder sb = new StringBuilder();
|
||||||
InputStream iStream = null;
|
InputStream iStream = null;
|
||||||
HttpURLConnection urlConnection = null;
|
HttpURLConnection urlConnection = null;
|
||||||
try {
|
try {
|
||||||
URL url = new URL(strUrl);
|
URL url = new URL(strUrl);
|
||||||
|
|
||||||
// Creating an http connection to communicate with url
|
|
||||||
urlConnection = (HttpURLConnection) url.openConnection();
|
urlConnection = (HttpURLConnection) url.openConnection();
|
||||||
|
|
||||||
// Connecting to url
|
|
||||||
urlConnection.connect();
|
urlConnection.connect();
|
||||||
|
|
||||||
// Reading data from url
|
|
||||||
iStream = urlConnection.getInputStream();
|
iStream = urlConnection.getInputStream();
|
||||||
|
|
||||||
BufferedReader br = new BufferedReader(new InputStreamReader(iStream));
|
BufferedReader br = new BufferedReader(new InputStreamReader(iStream));
|
||||||
|
String line;
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
|
|
||||||
String line = "";
|
|
||||||
while ((line = br.readLine()) != null) {
|
while ((line = br.readLine()) != null) {
|
||||||
sb.append(line);
|
sb.append(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
data = sb.toString();
|
|
||||||
Log.d("downloadUrl", data.toString());
|
|
||||||
br.close();
|
br.close();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.d("Exception", e.toString());
|
Log.e("Exception", e.toString());
|
||||||
} finally {
|
} finally {
|
||||||
iStream.close();
|
if (iStream != null) iStream.close();
|
||||||
urlConnection.disconnect();
|
if (urlConnection != null) urlConnection.disconnect();
|
||||||
}
|
}
|
||||||
return data;
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// AsyncTask to fetch directions
|
||||||
public void onConnected(@Nullable Bundle bundle) {
|
|
||||||
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
// TODO: Consider calling
|
|
||||||
// ActivityCompat#requestPermissions
|
|
||||||
// here to request the missing permissions, and then overriding
|
|
||||||
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
|
|
||||||
// int[] grantResults)
|
|
||||||
// to handle the case where the user grants the permission. See the documentation
|
|
||||||
// for ActivityCompat#requestPermissions for more details.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
|
|
||||||
|
|
||||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
|
||||||
|| ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
if (mLastLocation != null) {
|
|
||||||
latitude = mLastLocation.getLatitude();
|
|
||||||
longitude = mLastLocation.getLongitude();
|
|
||||||
|
|
||||||
mMap.setMyLocationEnabled(true);
|
|
||||||
|
|
||||||
origin = new LatLng(latitude, longitude);
|
|
||||||
destination = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
|
||||||
|
|
||||||
StoreBean store1 = new StoreBean();
|
|
||||||
store1.setLATITUDE(latitude+"");
|
|
||||||
store1.setLONGITUDE(longitude+"");
|
|
||||||
store1.setSTORE_NAME("Current Location");
|
|
||||||
showMarker(store1, R.layout.current_marker_view);
|
|
||||||
|
|
||||||
showMarker(store, R.layout.marker_view);
|
|
||||||
|
|
||||||
LatLngBounds.Builder builder = new LatLngBounds.Builder();
|
|
||||||
builder.include(new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE())));
|
|
||||||
builder.include(new LatLng(latitude, longitude));
|
|
||||||
//mMap.moveCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 48));
|
|
||||||
mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 48));
|
|
||||||
|
|
||||||
//destination = new LatLng(mapLat[1], mapLon[1]);
|
|
||||||
/*mMap.moveCamera(CameraUpdateFactory.newLatLng(origin));
|
|
||||||
mMap.animateCamera(CameraUpdateFactory.zoomTo(17));*/
|
|
||||||
|
|
||||||
//new GetDirection().execute();
|
|
||||||
// Getting URL to the Google Directions API
|
|
||||||
String url = getUrl(origin, destination);
|
|
||||||
Log.d("onMapClick", url.toString());
|
|
||||||
FetchUrl FetchUrl = new FetchUrl();
|
|
||||||
|
|
||||||
// Start downloading json data from Google Directions API
|
|
||||||
FetchUrl.execute(url);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// if (mRequestingLocationUpdates) {
|
|
||||||
startLocationUpdates();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onConnectionSuspended(int i) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLocationChanged(Location location) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showMarker(StoreBean store, int layout_resource){
|
|
||||||
// Add a marker of latest location and move the camera
|
|
||||||
LinearLayout tv = (LinearLayout) this.getLayoutInflater().inflate(layout_resource, null, false);
|
|
||||||
|
|
||||||
TextView desc = (TextView) tv.findViewById(R.id.tv_desc);
|
|
||||||
desc.setText(store.getSTORE_NAME());
|
|
||||||
|
|
||||||
tv.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
|
|
||||||
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
|
|
||||||
tv.layout(0, 0, tv.getMeasuredWidth(), tv.getMeasuredHeight());
|
|
||||||
|
|
||||||
tv.setDrawingCacheEnabled(true);
|
|
||||||
tv.buildDrawingCache();
|
|
||||||
Bitmap bm = tv.getDrawingCache();
|
|
||||||
LatLng loc = new LatLng(Double.parseDouble(store.getLATITUDE()), Double.parseDouble(store.getLONGITUDE()));
|
|
||||||
mMap.addMarker(new MarkerOptions().position(loc).anchor(0.5f, 0.5f).icon(BitmapDescriptorFactory.fromBitmap(bm)));
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void onStart() {
|
|
||||||
super.onStart();// ATTENTION: This was auto-generated to implement the App Indexing API.
|
|
||||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
|
||||||
mGoogleApiClient.connect();
|
|
||||||
if (mGoogleApiClient != null) {
|
|
||||||
mGoogleApiClient.connect();
|
|
||||||
}
|
|
||||||
// ATTENTION: This was auto-generated to implement the App Indexing API.
|
|
||||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
|
||||||
// AppIndex.AppIndexApi.start(mGoogleApiClient, getIndexApiAction());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ATTENTION: This was auto-generated to implement the App Indexing API.
|
|
||||||
* See https://g.co/AppIndexing/AndroidStudio for more information.
|
|
||||||
*/
|
|
||||||
public Action getIndexApiAction() {
|
|
||||||
Thing object = new Thing.Builder()
|
|
||||||
.setName("GeoTag Page") // TODO: Define a title for the content shown.
|
|
||||||
// TODO: Make sure this auto-generated URL is correct.
|
|
||||||
.setUrl(Uri.parse("http://[ENTER-YOUR-URL-HERE]"))
|
|
||||||
.build();
|
|
||||||
return new Action.Builder(Action.TYPE_VIEW)
|
|
||||||
.setObject(object)
|
|
||||||
.setActionStatus(Action.STATUS_TYPE_COMPLETED)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fetches data from url passed
|
|
||||||
private class FetchUrl extends AsyncTask<String, Void, String> {
|
private class FetchUrl extends AsyncTask<String, Void, String> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String doInBackground(String... url) {
|
protected String doInBackground(String... url) {
|
||||||
|
|
||||||
// For storing data from web service
|
|
||||||
String data = "";
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Fetching the data from web service
|
return downloadUrl(url[0]);
|
||||||
data = downloadUrl(url[0]);
|
} catch (IOException e) {
|
||||||
Log.d("Background Task data", data.toString());
|
Log.e("Background Task", e.toString());
|
||||||
} catch (Exception e) {
|
return "";
|
||||||
Log.d("Background Task", e.toString());
|
|
||||||
}
|
}
|
||||||
return data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(String result) {
|
protected void onPostExecute(String result) {
|
||||||
super.onPostExecute(result);
|
super.onPostExecute(result);
|
||||||
|
Log.d("DirectionsResponse", result);
|
||||||
ParserTask parserTask = new ParserTask();
|
new ParserTask().execute(result);
|
||||||
|
|
||||||
// Invokes the thread for parsing the JSON data
|
|
||||||
parserTask.execute(result);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* A class to parse the Google Places in JSON format
|
|
||||||
*/
|
|
||||||
private class ParserTask extends AsyncTask<String, Integer, List<List<HashMap<String, String>>>> {
|
private class ParserTask extends AsyncTask<String, Integer, List<List<HashMap<String, String>>>> {
|
||||||
|
|
||||||
// Parsing the data in non-ui thread
|
|
||||||
@Override
|
@Override
|
||||||
protected List<List<HashMap<String, String>>> doInBackground(String... jsonData) {
|
protected List<List<HashMap<String, String>>> doInBackground(String... jsonData) {
|
||||||
|
|
||||||
JSONObject jObject;
|
|
||||||
List<List<HashMap<String, String>>> routes = null;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
jObject = new JSONObject(jsonData[0]);
|
JSONObject jObject = new JSONObject(jsonData[0]);
|
||||||
Log.d("ParserTask",jsonData[0].toString());
|
|
||||||
DataParser parser = new DataParser();
|
DataParser parser = new DataParser();
|
||||||
Log.d("ParserTask", parser.toString());
|
return parser.parse(jObject);
|
||||||
|
|
||||||
// Starts parsing data
|
|
||||||
routes = parser.parse(jObject);
|
|
||||||
Log.d("ParserTask","Executing routes");
|
|
||||||
Log.d("ParserTask",routes.toString());
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.d("ParserTask",e.toString());
|
Log.e("ParserTask", e.toString());
|
||||||
e.printStackTrace();
|
return null;
|
||||||
}
|
}
|
||||||
return routes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Executes in UI thread, after the parsing process
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(List<List<HashMap<String, String>>> result) {
|
protected void onPostExecute(List<List<HashMap<String, String>>> result) {
|
||||||
|
if (result == null) return;
|
||||||
|
|
||||||
ArrayList<LatLng> points;
|
ArrayList<LatLng> points;
|
||||||
PolylineOptions lineOptions = null;
|
PolylineOptions lineOptions = null;
|
||||||
|
|
||||||
// Traversing through all the routes
|
for (List<HashMap<String, String>> path : result) {
|
||||||
for (int i = 0; i < result.size(); i++) {
|
|
||||||
points = new ArrayList<>();
|
points = new ArrayList<>();
|
||||||
lineOptions = new PolylineOptions();
|
lineOptions = new PolylineOptions();
|
||||||
|
|
||||||
// Fetching i-th route
|
for (HashMap<String, String> point : path) {
|
||||||
List<HashMap<String, String>> path = result.get(i);
|
|
||||||
|
|
||||||
// Fetching all the points in i-th route
|
|
||||||
for (int j = 0; j < path.size(); j++) {
|
|
||||||
HashMap<String, String> point = path.get(j);
|
|
||||||
|
|
||||||
double lat = Double.parseDouble(point.get("lat"));
|
double lat = Double.parseDouble(point.get("lat"));
|
||||||
double lng = Double.parseDouble(point.get("lng"));
|
double lng = Double.parseDouble(point.get("lng"));
|
||||||
LatLng position = new LatLng(lat, lng);
|
points.add(new LatLng(lat, lng));
|
||||||
|
|
||||||
points.add(position);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adding all the points in the route to LineOptions
|
|
||||||
lineOptions.addAll(points);
|
lineOptions.addAll(points);
|
||||||
lineOptions.width(12);
|
lineOptions.width(12);
|
||||||
lineOptions.color(Color.parseColor("#5ac614"));
|
lineOptions.color(Color.parseColor("#5ac614"));
|
||||||
|
|
||||||
Log.d("onPostExecute","onPostExecute lineoptions decoded");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Drawing polyline in the Google Map for the i-th route
|
if (lineOptions != null) {
|
||||||
if(lineOptions != null) {
|
|
||||||
mMap.addPolyline(lineOptions);
|
mMap.addPolyline(lineOptions);
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
Log.d("onPostExecute","without Polylines drawn");
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
|
||||||
|
@NonNull int[] grantResults) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
|
if (requestCode == LOCATION_PERMISSION_REQUEST) {
|
||||||
|
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||||
|
startLocationUpdates();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, "Location permission required", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,11 +15,13 @@ import android.util.Log;
|
|||||||
|
|
||||||
//import com.crashlytics.android.Crashlytics;
|
//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.Protocol;
|
||||||
import com.squareup.okhttp.RequestBody;
|
import com.squareup.okhttp.RequestBody;
|
||||||
|
import com.squareup.okhttp.TlsVersion;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
@@ -144,9 +146,8 @@ public class UploadImageWithRetrofit {
|
|||||||
if (finalFile == null) {
|
if (finalFile == null) {
|
||||||
finalFile = originalFile;
|
finalFile = originalFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
OkHttpClient okHttpClient = new OkHttpClient();
|
OkHttpClient okHttpClient = new OkHttpClient();
|
||||||
// okHttpClient.setProtocols(Arrays.asList(Protocol.HTTP_1_1));
|
// okHttpClient.setProtocols(Arrays.asList(Protocol.));
|
||||||
okHttpClient.setConnectTimeout(20, TimeUnit.SECONDS);
|
okHttpClient.setConnectTimeout(20, TimeUnit.SECONDS);
|
||||||
okHttpClient.setWriteTimeout(20, TimeUnit.SECONDS);
|
okHttpClient.setWriteTimeout(20, TimeUnit.SECONDS);
|
||||||
okHttpClient.setReadTimeout(20, TimeUnit.SECONDS);
|
okHttpClient.setReadTimeout(20, TimeUnit.SECONDS);
|
||||||
@@ -177,7 +178,6 @@ public class UploadImageWithRetrofit {
|
|||||||
uploadedFiles++;
|
uploadedFiles++;
|
||||||
} else {
|
} else {
|
||||||
status = 0;
|
status = 0;
|
||||||
//uploadedFiles = 0;
|
|
||||||
}
|
}
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
pd.dismiss();
|
pd.dismiss();
|
||||||
@@ -202,13 +202,11 @@ public class UploadImageWithRetrofit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (totalFiles == uploadedFiles) {
|
if (totalFiles == uploadedFiles) {
|
||||||
//region Coverage upload status Data
|
//region Coverage upload status Data
|
||||||
new StatusUpload().execute();
|
new StatusUpload().execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (JsonSyntaxException e) {
|
} catch (JsonSyntaxException e) {
|
||||||
e.fillInStackTrace();
|
e.fillInStackTrace();
|
||||||
|
|||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package cpm.com.gskmtorange.utils;
|
||||||
|
import com.squareup.okhttp.ConnectionSpec;
|
||||||
|
import com.squareup.okhttp.MediaType;
|
||||||
|
import com.squareup.okhttp.OkHttpClient;
|
||||||
|
import com.squareup.okhttp.Request;
|
||||||
|
import com.squareup.okhttp.RequestBody;
|
||||||
|
import com.squareup.okhttp.Response;
|
||||||
|
import com.squareup.okhttp.TlsVersion;
|
||||||
|
import org.ksoap2.HeaderProperty;
|
||||||
|
import org.ksoap2.SoapEnvelope;
|
||||||
|
import org.ksoap2.transport.ServiceConnection;
|
||||||
|
import org.ksoap2.transport.Transport;
|
||||||
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
public class OkHttpTransportSE extends Transport {
|
||||||
|
|
||||||
|
private final String url;
|
||||||
|
private final OkHttpClient client;
|
||||||
|
|
||||||
|
public OkHttpTransportSE(String url) {
|
||||||
|
this(url, 60000); // default 60s timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
public OkHttpTransportSE(String url, int timeout) {
|
||||||
|
super(url, timeout);
|
||||||
|
this.url = url;
|
||||||
|
|
||||||
|
client = new OkHttpClient();
|
||||||
|
|
||||||
|
// Force TLS 1.2
|
||||||
|
ConnectionSpec spec = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
|
||||||
|
.tlsVersions(TlsVersion.TLS_1_2,
|
||||||
|
TlsVersion.TLS_1_1,
|
||||||
|
TlsVersion.TLS_1_0)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
client.setConnectionSpecs(Collections.singletonList(spec));
|
||||||
|
client.setConnectTimeout(timeout, TimeUnit.MILLISECONDS);
|
||||||
|
client.setReadTimeout(timeout, TimeUnit.MILLISECONDS);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List call(String soapAction, SoapEnvelope envelope, List headers)
|
||||||
|
throws IOException, XmlPullParserException {
|
||||||
|
return call(soapAction, envelope, headers, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ServiceConnection getServiceConnection() throws IOException {
|
||||||
|
return null; // not used with OkHttp
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<HeaderProperty> call(String soapAction, SoapEnvelope envelope, List headers, File outputFile)
|
||||||
|
throws IOException, XmlPullParserException {
|
||||||
|
|
||||||
|
if (soapAction == null) {
|
||||||
|
soapAction = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] requestData = this.createRequestData(envelope, "UTF-8");
|
||||||
|
this.requestDump = this.debug ? new String(requestData) : null;
|
||||||
|
this.responseDump = null;
|
||||||
|
|
||||||
|
// Build request
|
||||||
|
Request.Builder builder = new Request.Builder()
|
||||||
|
.url(url)
|
||||||
|
.addHeader("User-Agent", "ksoap2-android/2.6.0+");
|
||||||
|
|
||||||
|
if (envelope.version == SoapEnvelope.VER12) {
|
||||||
|
builder.addHeader("Content-Type", "application/soap+xml;charset=utf-8");
|
||||||
|
} else {
|
||||||
|
builder.addHeader("Content-Type", "text/xml;charset=utf-8");
|
||||||
|
builder.addHeader("SOAPAction", soapAction); // Match HttpTransportSE
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add custom headers if any
|
||||||
|
if (headers != null) {
|
||||||
|
for (Object h : headers) {
|
||||||
|
HeaderProperty hp = (HeaderProperty) h;
|
||||||
|
if (hp.getKey() != null && hp.getValue() != null) {
|
||||||
|
builder.addHeader(hp.getKey(), hp.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
builder.post(RequestBody.create(MediaType.parse("text/xml; charset=utf-8"), requestData));
|
||||||
|
|
||||||
|
// Execute request
|
||||||
|
Response response = client.newCall(builder.build()).execute();
|
||||||
|
|
||||||
|
if (!response.isSuccessful()) {
|
||||||
|
throw new IOException("HTTP request failed, code: " + response.code());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Collect response headers
|
||||||
|
List<HeaderProperty> retHeaders = new ArrayList<>();
|
||||||
|
for (String name : response.headers().names()) {
|
||||||
|
retHeaders.add(new HeaderProperty(name, response.header(name)));
|
||||||
|
}
|
||||||
|
// Parse SOAP response
|
||||||
|
parseResponse(envelope, response.body().byteStream());
|
||||||
|
return retHeaders;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package cpm.com.gskmtorange.utils
|
||||||
|
|
||||||
|
// ScoreItem.kt
|
||||||
|
sealed class ScoreItem {
|
||||||
|
data class OverallScore(
|
||||||
|
val osa: String,
|
||||||
|
val msl: String,
|
||||||
|
val posm: String,
|
||||||
|
val sosSku: String,
|
||||||
|
val sosBrand: String
|
||||||
|
) : ScoreItem()
|
||||||
|
|
||||||
|
data class CategoryScore(
|
||||||
|
val categoryName: String,
|
||||||
|
val msl: String,
|
||||||
|
val posm: String,
|
||||||
|
val sosSku: String,
|
||||||
|
val sosBrand: String,
|
||||||
|
val brandDetails: List<Pair<String, String>> // BrandName to Value
|
||||||
|
) : ScoreItem()
|
||||||
|
|
||||||
|
data class ImageItem(
|
||||||
|
val url: String
|
||||||
|
) : ScoreItem()
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package cpm.com.gskmtorange.utils;
|
||||||
|
|
||||||
|
import javax.net.ssl.SSLSocket;
|
||||||
|
import javax.net.ssl.SSLSocketFactory;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.Socket;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class TLSSocketFactory extends SSLSocketFactory {
|
||||||
|
private final SSLSocketFactory delegate;
|
||||||
|
|
||||||
|
public TLSSocketFactory() {
|
||||||
|
this.delegate = (SSLSocketFactory) SSLSocketFactory.getDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getDefaultCipherSuites() {
|
||||||
|
return delegate.getDefaultCipherSuites();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getSupportedCipherSuites() {
|
||||||
|
return delegate.getSupportedCipherSuites();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException {
|
||||||
|
return enableModernTLS(delegate.createSocket(s, host, port, autoClose));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Socket createSocket(String host, int port) throws IOException {
|
||||||
|
return enableModernTLS(delegate.createSocket(host, port));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException {
|
||||||
|
return enableModernTLS(delegate.createSocket(host, port, localHost, localPort));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Socket createSocket(InetAddress host, int port) throws IOException {
|
||||||
|
return enableModernTLS(delegate.createSocket(host, port));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException {
|
||||||
|
return enableModernTLS(delegate.createSocket(address, port, localAddress, localPort));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Socket enableModernTLS(Socket socket) {
|
||||||
|
if (socket instanceof SSLSocket) {
|
||||||
|
SSLSocket sslSocket = (SSLSocket) socket;
|
||||||
|
|
||||||
|
// Supported protocols on this device
|
||||||
|
String[] supported = sslSocket.getSupportedProtocols();
|
||||||
|
|
||||||
|
// Collect TLSv1.2 and TLSv1.3 if available
|
||||||
|
List<String> enabled = new ArrayList<>();
|
||||||
|
for (String proto : supported) {
|
||||||
|
if ("TLSv1.2".equals(proto) || "TLSv1.3".equals(proto)) {
|
||||||
|
enabled.add(proto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!enabled.isEmpty()) {
|
||||||
|
sslSocket.setEnabledProtocols(enabled.toArray(new String[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Debug log
|
||||||
|
System.out.println("Enabled protocols: " + Arrays.toString(sslSocket.getEnabledProtocols()));
|
||||||
|
}
|
||||||
|
return socket;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
|
<corners android:radius="5dp"/>
|
||||||
|
<solid android:color="@color/white"/>
|
||||||
|
<stroke android:width="1dp"
|
||||||
|
android:color="@color/colorPrimary"/>
|
||||||
|
|
||||||
|
</shape>
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
|
android:visibility="gone"
|
||||||
android:layout_marginBottom="8dp"/>
|
android:layout_marginBottom="8dp"/>
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
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"
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<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"
|
||||||
|
tools:context="cpm.com.gskmtorange.dailyentry.PD_Pog_Activity">
|
||||||
|
|
||||||
|
<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:popupTheme="@style/AppTheme.PopupOverlay"
|
||||||
|
app:theme="@style/ThemeOverlay.AppCompat.Light" />
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
android:id="@+id/fab"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_margin="@dimen/fab_margin"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:srcCompat="@drawable/save_icon" />
|
||||||
|
|
||||||
|
<include
|
||||||
|
android:id="@+id/rlContent"
|
||||||
|
layout="@layout/content_ir_pog_picture" />
|
||||||
|
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<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"
|
||||||
|
tools:context="cpm.com.gskmtorange.dailyentry.PD_Realtime_Report">
|
||||||
|
|
||||||
|
<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:popupTheme="@style/AppTheme.PopupOverlay"
|
||||||
|
app:theme="@style/ThemeOverlay.AppCompat.Light" />
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<include
|
||||||
|
android:id="@+id/rlContent"
|
||||||
|
layout="@layout/content_realtime" />
|
||||||
|
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<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"
|
||||||
|
tools:context="cpm.com.gskmtorange.dailyentry.PD_Realtime_Report_Detail">
|
||||||
|
|
||||||
|
<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:popupTheme="@style/AppTheme.PopupOverlay"
|
||||||
|
app:theme="@style/ThemeOverlay.AppCompat.Light" />
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progressBar"
|
||||||
|
style="?android:attr/progressBarStyleLarge"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerView"
|
||||||
|
android:layout_marginTop="55dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
<!--<include
|
||||||
|
android:id="@+id/rlContent"
|
||||||
|
layout="@layout/content_realtime" />-->
|
||||||
|
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/webView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout 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:background="@color/grey_background"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="@dimen/activity_horizontal_margin"
|
||||||
|
android:weightSum="100"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
|
tools:context="cpm.com.gskmtorange.dailyentry.PD_Pog_Activity"
|
||||||
|
tools:showIn="@layout/activity_pd_pog">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerViewSubCat"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
tools:context=".password.MPinActivity"
|
tools:context=".password.MPinActivity"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
tools:showIn="@layout/activity_mpin">
|
tools:showIn="@layout/activity_mpin">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout 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:background="@color/grey_background"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="@dimen/activity_horizontal_margin"
|
||||||
|
android:weightSum="100"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
|
tools:context="cpm.com.gskmtorange.dailyentry.PD_Realtime_Report"
|
||||||
|
tools:showIn="@layout/activity_pd_realtime_report">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerViewSubCat"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="12dp"
|
||||||
|
app:cardCornerRadius="16dp"
|
||||||
|
app:cardElevation="5dp"
|
||||||
|
app:cardUseCompatPadding="true">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- Highlight Header -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvCategory"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/colorAccent"
|
||||||
|
android:padding="12dp"
|
||||||
|
android:text="Category Name"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:gravity="center"/>
|
||||||
|
|
||||||
|
<!-- Content Section -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<!-- Scores -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvMsl"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="MSL: 75%"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:layout_marginTop="6dp"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#DDDDDD"
|
||||||
|
android:layout_marginTop="6dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvPosm"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="POSM: 80%"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:layout_marginTop="6dp"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#DDDDDD"
|
||||||
|
android:layout_marginTop="6dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvSosSku"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="SOS SKU: 65%"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:layout_marginTop="6dp"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#DDDDDD"
|
||||||
|
android:layout_marginTop="6dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvSosBrand"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="SOS Brand: 70%"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:layout_marginTop="6dp"/>
|
||||||
|
|
||||||
|
<!-- Brand Details Section -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Brand Details:"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:textColor="@android:color/black"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layoutBrands"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_marginTop="4dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="12dp"
|
||||||
|
app:cardCornerRadius="16dp"
|
||||||
|
app:cardElevation="5dp"
|
||||||
|
app:cardUseCompatPadding="true">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- Header with highlight background -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTitle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/colorAccent"
|
||||||
|
android:text="Overall Score"
|
||||||
|
android:padding="12dp"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:gravity="center"/>
|
||||||
|
|
||||||
|
<!-- Content section -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvOsa"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="OSA: 20.00%"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:layout_marginTop="6dp"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#DDDDDD"
|
||||||
|
android:layout_marginTop="6dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvMsl"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="MSL: 0%"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:layout_marginTop="6dp"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#DDDDDD"
|
||||||
|
android:layout_marginTop="6dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvPosm"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="POSM: 0%"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:layout_marginTop="6dp"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#DDDDDD"
|
||||||
|
android:layout_marginTop="6dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvSosSku"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="SOS (SKU): 50%"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:layout_marginTop="6dp"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#DDDDDD"
|
||||||
|
android:layout_marginTop="6dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvSosBrand"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="SOS (Brand): 4.9%"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:layout_marginTop="6dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="12dp"
|
||||||
|
app:cardCornerRadius="12dp"
|
||||||
|
app:cardElevation="5dp">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivRawImage"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:scaleType="centerCrop"/>
|
||||||
|
<!-- <Button
|
||||||
|
android:id="@+id/btnViewImage"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:text="View Image Analytics"
|
||||||
|
android:background="@color/colorAccent"/>-->
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout 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="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:background="@drawable/rectangle_realtime_card"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="2dp"
|
||||||
|
android:layout_marginLeft="2dp"
|
||||||
|
android:layout_marginRight="2dp"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
card_view:cardCornerRadius="5dp"
|
||||||
|
card_view:cardPreventCornerOverlap="false">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_sub_category"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="6sp"
|
||||||
|
android:layout_marginTop="7dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="Text View "
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/analyticBT"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:layout_marginLeft="12dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingLeft="8dp"
|
||||||
|
android:paddingRight="8dp"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:background="@drawable/rectangle_realtime_card"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/img_recycler"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_margin="@dimen/custom_margin" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_start_session"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="80dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_marginStart="@dimen/fab_margin"
|
||||||
|
android:src="@mipmap/startsession" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
|
|||||||
@@ -93,6 +93,11 @@
|
|||||||
android:id="@+id/nav_services"
|
android:id="@+id/nav_services"
|
||||||
android:icon="@mipmap/services_grey"
|
android:icon="@mipmap/services_grey"
|
||||||
android:title="@string/menu_services" />
|
android:title="@string/menu_services" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/nav_version"
|
||||||
|
android:icon="@mipmap/exit_grey"
|
||||||
|
android:title="" />
|
||||||
</menu>
|
</menu>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
|||||||
@@ -235,4 +235,5 @@
|
|||||||
<string name="comment">تعليق</string>
|
<string name="comment">تعليق</string>
|
||||||
<string name="competition_promotion">تعليق</string>
|
<string name="competition_promotion">تعليق</string>
|
||||||
<string name="exists">التواجد</string>
|
<string name="exists">التواجد</string>
|
||||||
|
<string name="view_report_pd">عرض التقرير</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
<string name="menu_exit">Exit</string>
|
<string name="menu_exit">Exit</string>
|
||||||
<string name="menu_setting">Settings</string>
|
<string name="menu_setting">Settings</string>
|
||||||
<string name="menu_services">Services</string>
|
<string name="menu_services">Services</string>
|
||||||
|
<string name="menu_version">Version/Versiyon</string>
|
||||||
<string name="title_activity_t2_pcompliance">Visibility/T2P</string>
|
<string name="title_activity_t2_pcompliance">Visibility/T2P</string>
|
||||||
<!--Gagan start code-->
|
<!--Gagan start code-->
|
||||||
<string name="title_activity_category_list">Category List</string>
|
<string name="title_activity_category_list">Category List</string>
|
||||||
@@ -457,7 +458,10 @@
|
|||||||
|
|
||||||
<string name="title_activity_ir_image">IR Category Images</string>
|
<string name="title_activity_ir_image">IR Category Images</string>
|
||||||
<string name="title_activity_ir_visibility">IR Visibility Images</string>
|
<string name="title_activity_ir_visibility">IR Visibility Images</string>
|
||||||
|
<string name="title_activity_ir_pog">IR POG Images</string>
|
||||||
<string name="ir_data_upload">IR Category Data Uploading</string>
|
<string name="ir_data_upload">IR Category Data Uploading</string>
|
||||||
<string name="ir_visibility_data_upload">IR Visibilty Images Data Uploading</string>
|
<string name="ir_visibility_data_upload">IR Visibilty Images Data Uploading</string>
|
||||||
|
<string name="view_report_pd">View Report</string>
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<network-security-config>
|
||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
<domain-config>
|
||||||
|
<domain includeSubdomains="true">gskme2.parinaam.in</domain>
|
||||||
</PreferenceScreen>
|
<trust-anchors>
|
||||||
|
<certificates src="system" />
|
||||||
|
<certificates src="user" />
|
||||||
|
</trust-anchors>
|
||||||
|
</domain-config>
|
||||||
|
</network-security-config>
|
||||||
@@ -4,11 +4,6 @@ import org.junit.Test;
|
|||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
/**
|
|
||||||
* Example local unit test, which will execute on the development machine (host).
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
public class ExampleUnitTest {
|
public class ExampleUnitTest {
|
||||||
@Test
|
@Test
|
||||||
public void addition_isCorrect() throws Exception {
|
public void addition_isCorrect() throws Exception {
|
||||||
|
|||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#Tue Jul 29 16:36:46 IST 2025
|
#Thu Sep 25 11:55:29 IST 2025
|
||||||
com.androidbuts.multispinnerfilter.library-main-5\:/layout/textview_for_spinner.xml=D\:\\Haleon_Egypt_PD_Git\\library\\build\\intermediates\\packaged_res\\release\\packageReleaseResources\\layout\\textview_for_spinner.xml
|
com.androidbuts.multispinnerfilter.library-main-5\:/layout/textview_for_spinner.xml=D\:\\Haleon_Egypt_PD_Git\\library\\build\\intermediates\\packaged_res\\release\\packageReleaseResources\\layout\\textview_for_spinner.xml
|
||||||
com.androidbuts.multispinnerfilter.library-main-5\:/layout/activity_main.xml=D\:\\Haleon_Egypt_PD_Git\\library\\build\\intermediates\\packaged_res\\release\\packageReleaseResources\\layout\\activity_main.xml
|
com.androidbuts.multispinnerfilter.library-main-5\:/layout/activity_main.xml=D\:\\Haleon_Egypt_PD_Git\\library\\build\\intermediates\\packaged_res\\release\\packageReleaseResources\\layout\\activity_main.xml
|
||||||
com.androidbuts.multispinnerfilter.library-main-5\:/layout/alert_dialog_listview_search.xml=D\:\\Haleon_Egypt_PD_Git\\library\\build\\intermediates\\packaged_res\\release\\packageReleaseResources\\layout\\alert_dialog_listview_search.xml
|
com.androidbuts.multispinnerfilter.library-main-5\:/layout/alert_dialog_listview_search.xml=D\:\\Haleon_Egypt_PD_Git\\library\\build\\intermediates\\packaged_res\\release\\packageReleaseResources\\layout\\alert_dialog_listview_search.xml
|
||||||
|
|||||||
Reference in New Issue
Block a user