banner_module

This commit is contained in:
2026-06-15 18:54:42 +05:30
parent 1fbb7ebadf
commit 0d1e462563
21 changed files with 921 additions and 432 deletions
+109
View File
@@ -352,6 +352,18 @@
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="samsung" />
<option name="codename" value="a32" />
<option name="id" value="a32" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy A32" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
@@ -568,6 +580,11 @@
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2410" />
<option name="tags">
<list>
<option value="dda-default" />
</list>
</option>
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="32" />
@@ -665,6 +682,18 @@
<option name="screenX" value="2076" />
<option name="screenY" value="2152" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="google" />
<option name="codename" value="comet" />
<option name="id" value="comet" />
<option name="labId" value="google" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 9 Pro Fold" />
<option name="screenDensity" value="390" />
<option name="screenX" value="2076" />
<option name="screenY" value="2152" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="35" />
<option name="brand" value="motorola" />
@@ -893,6 +922,18 @@
<option name="screenX" value="2208" />
<option name="screenY" value="1840" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="google" />
<option name="codename" value="felix" />
<option name="id" value="felix" />
<option name="labId" value="google" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Fold" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2208" />
<option name="screenY" value="1840" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
@@ -965,6 +1006,11 @@
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2424" />
<option name="tags">
<list>
<option value="dda-default" />
</list>
</option>
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
@@ -1014,6 +1060,19 @@
<option name="screenX" value="1200" />
<option name="screenY" value="1920" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="gts10pwifi" />
<option name="formFactor" value="Tablet" />
<option name="id" value="gts10pwifi" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Tab S10+" />
<option name="screenDensity" value="320" />
<option name="screenX" value="1752" />
<option name="screenY" value="2800" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="samsung" />
@@ -1292,6 +1351,11 @@
<option name="screenDensity" value="390" />
<option name="screenX" value="1080" />
<option name="screenY" value="2404" />
<option name="tags">
<list>
<option value="dda-default" />
</list>
</option>
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
@@ -1389,6 +1453,11 @@
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
<option name="tags">
<list>
<option value="dda-default" />
</list>
</option>
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
@@ -1402,6 +1471,11 @@
<option name="screenDensity" value="450" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
<option name="tags">
<list>
<option value="dda-default" />
</list>
</option>
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
@@ -1427,6 +1501,18 @@
<option name="screenX" value="1440" />
<option name="screenY" value="3120" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="samsung" />
<option name="codename" value="q4qksx" />
<option name="id" value="q4qksx" />
<option name="labId" value="google" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Z Fold4" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1812" />
<option name="screenY" value="2176" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
@@ -1597,6 +1683,11 @@
<option name="screenDensity" value="390" />
<option name="screenX" value="2076" />
<option name="screenY" value="2152" />
<option name="tags">
<list>
<option value="dda-default" />
</list>
</option>
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="30" />
@@ -1609,6 +1700,11 @@
<option name="screenDensity" value="440" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
<option name="tags">
<list>
<option value="default" />
</list>
</option>
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
@@ -1671,6 +1767,19 @@
<option name="screenX" value="1600" />
<option name="screenY" value="2560" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="36" />
<option name="brand" value="google" />
<option name="codename" value="tangorpro" />
<option name="formFactor" value="Tablet" />
<option name="id" value="tangorpro" />
<option name="labId" value="google" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Tablet" />
<option name="screenDensity" value="320" />
<option name="screenX" value="1600" />
<option name="screenY" value="2560" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="35" />
<option name="brand" value="google" />
+2 -1
View File
@@ -4,7 +4,7 @@ apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'org.jetbrains.kotlin.android'
android {
namespace("cpm.com.gskmtorange")
compileSdk(35)
compileSdk 36
lintOptions {
checkReleaseBuilds false
@@ -126,6 +126,7 @@ android {
}
dependencies {
implementation 'androidx.activity:activity-ktx:1.13.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation files('libs/ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar')
// implementation files('libs/ksoap2-android-assembly-3.6.4.jar')
+8 -4
View File
@@ -46,13 +46,19 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:networkSecurityConfig="@xml/network_security_config"
android:requestLegacyExternalStorage="true"
android:supportsRtl="false"
android:networkSecurityConfig="@xml/network_security_config"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
tools:replace="android:supportsRtl">
<activity
android:name=".dailyentry.BannerActivity"
android:configChanges="screenSize|orientation|keyboardHidden"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan"
android:exported="false" />
<activity
android:name=".dailyentry.PD_Realtime_Report_Detail"
android:configChanges="screenSize|orientation|keyboardHidden"
@@ -60,7 +66,6 @@
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan"
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity
android:name=".dailyentry.PD_Realtime_Report"
android:configChanges="screenSize|orientation|keyboardHidden"
@@ -68,7 +73,6 @@
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan"
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity
android:name=".dailyentry.WebViewActivity"
android:configChanges="screenSize|orientation|keyboardHidden"
@@ -10,6 +10,9 @@ import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import android.widget.Toast;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
@@ -69,6 +72,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockStorewiseGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingSubCategoryImageAllowGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MasterDetailerGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.Master_Storelist_PDA_GetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraDataGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraLastVisitGetterSetter;
@@ -146,6 +150,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
db.execSQL(TableBean.getJourneyPlan());
db.execSQL(TableBean.getAdhocJourneyPlan());
//Gagan Start
db.execSQL(TableBean.getTable_MASTER_DETAILER());
db.execSQL(TableBean.getBrandMaster());
db.execSQL(TableBean.getSkuMaster());
db.execSQL(TableBean.getCategoryMaster());
@@ -193,6 +198,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
db.execSQL(CommonString.CREATE_TABLE_INSERT_STORE_CAMERA);
db.execSQL(CommonString.CREATE_TABLE_INSERT_CATEGORY_PICTURE_LIST);
db.execSQL(CommonString.CREATE_TABLE_INSERT_CATEGORY_PICTURE);
db.execSQL(CommonString.CREATE_TABLE_WEBVIEW_TIME_SPENT);
db.execSQL(TableBean.getMappingSubCategoryImageAllow());
db.execSQL(TableBean.getMappingCategoryImageAllow());
db.execSQL(TableBean.getSkugroupMaster());
@@ -254,7 +260,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
e.fillInStackTrace();
Toast.makeText(context, "Error -" + e.toString(), Toast.LENGTH_SHORT).show();
}
}
@Override
@@ -338,7 +343,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
db.delete(CommonString.TABLE_INSERT_PROMO_SKUWISE, null, null);
db.delete(CommonString.TABLE_INSERT_PROMO_SKUWISE_EXISTS, null, null);
//Gagan end code
db.delete(CommonString.TABLE_INSERT_T2P_COMPLIANCE, null, null);
db.delete(CommonString.TABLE_INSERT_T2P_GAPS, null, null);
db.delete(CommonString.TABLE_INSERT_T2P_SKU, null, null);
@@ -375,14 +379,10 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
try {
for (int i = 0; i < data.getSTORE_ID().size(); i++) {
values.put("STORE_ID", data.getSTORE_ID().get(i));
values.put("EMP_ID", data.getEMP_ID().get(i));
values.put("STORE_NAME", data.getSTORE_NAME().get(i));
values.put("CITY", data.getCITY().get(i));
values.put("VISIT_DATE", data.getVISIT_DATE().get(i));
values.put("ADDRESS", data.getADDRESS().get(i));
@@ -393,7 +393,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
values.put("KEYACCOUNT_ID", data.getKEYACCOUNT_ID().get(i));
values.put("STORETYPE_ID", data.getSTORETYPE_ID().get(i));
values.put("CHECKOUT_STATUS", data.getCHECKOUT_STATUS().get(i));
@@ -1364,7 +1363,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
dbcursor.moveToFirst();
while (!dbcursor.isAfterLast()) {
CategoryGetterSetter cd = new CategoryGetterSetter();
cd.setCategory_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("CATEGORY_ID")));
cd.setCategory(dbcursor.getString(dbcursor.getColumnIndexOrThrow("CATEGORY")));
cd.setCategory_img(-1);
@@ -7649,10 +7647,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
dbcursor.moveToFirst();
while (!dbcursor.isAfterLast()) {
MSL_AvailabilityStockFacingGetterSetter cd = new MSL_AvailabilityStockFacingGetterSetter();
cd.setSub_category_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SUB_CATEGORY_ID")));
cd.setSub_category(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SUB_CATEGORY")));
list.add(cd);
dbcursor.moveToNext();
}
@@ -8915,7 +8911,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
try {
dbcursor = db.rawQuery("SELECT * from GEO_FENCING where COUNTRY_ID ='" + country_id + "'", null);
if (dbcursor != null) {
dbcursor.moveToFirst();
while (!dbcursor.isAfterLast()) {
@@ -8936,13 +8931,10 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
dbcursor.close();
return list;
}
} catch (Exception e) {
Log.d("Excep get geofencing!", e.toString());
return list;
}
return list;
}
@@ -11091,6 +11083,25 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
}
public void InsertMasterDetailerData(MasterDetailerGetterSetter data) {
db.delete("MASTER_DETAILER", null, null);
ContentValues values = new ContentValues();
try {
for (int i = 0; i < data.getDTID().size(); i++) {
values.put("DTID", data.getDTID().get(i));
values.put("DT_LEVEL", data.getDT_LEVEL().get(i));
values.put("DT_NAME", data.getDT_NAME().get(i));
values.put("CATEGORY_ID", data.getCATEGORY_ID().get(i));
values.put("DT_URL", data.getDT_URL().get(i));
values.put("DT_THUMBNAIL", data.getDT_THUMBNAIL().get(i));
db.insert("MASTER_DETAILER", null, values);
}
} catch (Exception ex) {
Log.d("Exception ", "MASTER_DETAILER" + ex.toString());
}
}
/*public void InsertNoticeBoardData(NoticeboardGetterSetter data) {
db.delete("Mer_NoticeBoard", null, null);
ContentValues values = new ContentValues();
@@ -11828,6 +11839,44 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
return list;
}
public long insertWebViewTimeSpent(String storeId, String visitDate, String startTime, String endTime, String duration, String noticeboardId, String userId, String categoryId) {
ContentValues values = new ContentValues();
values.put("STORE_ID", storeId);
values.put("VISIT_DATE", visitDate);
values.put("START_TIME", startTime);
values.put("END_TIME", endTime);
values.put("DURATION", duration);
values.put("NOTICEBOARD_ID", noticeboardId);
values.put("USER_ID", userId);
values.put("CATEGORY_ID", categoryId);
return db.insert(CommonString.TABLE_WEBVIEW_TIME_SPENT, null, values);
}
public ArrayList<MasterDetailerGetterSetter> getMasterDetailerData(String tableName) {
ArrayList<MasterDetailerGetterSetter> list = new ArrayList<>();
try {
String query = "SELECT * FROM " + tableName;
try (Cursor cursor = db.rawQuery(query, null)) {
while (cursor != null && cursor.moveToNext()) {
MasterDetailerGetterSetter sb = new MasterDetailerGetterSetter();
sb.setDTID(cursor.getString(cursor.getColumnIndexOrThrow("DTID")));
sb.setDT_LEVEL(cursor.getString(cursor.getColumnIndexOrThrow("DT_LEVEL")));
sb.setCATEGORY_ID(cursor.getString(cursor.getColumnIndexOrThrow("CATEGORY_ID")));
sb.setDT_NAME(cursor.getString(cursor.getColumnIndexOrThrow("DT_NAME")));
sb.setDT_THUMBNAIL(cursor.getString(cursor.getColumnIndexOrThrow("DT_THUMBNAIL")));
sb.setDT_URL(cursor.getString(cursor.getColumnIndexOrThrow("DT_URL")));
list.add(sb);
}
}
} catch (Exception e) {
Log.e("DB_ERROR", "Error fetching MasterDetailer data", e);
}
return list;
}
}
@@ -656,12 +656,6 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
super.onActivityResult(requestCode, resultCode, data);
}
/**
* ATTENTION: This was auto-generated to implement the App Indexing API.
* See https://g.co/AppIndexing/AndroidStudio for more information.
* @return
*/
public class GeoTagUpload extends AsyncTask<Void, Void, String> {
@@ -702,9 +702,9 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
editor.putString("NOTICEBOARD_DATA", noticeJson);
editor.apply();
} else {
} /*else {
return CommonString.KEY_FAILURE;
}
}*/
editor.putString(CommonString.KEY_USERNAME, userid);
@@ -814,7 +814,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
dialog.dismiss();
}
}
private String safe(ArrayList<String> list, int index) {
if (list == null || list.size() <= index || list.get(index) == null) {
return "";
@@ -830,56 +829,12 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
}
});
AlertDialog alert = builder.create();
alert.show();
}
private static String arabicToenglish(String number) {
char[] chars = new char[number.length()];
for (int i = 0; i < number.length(); i++) {
char ch = number.charAt(i);
if (ch >= 0x0660 && ch <= 0x0669)
ch -= 0x0660 - '0';
else if (ch >= 0x06f0 && ch <= 0x06F9)
ch -= 0x06f0 - '0';
chars[i] = ch;
}
return new String(chars);
}
public String getCurrentTimeNotUsed() {
Calendar m_cal = Calendar.getInstance();
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
String cdate = formatter.format(m_cal.getTime());
if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KSA)) {
cdate = arabicToenglish(cdate);
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_UAE)) {
cdate = arabicToenglish(cdate);
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_JORDAN)) {
cdate = arabicToenglish(cdate);
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_KUWAIT)) {
cdate = arabicToenglish(cdate);
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_BAHRAIN)) {
cdate = arabicToenglish(cdate);
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_OMAN)) {
cdate = arabicToenglish(cdate);
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_QATAR)) {
cdate = arabicToenglish(cdate);
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LEBANON)) {
cdate = arabicToenglish(cdate);
} else if (preferences.getString(CommonString.KEY_LANGUAGE, "").equalsIgnoreCase(CommonString.KEY_LANGUAGE_ARABIC_LIBIYA)) {
cdate = arabicToenglish(cdate);
}
return cdate;
}
private void setDataFromSharedPreferences(LoginGetterSetter lgs) {
Gson gson = new Gson();
String jsonCurProduct = gson.toJson(lgs);
@@ -890,7 +845,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
void checkAppPermission(String permission, int requestCode) {
boolean permission_flag = false;
// Here, thisActivity is the current activity
if (ContextCompat.checkSelfPermission(LoginActivity.this,
permission)
@@ -900,19 +854,12 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
// Should we show an explanation?
if (ActivityCompat.shouldShowRequestPermissionRationale(LoginActivity.this,
permission)) {
// Show an explanation to the user *asynchronously* -- don't block
// this thread waiting for the user's response! After the user
// sees the explanation, try again to request the permission.
showOnPermissiondenied(Manifest.permission.CAMERA, MY_PERMISSIONS_REQUEST_CAMERA, 1);
} else {
// No explanation needed; request the permission
ActivityCompat.requestPermissions(LoginActivity.this,
new String[]{permission},
requestCode);
// MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
// app-defined int constant. The callback method gets the
// result of the request.
}
} else {
// Permission has already been granted
@@ -962,13 +909,6 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
}
});
/* builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
finish();
}
});*/
builder.show();
}
@@ -1001,8 +941,8 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
}
}
};
if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
&& ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
&& ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(LoginActivity.this, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, 1);
ActivityCompat.requestPermissions(LoginActivity.this, new String[]{android.Manifest.permission.ACCESS_COARSE_LOCATION}, 2);
}
@@ -1017,8 +957,7 @@ public class LoginActivity extends AppCompatActivity implements GoogleApiClient.
GooglePlayServicesUtil.getErrorDialog(resultCode, this,
PLAY_SERVICES_RESOLUTION_REQUEST).show();
} else {
Toast.makeText(context, getResources().getString(R.string.notsuppoted), Toast.LENGTH_LONG)
.show();
Toast.makeText(context, getResources().getString(R.string.notsuppoted), Toast.LENGTH_LONG).show();
finish();
}
return false;
@@ -42,6 +42,7 @@ import com.google.gson.Gson;
import org.json.JSONObject;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
@@ -113,9 +114,11 @@ public class MainActivity extends AppCompatActivity
webView.setWebViewClient(new MyWebViewClient());
webView.getSettings().setJavaScriptEnabled(true);
String json = preferences.getString("NOTICEBOARD_DATA", null);
String json = preferences.getString("NOTICEBOARD_DATA", null) != null
? preferences.getString("NOTICEBOARD_DATA", null)
: "";
Log.d("noticejsondata",json);
if (json != null) {
if (!json.isEmpty()) {
Gson gson = new Gson();
NoticeResponse response =
gson.fromJson(json, NoticeResponse.class);
@@ -242,17 +245,28 @@ public class MainActivity extends AppCompatActivity
String url = String.valueOf(item.getNoticeLink_FullPage());
String type = String.valueOf(item.getFullPageTarget());
Log.d("clickdata",url + ","+type);
// Log.d("clickdata",url + ","+type);
Log.e("clickdata", "URL = " + url);
System.out.println("FULL URL = " + url);
if (type == null) return;
// append store id and merchant id (NoticeBoardId) to the url as query params
String storeId = preferences.getString(CommonString.KEY_STORE_ID, "");
String merId = String.valueOf(item.getNoticeBoardId());
String finalUrl = appendStoreMerQuery(url, storeId, merId);
Log.d("finalurl", finalUrl);
// Log full URL in chunks to avoid logcat truncation or masking
switch (type.toLowerCase()) {
case "html-webview":
Log.d("itemdata", String.valueOf(item.getFullPageTarget()));
Intent webIntent = new Intent(this, WebViewActivity.class);
webIntent.putExtra("url", url);
webIntent.putExtra("url", finalUrl);
webIntent.putExtra("type", item.getFullPageTarget());
webIntent.putExtra("storeid", storeId);
webIntent.putExtra("merid", merId);
startActivity(webIntent);
break;
@@ -262,21 +276,25 @@ public class MainActivity extends AppCompatActivity
case "video":
Intent videoIntent = new Intent(this, WebViewActivity.class);
videoIntent.putExtra("url", url);
videoIntent.putExtra("url", finalUrl);
videoIntent.putExtra("type", item.getFullPageTarget());
videoIntent.putExtra("storeid", storeId);
videoIntent.putExtra("merid", merId);
startActivity(videoIntent);
break;
case "image":
Intent imageIntent = new Intent(this, WebViewActivity.class);
imageIntent.putExtra("url", url);
imageIntent.putExtra("url", finalUrl);
imageIntent.putExtra("type", item.getFullPageTarget());
imageIntent.putExtra("storeid", storeId);
imageIntent.putExtra("merid", merId);
startActivity(imageIntent);
break;
case "deeplink":
try {
Intent deepIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
Intent deepIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(finalUrl));
startActivity(deepIntent);
} catch (Exception e) {
Toast.makeText(this, "Invalid deeplink", Toast.LENGTH_SHORT).show();
@@ -786,6 +804,32 @@ public class MainActivity extends AppCompatActivity
return list != null ? list.size() : 0;
}
}
/**
* Append storeid and merid to the provided URL as query parameters.
* If the URL already contains query params, append with '&', otherwise use '?'.
*/
private String appendStoreMerQuery(String url, String storeId, String merId) {
if (url == null) return null;
try {
StringBuilder sb = new StringBuilder(url);
String separator = url.contains("?") ? "&" : "?";
boolean appended = false;
if (storeId != null && !storeId.isEmpty()) {
sb.append(separator).append("storeid=").append(URLEncoder.encode(storeId, "UTF-8"));
separator = "&";
appended = true;
}
if (merId != null && !merId.isEmpty()) {
sb.append(separator).append("merid=").append(URLEncoder.encode(merId, "UTF-8"));
appended = true;
}
return sb.toString();
} catch (Exception e) {
e.printStackTrace();
return url;
}
}
}
@@ -1642,11 +1642,27 @@ public class CommonString {
+ KEY_IRPD_VISIBILITY_IMAGES
+ " VARCHAR)";
public static final String TABLE_WEBVIEW_TIME_SPENT = "WEBVIEW_TIME_SPENT";
public static final String CREATE_TABLE_WEBVIEW_TIME_SPENT = "CREATE TABLE IF NOT EXISTS "
+ TABLE_WEBVIEW_TIME_SPENT
+ " ("
+ "KEY_ID INTEGER PRIMARY KEY AUTOINCREMENT,"
+ "STORE_ID VARCHAR,"
+ "VISIT_DATE VARCHAR,"
+ "START_TIME VARCHAR,"
+ "END_TIME VARCHAR,"
+ "DURATION VARCHAR,"
+ "NOTICEBOARD_ID VARCHAR,"
+ "USER_ID VARCHAR,"
+ "CATEGORY_ID VARCHAR)";
public static final String BACKUP_FOLDER_NAME = "HaleonMT_Backup";
public static final String IMAGE_FOLDER_NAME = "HaleonMT_Images";
public static final String Download_IMAGE_FOLDER = "Downloaded_HaleonMT_Images";
public static final String ApkFolder = "HaleonMT_ApkFolder";
public static String getApkFolder(Context context) {
return AppUtils.getInternalDirectory(context, ApkFolder).getAbsolutePath() + "/";
}
@@ -0,0 +1,141 @@
package cpm.com.gskmtorange.dailyentry
import android.content.Intent
import android.content.SharedPreferences
import android.net.Uri
import android.os.Bundle
import android.preference.PreferenceManager
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import cpm.com.gskmtorange.Database.GSKOrangeDB
import cpm.com.gskmtorange.R
import cpm.com.gskmtorange.constant.CommonFunctions
import cpm.com.gskmtorange.constant.CommonString
import cpm.com.gskmtorange.xmlGetterSetter.MasterDetailerGetterSetter
import java.net.URLEncoder
class BannerActivity : AppCompatActivity() {
private lateinit var recyclerView: RecyclerView
var bannerlistnew: ArrayList<MasterDetailerGetterSetter>? = ArrayList()
private lateinit var preferences: SharedPreferences
private lateinit var db: GSKOrangeDB
private lateinit var countryId: String
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_banner)
val toolbar: androidx.appcompat.widget.Toolbar = findViewById(R.id.toolbar)
setSupportActionBar(toolbar)
supportActionBar?.title = "Banner Dashboard"
supportActionBar?.setDisplayHomeAsUpEnabled(true)
toolbar.setNavigationOnClickListener {
onBackPressedDispatcher.onBackPressed()
}
recyclerView = findViewById(R.id.recyclerView)
recyclerView.layoutManager = LinearLayoutManager(this)
preferences = PreferenceManager.getDefaultSharedPreferences(this)
CommonFunctions.updateLangResources(this, preferences.getString(CommonString.KEY_LANGUAGE, ""))
countryId = preferences.getString(CommonString.KEY_COUNTRY_ID, "") ?: ""
db = GSKOrangeDB(this)
db.open()
bannerlistnew = db.getMasterDetailerData("MASTER_DETAILER")
Log.d("bannerlistkotlin", bannerlistnew?.size.toString())
bannerlistnew?.let {
if (it.isNotEmpty()) {
recyclerView.adapter = BannerListAdapter(it) { item -> handleClick(item) }
}
}
}
private fun handleClick(item: MasterDetailerGetterSetter) {
val url = if (item.dT_URL.isNotEmpty()) item.dT_URL[0] else ""
val type = "html-webview" // Default type as not specified in MASTER_DETAILER metadata
Log.e("clickdata", "URL = $url")
val storeId = preferences.getString(CommonString.KEY_STORE_ID, "") ?: ""
val merId = if (item.dtid.isNotEmpty()) item.dtid[0] else ""
val categoryId = intent.getStringExtra("CategoryId") ?: ""
val finalUrl = appendStoreMerQuery(url, storeId, merId)
Log.d("finalurl", finalUrl)
val webIntent = Intent(this, WebViewActivity::class.java).apply {
putExtra("url", finalUrl)
putExtra("type", type)
putExtra("storeid", storeId)
putExtra("merid", merId)
putExtra("categoryId", categoryId)
}
startActivity(webIntent)
}
private fun appendStoreMerQuery(url: String?, storeId: String?, merId: String?): String {
if (url == null) return ""
return try {
val sb = StringBuilder(url)
var separator = if (url.contains("?")) "&" else "?"
if (!storeId.isNullOrEmpty()) {
sb.append(separator).append("storeid=").append(URLEncoder.encode(storeId, "UTF-8"))
separator = "&"
}
if (!merId.isNullOrEmpty()) {
sb.append(separator).append("merid=").append(URLEncoder.encode(merId, "UTF-8"))
}
sb.toString()
} catch (e: Exception) {
e.printStackTrace()
url
}
}
inner class BannerListAdapter(
private val list: List<MasterDetailerGetterSetter>,
private val listener: (MasterDetailerGetterSetter) -> Unit
) : RecyclerView.Adapter<BannerListAdapter.ViewHolder>() {
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val image: ImageView = itemView.findViewById(R.id.imgThumbnail)
val name: TextView = itemView.findViewById(R.id.tvName)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_banner_list, parent, false)
return ViewHolder(view)
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val item = list[position]
// Accessing first element of internal list as per parinaam pattern
val url = if (item.dT_THUMBNAIL.isNotEmpty()) item.dT_THUMBNAIL[0] else ""
val displayName = if (item.dT_NAME.isNotEmpty()) item.dT_NAME[0] else ""
holder.name.text = displayName
Glide.with(holder.itemView.context)
.load(url)
.placeholder(R.mipmap.ic_launcher)
.transform(RoundedCorners(15))
.into(holder.image)
holder.itemView.setOnClickListener { listener(item) }
}
override fun getItemCount(): Int = list.size
}
}
@@ -119,7 +119,6 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
//temp
public static final String FILE_PATH = Environment.getExternalStorageDirectory() + "/";
ProductAdapter productAdapter;
//ImageView bmImage;
RelativeLayout view;
RadioButton radio_yes,radio_no;
RadioGroup radio_group;
@@ -133,7 +132,6 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
//setContentView(R.layout.activity_msl__availability_stock_facing);
setContentView(R.layout.activity_order_taking);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
expandableListView = (ExpandableListView) findViewById(R.id.expandableListView);
@@ -194,7 +192,7 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
//subcategory_list.clear();
//txt_mslAvailabilityName.setText(getResources().getString(R.string.title_activity_msl__availability));
addedCounterfeitProducts = db.getOrderTakingNewAfterData(store_id, categoryId);
if(addedCounterfeitProducts.size()>0){
if(!addedCounterfeitProducts.isEmpty()){
rec_added_counterfeit_product.setLayoutManager(new LinearLayoutManager(context));
productAdapter = new ProductAdapter(addedCounterfeitProducts);
rec_added_counterfeit_product.setAdapter(productAdapter);
@@ -217,9 +215,7 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
podateET.setText(visit_date);
prepareList();
fab_add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
fab_add.setOnClickListener(view -> {
Order_qty = editText_QTY.getText().toString();
ArrayList<MSL_AvailabilityStockFacingGetterSetter>finddetailbysku= new ArrayList<>();
finddetailbysku = db.getSkuDetails(String.valueOf(skuid));
@@ -230,12 +226,8 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
Snackbar.make(rec_added_counterfeit_product, R.string.add_different_sku,
Snackbar.LENGTH_SHORT).show();
return;
}
}
//
if (skuname.isEmpty()) {
Snackbar.make(rec_added_counterfeit_product, R.string.pls_select_sku, Snackbar.LENGTH_SHORT).show();
} else if (Order_qty.isEmpty()) {
@@ -254,7 +246,6 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
rec_added_counterfeit_product.setLayoutManager(new LinearLayoutManager(context));
productAdapter = new ProductAdapter(addedCounterfeitProducts);
rec_added_counterfeit_product.setAdapter(productAdapter);
subcategory = "";
brand = "";
subcategory = "";
@@ -272,25 +263,19 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
setNewData();
isdata_added = true;
}
}
});
final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
poIV.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
poIV.setOnClickListener(v -> {
_pathforcheck = store_id + categoryId + "POImage_" + date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
_path = CommonString.getImagesFolder(context) + _pathforcheck;
intime = CommonFunctions.getCurrentTimeWithLanguage(context);
startCameraActivity();
}
});
radio_group.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup, int i) {
radio_group.setOnCheckedChangeListener((radioGroup, i) -> {
if (radio_yes.isChecked()) {
radio_yes.setBackground(getResources().getDrawable(R.mipmap.yes_green));
radio_no.setBackground(getResources().getDrawable(R.mipmap.no_white));
@@ -302,9 +287,6 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
pocamLL.setVisibility(View.GONE);
}
isExist="yes";
/*expListView.setVisibility(View.VISIBLE);
categoryobject.setIsChecked(1);
skuData.get(0).setIsChecked(1);*/
}
if (radio_no.isChecked()) {
radio_no.setBackground(getResources().getDrawable(R.mipmap.no_red));
@@ -313,21 +295,15 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
pocamLL.setVisibility(View.GONE);
isExist="no";
img_str = "";
/*expListView.setVisibility(View.GONE);
categoryobject.setIsChecked(0);
skuData.get(0).setIsChecked(0);*/
}
}
});
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(final View view) {
fab.setOnClickListener(view -> {
expandableListView.clearFocus();
adapter.notifyDataSetChanged();
storepo = storepoET.getText().toString();
if (addedCounterfeitProducts.size() == 0) {
if (addedCounterfeitProducts.isEmpty()) {
Snackbar.make(rec_added_counterfeit_product, R.string.title_activity_Want_add, Snackbar.LENGTH_SHORT).show();
} else {
Log.d("sysponumber",sys_po_number);
@@ -460,7 +436,6 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
}*/
}
});
expandableListView.setOnScrollListener(new AbsListView.OnScrollListener() {
@@ -472,11 +447,11 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
int lastItem = firstVisibleItem + visibleItemCount;
if (firstVisibleItem == 0) {
fab.show();//.setVisibility(View.VISIBLE);
fab.show();
} else if (lastItem == totalItemCount) {
fab.hide();//setVisibility(View.INVISIBLE);
fab.hide();
} else {
fab.show();//setVisibility(View.VISIBLE);
fab.show();
}
}
@@ -1132,12 +1107,10 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
AlertDialog.Builder builder = new AlertDialog.Builder(OrderTakingActivity.this);
builder.setMessage(getString(R.string.check_faceup))
.setCancelable(false)
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
.setPositiveButton(getString(R.string.ok), (dialog, id) -> {
finalHolder1.facing.setText("");
dialog.dismiss();
finalHolder2.facing.setText("");
}
});
AlertDialog alert = builder.create();
alert.show();
@@ -1160,10 +1133,8 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
faceup = "0";
} else {
faceup = edFaceup.replaceFirst("^0+(?!$)", "");
//faceup = new DecimalFormat("##.#").format(Double.parseDouble(faceup));
}
// String str2 = PerfectDecimal(faceup, 3, 1);
childData.setFacing(faceup);
} else {
childData.setFacing("");
@@ -1498,9 +1469,6 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
MSL_AvailabilityStockFacingGetterSetter tempValues = null;
LayoutInflater inflater;
/*************
* CustomBrandAdapter Constructor
*****************/
public CustomSkuAdapter(
OrderTakingActivity activitySpinner,
int textViewResourceId,
@@ -1524,26 +1492,19 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
public View getView(int position, View convertView, ViewGroup parent) {
return getCustomView(position, convertView, parent);
}
// This funtion called for each row ( Called data.size() times )
public View getCustomView(int position, View convertView, ViewGroup parent) {
/********** Inflate spinner_rows.xml file for each row ( Defined below ) ************/
View row = inflater.inflate(R.layout.custom_spinner_item, parent, false);
/***** Get each Model object from Arraylist ********/
tempValues = null;
tempValues = (MSL_AvailabilityStockFacingGetterSetter) data.get(position);
TextView label = (TextView) row.findViewById(R.id.tv_text);
if (position == 0) {
// Default selected Spinner item
label.setText(getResources().getString(R.string.select));
//sub.setText("");
} else {
// Set values for spinner each row
label.setText(tempValues.getSku());
}
// label.setText(tempValues.getSku());
return row;
}
}
@@ -1583,7 +1544,6 @@ public class OrderTakingActivity extends AppCompatActivity implements DialogCall
public ViewHolder(View view) {
super(view);
mView = view;
tv_brand = (TextView) mView.findViewById(R.id.tv_brand);
tv_order_qty = (TextView) mView.findViewById(R.id.tv_order_qty);
@@ -1338,7 +1338,6 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
return true;
}
}
return flag_checked_in;
}
@@ -2,10 +2,11 @@ package cpm.com.gskmtorange.dailyentry
import android.annotation.SuppressLint
import android.content.Intent
import android.content.SharedPreferences
import android.graphics.BitmapFactory
import android.graphics.drawable.Drawable
import android.net.Uri
import android.os.Bundle
import android.preference.PreferenceManager
import android.provider.MediaStore
import android.util.Base64
import android.util.Log
@@ -16,23 +17,31 @@ import android.webkit.WebChromeClient
import android.webkit.WebSettings
import android.webkit.WebView
import android.webkit.WebViewClient
import android.widget.ImageView
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import androidx.media3.common.MediaItem
import androidx.media3.exoplayer.ExoPlayer
import com.bumptech.glide.request.target.ViewTarget
import cpm.com.gskmtorange.Database.GSKOrangeDB
import cpm.com.gskmtorange.constant.CommonString
import cpm.com.gskmtorange.databinding.ActivityWebviewBinding
import org.json.JSONObject
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
class WebViewActivity : AppCompatActivity() {
private lateinit var binding: ActivityWebviewBinding
var toolbar: Toolbar? = null
private lateinit var type : String
private var player: ExoPlayer? = null
// private var player : ExoPlayer? = null
private var pageStartTime: Long = 0
private var pageEndTime: Long = 0
private lateinit var preferences: SharedPreferences
private lateinit var db: GSKOrangeDB
private var storeid: String = ""
private var merid: String = ""
private var categoryId: String = ""
@SuppressLint("SetJavaScriptEnabled")
override fun onCreate(savedInstanceState: Bundle?) {
@@ -40,56 +49,21 @@ class WebViewActivity : AppCompatActivity() {
binding = ActivityWebviewBinding.inflate(layoutInflater)
setContentView(binding.root)
preferences = PreferenceManager.getDefaultSharedPreferences(this)
db = GSKOrangeDB(this)
db.open()
val url = intent.getStringExtra("url") ?: ""
type = intent.getStringExtra("type") ?: "html-webview"
type = intent.getStringExtra("type") ?: "html-webview"
storeid = intent.getStringExtra("storeid") ?: ""
merid = intent.getStringExtra("merid") ?: ""
categoryId = intent.getStringExtra("categoryId") ?: ""
handleContent(type, url)
binding.toolbar.setTitle("Banner Detail")
setSupportActionBar(binding.toolbar)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
/* // ✅ SETTINGS
with(binding.webView.settings) {
javaScriptEnabled = true
domStorageEnabled = true
javaScriptCanOpenWindowsAutomatically = true
setSupportMultipleWindows(true)
loadWithOverviewMode = true
useWideViewPort = true
mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW
}
// ✅ JS INTERFACE
binding.webView.addJavascriptInterface(WebAppInterface(), "Android")
// ✅ WEBVIEW CLIENT
binding.webView.webViewClient = object : WebViewClient() {
override fun onPageStarted(view: WebView?, url: String?, favicon: android.graphics.Bitmap?) {
super.onPageStarted(view, url, favicon)
injectJS(view) // 🔥 early injection
}
override fun onPageFinished(view: WebView?, url: String?) {
super.onPageFinished(view, url)
injectJS(view) // 🔥 safe injection again
}
}
// ✅ JS LOGS
binding.webView.webChromeClient = object : WebChromeClient() {
override fun onConsoleMessage(consoleMessage: ConsoleMessage?): Boolean {
Log.e("JS_LOG", consoleMessage?.message() ?: "")
return true
}
}
binding.webView.loadUrl(url)
*/
}
private fun handleContent(type: String, url: String) {
@@ -148,7 +122,6 @@ class WebViewActivity : AppCompatActivity() {
@SuppressLint("SetJavaScriptEnabled")
private fun setupWebView(url: String) {
with(binding.webView.settings) {
javaScriptEnabled = true
domStorageEnabled = true
@@ -169,10 +142,20 @@ class WebViewActivity : AppCompatActivity() {
binding.webView.webViewClient = object : WebViewClient() {
override fun onPageStarted(view: WebView?, url: String?, favicon: android.graphics.Bitmap?) {
pageStartTime = System.currentTimeMillis()
val formattedTime = SimpleDateFormat(
"HH:mm:ss",
Locale.getDefault()
).format(Date(pageStartTime))
// println(formattedTime)
Log.d("WEBVIEW_START_TIME", "Start time is :$formattedTime ")
injectJS(view)
}
override fun onPageFinished(view: WebView?, url: String?) {
pageStartTime = System.currentTimeMillis()
Log.d("WEBVIEW_TIME", " viewed for $pageStartTime sec")
injectJS(view)
}
}
@@ -183,7 +166,6 @@ class WebViewActivity : AppCompatActivity() {
return true
}
}
binding.webView.loadUrl(url)
}
@@ -447,11 +429,31 @@ class WebViewActivity : AppCompatActivity() {
override fun onPause() {
super.onPause()
player?.pause()
}
pageEndTime = System.currentTimeMillis()
val start_time = SimpleDateFormat("HH:mm:ss", Locale.getDefault()).format(Date(pageStartTime))
val end_time = SimpleDateFormat("HH:mm:ss", Locale.getDefault()).format(Date(pageEndTime))
val spent = (pageEndTime - pageStartTime) / 1000
val visit_date = preferences.getString(CommonString.KEY_DATE, "") ?: ""
val user_id = preferences.getString(CommonString.KEY_USERNAME, "") ?: ""
db.insertWebViewTimeSpent(
storeid,
visit_date,
start_time,
end_time,
spent.toString(),
merid,
user_id,
categoryId
)
Log.d("WEBVIEW_END_TIME", "End time is :$end_time and viewed for $spent sec ")
}
override fun onDestroy() {
super.onDestroy()
player?.release()
player = null
// pageStartTime = System.currentTimeMillis()
// Log.d("WEBVIEW_END_TIME", " viewed for $pageStartTime sec")
}
}
@@ -67,6 +67,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockStorewiseGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingSubCategoryImageAllowGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MasterDetailerGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.Master_Storelist_PDA_GetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraLastVisitGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.NonT2pReasonGetterSetter;
@@ -145,6 +146,7 @@ public class DownloadActivity extends AppCompatActivity {
Visit_Type_Master_GetterSetter visit_type_master_getterSetter;
Master_Storelist_PDA_GetterSetter masterStorelistPdaGetterSetter;
NoticeboardGetterSetter noticeboardGetterSetter;
MasterDetailerGetterSetter masterDetailerGetterSetter;
@@ -1910,9 +1912,9 @@ public class DownloadActivity extends AppCompatActivity {
//Mer_Noticeboard
/* 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("Type", "Mer_NoticeBoard");
request.addProperty("Type", "MASTER_DETAILER");
request.addProperty("cultureid", culture_id);
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
@@ -1930,23 +1932,22 @@ public class DownloadActivity extends AppCompatActivity {
xpp.next();
eventType = xpp.getEventType();
noticeboardGetterSetter = XMLHandlers.Noticeboard_XMLHandler(xpp, eventType);
String stocktable = noticeboardGetterSetter.getTable_mer_noticeboard_detailer();
masterDetailerGetterSetter = XMLHandlers.MasterDetailer_XMLHandler(xpp, eventType);
String stocktable = masterDetailerGetterSetter.getTable_MASTER_DETAILER();
if (stocktable != null) {
resultHttp = CommonString.KEY_SUCCESS;
TableBean.setNoticeboardData(stocktable);
TableBean.setTable_MASTER_DETAILER(stocktable);
}
if (noticeboardGetterSetter.getNoticeBoardId().size() > 0) {
Log.d("mer_noticeboard","download");
if (masterDetailerGetterSetter.getDTID().size() > 0) {
Log.d("master_detailer","download");
data.value = 99;
data.name = "Mer_NoticeBoard" + getResources().getString(R.string.download_data);
data.name = "master_detailer" + getResources().getString(R.string.download_data);
} else {
// return "MAPPING_PHARMA_MSL";
}
}
publishProgress(data);*/
}
}
publishProgress(data);
//Images DownLoads
@@ -2182,6 +2183,7 @@ public class DownloadActivity extends AppCompatActivity {
db.InsertCATEGORYWISE_SOS_TARGET(store_category_wiseGetterSetter);
db.InsertMAPPING_SKU_PRICING_ENABLE(mapping_sku_pricing_enableGetterSetter);
db.InsertMaster_Storelist_Pda(masterStorelistPdaGetterSetter);
db.InsertMasterDetailerData(masterDetailerGetterSetter);
// db.InsertNoticeBoardData(noticeboardGetterSetter);
} catch (MalformedURLException e) {
ResultFlag = false;
@@ -33,21 +33,27 @@ import java.util.Objects;
import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
import cpm.com.gskmtorange.MainActivity;
import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonFunctions;
import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.dailyentry.BannerActivity;
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.CategoryGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MasterDetailerGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
public class CategoryListActivity extends AppCompatActivity {
private Context context;
RecyclerView recyclerView;
ArrayList<CategoryGetterSetter> categoryList;
ArrayList<MasterDetailerGetterSetter> bannerdatacheck;
CategoryListAdapter adapter;
GSKOrangeDB db;
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str, pog_type_id;
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str, pog_type_id, mer_Id;
private SharedPreferences preferences;
String visit_type_id = "";
@@ -69,9 +75,9 @@ public class CategoryListActivity extends AppCompatActivity {
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
mer_Id = preferences.getString(CommonString.KEY_MERCHANDISER_ID, "");
camera_allow = preferences.getString(CommonString.KEY_CAMERA_ALLOW, "");
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
Log.d("countrydata",country_id);
store_flag_str = preferences.getString(CommonString.KEY_STORE_FLAG, null);
pog_type_id = preferences.getString(CommonString.KEY_POG_TYPE_ID, "");
preferences.getString(CommonString.KEY_VISIT_ID, "");
@@ -80,6 +86,8 @@ public class CategoryListActivity extends AppCompatActivity {
setSupportActionBar(toolbar);
Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab_category);
bannerdatacheck = db.getMasterDetailerData("MASTER_DETAILER");
fab.setOnClickListener(view -> Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG).setAction("Action", null).show());
}
@@ -100,6 +108,18 @@ public class CategoryListActivity extends AppCompatActivity {
categoryList = db.getCategoryListData(keyAccount_id, storeType_id, class_id, store_id, "MAPPING_STOCK");
}
// Add a manual KPI tile for "Detailer" (manual usage without a DB category id)
// This will appear as an extra item in the grid. The id used is a reserved key
// "detailer_manual" and its images are mapped in getImageRes().
try {
CategoryGetterSetter detailer = new CategoryGetterSetter();
detailer.setCategory("Detailer");
detailer.setCategory_id("detailer_manual");
categoryList.add(detailer);
} catch (Exception ignored) {
// If CategoryGetterSetter constructor/signatures differ, skip adding manually.
}
if (categoryList != null && !categoryList.isEmpty()) {
for (int i = 0; i < categoryList.size(); i++) {
String category_id = categoryList.get(i).getCategory_id();
@@ -120,6 +140,7 @@ public class CategoryListActivity extends AppCompatActivity {
imageRes = switch (category_id) {
case "1" -> R.mipmap.health_food_drink_tick;
case "2" -> R.mipmap.oralcare_tick;
case "detailer_manual" -> R.mipmap.oralcare_tick;
case "3" -> R.mipmap.wellness_tick;
case "4" -> R.mipmap.nutritionals_tick;
case "5" -> R.mipmap.gastro_n_indigestion_tick;
@@ -132,6 +153,7 @@ public class CategoryListActivity extends AppCompatActivity {
imageRes = switch (category_id) {
case "1" -> R.mipmap.health_food_drink;
case "2" -> R.mipmap.oral_care;
case "detailer_manual" -> R.mipmap.oral_care;
case "3" -> R.mipmap.wellness;
case "4" -> R.mipmap.nutritionals;
case "5" -> R.mipmap.gastro_n_indigestion;
@@ -231,20 +253,15 @@ public class CategoryListActivity extends AppCompatActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == android.R.id.home) {
finish();
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
}
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
@@ -280,11 +297,19 @@ public class CategoryListActivity extends AppCompatActivity {
Log.e("CatImg--", "" + categoryData.getCategory_img());
holder.categoryIcon.setImageResource(categoryData.getCategory_img());
holder.lay_menu.setOnClickListener(view -> {
if(categoryData.getCategory().equalsIgnoreCase("Detailer")){
Intent intent = new Intent(CategoryListActivity.this, BannerActivity.class);
intent.putExtra("StoreId", store_id);
intent.putExtra("MerId",mer_Id);
startActivity(intent);
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
} else{
Intent intent = new Intent(CategoryListActivity.this, CategoryWisePerformanceActivity.class);
intent.putExtra("categoryName", categoryData.getCategory());
intent.putExtra("categoryId", categoryData.getCategory_id());
startActivity(intent);
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
}
});
}
@@ -344,7 +369,6 @@ public class CategoryListActivity extends AppCompatActivity {
}
}
//New MSL_Availability_StockFacing
if (country_id.equals("10") || country_id.equals("8")) {
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
} else if (store_flag_str.equalsIgnoreCase(CommonString.FROM_DEVIATION)) {
@@ -44,6 +44,7 @@ import cpm.com.gskmtorange.constant.CommonUtils;
import cpm.com.gskmtorange.dailyentry.AdditionalPromoSKUwiseActivity;
import cpm.com.gskmtorange.dailyentry.AdditionalVisibility;
import cpm.com.gskmtorange.dailyentry.AuditActivity;
import cpm.com.gskmtorange.dailyentry.BannerActivity;
import cpm.com.gskmtorange.dailyentry.CategoryPicture;
import cpm.com.gskmtorange.dailyentry.CompetitionPromoActivity;
import cpm.com.gskmtorange.dailyentry.CounterfeitProductsActivity;
@@ -477,16 +478,22 @@ public class DailyDataMenuActivity extends AppCompatActivity {
} else {
data.setCategory_img(R.mipmap.competition);
}
data.setCategory_name(getString(R.string.title_activity_competition_promo));
categoryList.add(data);
}
}
//Detailer
data = new DailyDataMenuGetterSetter();
data.setCategory_name("Detailer");
data.setCategory_img(R.mipmap.oral_care);
categoryList.add(data);
if (categoryList.size() % 2 != 0) {
data = new DailyDataMenuGetterSetter();
data.setCategory_img(R.mipmap.competition);
data.setCategory_name("");
categoryList.add(data);
}
}
//IR Images
data = new DailyDataMenuGetterSetter();
@@ -641,7 +648,13 @@ public class DailyDataMenuActivity extends AppCompatActivity {
public void onBindViewHolder(final DailyDataMenuAdapter.MyViewHolder holder, int position) {
final DailyDataMenuGetterSetter dailyData = list.get(position);
holder.categoryName.setText(dailyData.getCategory_name());
if (dailyData.getCategory_img() != -1) {
holder.categoryIcon.setImageResource(dailyData.getCategory_img());
} else {
holder.categoryIcon.setImageResource(0);
}
holder.lay_menu.setVisibility(View.VISIBLE);
holder.categoryName.setVisibility(View.VISIBLE);
holder.irview.setVisibility(View.GONE);
db.open();
visittypelist = db.getInsertedVisitType(store_id, visit_date, "3");
@@ -757,6 +770,9 @@ public class DailyDataMenuActivity extends AppCompatActivity {
holder.categoryName.setTextColor(isPdPogIRMapping() != null && !isPdPogIRMapping().isEmpty() && camera_allow.equals("1")
? ContextCompat.getColor(context, R.color.black) : ContextCompat.getColor(context, R.color.grey_background));
}*/
else if (dailyData.getCategory_name().equalsIgnoreCase("Detailer")) {
holder.categoryName.setTextColor(ContextCompat.getColor(context, R.color.black));
}
else{
holder.irview.setVisibility(View.GONE);
}
@@ -827,6 +843,15 @@ public class DailyDataMenuActivity extends AppCompatActivity {
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
}
}
else if (dailyData.getCategory_name().equalsIgnoreCase("Detailer")) {
Intent intent = new Intent(DailyDataMenuActivity.this, BannerActivity.class);
String merId = preferences.getString(CommonString.KEY_MERCHANDISER_ID, "");
intent.putExtra("StoreId", store_id);
intent.putExtra("MerId", merId);
intent.putExtra("CategoryId", categoryId);
startActivity(intent);
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
}
else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.title_activity_ir_image))) {
if (isPdIRMapping() != null && !isPdIRMapping().isEmpty() && camera_allow.equals("1")) {
Intent intent = new Intent(DailyDataMenuActivity.this, PDimageActivity.class);
@@ -598,9 +598,9 @@ public class MPinActivity extends AppCompatActivity implements BlurLockView.OnPa
editor.putString("NOTICEBOARD_DATA", noticeJson);
editor.apply();
} else {
} /*else {
return CommonString.KEY_FAILURE;
}
}*/
} catch (XmlPullParserException | IOException e) {
e.fillInStackTrace();
@@ -0,0 +1,70 @@
package cpm.com.gskmtorange.xmlGetterSetter;
import java.util.ArrayList;
public class MasterDetailerGetterSetter {
String Table_MASTER_DETAILER;
ArrayList<String> DTID = new ArrayList<>();
ArrayList<String> DT_LEVEL = new ArrayList<>();
ArrayList<String> DT_NAME = new ArrayList<>();
ArrayList<String> CATEGORY_ID = new ArrayList<>();
ArrayList<String> DT_URL = new ArrayList<>();
ArrayList<String> DT_THUMBNAIL = new ArrayList<>();
public String getTable_MASTER_DETAILER() {
return Table_MASTER_DETAILER;
}
public void setTable_MASTER_DETAILER(String table_MASTER_DETAILER) {
Table_MASTER_DETAILER = table_MASTER_DETAILER;
}
public ArrayList<String> getDTID() {
return DTID;
}
public void setDTID(String DTID) {
this.DTID.add(DTID);
}
public ArrayList<String> getDT_LEVEL() {
return DT_LEVEL;
}
public void setDT_LEVEL(String DT_LEVEL) {
this.DT_LEVEL.add(DT_LEVEL);
}
public ArrayList<String> getDT_NAME() {
return DT_NAME;
}
public void setDT_NAME(String DT_NAME) {
this.DT_NAME.add(DT_NAME);
}
public ArrayList<String> getCATEGORY_ID() {
return CATEGORY_ID;
}
public void setCATEGORY_ID(String CATEGORY_ID) {
this.CATEGORY_ID.add(CATEGORY_ID);
}
public ArrayList<String> getDT_URL() {
return DT_URL;
}
public void setDT_URL(String DT_URL) {
this.DT_URL.add(DT_URL);
}
public ArrayList<String> getDT_THUMBNAIL() {
return DT_THUMBNAIL;
}
public void setDT_THUMBNAIL(String DT_THUMBNAIL) {
this.DT_THUMBNAIL.add(DT_THUMBNAIL);
}
}
@@ -76,8 +76,15 @@ public class TableBean {
public static String Table_MAPPING_PLANOGRAM_STORE_WISE;
public static String Table_PROMOTION_TYPE_MASTER;
public static String Table_ORDER_RECEIVED_STATUS;
public static String Table_MASTER_DETAILER;
public static String getTable_MASTER_DETAILER() {
return Table_MASTER_DETAILER;
}
public static void setTable_MASTER_DETAILER(String table_MASTER_DETAILER) {
Table_MASTER_DETAILER = table_MASTER_DETAILER;
}
public static String Table_Master_PDA_STORE_LIST;
@@ -24,6 +24,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGe
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SKU_PRICING_ENABLEGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SOS_TARGET_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MasterDetailerGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingCategoryImageAllowGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingPharmaMSLGetterSetter;
@@ -1914,6 +1915,46 @@ public class XMLHandlers {
return noticeboardGetterSetter;
}
public static MasterDetailerGetterSetter MasterDetailer_XMLHandler(XmlPullParser xpp,
int eventType) {
MasterDetailerGetterSetter masterDetailerGetterSetter = new MasterDetailerGetterSetter();
try {
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
if (xpp.getEventType() == XmlPullParser.START_TAG) {
if (xpp.getName().equals("META_DATA")) {
masterDetailerGetterSetter.setTable_MASTER_DETAILER(xpp.nextText());
}
if (xpp.getName().equals("DTID")) {
masterDetailerGetterSetter.setDTID(xpp.nextText());
}
if (xpp.getName().equals("DT_LEVEL")) {
masterDetailerGetterSetter.setDT_LEVEL(xpp.nextText());
}
if (xpp.getName().equals("DT_NAME")) {
masterDetailerGetterSetter.setDT_NAME(xpp.nextText());
}
if (xpp.getName().equals("CATEGORY_ID")) {
masterDetailerGetterSetter.setCATEGORY_ID(xpp.nextText());
}
if (xpp.getName().equals("DT_URL")) {
masterDetailerGetterSetter.setDT_URL(xpp.nextText());
}
if (xpp.getName().equals("DT_THUMBNAIL")) {
masterDetailerGetterSetter.setDT_THUMBNAIL(xpp.nextText());
}
}
xpp.next();
}
} catch (XmlPullParserException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return masterDetailerGetterSetter;
}
// JCP XML HANDLER
public static PD_CONFIGURATION PDConfigXMLHandler(XmlPullParser xpp) {
PD_CONFIGURATION jcpGetterSetter = new PD_CONFIGURATION();
@@ -0,0 +1,26 @@
<?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:orientation="vertical"
tools:context=".dailyentry.BannerActivity">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white"
android:elevation="8dp"
app:theme="@style/ThemeOverlay.AppCompat.Light"
app:popupTheme="@style/AppTheme.PopupOverlay" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp"
android:clipToPadding="false" />
</LinearLayout>
@@ -0,0 +1,36 @@
<?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="8dp"
app:cardCornerRadius="8dp"
app:cardElevation="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="16dp"
android:gravity="center_vertical">
<ImageView
android:id="@+id/imgThumbnail"
android:layout_width="60dp"
android:layout_height="60dp"
android:scaleType="centerCrop"
android:src="@mipmap/ic_launcher" />
<TextView
android:id="@+id/tvName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="Detailer Name"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
</androidx.cardview.widget.CardView>