Merge branch 'master' of https://github.com/CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/GSKORANGEV1 into GG_Update_Manifest
# Conflicts: # GSKMTOrange/src/main/AndroidManifest.xml
This commit is contained in:
+238
-39
@@ -2,6 +2,7 @@ package cpm.com.gskmtorange.gsk_dailyentry;
|
|||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -25,6 +26,8 @@ import android.support.design.widget.Snackbar;
|
|||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.CardView;
|
import android.support.v7.widget.CardView;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.text.TextWatcher;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
@@ -78,6 +81,8 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
boolean isDialogOpen = true;
|
boolean isDialogOpen = true;
|
||||||
boolean checkflag = true;
|
boolean checkflag = true;
|
||||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow;
|
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow;
|
||||||
|
Uri outputFileUri = null;
|
||||||
|
String gallery_package = "";
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -128,18 +133,18 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (validateData(hashMapListHeaderData, hashMapListChildData)) {
|
if (validateData(hashMapListHeaderData, hashMapListChildData)) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(Stock_FacingActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(Stock_FacingActivity.this);
|
||||||
builder.setMessage("Are you sure you want to save")
|
builder.setMessage(getResources().getString(R.string.check_save_message))
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
if (db.checkStockAndFacingData(store_id, categoryId)) {
|
if (db.checkStockAndFacingData(store_id, categoryId)) {
|
||||||
db.updateStockAndFacing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
db.updateStockAndFacing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
Snackbar.make(view, "Data has been updated", Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(view, getResources().getString(R.string.update_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
} else {
|
} else {
|
||||||
db.InsertStock_Facing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
db.InsertStock_Facing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
Snackbar.make(view, "Data has been saved", Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
Snackbar.make(view, getResources().getString(R.string.save_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
//Toast.makeText(getApplicationContext(), "Data has been saved", Toast.LENGTH_LONG).show();
|
//Toast.makeText(getApplicationContext(), "Data has been saved", Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +152,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton("No", new DialogInterface.OnClickListener() {
|
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
}
|
}
|
||||||
@@ -156,9 +161,10 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
alert.show();
|
alert.show();
|
||||||
} else {
|
} else {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(Stock_FacingActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(Stock_FacingActivity.this);
|
||||||
builder.setMessage("Fill the value or fill 0 ")
|
//builder.setMessage(getResources().getString(R.string.empty_field))
|
||||||
|
builder.setMessage(Error_Message)
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
@@ -214,6 +220,8 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||||
getCurrentFocus().clearFocus();
|
getCurrentFocus().clearFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fab.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -227,6 +235,8 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||||
getCurrentFocus().clearFocus();
|
getCurrentFocus().clearFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fab.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -289,6 +299,8 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
String stock = listDataChild.get(listDataHeader.get(i)).get(j).getStock();
|
String stock = listDataChild.get(listDataHeader.get(i)).get(j).getStock();
|
||||||
String faceup = listDataChild.get(listDataHeader.get(i)).get(j).getFacing();
|
String faceup = listDataChild.get(listDataHeader.get(i)).get(j).getFacing();
|
||||||
|
|
||||||
|
//Company_id
|
||||||
|
if (listDataChild.get(listDataHeader.get(i)).get(j).getCompany_id().equals("1")) {
|
||||||
//Camera allow enable
|
//Camera allow enable
|
||||||
if (camera_allow.equalsIgnoreCase("1")) {
|
if (camera_allow.equalsIgnoreCase("1")) {
|
||||||
|
|
||||||
@@ -300,7 +312,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
flag = false;
|
flag = false;
|
||||||
Error_Message = "Please fill all the data";
|
Error_Message = getResources().getString(R.string.fill_data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -310,7 +322,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
flag = false;
|
flag = false;
|
||||||
Error_Message = "Please fill all the data";
|
Error_Message = getResources().getString(R.string.fill_data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -320,7 +332,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
flag = false;
|
flag = false;
|
||||||
Error_Message = "Please click either 1 image";
|
Error_Message = getResources().getString(R.string.click_image);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,7 +359,17 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (faceup.equals("")) {
|
||||||
|
if (!checkHeaderArray.contains(i)) {
|
||||||
|
checkHeaderArray.add(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
flag = false;
|
||||||
|
Error_Message = "Please fill all the data";
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -365,16 +387,8 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void startCameraActivity1(int position) {
|
private void startCameraActivity1(int position) {
|
||||||
try {
|
/*try {
|
||||||
/*Log.e("Stock and Facing ", "startCameraActivity()");
|
Log.e("Stock & Facing ", "startCameraActivity()");
|
||||||
File file = new File(path);
|
|
||||||
Uri outputFileUri = Uri.fromFile(file);
|
|
||||||
|
|
||||||
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
|
|
||||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
|
||||||
startActivityForResult(intent, position);*/
|
|
||||||
|
|
||||||
Log.i("Stock & Facing ", "startCameraActivity()");
|
|
||||||
File file = new File(path);
|
File file = new File(path);
|
||||||
Uri outputFileUri = Uri.fromFile(file);
|
Uri outputFileUri = Uri.fromFile(file);
|
||||||
|
|
||||||
@@ -383,8 +397,8 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||||
for (int n = 0; n < list.size(); n++) {
|
for (int n = 0; n < list.size(); n++) {
|
||||||
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
||||||
/*Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
*//*Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
||||||
Log.e("TAG", "package name : " + list.get(n).packageName);*/
|
Log.e("TAG", "package name : " + list.get(n).packageName);*//*
|
||||||
|
|
||||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
||||||
@@ -406,21 +420,58 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
startActivityForResult(intent, 1);
|
startActivityForResult(intent, 1);
|
||||||
//startActivityForResult(intent, position);
|
//startActivityForResult(intent, position);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}*/
|
||||||
|
|
||||||
|
try {
|
||||||
|
Log.e("MakeMachine", "startCameraActivity()");
|
||||||
|
File file = new File(path);
|
||||||
|
outputFileUri = Uri.fromFile(file);
|
||||||
|
|
||||||
|
String defaultCameraPackage = "";
|
||||||
|
final PackageManager packageManager = getPackageManager();
|
||||||
|
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||||
|
for (int n = 0; n < list.size(); n++) {
|
||||||
|
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
||||||
|
//Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
||||||
|
//Log.e("TAG", "package name : " + list.get(n).packageName);
|
||||||
|
|
||||||
|
//temp value in case camera is gallery app above jellybean
|
||||||
|
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Gallery")) {
|
||||||
|
gallery_package = list.get(n).packageName;
|
||||||
|
}
|
||||||
|
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
|
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
||||||
|
defaultCameraPackage = list.get(n).packageName;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
||||||
|
defaultCameraPackage = list.get(n).packageName;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||||
|
intent.setPackage(defaultCameraPackage);
|
||||||
|
startActivityForResult(intent, 1);
|
||||||
|
} catch (ActivityNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||||
|
intent.setPackage(gallery_package);
|
||||||
|
startActivityForResult(intent, 1);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startCameraActivity2(int position) {
|
private void startCameraActivity2(int position) {
|
||||||
try {
|
/*try {
|
||||||
/*Log.e("Stock and Facing ", "startCameraActivity()");
|
|
||||||
File file = new File(path);
|
|
||||||
Uri outputFileUri = Uri.fromFile(file);
|
|
||||||
|
|
||||||
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
|
|
||||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
|
||||||
startActivityForResult(intent, position);*/
|
|
||||||
|
|
||||||
Log.i("Stock & Facing ", "startCameraActivity()");
|
Log.i("Stock & Facing ", "startCameraActivity()");
|
||||||
File file = new File(path);
|
File file = new File(path);
|
||||||
Uri outputFileUri = Uri.fromFile(file);
|
Uri outputFileUri = Uri.fromFile(file);
|
||||||
@@ -430,8 +481,8 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||||
for (int n = 0; n < list.size(); n++) {
|
for (int n = 0; n < list.size(); n++) {
|
||||||
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
||||||
/*Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
*//*Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
||||||
Log.e("TAG", "package name : " + list.get(n).packageName);*/
|
Log.e("TAG", "package name : " + list.get(n).packageName);*//*
|
||||||
|
|
||||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
||||||
@@ -451,7 +502,51 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||||
intent.setPackage(defaultCameraPackage);
|
intent.setPackage(defaultCameraPackage);
|
||||||
startActivityForResult(intent, 2);
|
startActivityForResult(intent, 2);
|
||||||
//startActivityForResult(intent, position);
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}*/
|
||||||
|
|
||||||
|
try {
|
||||||
|
Log.e("MakeMachine", "startCameraActivity()");
|
||||||
|
File file = new File(path);
|
||||||
|
outputFileUri = Uri.fromFile(file);
|
||||||
|
|
||||||
|
String defaultCameraPackage = "";
|
||||||
|
final PackageManager packageManager = getPackageManager();
|
||||||
|
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||||
|
for (int n = 0; n < list.size(); n++) {
|
||||||
|
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
||||||
|
//Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
||||||
|
//Log.e("TAG", "package name : " + list.get(n).packageName);
|
||||||
|
|
||||||
|
//temp value in case camera is gallery app above jellybean
|
||||||
|
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Gallery")) {
|
||||||
|
gallery_package = list.get(n).packageName;
|
||||||
|
}
|
||||||
|
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
|
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
||||||
|
defaultCameraPackage = list.get(n).packageName;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
||||||
|
defaultCameraPackage = list.get(n).packageName;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||||
|
intent.setPackage(defaultCameraPackage);
|
||||||
|
startActivityForResult(intent, 2);
|
||||||
|
} catch (ActivityNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||||
|
intent.setPackage(gallery_package);
|
||||||
|
startActivityForResult(intent, 2);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -530,8 +625,25 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
if (id == android.R.id.home) {
|
if (id == android.R.id.home) {
|
||||||
|
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(Stock_FacingActivity.this);
|
||||||
|
builder.setTitle(getResources().getString(R.string.dialog_title));
|
||||||
|
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||||
|
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
android.app.AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
//finish();
|
||||||
|
}
|
||||||
|
|
||||||
//Planogram Dialog
|
//Planogram Dialog
|
||||||
if (id == R.id.action_planogram) {
|
if (id == R.id.action_planogram) {
|
||||||
@@ -582,15 +694,15 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
//super.onBackPressed();
|
//super.onBackPressed();
|
||||||
|
|
||||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(Stock_FacingActivity.this);
|
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(Stock_FacingActivity.this);
|
||||||
builder.setTitle("Parinaam");
|
builder.setTitle(getResources().getString(R.string.dialog_title));
|
||||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton("Cancel ", new DialogInterface.OnClickListener() {
|
.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
|
||||||
@@ -649,8 +761,16 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (headerTitle.getCompany_id().equals("1")) {
|
if (headerTitle.getCompany_id().equals("1")) {
|
||||||
txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||||
|
|
||||||
|
txt_sosHeader.setVisibility(View.VISIBLE);
|
||||||
|
img_camera1.setVisibility(View.VISIBLE);
|
||||||
|
img_camera2.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.black));
|
txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
|
||||||
|
txt_sosHeader.setVisibility(View.GONE);
|
||||||
|
img_camera1.setVisibility(View.GONE);
|
||||||
|
img_camera2.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Camera allow enable
|
//Camera allow enable
|
||||||
@@ -662,7 +782,8 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
//String date = new Date().toLocaleString().toString();
|
//String date = new Date().toLocaleString().toString();
|
||||||
//String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
//String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
||||||
|
|
||||||
_pathforcheck = "Stock_Cam1_" + store_id + "_" + headerTitle.getBrand_id() + "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck = "Stock_Cam1_" + store_id + "_" + headerTitle.getBrand_id()
|
||||||
|
+ "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||||
child_position = groupPosition;
|
child_position = groupPosition;
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
@@ -690,7 +811,8 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
//String date = new Date().toLocaleString().toString();
|
//String date = new Date().toLocaleString().toString();
|
||||||
//String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
//String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
||||||
|
|
||||||
_pathforcheck = "Stock_Cam2_" + store_id + "_" + headerTitle.getBrand_id() + "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck = "Stock_Cam2_" + store_id + "_" + headerTitle.getBrand_id()
|
||||||
|
+ "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||||
child_position = groupPosition;
|
child_position = groupPosition;
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
@@ -716,11 +838,29 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
img_camera2.setBackgroundResource(R.mipmap.camera_grey);
|
img_camera2.setBackgroundResource(R.mipmap.camera_grey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (headerTitle.getCompany_id().equals("1")) {
|
||||||
if (!checkflag) {
|
if (!checkflag) {
|
||||||
if (checkHeaderArray.contains(groupPosition)) {
|
if (checkHeaderArray.contains(groupPosition)) {
|
||||||
txt_stockFaceupHeader.setTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
txt_stockFaceupHeader.setTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
} else {
|
||||||
|
txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||||
|
/*if (headerTitle.getCompany_id().equals("1")) {
|
||||||
} else {
|
} else {
|
||||||
txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.black));
|
txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!checkflag) {
|
||||||
|
if (checkHeaderArray.contains(groupPosition)) {
|
||||||
|
txt_stockFaceupHeader.setTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
} else {
|
||||||
|
/*if (headerTitle.getCompany_id().equals("1")) {
|
||||||
|
txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||||
|
} else {*/
|
||||||
|
txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
//}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -768,8 +908,10 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (childData.getCompany_id().equals("1")) {
|
if (childData.getCompany_id().equals("1")) {
|
||||||
holder.txt_skuName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
holder.txt_skuName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||||
|
holder.ed_stock.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
holder.txt_skuName.setTextColor(getResources().getColor(R.color.black));
|
holder.txt_skuName.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
holder.ed_stock.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -806,6 +948,43 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*holder.ed_stock.addTextChangedListener(new TextWatcher() {
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
//final EditText caption = (EditText) v;
|
||||||
|
String edStock = s.toString();
|
||||||
|
|
||||||
|
if (!edStock.equals("")) {
|
||||||
|
String stock = edStock.replaceFirst("^0+(?!$)", "");
|
||||||
|
childData.setStock(stock);
|
||||||
|
|
||||||
|
if (edStock.equals("0")) {
|
||||||
|
childData.setFacing("0");
|
||||||
|
|
||||||
|
finalHolder.ed_facing.setEnabled(false);
|
||||||
|
} else {
|
||||||
|
childData.setFacing(childData.getFacing());
|
||||||
|
finalHolder.ed_facing.setEnabled(true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
childData.setStock("");
|
||||||
|
finalHolder.ed_facing.setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
expandableListView.invalidateViews();
|
||||||
|
}
|
||||||
|
});*/
|
||||||
|
|
||||||
holder.ed_stock.setText(childData.getStock());
|
holder.ed_stock.setText(childData.getStock());
|
||||||
|
|
||||||
holder.ed_facing.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
holder.ed_facing.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
@@ -814,6 +993,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
final EditText caption = (EditText) v;
|
final EditText caption = (EditText) v;
|
||||||
final String edFaceup = caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
final String edFaceup = caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
||||||
|
|
||||||
|
if (childData.getCompany_id().equals("1")) {
|
||||||
if (!childData.getStock().equals("")) {
|
if (!childData.getStock().equals("")) {
|
||||||
if (!edFaceup.equals("")) {
|
if (!edFaceup.equals("")) {
|
||||||
if (Integer.parseInt(edFaceup) <= Integer.parseInt(childData.getStock())) {
|
if (Integer.parseInt(edFaceup) <= Integer.parseInt(childData.getStock())) {
|
||||||
@@ -853,6 +1033,10 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
alert.show();
|
alert.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
childData.setFacing(edFaceup);
|
||||||
|
childData.setStock("0");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -861,6 +1045,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
if (!checkflag) {
|
if (!checkflag) {
|
||||||
boolean tempflag = false;
|
boolean tempflag = false;
|
||||||
|
|
||||||
|
if (childData.getCompany_id().equals("1")) {
|
||||||
if (holder.ed_stock.getText().toString().equals("")) {
|
if (holder.ed_stock.getText().toString().equals("")) {
|
||||||
holder.ed_stock.setBackgroundColor(getResources().getColor(R.color.white));
|
holder.ed_stock.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
holder.ed_stock.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
holder.ed_stock.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
@@ -880,6 +1065,20 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (holder.ed_facing.getText().toString().equals("")) {
|
||||||
|
holder.ed_facing.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
holder.ed_facing.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
holder.ed_facing.setHint("Empty");
|
||||||
|
tempflag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tempflag) {
|
||||||
|
holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||||
|
} else {
|
||||||
|
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return convertView;
|
return convertView;
|
||||||
|
|||||||
Reference in New Issue
Block a user