Added BA assessment and fixed baskinGss
This commit is contained in:
+11
-9
@@ -12,8 +12,8 @@ android {
|
||||
applicationId "com.cpm.lorealbaMabeline"
|
||||
//noinspection OldTargetApi
|
||||
targetSdk 34
|
||||
versionCode 21
|
||||
versionName "3.0"
|
||||
versionCode 24
|
||||
versionName "3.2"
|
||||
multiDexEnabled true
|
||||
useLibrary 'org.apache.http.legacy'
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
@@ -33,10 +33,10 @@ android {
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
buildConfigField "boolean", "LOG_ENABLED", "true"
|
||||
//buildConfigField "boolean", "LOG_ENABLED", "true"
|
||||
debuggable false
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
minifyEnabled false
|
||||
shrinkResources false
|
||||
signingConfig signingConfigs.config
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
firebaseCrashlytics {
|
||||
@@ -73,12 +73,14 @@ dependencies {
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.4.0'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.3.0'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
|
||||
implementation 'org.jetbrains:annotations-java5:15.0'
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||
//noinspection GradleDependency
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.0.2'
|
||||
//noinspection GradleDependency
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
|
||||
implementation 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||
implementation 'com.github.bumptech.glide:glide:4.16.0'
|
||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.15.1'
|
||||
implementation 'de.hdodenhof:circleimageview:3.1.0'
|
||||
|
||||
Binary file not shown.
@@ -11,8 +11,8 @@
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 21,
|
||||
"versionName": "3.0",
|
||||
"versionCode": 24,
|
||||
"versionName": "3.2",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -621,10 +621,11 @@
|
||||
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||
<activity
|
||||
android:name="com.cpm.lorealbaMabeline.dailyactivity.BASurveyListActivity"
|
||||
android:screenOrientation="portrait"
|
||||
|
||||
android:exported="false"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
android:screenOrientation="portrait"
|
||||
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||
<activity
|
||||
android:name="com.cpm.lorealbaMabeline.reports.DamagedStockHistory"
|
||||
@@ -658,6 +659,14 @@
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||
|
||||
<activity
|
||||
android:name=".dailyactivity.BaAssessmentActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:exported="false"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
|
||||
|
||||
<!-- <meta-data
|
||||
android:name="com.google.android.geo.API_KEY"
|
||||
android:value="AIzaSyAJIqKPhsyYTp6WnM387Fri4nLJo4-mOvc"
|
||||
@@ -670,10 +679,11 @@
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.file provider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true"
|
||||
tools:replace="android:authorities">
|
||||
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/provider_paths"
|
||||
|
||||
@@ -14,6 +14,9 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import androidx.core.content.FileProvider;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.Window;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
@@ -151,18 +154,28 @@ public class AutoUpdateActivity extends AppCompatActivity {
|
||||
Uri apkUri;
|
||||
Intent intent;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
apkUri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".fileprovider", toInstall);
|
||||
intent = new Intent(Intent.ACTION_INSTALL_PACKAGE);
|
||||
intent.setData(apkUri);
|
||||
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
apkUri = FileProvider.getUriForFile(context,
|
||||
BuildConfig.APPLICATION_ID + ".fileprovider",
|
||||
toInstall);
|
||||
|
||||
intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setDataAndType(apkUri, "application/vnd.android.package-archive");
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
context.startActivity(intent);
|
||||
} else {
|
||||
apkUri = Uri.fromFile(toInstall);
|
||||
intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setDataAndType(apkUri, "application/vnd.android.package-archive");
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
startActivity(intent);
|
||||
finish();
|
||||
// Optional: close the updater activity gracefully
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
((Activity) context).finishAffinity();
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -502,7 +502,7 @@ public class CounterLoginActivity extends AppCompatActivity implements View.OnCl
|
||||
try {
|
||||
PackageInfo pInfo = context.getPackageManager().getPackageInfo(getPackageName(), 0);
|
||||
String version = pInfo.versionName;
|
||||
versioncode_txt.setText("Version : " + version +"-T");
|
||||
versioncode_txt.setText("Version : " + version);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.fillInStackTrace();
|
||||
versioncode_txt.setText("Version : 0.0");
|
||||
|
||||
@@ -1998,19 +1998,20 @@ public class Lorealba_Database extends SQLiteOpenHelper {
|
||||
values.put("ProductId", tStockSummary.getProductId());
|
||||
values.put("SaleableIn", tStockSummary.getSaleableIn());
|
||||
values.put("SaleableOut", tStockSummary.getSaleableOut());
|
||||
values.put("SaleableBalance", tStockSummary.getSaleableStatus().trim().equalsIgnoreCase("COMPLETE") && tStockSummary.getSaleableBalance() == -1 ? 0 : tStockSummary.getSaleableBalance());
|
||||
values.put("SaleableDamage", tStockSummary.getSaleableDamage());
|
||||
values.put("SaleableBalance", tStockSummary.getSaleableBalance());
|
||||
values.put("TesterIn", tStockSummary.getTesterIn());
|
||||
values.put("TesterOut", tStockSummary.getTesterOut());
|
||||
values.put("TesterDamage", tStockSummary.getTesterDamage());
|
||||
values.put("TesterBalance", tStockSummary.getTesterStatus().trim().equalsIgnoreCase("COMPLETE") && tStockSummary.getTesterBalance() == -1 ? 0 : tStockSummary.getTesterBalance());
|
||||
values.put("TesterBalance", tStockSummary.getTesterBalance());
|
||||
values.put("SampleIn", tStockSummary.getSampleIn());
|
||||
values.put("SampleOut", tStockSummary.getSampleOut());
|
||||
values.put("SampleDamage", tStockSummary.getSampleDamage());
|
||||
values.put("SampleBalance", tStockSummary.getSampleStatus().trim().equalsIgnoreCase("COMPLETE") && tStockSummary.getSampleBalance() == -1 ? 0 : tStockSummary.getSampleBalance());
|
||||
values.put("SampleBalance", tStockSummary.getSampleBalance());
|
||||
values.put("GwpIn", tStockSummary.getGwpIn());
|
||||
values.put("GwpOut", tStockSummary.getGwpOut());
|
||||
values.put("GwpDamage", tStockSummary.getGwpDamage());
|
||||
values.put("GwpBalance", tStockSummary.getGwpStatus().trim().equalsIgnoreCase("COMPLETE") && tStockSummary.getGwpBalance() == -1 ? 0 : tStockSummary.getGwpBalance());
|
||||
values.put("GwpBalance", tStockSummary.getGwpBalance());
|
||||
values.put("SaleableStatus", tStockSummary.getSaleableStatus().trim());
|
||||
values.put("TesterStatus", tStockSummary.getTesterStatus().trim());
|
||||
values.put("SampleStatus", tStockSummary.getSampleStatus().trim());
|
||||
@@ -2021,9 +2022,7 @@ public class Lorealba_Database extends SQLiteOpenHelper {
|
||||
if (l == -1) {
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (isTStockTotalLine(date, counterId, "T_StockSummary") != data.size()) {
|
||||
delete_table_data("T_StockSummary");
|
||||
throw new Exception();
|
||||
|
||||
@@ -807,7 +807,7 @@ public class DealarBoardActivity extends AppCompatActivity implements Navigation
|
||||
finalList.add(getFileNames(Objects.requireNonNull(f.listFiles())).get(k));
|
||||
}
|
||||
}
|
||||
|
||||
Log.e("finalList", "DealerB"+finalList.toString() );
|
||||
if (!finalList.isEmpty()) {
|
||||
Intent intentu = new Intent(context, Downloader.class);
|
||||
intentu.putExtra(CommonString.KEY_UPLOADIMAGE, "1");
|
||||
@@ -818,7 +818,7 @@ public class DealarBoardActivity extends AppCompatActivity implements Navigation
|
||||
try {
|
||||
PackageInfo pInfo = context.getPackageManager().getPackageInfo(getPackageName(), 0);
|
||||
String version = pInfo.versionName;
|
||||
version_code.setText("Version : " + version +"-T");
|
||||
version_code.setText("Version : " + version);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.fillInStackTrace();
|
||||
version_code.setText("Version : 0.0");
|
||||
|
||||
@@ -166,7 +166,7 @@ public class IMEILoginActivity extends AppCompatActivity implements GoogleApiCli
|
||||
try {
|
||||
PackageInfo pInfo = context.getPackageManager().getPackageInfo(getPackageName(), 0);
|
||||
String version = pInfo.versionName;
|
||||
versioncode_txt.setText("Version : " + version+"-T");
|
||||
versioncode_txt.setText("Version : " + version);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.fillInStackTrace();
|
||||
versioncode_txt.setText("Version : 0.0");
|
||||
@@ -266,7 +266,6 @@ public class IMEILoginActivity extends AppCompatActivity implements GoogleApiCli
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("ObsoleteSdkInt")
|
||||
private void AttempLogin() {
|
||||
try {
|
||||
|
||||
@@ -118,8 +118,6 @@ public class UserLoginActivity extends AppCompatActivity implements View.OnClick
|
||||
|
||||
showAlertForLogoutUser(false);
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
void getViewId() {
|
||||
context = this;
|
||||
@@ -285,7 +283,7 @@ public class UserLoginActivity extends AppCompatActivity implements View.OnClick
|
||||
try {
|
||||
PackageInfo pInfo = context.getPackageManager().getPackageInfo(getPackageName(), 0);
|
||||
String version = pInfo.versionName;
|
||||
versioncode_txt.setText("Version : " + version +"-T");
|
||||
versioncode_txt.setText("Version : " + version);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.fillInStackTrace();
|
||||
versioncode_txt.setText("Version : 0.0");
|
||||
|
||||
@@ -13,6 +13,7 @@ public class CommonString {
|
||||
public static final String PROFILE_FOLDER_NAME = "LorealMNYProfile";
|
||||
public static final String LorealPromo_Folder = "LorealMNYPromoOffers";
|
||||
public static final String LorealBaApkFolder = "LorealBaMNYApkFolder";
|
||||
public static String BA_ASSESSMENT_URL ="https://careaudit.parinaam.in?";
|
||||
|
||||
public static String getLorealBaApkFolder(Context context) {
|
||||
return AppUtils.getInternalDirectory(context, LorealBaApkFolder).getAbsolutePath() + "/";
|
||||
|
||||
+34
-2
@@ -873,8 +873,40 @@ public class ConsumerReturnReplaceProductActivity extends AppCompatActivity impl
|
||||
dialog_sku_adapter.setDropDownViewResource(R.layout.spinner_custom_item);
|
||||
}
|
||||
|
||||
|
||||
public void setFilter(int filterType, Spinner dialog_spin) {
|
||||
List<ProductMaster> filteredList = new ArrayList<>();
|
||||
|
||||
// Filter only once based on type
|
||||
switch (filterType) {
|
||||
case FILTER_FOR_BRAND:
|
||||
filteredList = filterListForBrand(dialog_product_list, dialog_brand_Id);
|
||||
break;
|
||||
case FILTER_FOR_SUB_BRAND:
|
||||
filteredList = filterListForSubBrand(dialog_product_list, dialog_sub_brand_Id, dialog_brand_Id);
|
||||
break;
|
||||
case FILTER_FOR_REFERENCE_NAME:
|
||||
filteredList = filterListForReferencename(dialog_product_list, dialog_reference_Id, dialog_brand_Id, dialog_sub_brand_Id);
|
||||
break;
|
||||
default:
|
||||
filteredList = dialog_product_list;
|
||||
break;
|
||||
}
|
||||
|
||||
// Prepare display strings
|
||||
List<String> displayList = new ArrayList<>();
|
||||
displayList.add("- Select Product -"); // default item
|
||||
for (ProductMaster product : filteredList) {
|
||||
displayList.add(product.getProductName() + " - (MRP-" + product.getMrp() + ")");
|
||||
}
|
||||
|
||||
// Set adapter
|
||||
dialog_sku_adapter = new ArrayAdapter<>(context, R.layout.spinner_custom_item);
|
||||
dialog_sku_adapter.addAll(displayList);
|
||||
dialog_sku_adapter.setDropDownViewResource(R.layout.spinner_custom_item);
|
||||
dialog_spin.setAdapter(dialog_sku_adapter);
|
||||
}
|
||||
|
||||
/*public void setFilter(int filterType, Spinner dialog_spin) {
|
||||
if (filterType == FILTER_FOR_BRAND) {
|
||||
dialog_sku_adapter = new ArrayAdapter<>(context, R.layout.spinner_custom_item);
|
||||
dialog_sku_adapter.add("- Select Product -");
|
||||
@@ -922,7 +954,7 @@ public class ConsumerReturnReplaceProductActivity extends AppCompatActivity impl
|
||||
}
|
||||
|
||||
dialog_spin.invalidate();
|
||||
}
|
||||
}*/
|
||||
|
||||
final int CLEAR_FILTER = 0;
|
||||
final int FILTER_FOR_BRAND = 1;
|
||||
|
||||
+69
-8
@@ -16,6 +16,7 @@ import android.content.SharedPreferences;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
@@ -2907,7 +2908,6 @@ public class ConsumerUserDetailsActivity extends AppCompatActivity implements Vi
|
||||
dialog_sku_adapter.add(productList.get(i).getProductName() + " - (MRP-" + productList.get(i).getMrp().toString() + ")");
|
||||
}
|
||||
}
|
||||
|
||||
dialog_product_spin.setAdapter(dialog_sku_adapter);
|
||||
dialog_sku_adapter.setDropDownViewResource(R.layout.spinner_custom_item);
|
||||
} catch (Exception ignored) {
|
||||
@@ -2915,6 +2915,51 @@ public class ConsumerUserDetailsActivity extends AppCompatActivity implements Vi
|
||||
}
|
||||
|
||||
public void setFilter(int filterType, Spinner dialog_spin) {
|
||||
try {
|
||||
List<ProductMaster> filteredList = new ArrayList<>();
|
||||
// Filter once based on type
|
||||
switch (filterType) {
|
||||
case FILTER_FOR_BRAND:
|
||||
filteredList = filterListForBrand(dialog_product_list, dialog_brand_Id);
|
||||
break;
|
||||
case FILTER_FOR_SUB_BRAND:
|
||||
filteredList = filterListForSubBrand(dialog_product_list, dialog_sub_brand_Id, dialog_brand_Id);
|
||||
break;
|
||||
case FILTER_FOR_REFERENCE_NAME:
|
||||
filteredList = filterListForReferencename(dialog_product_list, dialog_reference_Id, dialog_brand_Id, dialog_sub_brand_Id, dialog_invoiceType);
|
||||
break;
|
||||
default:
|
||||
filteredList = dialog_product_list;
|
||||
break;
|
||||
}
|
||||
|
||||
// Prepare display strings
|
||||
List<String> displayList = new ArrayList<>();
|
||||
displayList.add("- Select Product -"); // default item
|
||||
|
||||
boolean isSampleOrGWP = dialog_invoiceType.equalsIgnoreCase("Sample") || dialog_invoiceType.equalsIgnoreCase("GWP");
|
||||
|
||||
for (ProductMaster product : filteredList) {
|
||||
if (isSampleOrGWP) {
|
||||
displayList.add(product.getProductName() + " - Type-" + dialog_invoiceType);
|
||||
} else {
|
||||
displayList.add(product.getProductName() + " - (MRP-" + product.getMrp() + ")");
|
||||
}
|
||||
}
|
||||
|
||||
// Set adapter efficiently
|
||||
dialog_sku_adapter = new ArrayAdapter<>(context, R.layout.spinner_custom_item);
|
||||
dialog_sku_adapter.addAll(displayList);
|
||||
dialog_sku_adapter.setDropDownViewResource(R.layout.spinner_custom_item);
|
||||
dialog_spin.setAdapter(dialog_sku_adapter);
|
||||
|
||||
dialog_spin.invalidate();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/*public void setFilter(int filterType, Spinner dialog_spin) {
|
||||
try {
|
||||
if (filterType == FILTER_FOR_BRAND) {
|
||||
dialog_sku_adapter = new ArrayAdapter<>(context, R.layout.spinner_custom_item);
|
||||
@@ -2979,7 +3024,7 @@ public class ConsumerUserDetailsActivity extends AppCompatActivity implements Vi
|
||||
} catch (Exception e) {
|
||||
e.fillInStackTrace();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
final int CLEAR_FILTER = 0;
|
||||
final int FILTER_FOR_BRAND = 1;
|
||||
@@ -4275,15 +4320,24 @@ public class ConsumerUserDetailsActivity extends AppCompatActivity implements Vi
|
||||
} catch (Exception e) {
|
||||
e.fillInStackTrace();
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
protected void remove_added_promo_index() {
|
||||
try {
|
||||
if (!selected_list.isEmpty()) {
|
||||
// Do something
|
||||
selected_list.removeIf(InvoiceGetterSetter::isPromo_flag);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { // API 24+
|
||||
selected_list.removeIf(InvoiceGetterSetter::isPromo_flag);
|
||||
} else {
|
||||
// Fallback for SDK 23 and below
|
||||
Iterator<InvoiceGetterSetter> iterator = selected_list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
InvoiceGetterSetter item = iterator.next();
|
||||
if (item.isPromo_flag()) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.fillInStackTrace();
|
||||
@@ -4292,9 +4346,16 @@ public class ConsumerUserDetailsActivity extends AppCompatActivity implements Vi
|
||||
|
||||
protected void remove_added_promo_fromtemp(String promoId) {
|
||||
try {
|
||||
if (!added_prmo_products.isEmpty()) {
|
||||
// Do something
|
||||
added_prmo_products.removeIf(name -> promoId.equals(name.getPromotion_Id()));
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
added_prmo_products.removeIf(item -> promoId.equals(item.getPromotion_Id()));
|
||||
} else {
|
||||
Iterator<InvoiceGetterSetter> iterator = added_prmo_products.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
InvoiceGetterSetter item = iterator.next();
|
||||
if (promoId.equals(item.getPromotion_Id())) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.fillInStackTrace();
|
||||
|
||||
@@ -215,7 +215,6 @@ public class BAProfileActivity extends AppCompatActivity implements View.OnClick
|
||||
if (file != null) {
|
||||
for (File value : file) arrayFiles.add(value.getName());
|
||||
}
|
||||
|
||||
return arrayFiles;
|
||||
}
|
||||
|
||||
@@ -312,7 +311,6 @@ public class BAProfileActivity extends AppCompatActivity implements View.OnClick
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
fab.setOnClickListener(view -> {
|
||||
expandableListView.clearFocus();
|
||||
expandableListView.invalidateViews();
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
package com.cpm.lorealbaMabeline.dailyactivity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import com.cpm.lorealbaMabeline.Database.Lorealba_Database;
|
||||
import com.cpm.lorealbaMabeline.R;
|
||||
import com.cpm.lorealbaMabeline.constant.AlertandMessages;
|
||||
import com.cpm.lorealbaMabeline.constant.CommonFunctions;
|
||||
import com.cpm.lorealbaMabeline.constant.CommonString;
|
||||
import com.cpm.lorealbaMabeline.delegates.PrefHelper;
|
||||
import com.cpm.lorealbaMabeline.gsonGetterSetter.JourneyPlan;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import im.delight.android.webview.AdvancedWebView;
|
||||
|
||||
|
||||
public class BaAssessmentActivity extends AppCompatActivity {
|
||||
private final Handler loaderHandler = new Handler(Looper.getMainLooper());
|
||||
private String username;
|
||||
private String couter_code;
|
||||
private Lorealba_Database db;
|
||||
JourneyPlan jcp_Object = new JourneyPlan();
|
||||
AdvancedWebView webView;
|
||||
ProgressBar progressBar;
|
||||
private Runnable showLoaderRunnable;
|
||||
private boolean pageLoaded = false;
|
||||
|
||||
@SuppressLint("MissingInflatedId")
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_ba_assessment);
|
||||
progressBar = (ProgressBar) findViewById(R.id.progressBar);
|
||||
webView = (AdvancedWebView) findViewById(R.id.webviewbaAssessment);
|
||||
SharedPreferences preferences = PrefHelper.getPrefs(this);
|
||||
String date = preferences.getString(CommonString.KEY_DATE, "");
|
||||
username = preferences.getString(CommonString.KEY_USERNAME, "");
|
||||
String counter_id = preferences.getString(CommonString.KEY_COUNTER_ID, "");
|
||||
couter_code = preferences.getString(CommonString.KEY_COUNTER_CODE, "");
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
if (!CommonFunctions.isTablet(this)) {
|
||||
toolbar.setTitleTextAppearance(this, R.style.changestext_sizefor_mobile);
|
||||
}
|
||||
Objects.requireNonNull(getSupportActionBar()).setHomeButtonEnabled(true);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
db = new Lorealba_Database(this);
|
||||
db.open();
|
||||
jcp_Object = db.getBIDfromJCP(username, counter_id);
|
||||
setTitle("BA Assessment - " + date);
|
||||
|
||||
if (CommonFunctions.checkNetIsAvailable(this)) {
|
||||
loadWeb();
|
||||
} else {
|
||||
AlertandMessages.showToastMsg(this, getString(R.string.nonetwork));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
db.open();
|
||||
}
|
||||
|
||||
@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) {
|
||||
onBackPressed();
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (webView.canGoBack()) {
|
||||
webView.goBack();
|
||||
} else {
|
||||
super.onBackPressed();
|
||||
this.finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
private void loadWeb() {
|
||||
WebSettings webSettings = webView.getSettings();
|
||||
webSettings.setJavaScriptEnabled(true);
|
||||
webSettings.setDomStorageEnabled(true);
|
||||
webSettings.setLoadWithOverviewMode(true);
|
||||
webSettings.setUseWideViewPort(true);
|
||||
webSettings.setSupportZoom(true);
|
||||
webSettings.setBuiltInZoomControls(true);
|
||||
webSettings.setDisplayZoomControls(false);
|
||||
// Android 5+ mixed content
|
||||
webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
webView.loadUrl(CommonString.BA_ASSESSMENT_URL + "c=" + couter_code + "&u=" + username);
|
||||
webView.setWebViewClient(new WebViewClient() {
|
||||
|
||||
@Override
|
||||
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
||||
pageLoaded = false;
|
||||
|
||||
showLoaderRunnable = () -> {
|
||||
if (!pageLoaded) {
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
};
|
||||
|
||||
// ⏳ Wait 400ms before showing loader
|
||||
loaderHandler.postDelayed(showLoaderRunnable, 4000);
|
||||
}
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
pageLoaded = true;
|
||||
|
||||
loaderHandler.removeCallbacks(showLoaderRunnable);
|
||||
progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
+34
-2
@@ -782,8 +782,40 @@ public class ConsumerReturnActivity extends AppCompatActivity implements View.On
|
||||
dialog_sku_adapter.setDropDownViewResource(R.layout.spinner_custom_item);
|
||||
}
|
||||
|
||||
|
||||
public void setFilter(int filterType, Spinner dialog_spin) {
|
||||
List<ProductMaster> filteredList = new ArrayList<>();
|
||||
|
||||
// Filter only once based on type
|
||||
switch (filterType) {
|
||||
case FILTER_FOR_BRAND:
|
||||
filteredList = filterListForBrand(dialog_product_list, dialog_brand_Id);
|
||||
break;
|
||||
case FILTER_FOR_SUB_BRAND:
|
||||
filteredList = filterListForSubBrand(dialog_product_list, dialog_sub_brand_Id, dialog_brand_Id);
|
||||
break;
|
||||
case FILTER_FOR_REFERENCE_NAME:
|
||||
filteredList = filterListForReferencename(dialog_product_list, dialog_reference_Id, dialog_brand_Id, dialog_sub_brand_Id);
|
||||
break;
|
||||
default:
|
||||
filteredList = dialog_product_list;
|
||||
break;
|
||||
}
|
||||
|
||||
// Prepare display strings
|
||||
List<String> displayList = new ArrayList<>();
|
||||
displayList.add("- Select Product -"); // default item
|
||||
for (ProductMaster product : filteredList) {
|
||||
displayList.add(product.getProductName() + " - (MRP-" + product.getMrp() + ")");
|
||||
}
|
||||
|
||||
// Set adapter
|
||||
dialog_sku_adapter = new ArrayAdapter<>(context, R.layout.spinner_custom_item);
|
||||
dialog_sku_adapter.addAll(displayList);
|
||||
dialog_sku_adapter.setDropDownViewResource(R.layout.spinner_custom_item);
|
||||
dialog_spin.setAdapter(dialog_sku_adapter);
|
||||
}
|
||||
|
||||
/*public void setFilter(int filterType, Spinner dialog_spin) {
|
||||
if (filterType == FILTER_FOR_BRAND) {
|
||||
dialog_sku_adapter = new ArrayAdapter<>(context, R.layout.spinner_custom_item);
|
||||
dialog_sku_adapter.add("- Select Product -");
|
||||
@@ -829,7 +861,7 @@ public class ConsumerReturnActivity extends AppCompatActivity implements View.On
|
||||
}
|
||||
|
||||
dialog_spin.invalidate();
|
||||
}
|
||||
}*/
|
||||
|
||||
final int CLEAR_FILTER = 0;
|
||||
final int FILTER_FOR_BRAND = 1;
|
||||
|
||||
+33
-2
@@ -934,8 +934,39 @@ public class ManualInWardStockActivity extends AppCompatActivity implements View
|
||||
dialog_sku_adapter.setDropDownViewResource(R.layout.spinner_custom_item);
|
||||
}
|
||||
|
||||
|
||||
public void setFilter(int filterType, Spinner dialog_spin) {
|
||||
List<ProductMaster> filteredList = new ArrayList<>();
|
||||
|
||||
// Filter only once based on type
|
||||
switch (filterType) {
|
||||
case FILTER_FOR_BRAND:
|
||||
filteredList = filterListForBrand(dialog_product_list, dialog_brand_Id);
|
||||
break;
|
||||
case FILTER_FOR_SUB_BRAND:
|
||||
filteredList = filterListForSubBrand(dialog_product_list, dialog_sub_brand_Id, dialog_brand_Id);
|
||||
break;
|
||||
case FILTER_FOR_REFERENCE_NAME:
|
||||
filteredList = filterListForReferencename(dialog_product_list, dialog_reference_Id, dialog_brand_Id, dialog_sub_brand_Id);
|
||||
break;
|
||||
default:
|
||||
filteredList = dialog_product_list;
|
||||
break;
|
||||
}
|
||||
|
||||
// Prepare display strings
|
||||
List<String> displayList = new ArrayList<>();
|
||||
displayList.add("- Select Product -"); // default item
|
||||
for (ProductMaster product : filteredList) {
|
||||
displayList.add(product.getProductName() + " - (MRP-" + product.getMrp() + ")");
|
||||
}
|
||||
|
||||
// Set adapter
|
||||
dialog_sku_adapter = new ArrayAdapter<>(context, R.layout.spinner_custom_item);
|
||||
dialog_sku_adapter.addAll(displayList);
|
||||
dialog_sku_adapter.setDropDownViewResource(R.layout.spinner_custom_item);
|
||||
dialog_spin.setAdapter(dialog_sku_adapter);
|
||||
}
|
||||
/*public void setFilter(int filterType, Spinner dialog_spin) {
|
||||
if (filterType == FILTER_FOR_BRAND) {
|
||||
dialog_sku_adapter = new ArrayAdapter<>(context, R.layout.spinner_custom_item);
|
||||
dialog_sku_adapter.add("- Select Product -");
|
||||
@@ -983,7 +1014,7 @@ public class ManualInWardStockActivity extends AppCompatActivity implements View
|
||||
}
|
||||
|
||||
dialog_spin.invalidate();
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
public ArrayList<ProductMaster> filterListForBrand(List<ProductMaster> originalList, String text) {
|
||||
|
||||
+1
-6
@@ -5,17 +5,12 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
||||
import com.cpm.lorealbaMabeline.Database.Lorealba_Database;
|
||||
import com.cpm.lorealbaMabeline.R;
|
||||
import com.cpm.lorealbaMabeline.constant.AlertandMessages;
|
||||
@@ -94,7 +89,7 @@ public class SkinGeniusCategoryActivity extends AppCompatActivity implements Vie
|
||||
context.startActivity(new Intent(context, SkinGeniusScreenshotActivity.class));
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
} else if (v.getId() == R.id.skin_genius_img) {
|
||||
if (skingenius_url != null && !skingenius_url.equals("")) {
|
||||
if (skingenius_url != null && !skingenius_url.isEmpty()) {
|
||||
openUrlInChrome(skingenius_url);
|
||||
db.open();
|
||||
int openskingenius_count = 1;
|
||||
|
||||
+48
-78
@@ -6,44 +6,34 @@ import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.net.Uri;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.cpm.lorealbaMabeline.Database.Lorealba_Database;
|
||||
import com.cpm.lorealbaMabeline.R;
|
||||
import com.cpm.lorealbaMabeline.constant.AlertandMessages;
|
||||
import com.cpm.lorealbaMabeline.constant.CommonFunctions;
|
||||
import com.cpm.lorealbaMabeline.constant.CommonString;
|
||||
import com.cpm.lorealbaMabeline.constant.FileUtils;
|
||||
import com.cpm.lorealbaMabeline.delegates.PrefHelper;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.cpm.lorealbaMabeline.constant.CommonFunctions.getCurrentTime;
|
||||
import static com.cpm.lorealbaMabeline.dailyactivity.StoreImageActivity.convertBitmap;
|
||||
|
||||
public class SkinGeniusScreenshotActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
String CounterId, visit_date, username, skingenius_uploadTym = "";
|
||||
@@ -145,7 +135,6 @@ public class SkinGeniusScreenshotActivity extends AppCompatActivity implements V
|
||||
@SuppressLint("NonConstantResourceId")
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
if (v.getId() == R.id.img_cam_selfie) {
|
||||
browseDocuments();
|
||||
} else if (v.getId() == R.id.save_skin_genius) {
|
||||
@@ -183,81 +172,62 @@ public class SkinGeniusScreenshotActivity extends AppCompatActivity implements V
|
||||
return activeNetwork != null && activeNetwork.isConnectedOrConnecting();
|
||||
}
|
||||
|
||||
|
||||
private void browseDocuments() {
|
||||
String[] mimeTypes =
|
||||
{"application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
"image/jpeg",
|
||||
"image/jpg", "image/png"};
|
||||
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.setType("*/*");
|
||||
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);
|
||||
startActivityForResult(Intent.createChooser(intent, "Choose Skin Genius Screenshot"), FILE_PICKER_CODE);
|
||||
|
||||
intent.setType("image/*");
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
startActivityForResult(
|
||||
Intent.createChooser(intent, "Choose Skin Genius Screenshot"),
|
||||
FILE_PICKER_CODE
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
// TODO Auto-generated method stub
|
||||
if (resultCode == Activity.RESULT_OK) {
|
||||
if (requestCode == FILE_PICKER_CODE) {
|
||||
Uri uri = data.getData();
|
||||
assert uri != null;
|
||||
String uriString = uri.toString();
|
||||
String displayName = null;
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
if (uriString.startsWith("content://")) {
|
||||
try (Cursor cursor = getContentResolver().query(uri, null, null, null, null)) {
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
displayName = CounterId + username.replace(".", "") + "-SkinGenius-" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||
}
|
||||
}
|
||||
} else if (uriString.startsWith("file://")) {
|
||||
displayName = CounterId + username.replace(".", "") + "-SkinGenius-" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||
if (requestCode == FILE_PICKER_CODE && resultCode == Activity.RESULT_OK) {
|
||||
|
||||
Uri uri = data.getData();
|
||||
if (uri == null) return;
|
||||
|
||||
String displayName =
|
||||
CounterId +
|
||||
username.replace(".", "") +
|
||||
"-SkinGenius-" +
|
||||
visit_date.replace("/", "") + "_" +
|
||||
getCurrentTime().replace(":", "") +
|
||||
".jpg";
|
||||
|
||||
File targetFile = new File(CommonString.getImagesFolder(this), displayName);
|
||||
|
||||
try (
|
||||
InputStream inputStream = getContentResolver().openInputStream(uri);
|
||||
OutputStream outputStream = new FileOutputStream(targetFile)
|
||||
) {
|
||||
byte[] buffer = new byte[8192];
|
||||
int bytesRead;
|
||||
while ((bytesRead = inputStream.read(buffer)) != -1) {
|
||||
outputStream.write(buffer, 0, bytesRead);
|
||||
}
|
||||
try {
|
||||
File sourceLocation = null;
|
||||
sourceLocation = FileUtils.getFile(context, uri);
|
||||
File targetLocation = new File(CommonString.getImagesFolder(context) + displayName);
|
||||
if (sourceLocation != null) {
|
||||
InputStream in = null;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
in = Files.newInputStream(sourceLocation.toPath());
|
||||
} else {
|
||||
in = new FileInputStream(sourceLocation);
|
||||
}
|
||||
OutputStream out = null;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
out = Files.newOutputStream(targetLocation.toPath());
|
||||
} else out = new FileOutputStream(targetLocation);
|
||||
// Copy the bits from instream to outstream
|
||||
byte[] buf = new byte[1024];
|
||||
int len;
|
||||
while ((len = in.read(buf)) > 0) {
|
||||
out.write(buf, 0, len);
|
||||
}
|
||||
in.close();
|
||||
out.close();
|
||||
img_str = displayName;
|
||||
if (new File(CommonString.getImagesFolder(context) + img_str).exists()) {
|
||||
try {
|
||||
Bitmap bmp = convertBitmap(CommonString.getImagesFolder(context) + img_str);
|
||||
img_cam.setImageBitmap(bmp);
|
||||
} catch (OutOfMemoryError ex) {
|
||||
CommonFunctions.setScaledImage(img_cam, CommonString.getImagesFolder(context) + img_str);
|
||||
}
|
||||
img_clicked.setVisibility(View.GONE);
|
||||
img_cam.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
AlertandMessages.showToastMsg(context, "Unable to retrieve the path. Please try again");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.fillInStackTrace();
|
||||
|
||||
img_str = displayName;
|
||||
|
||||
if (targetFile.exists()) {
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
options.inSampleSize = 2; // prevent OOM
|
||||
Bitmap bitmap = BitmapFactory.decodeFile(
|
||||
targetFile.getAbsolutePath(), options
|
||||
);
|
||||
img_cam.setImageBitmap(bitmap);
|
||||
img_clicked.setVisibility(View.GONE);
|
||||
img_cam.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.fillInStackTrace();
|
||||
AlertandMessages.showToastMsg(this, "Image load failed");
|
||||
}
|
||||
}
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ public class TabLoginActivity extends AppCompatActivity implements View.OnClickL
|
||||
try {
|
||||
PackageInfo pInfo = context.getPackageManager().getPackageInfo(getPackageName(), 0);
|
||||
String version = pInfo.versionName;
|
||||
versioncode_txt.setText("Version : " + version +"-T");
|
||||
versioncode_txt.setText("Version : " + version);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.fillInStackTrace();
|
||||
versioncode_txt.setText("Version : 0.0");
|
||||
@@ -319,7 +319,6 @@ public class TabLoginActivity extends AppCompatActivity implements View.OnClickL
|
||||
AttempLogin();
|
||||
}
|
||||
|
||||
|
||||
private void AttempLogin() {
|
||||
try {
|
||||
loading = ProgressDialog.show(TabLoginActivity.this, "Processing", "Please wait...", false, false);
|
||||
|
||||
@@ -280,6 +280,7 @@ public class Downloader extends JobIntentService {
|
||||
}
|
||||
storeDetail.put(jsonObject);
|
||||
}
|
||||
Log.d("uploadProfiledata",storeDetail.toString());
|
||||
JSONObject jsonFinalObject = new JSONObject();
|
||||
jsonFinalObject.put("MID", mid);
|
||||
jsonFinalObject.put("Keys", "BaProfileData");
|
||||
|
||||
@@ -72,9 +72,8 @@ public class BAdvisorMenuFragment extends Fragment {
|
||||
user_type = preferences.getString(CommonString.KEY_USER_TYPE, "");
|
||||
((DealarBoardActivity) requireActivity()).setBaMenuRefreshListener(value -> {
|
||||
// Set the adapter
|
||||
if (view instanceof RecyclerView) {
|
||||
if (view instanceof RecyclerView recyclerView) {
|
||||
Context context = view.getContext();
|
||||
RecyclerView recyclerView = (RecyclerView) view;
|
||||
recyclerView.setAdapter(new MyAdaperForIcon(context, getdata(value), value));
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false));
|
||||
}
|
||||
@@ -85,7 +84,7 @@ public class BAdvisorMenuFragment extends Fragment {
|
||||
|
||||
public List<NavMenuItemGetterSetter> getdata(String value) {
|
||||
List<NavMenuItemGetterSetter> data = new ArrayList<>();
|
||||
int groomed_img = 0, consumer_interaction = 0, consumer_return = 0, break_mangment = 0, ba_training = 0, leave_mangment = 0, ba_survey = 0, ba_skin_genius = 0;
|
||||
int groomed_img = 0, consumer_interaction = 0, consumer_return = 0, break_mangment = 0, ba_training = 0, leave_mangment = 0, ba_survey = 0,ba_assessment=0, ba_skin_genius = 0;
|
||||
db.open();
|
||||
String saleable_status = db.getStatus(CommonString.KEY_SaleableStatus, counterId);
|
||||
if (value.equals("1")) {
|
||||
@@ -98,6 +97,7 @@ public class BAdvisorMenuFragment extends Fragment {
|
||||
leave_mangment = R.mipmap.leave_m_grey;
|
||||
}
|
||||
ba_survey = R.mipmap.ba_survey;
|
||||
ba_assessment = R.mipmap.ba_assessment;
|
||||
ba_skin_genius = R.mipmap.vto_grey;
|
||||
|
||||
} else if (value.equals("2")) {
|
||||
@@ -110,6 +110,7 @@ public class BAdvisorMenuFragment extends Fragment {
|
||||
}
|
||||
ba_training = R.mipmap.training;
|
||||
ba_survey = R.mipmap.ba_survey;
|
||||
ba_assessment = R.mipmap.ba_assessment;
|
||||
ba_skin_genius = R.mipmap.vto_grey;
|
||||
} else {
|
||||
db.open();
|
||||
@@ -131,9 +132,11 @@ public class BAdvisorMenuFragment extends Fragment {
|
||||
leave_mangment = R.mipmap.leave_management;
|
||||
}
|
||||
ba_survey = R.mipmap.ba_survey;
|
||||
ba_assessment = R.mipmap.ba_assessment;
|
||||
|
||||
|
||||
} else if (db.isGroomedChecked(counterId, username, visit_date).equalsIgnoreCase("Amber")) {
|
||||
}
|
||||
else if (db.isGroomedChecked(counterId, username, visit_date).equalsIgnoreCase("Amber")) {
|
||||
if (complete) {
|
||||
consumer_return = R.mipmap.consumer_return;
|
||||
consumer_interaction = R.mipmap.consumer_interaction;
|
||||
@@ -150,6 +153,7 @@ public class BAdvisorMenuFragment extends Fragment {
|
||||
leave_mangment = R.mipmap.leave_management;
|
||||
}
|
||||
ba_survey = R.mipmap.ba_survey;
|
||||
ba_assessment = R.mipmap.ba_assessment;
|
||||
|
||||
} else {
|
||||
if (complete) {
|
||||
@@ -169,15 +173,16 @@ public class BAdvisorMenuFragment extends Fragment {
|
||||
leave_mangment = R.mipmap.leave_management;
|
||||
}
|
||||
ba_survey = R.mipmap.ba_survey;
|
||||
ba_assessment = R.mipmap.ba_assessment;
|
||||
}
|
||||
}
|
||||
|
||||
int[] img = {groomed_img, consumer_interaction, consumer_return, break_mangment, ba_training, ba_survey, ba_skin_genius};
|
||||
String[] name = {"Grooming Image", "Consumer Interaction", "Consumer Return", "Break Management", "Training", "BA Survey", "VTO"};
|
||||
int[] img = {groomed_img, consumer_interaction, consumer_return, break_mangment, ba_training, ba_survey,ba_assessment, ba_skin_genius};
|
||||
String[] name = {"Grooming Image", "Consumer Interaction", "Consumer Return", "Break Management", "Training", "BA Survey","BA Assessment", "VTO"};
|
||||
|
||||
if (user_type != null && user_type.equalsIgnoreCase(CommonString.TAG_FROM_BA)) {
|
||||
name = new String[]{"Grooming Image", "Consumer Interaction", "Consumer Return", "Break Management", "Leave Management", "Training", "BA Survey", "VTO"};
|
||||
img = new int[]{groomed_img, consumer_interaction, consumer_return, break_mangment, leave_mangment, ba_training, ba_survey, ba_skin_genius};
|
||||
name = new String[]{"Grooming Image", "Consumer Interaction", "Consumer Return", "Break Management", "Leave Management", "Training", "BA Survey", "BA Assessment","VTO"};
|
||||
img = new int[]{groomed_img, consumer_interaction, consumer_return, break_mangment, leave_mangment, ba_training, ba_survey,ba_assessment, ba_skin_genius};
|
||||
}
|
||||
for (int i = 0; i < img.length; i++) {
|
||||
NavMenuItemGetterSetter recData = new NavMenuItemGetterSetter();
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.cpm.lorealbaMabeline.constant.AlertandMessages;
|
||||
import com.cpm.lorealbaMabeline.constant.CommonString;
|
||||
import com.cpm.lorealbaMabeline.consumeractivity.ConsumerIntractionDetailActivity;
|
||||
import com.cpm.lorealbaMabeline.dailyactivity.BASurveyListActivity;
|
||||
import com.cpm.lorealbaMabeline.dailyactivity.BaAssessmentActivity;
|
||||
import com.cpm.lorealbaMabeline.dailyactivity.ConsumerReturnActivity;
|
||||
import com.cpm.lorealbaMabeline.dailyactivity.CounterImageActivity;
|
||||
import com.cpm.lorealbaMabeline.dailyactivity.CounterProfileActivity;
|
||||
@@ -103,7 +104,7 @@ public class MyAdaperForIcon extends RecyclerView.Adapter<MyAdaperForIcon.ViewHo
|
||||
holder.icon_txtname.setTextColor(context.getResources().getColor(R.color.black));
|
||||
holder.icon_txtname.setId(position);
|
||||
} else {
|
||||
holder.icon_txtname.setTextColor(context.getResources().getColor(com.androidbuts.multispinnerfilter.R.color.background_color));
|
||||
holder.icon_txtname.setTextColor(context.getResources().getColor(R.color.background_color));
|
||||
holder.icon_txtname.setId(position);
|
||||
}
|
||||
} else if (value.equals("2")) {
|
||||
@@ -178,6 +179,8 @@ public class MyAdaperForIcon extends RecyclerView.Adapter<MyAdaperForIcon.ViewHo
|
||||
db.deleteBASurveyData(counter_id, visit_date);
|
||||
}
|
||||
context.startActivity(new Intent(context, BASurveyListActivity.class).putExtra("SurveyType", "BA"));
|
||||
} else if (current.getIconImg() == R.mipmap.ba_assessment) {
|
||||
context.startActivity(new Intent(context, BaAssessmentActivity.class));
|
||||
} else if (current.getIconImg() == R.mipmap.survey) {
|
||||
db.open();
|
||||
JourneyPlan jcp_Object = db.getBIDfromJCP(username, counter_id);
|
||||
|
||||
@@ -497,7 +497,7 @@ PinViewActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
versionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("UserName", user_id);
|
||||
jsonObject.put("Password", allLoginData.get(0).getPassword());
|
||||
jsonObject.put("Password", allLoginData.get(0).getPassword().trim());
|
||||
jsonObject.put("CounterId", counterId);
|
||||
jsonObject.put("Latitude", lat);
|
||||
jsonObject.put("Longitude", lon);
|
||||
@@ -526,7 +526,6 @@ PinViewActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
jsonObject.put("IMEINumber2", "0");
|
||||
}
|
||||
}
|
||||
|
||||
String jsonString = jsonObject.toString();
|
||||
try {
|
||||
final OkHttpClient okHttpClient = new OkHttpClient.Builder().readTimeout(CommonString.TIMEOUT, TimeUnit.SECONDS).
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.squareup.okhttp.ResponseBody;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.Type;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import retrofit.Converter;
|
||||
|
||||
@@ -28,24 +29,20 @@ public class StringConverterFactory implements Converter.Factory {
|
||||
}
|
||||
|
||||
class StringConverter implements Converter<String> {
|
||||
private static final MediaType PLAIN_TEXT = MediaType.parse("text/plain; charset=UTF-8");
|
||||
private static final MediaType PLAIN_TEXT = MediaType.parse("text/plain; charset=UTF-8");
|
||||
|
||||
@Override
|
||||
public String fromBody(ResponseBody body) throws IOException {
|
||||
return new String(body.bytes());
|
||||
}
|
||||
@Override
|
||||
public String fromBody(ResponseBody body) throws IOException {
|
||||
return new String(body.bytes());
|
||||
}
|
||||
|
||||
@Override
|
||||
public RequestBody toBody(String value) {
|
||||
return RequestBody.create(PLAIN_TEXT, convertToBytes(value));
|
||||
}
|
||||
@Override
|
||||
public RequestBody toBody(String value) {
|
||||
return RequestBody.create(PLAIN_TEXT, convertToBytes(value));
|
||||
}
|
||||
|
||||
private static byte[] convertToBytes(String string) {
|
||||
try {
|
||||
return string.getBytes("UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
private static byte[] convertToBytes(String string) {
|
||||
return string.getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
@@ -1921,7 +1922,7 @@ public class ManualUploadActivity extends AppCompatActivity implements View.OnCl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Log.e("finalList", finalList.toString());
|
||||
if (!finalList.isEmpty()) {
|
||||
filename = "";
|
||||
for (int i = 0; i < finalList.size(); i++) {
|
||||
@@ -2032,6 +2033,7 @@ public class ManualUploadActivity extends AppCompatActivity implements View.OnCl
|
||||
AlertandMessages.showAlertlogin((Activity) context, "Image not uploaded.Please try again." + "\n" + uploadedFiles + " images uploaded out of " + totalFiles);
|
||||
|
||||
} catch (OutOfMemoryError error) {
|
||||
Log.e("finalList", error.toString());
|
||||
statusforimage[0] = -1;
|
||||
error.fillInStackTrace();
|
||||
pd.dismiss();
|
||||
@@ -2848,6 +2850,7 @@ public class ManualUploadActivity extends AppCompatActivity implements View.OnCl
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
super.onBackPressed();
|
||||
if (clicked_flag) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context).setTitle(R.string.parinaam).setMessage(CommonString.UPLOAD_PONBACK_ALERT_MESSAGE).setCancelable(false).setPositiveButton("Ok", (dialog, id) -> {
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?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"
|
||||
tools:context=".dailyactivity.BaAssessmentActivity">
|
||||
|
||||
<!-- APP BAR -->
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appBar"
|
||||
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="?attr/colorPrimary"
|
||||
app:titleTextAppearance="@style/Toolbar.TitleTextPhone"/>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<!-- CONTENT BELOW TOOLBAR -->
|
||||
<include
|
||||
android:id="@+id/contentLayout"
|
||||
layout="@layout/content_ba_assessment"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
tools:context=".dailyactivity.BaAssessmentActivity"
|
||||
android:background="@color/grey_background"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:showIn="@layout/activity_ba_assessment">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="@dimen/custom_margin60dp"
|
||||
android:layout_height="@dimen/custom_margin60dp"
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<im.delight.android.webview.AdvancedWebView
|
||||
android:id="@+id/webviewbaAssessment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?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"
|
||||
tools:context=".dailyactivity.BaAssessmentActivity">
|
||||
|
||||
<!-- APP BAR -->
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appBar"
|
||||
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="?attr/colorPrimary"
|
||||
app:titleTextAppearance="@style/Toolbar.TitleTextPhone"/>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<!-- CONTENT BELOW TOOLBAR -->
|
||||
<include
|
||||
android:id="@+id/contentLayout"
|
||||
layout="@layout/content_ba_assessment"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
tools:context=".dailyactivity.BaAssessmentActivity"
|
||||
android:background="@color/grey_background"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:showIn="@layout/activity_ba_assessment">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="@dimen/custom_margin60dp"
|
||||
android:layout_height="@dimen/custom_margin60dp"
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<im.delight.android.webview.AdvancedWebView
|
||||
android:id="@+id/webviewbaAssessment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
@@ -1,4 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<external-path name="external_files" path="."/>
|
||||
</paths>
|
||||
<!-- Example: give access to files in the app's cache or files directory -->
|
||||
<external-files-path
|
||||
name="external_files"
|
||||
path="." />
|
||||
|
||||
<!-- or internal -->
|
||||
<files-path
|
||||
name="internal_files"
|
||||
path="." />
|
||||
</paths>
|
||||
|
||||
Reference in New Issue
Block a user