Merge pull request #47 from CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/GG_MappingPlanogram_DialogDisplay

Gg mapping planogram dialog display
This commit is contained in:
YadavendraSinghYaduvanshi
2017-01-13 16:02:12 +05:30
committed by GitHub
14 changed files with 598 additions and 142 deletions
@@ -18,6 +18,7 @@ import cpm.com.gskmtorange.GetterSetter.StoreBean;
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter; import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_DataGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
import cpm.com.gskmtorange.constant.CommonString; import cpm.com.gskmtorange.constant.CommonString;
@@ -2561,11 +2562,10 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
Cursor dbcursor = null; Cursor dbcursor = null;
try { try {
if(category_id == null){ if (category_id == null) {
dbcursor = db.rawQuery("SELECT * FROM " + CommonString.TABLE_INSERT_T2P_COMPLIANCE + " where " + dbcursor = db.rawQuery("SELECT * FROM " + CommonString.TABLE_INSERT_T2P_COMPLIANCE + " where " +
CommonString.KEY_STORE_ID + "='" + store_id + "'", null); CommonString.KEY_STORE_ID + "='" + store_id + "'", null);
} } else {
else{
dbcursor = db.rawQuery("SELECT * FROM " + CommonString.TABLE_INSERT_T2P_COMPLIANCE + " where " + dbcursor = db.rawQuery("SELECT * FROM " + CommonString.TABLE_INSERT_T2P_COMPLIANCE + " where " +
CommonString.KEY_STORE_ID + "='" + store_id + "' AND " + CommonString.KEY_STORE_ID + "='" + store_id + "' AND " +
CommonString.KEY_CATEGORY_ID + "='" + category_id + "'", null); CommonString.KEY_CATEGORY_ID + "='" + category_id + "'", null);
@@ -2683,6 +2683,36 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
Log.d("Exception ", " MAPPING_PLANOGRAM " + ex.toString()); Log.d("Exception ", " MAPPING_PLANOGRAM " + ex.toString());
} }
} }
public ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> getMappingPlanogramData(String category_id) {
ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> list = new ArrayList<>();
Cursor dbcursor = null;
try {
dbcursor = db.rawQuery("SELECT * FROM MAPPING_PLANOGRAM", null);
if (dbcursor != null) {
dbcursor.moveToFirst();
while (!dbcursor.isAfterLast()) {
MAPPING_PLANOGRAM_DataGetterSetter mp = new MAPPING_PLANOGRAM_DataGetterSetter();
mp.setKEYACCOUNT_ID(dbcursor.getString(dbcursor.getColumnIndexOrThrow("KEYACCOUNT_ID")));
mp.setSTORETYPE_ID(dbcursor.getString(dbcursor.getColumnIndexOrThrow("STORETYPE_ID")));
mp.setCLASS_ID(dbcursor.getString(dbcursor.getColumnIndexOrThrow("CLASS_ID")));
mp.setPLANOGRAM_IMAGE(dbcursor.getString(dbcursor.getColumnIndexOrThrow("PLANOGRAM_IMAGE")));
mp.setIMAGE_PATH(dbcursor.getString(dbcursor.getColumnIndexOrThrow("IMAGE_PATH")));
list.add(mp);
dbcursor.moveToNext();
}
dbcursor.close();
return list;
}
} catch (Exception e) {
return list;
}
return list;
}
//Gagan end new code 2 //Gagan end new code 2
} }
@@ -10,6 +10,7 @@ import android.content.res.Resources;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.view.Window; import android.view.Window;
@@ -24,11 +25,16 @@ import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserFactory;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader; import java.io.StringReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL;
import java.text.DecimalFormat;
import java.util.Locale; import java.util.Locale;
import cpm.com.gskmtorange.Database.GSKOrangeDB; import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.R; import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonString; import cpm.com.gskmtorange.constant.CommonString;
@@ -669,6 +675,62 @@ public class DownloadActivity extends AppCompatActivity {
publishProgress(data); publishProgress(data);
//MAPPING_PLANOGRAM Image save into folder
if (mapping_planogram_masterGetterSetter != null) {
for (int i = 0; i < mapping_planogram_masterGetterSetter.getIMAGE_PATH().size(); i++) {
//publishing image download
data.value = data.value + 1;
if (data.value < 100) {
publishProgress(data);
}
String image_name = mapping_planogram_masterGetterSetter.getPLANOGRAM_IMAGE().get(i);
String path = mapping_planogram_masterGetterSetter.getIMAGE_PATH().get(i);
if (!image_name.equalsIgnoreCase("NA") && !image_name.equalsIgnoreCase("")) {
URL url = new URL(path + "/" + image_name);
HttpURLConnection c = (HttpURLConnection) url.openConnection();
c.setRequestMethod("GET");
c.getResponseCode();
c.connect();
if (c.getResponseCode() == 200) {
int length = c.getContentLength();
String size = new DecimalFormat("##.##").format((double) length / 1024) + " KB";
//String PATH = Environment.getExternalStorageDirectory() + "/Download/GT_GSK_Images/";
String PATH = CommonString.FILE_PATH;
File file = new File(PATH);
if (!file.isDirectory()) {
file.mkdir();
}
// Environment.getExternalStorageDirectory() + "/GT_GSK_Images/" + _pathforcheck1;
if (!new File(PATH + image_name).exists() && !size.equalsIgnoreCase("0 KB")) {
File outputFile = new File(file, image_name);
FileOutputStream fos = new FileOutputStream(outputFile);
InputStream is1 = c.getInputStream();
int bytes = 0;
byte[] buffer = new byte[1024];
int len1 = 0;
while ((len1 = is1.read(buffer)) != -1) {
bytes = (bytes + len1);
// data.value = (int) ((double) (((double)
// bytes) / length) * 100);
fos.write(buffer, 0, len1);
}
fos.close();
is1.close();
}
}
}
}
}
//Gagan end code //Gagan end code
@@ -143,7 +143,7 @@ public class CategoryListActivity extends AppCompatActivity {
@Override @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present. // Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu); //getMenuInflater().inflate(R.menu.main, menu);
return true; return true;
} }
@@ -174,7 +174,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
@Override @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present. // Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu); //getMenuInflater().inflate(R.menu.main, menu);
return true; return true;
} }
@@ -106,18 +106,18 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
//if (validateData(listDataHeader, listDataChild)) { //if (validateData(listDataHeader, listDataChild)) {
AlertDialog.Builder builder = new AlertDialog.Builder(MSL_AvailabilityActivity.this); AlertDialog.Builder builder = new AlertDialog.Builder(MSL_AvailabilityActivity.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.checkMsl_AvailabilityData(store_id, categoryId)) { if (db.checkMsl_AvailabilityData(store_id, categoryId)) {
db.updateMSL_Availability(store_id, categoryId, hashMapListHeaderData, hashMapListChildData); db.updateMSL_Availability(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.InsertMSL_Availability(store_id, categoryId, hashMapListHeaderData, hashMapListChildData); db.InsertMSL_Availability(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();
@@ -125,7 +125,7 @@ public class MSL_AvailabilityActivity 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();
} }
@@ -260,7 +260,23 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
int id = item.getItemId(); int id = item.getItemId();
if (id == android.R.id.home) { if (id == android.R.id.home) {
finish(); android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(MSL_AvailabilityActivity.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();
}
})
.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();
} }
//noinspection SimplifiableIfStatement //noinspection SimplifiableIfStatement
@@ -271,6 +287,28 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
@Override
public void onBackPressed() {
//super.onBackPressed();
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(MSL_AvailabilityActivity.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();
}
})
.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();
}
public class ExpandableListAdapter extends BaseExpandableListAdapter { public class ExpandableListAdapter extends BaseExpandableListAdapter {
private Context _context; private Context _context;
private List<MSL_AvailabilityGetterSetter> _listDataHeader; private List<MSL_AvailabilityGetterSetter> _listDataHeader;
@@ -312,6 +350,7 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
ImageView img_camera = (ImageView) convertView.findViewById(R.id.img_camera); ImageView img_camera = (ImageView) convertView.findViewById(R.id.img_camera);
txt_categoryHeader.setTypeface(null, Typeface.BOLD); txt_categoryHeader.setTypeface(null, Typeface.BOLD);
txt_categoryHeader.setTextColor(getResources().getColor(R.color.colorPrimary));
txt_categoryHeader.setText(headerTitle.getSub_category() + "-" + headerTitle.getBrand()); txt_categoryHeader.setText(headerTitle.getSub_category() + "-" + headerTitle.getBrand());
/*img_camera.setOnClickListener(new View.OnClickListener() { /*img_camera.setOnClickListener(new View.OnClickListener() {
@@ -393,6 +432,7 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
holder = (ViewHolder) convertView.getTag(); holder = (ViewHolder) convertView.getTag();
} }
holder.txt_skuName.setTextColor(getResources().getColor(R.color.colorPrimary));
holder.txt_skuName.setText(childData.getSku()); holder.txt_skuName.setText(childData.getSku());
holder.txt_mbq.setText(childData.getMbq()); holder.txt_mbq.setText(childData.getMbq());
@@ -45,9 +45,8 @@ public class PromoComplianceActivity extends AppCompatActivity {
GSKOrangeDB db; GSKOrangeDB db;
String categoryName, categoryId; String categoryName, categoryId;
private SharedPreferences preferences;
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id; String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id;
private SharedPreferences preferences;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@@ -418,7 +417,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
@Override @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present. // Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu); //getMenuInflater().inflate(R.menu.main, menu);
return true; return true;
} }
@@ -430,7 +429,23 @@ public class PromoComplianceActivity extends AppCompatActivity {
int id = item.getItemId(); int id = item.getItemId();
if (id == android.R.id.home) { if (id == android.R.id.home) {
finish(); android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(PromoComplianceActivity.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();
}
})
.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();
} }
//noinspection SimplifiableIfStatement //noinspection SimplifiableIfStatement
@@ -442,6 +457,27 @@ public class PromoComplianceActivity extends AppCompatActivity {
} }
@Override @Override
public void onBackPressed() {
//super.onBackPressed();
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(PromoComplianceActivity.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();
}
})
.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();
}
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, "")); updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
@@ -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;
@@ -26,6 +27,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;
@@ -60,6 +63,7 @@ import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.R; import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonString; import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity; import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_DataGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
@@ -79,6 +83,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
@@ -132,18 +138,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();
} }
@@ -151,7 +157,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();
} }
@@ -160,9 +166,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();
} }
@@ -218,6 +225,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);
} }
}); });
@@ -231,6 +240,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);
} }
}); });
@@ -293,10 +304,45 @@ 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();
//Camera allow enable //Company_id
if (camera_allow.equalsIgnoreCase("1")) { if (listDataChild.get(listDataHeader.get(i)).get(j).getCompany_id().equals("1")) {
//Camera allow enable
if (camera_allow.equalsIgnoreCase("1")) {
if (!imagePath.equals("") || !imagePath1.equals("")) { if (!imagePath.equals("") || !imagePath1.equals("")) {
if (!stock.equals("0")) {
if (stock.equals("") || faceup.equals("")) {
if (!checkHeaderArray.contains(i)) {
checkHeaderArray.add(i);
}
flag = false;
Error_Message = getResources().getString(R.string.fill_data);
break;
}
} else {
if (stock.equals("")) {
if (!checkHeaderArray.contains(i)) {
checkHeaderArray.add(i);
}
flag = false;
Error_Message = getResources().getString(R.string.fill_data);
break;
}
}
} else {
if (!checkHeaderArray.contains(i)) {
checkHeaderArray.add(i);
}
flag = false;
Error_Message = getResources().getString(R.string.click_image);
break;
}
} else {
//Camera allow disable
if (!stock.equals("0")) { if (!stock.equals("0")) {
if (stock.equals("") || faceup.equals("")) { if (stock.equals("") || faceup.equals("")) {
if (!checkHeaderArray.contains(i)) { if (!checkHeaderArray.contains(i)) {
@@ -318,40 +364,17 @@ public class Stock_FacingActivity extends AppCompatActivity {
break; break;
} }
} }
} else { }
} else {
if (faceup.equals("")) {
if (!checkHeaderArray.contains(i)) { if (!checkHeaderArray.contains(i)) {
checkHeaderArray.add(i); checkHeaderArray.add(i);
} }
flag = false; flag = false;
Error_Message = "Please click either 1 image"; Error_Message = "Please fill all the data";
break; break;
} }
} else {
//Camera allow disable
if (!stock.equals("0")) {
if (stock.equals("") || faceup.equals("")) {
if (!checkHeaderArray.contains(i)) {
checkHeaderArray.add(i);
}
flag = false;
Error_Message = "Please fill all the data";
break;
}
} else {
if (stock.equals("")) {
if (!checkHeaderArray.contains(i)) {
checkHeaderArray.add(i);
}
flag = false;
Error_Message = "Please fill all the data";
break;
}
}
} }
} }
@@ -369,16 +392,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);
@@ -387,8 +402,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")) {
@@ -410,21 +425,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);
@@ -434,8 +486,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")) {
@@ -455,7 +507,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();
} }
@@ -534,7 +630,24 @@ 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) {
finish(); 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();
}
})
.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
@@ -548,7 +661,9 @@ public class Stock_FacingActivity extends AppCompatActivity {
ImageView img_planogram = (ImageView) dialog.findViewById(R.id.img_planogram); ImageView img_planogram = (ImageView) dialog.findViewById(R.id.img_planogram);
String planogram_image = ""; ArrayList<MAPPING_PLANOGRAM_DataGetterSetter> mp = db.getMappingPlanogramData("");
String planogram_image = mp.get(0).getPLANOGRAM_IMAGE();
if (new File(str + planogram_image).exists()) { if (new File(str + planogram_image).exists()) {
Bitmap bmp = BitmapFactory.decodeFile(str + planogram_image); Bitmap bmp = BitmapFactory.decodeFile(str + planogram_image);
img_planogram.setImageBitmap(bmp); img_planogram.setImageBitmap(bmp);
@@ -579,6 +694,29 @@ public class Stock_FacingActivity extends AppCompatActivity {
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
@Override
public void onBackPressed() {
//super.onBackPressed();
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();
}
})
.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();
}
public class ExpandableListAdapter extends BaseExpandableListAdapter { public class ExpandableListAdapter extends BaseExpandableListAdapter {
private Context _context; private Context _context;
private List<Stock_FacingGetterSetter> _listDataHeader; private List<Stock_FacingGetterSetter> _listDataHeader;
@@ -628,8 +766,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
@@ -641,7 +787,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;
@@ -669,7 +816,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;
@@ -695,11 +843,29 @@ public class Stock_FacingActivity extends AppCompatActivity {
img_camera2.setBackgroundResource(R.mipmap.camera_grey); img_camera2.setBackgroundResource(R.mipmap.camera_grey);
} }
if (!checkflag) { if (headerTitle.getCompany_id().equals("1")) {
if (checkHeaderArray.contains(groupPosition)) { if (!checkflag) {
txt_stockFaceupHeader.setTextColor(getResources().getColor(android.R.color.holo_red_dark)); if (checkHeaderArray.contains(groupPosition)) {
} else { txt_stockFaceupHeader.setTextColor(getResources().getColor(android.R.color.holo_red_dark));
txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.black)); } else {
txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
/*if (headerTitle.getCompany_id().equals("1")) {
} else {
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));
//}
}
} }
} }
@@ -747,8 +913,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);
} }
@@ -785,6 +953,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() {
@@ -793,44 +998,49 @@ 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.getStock().equals("")) { if (childData.getCompany_id().equals("1")) {
if (!edFaceup.equals("")) { if (!childData.getStock().equals("")) {
if (Integer.parseInt(edFaceup) <= Integer.parseInt(childData.getStock())) { if (!edFaceup.equals("")) {
childData.setFacing(edFaceup); if (Integer.parseInt(edFaceup) <= Integer.parseInt(childData.getStock())) {
} else { childData.setFacing(edFaceup);
if (isDialogOpen) { } else {
isDialogOpen = !isDialogOpen; if (isDialogOpen) {
AlertDialog.Builder builder = new AlertDialog.Builder(Stock_FacingActivity.this); isDialogOpen = !isDialogOpen;
builder.setMessage("Faceup can not be greater than stock value") AlertDialog.Builder builder = new AlertDialog.Builder(Stock_FacingActivity.this);
.setCancelable(false) builder.setMessage("Faceup can not be greater than stock value")
.setPositiveButton("OK", new DialogInterface.OnClickListener() { .setCancelable(false)
public void onClick(DialogInterface dialog, int id) { .setPositiveButton("OK", new DialogInterface.OnClickListener() {
dialog.dismiss(); public void onClick(DialogInterface dialog, int id) {
isDialogOpen = !isDialogOpen; dialog.dismiss();
} isDialogOpen = !isDialogOpen;
}); }
AlertDialog alert = builder.create(); });
alert.show(); AlertDialog alert = builder.create();
alert.show();
}
} }
} else {
childData.setFacing("");
} }
} else { } else {
childData.setFacing(""); if (isDialogOpen) {
isDialogOpen = !isDialogOpen;
AlertDialog.Builder builder = new AlertDialog.Builder(Stock_FacingActivity.this);
builder.setMessage("First fill the stock value")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
isDialogOpen = !isDialogOpen;
}
});
AlertDialog alert = builder.create();
alert.show();
}
} }
} else { } else {
if (isDialogOpen) { childData.setFacing(edFaceup);
isDialogOpen = !isDialogOpen; childData.setStock("0");
AlertDialog.Builder builder = new AlertDialog.Builder(Stock_FacingActivity.this);
builder.setMessage("First fill the stock value")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
isDialogOpen = !isDialogOpen;
}
});
AlertDialog alert = builder.create();
alert.show();
}
} }
} }
}); });
@@ -840,24 +1050,39 @@ public class Stock_FacingActivity extends AppCompatActivity {
if (!checkflag) { if (!checkflag) {
boolean tempflag = false; boolean tempflag = false;
if (holder.ed_stock.getText().toString().equals("")) { if (childData.getCompany_id().equals("1")) {
holder.ed_stock.setBackgroundColor(getResources().getColor(R.color.white)); if (holder.ed_stock.getText().toString().equals("")) {
holder.ed_stock.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark)); holder.ed_stock.setBackgroundColor(getResources().getColor(R.color.white));
holder.ed_stock.setHint("Empty"); holder.ed_stock.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
tempflag = true; holder.ed_stock.setHint("Empty");
} tempflag = true;
}
if (holder.ed_facing.getText().toString().equals("")) { if (holder.ed_facing.getText().toString().equals("")) {
holder.ed_facing.setBackgroundColor(getResources().getColor(R.color.white)); holder.ed_facing.setBackgroundColor(getResources().getColor(R.color.white));
holder.ed_facing.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark)); holder.ed_facing.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
holder.ed_facing.setHint("Empty"); holder.ed_facing.setHint("Empty");
tempflag = true; tempflag = true;
} }
if (tempflag) { if (tempflag) {
holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark)); holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
} else {
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
}
} else { } else {
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white)); 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));
}
} }
} }
@@ -0,0 +1,51 @@
package cpm.com.gskmtorange.xmlGetterSetter;
import java.util.ArrayList;
/**
* Created by gagang on 12-01-2017.
*/
public class MAPPING_PLANOGRAM_DataGetterSetter {
String KEYACCOUNT_ID, STORETYPE_ID, CLASS_ID, PLANOGRAM_IMAGE, IMAGE_PATH;
public String getKEYACCOUNT_ID() {
return KEYACCOUNT_ID;
}
public void setKEYACCOUNT_ID(String KEYACCOUNT_ID) {
this.KEYACCOUNT_ID = KEYACCOUNT_ID;
}
public String getSTORETYPE_ID() {
return STORETYPE_ID;
}
public void setSTORETYPE_ID(String STORETYPE_ID) {
this.STORETYPE_ID = STORETYPE_ID;
}
public String getCLASS_ID() {
return CLASS_ID;
}
public void setCLASS_ID(String CLASS_ID) {
this.CLASS_ID = CLASS_ID;
}
public String getPLANOGRAM_IMAGE() {
return PLANOGRAM_IMAGE;
}
public void setPLANOGRAM_IMAGE(String PLANOGRAM_IMAGE) {
this.PLANOGRAM_IMAGE = PLANOGRAM_IMAGE;
}
public String getIMAGE_PATH() {
return IMAGE_PATH;
}
public void setIMAGE_PATH(String IMAGE_PATH) {
this.IMAGE_PATH = IMAGE_PATH;
}
}
@@ -160,9 +160,9 @@
android:id="@+id/toggle_add_InStock" android:id="@+id/toggle_add_InStock"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/toggle_selector_background"
android:textOff="@string/no" android:textOff="@string/no"
android:textOn="@string/yes" android:textOn="@string/yes"/>
android:background="@drawable/toggle_selector_background"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
@@ -199,9 +199,9 @@
android:id="@+id/toggle_add_promoAnnouncer" android:id="@+id/toggle_add_promoAnnouncer"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/toggle_selector_background"
android:textOff="@string/no" android:textOff="@string/no"
android:textOn="@string/yes" android:textOn="@string/yes" />
android:background="@drawable/toggle_selector_background" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
@@ -238,9 +238,9 @@
android:id="@+id/toggle_add_runningPos" android:id="@+id/toggle_add_runningPos"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/toggle_selector_background"
android:textOff="@string/no" android:textOff="@string/no"
android:textOn="@string/yes" android:textOn="@string/yes" />
android:background="@drawable/toggle_selector_background" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
@@ -258,7 +258,7 @@
android:id="@+id/btn_add" android:id="@+id/btn_add"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="right" android:layout_gravity="center"
android:background="@color/colorPrimaryDark" android:background="@color/colorPrimaryDark"
android:text="@string/promo_compliance_add" android:text="@string/promo_compliance_add"
android:textColor="@color/white" /> android:textColor="@color/white" />
@@ -77,6 +77,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:hint="@string/stock_facing_stock"
android:inputType="number" android:inputType="number"
android:maxLength="7" android:maxLength="7"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
@@ -105,6 +106,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:hint="@string/stock_facing_faceup"
android:inputType="number" android:inputType="number"
android:maxLength="7" android:maxLength="7"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
+1 -1
View File
@@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<item <item
android:id="@+id/action_planogram" android:id="@+id/action_planogram"
android:icon="@mipmap/star" android:icon="@mipmap/ref_images_white"
android:orderInCategory="100" android:orderInCategory="100"
android:title="planogram" android:title="planogram"
app:showAsAction="always" /> app:showAsAction="always" />
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -160,6 +160,16 @@
<!--Gagan start new code 2--> <!--Gagan start new code 2-->
<string name="stock_facing_planogram_dialog_title">Planogram</string> <string name="stock_facing_planogram_dialog_title">Planogram</string>
<string name="ok">OK</string>
<string name="check_save_message">Are you sure you want to save</string>
<string name="save_message">Data has been saved</string>
<string name="update_message">Data has been updated</string>
<string name="empty_field">Fill the value </string>
<string name="fill_data">Please fill all the data</string>
<string name="dialog_title">Parinaam</string>
<!--Gagan end new code 2--> <!--Gagan end new code 2-->
</resources> </resources>