Merge branch 'master' into NewchangesAC

This commit is contained in:
YadavendraSinghYaduvanshi
2017-01-11 13:40:22 +05:30
committed by GitHub
19 changed files with 639 additions and 194 deletions
@@ -82,6 +82,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
db.execSQL(TableBean.getMappingAdditionalPromotion());
db.execSQL(TableBean.getMappingPromotion());
db.execSQL(CommonString.CREATE_TABLE_INSERT_MSL_AVAILABILITY);
db.execSQL(CommonString.CREATE_TABLE_INSERT_STOCK_ADDITIONAL_VISIBILITY);
db.execSQL(CommonString.CREATE_TABLE_INSERT_STOCK_FACING_HEADER);
db.execSQL(CommonString.CREATE_TABLE_INSERT_STOCK_FACING_CHILD);
db.execSQL(CommonString.CREATE_TABLE_STOCK_DIALOG);
@@ -141,7 +142,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
values.put("CAMERA_ALLOW", data.getCAMERA_ALLOW().get(i));
values.put("GEO_TAG", data.getGEO_TAG().get(i));
values.put("CHANNEL_ID", data.getCHANNEL_ID().get(i));
db.insert("JOURNEY_PLAN", null, values);
@@ -2014,22 +2015,13 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
}
public ArrayList<AdditionalDialogGetterSetter> getDialogStock(String store_id) {
public ArrayList<AdditionalDialogGetterSetter> getDialogStock(String keyid) {
Cursor cursordata = null;
ArrayList<AdditionalDialogGetterSetter> productData = new ArrayList<AdditionalDialogGetterSetter>();
try {
cursordata = db.rawQuery("SELECT * FROM STOCK_DIALOG WHERE STORE_ID = '"+store_id + "'", null);
/* cursordata = db.rawQuery("SELECT * from "
+ CommonString.TABLE_INSERT_STOCK_TOT + " WHERE "
+ CommonString.KEY_STORE_ID + "='" + store_id + "' AND "
+ CommonString.KEY_CATEGORY_ID + "='" + cate_id + "' AND "
+ CommonString.KEY_PROCESS_ID + " ='" + process_id + "' AND "
+ CommonString.KEY_DISPLAY_ID + "= '" + display_id + "' AND "
+ CommonString.UNIQUE_KEY_ID + "= '" + unique_id + "'",
null);*/
cursordata = db.rawQuery("SELECT * FROM STOCK_DIALOG WHERE COMMON_ID = '"+keyid + "'", null);
if (cursordata != null) {
cursordata.moveToFirst();
@@ -2045,12 +2037,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
sb.setBrand(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_BRAND)));
/*sb.setCategory_id(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_CATEGORY_ID)));
sb.setDisplay_id(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_DISPLAY_ID)));*/
sb.setQuantity(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_QUANTITY)));
@@ -2061,12 +2047,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
sb.setSku_name(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_SKUNAME)));
/* sb.setProcess_id(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_PROCESS_ID)));
sb.setUnique_id(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.UNIQUE_KEY_ID)));*/
productData.add(sb);
cursordata.moveToNext();
@@ -2094,7 +2074,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
public void deleteStockEntry(String id) {
try {
db.delete(CommonString.TABLE_INSERT_STOCK_ADDITIONAL_DATA, "Id" + "='" + id + "'", null);
db.delete(CommonString.TABLE_INSERT_STOCK_ADDITIONAL, "KEY_ID" + "='" + id + "'", null);
} catch (Exception e) {
System.out.println("" + e);
}
@@ -2186,20 +2166,44 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
}
public void InsertAdditionalData(AddittionalGetterSetter data) {
public void InsertAdditionalData(AddittionalGetterSetter data,ArrayList<AdditionalDialogGetterSetter> dialog) {
ContentValues values = new ContentValues();
ContentValues values1 = new ContentValues();
try {
values.put(CommonString.KEY_STORE_ID, data.getStore_id());
values.put(CommonString.KEY_BRAND, data.getBrand());
values.put(CommonString.KEY_BRAND_ID, data.getBrand_id());
values.put(CommonString.KEY_IMAGE, data.getImage());
values.put(CommonString.KEY_SKU_ID, data.getSku_id());
values.put(CommonString.KEY_SKUNAME, data.getSku());
values.put("Store_Id", data.getStore_id());
values.put("brand_name", data.getBrand());
values.put("brand_id", data.getBrand_id());
values.put("image_url", data.getImage());
values.put("sku_id", data.getSku_id());
values.put("sku_name", data.getSku());
values.put("toggle_value", data.getBtn_toogle());
long key_id = db.insert(CommonString.TABLE_INSERT_STOCK_ADDITIONAL, null, values);
for(int i=0;i<dialog.size();i++)
{
values1.put(CommonString.KEY_Common_ID, key_id);
values1.put(CommonString.KEY_STORE_ID, dialog.get(i).getStore_id());
values1.put(CommonString.KEY_BRAND, dialog.get(i).getBrand());
values1.put(CommonString.KEY_BRAND_ID, dialog.get(i).getBrand_id());
values1.put(CommonString.KEY_QUANTITY, dialog.get(i).getQuantity());
values1.put(CommonString.KEY_SKU_ID, dialog.get(i).getSku_id());
values1.put(CommonString.KEY_SKUNAME, dialog.get(i).getSku_name());
db.insert(CommonString.TABLE_INSERT_STOCK_DIALOG, null, values1);
}
db.insert(CommonString.TABLE_INSERT_STOCK_ADDITIONAL_DATA, null, values);
} catch (Exception ex) {
@@ -2215,7 +2219,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
try {
cursordata = db.rawQuery("SELECT * FROM ADDITIONAL_STOCK_DATA WHERE STORE_ID = '"+store_id + "'", null);
cursordata = db.rawQuery("SELECT * FROM Stock_Additional_visibility WHERE Store_Id = '"+store_id + "'", null);
if (cursordata != null) {
@@ -2225,27 +2229,27 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
sb.setKey_id(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_ID)));
.getColumnIndexOrThrow("KEY_ID")));
sb.setStore_id(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_STORE_ID)));
.getColumnIndexOrThrow("Store_Id")));
sb.setBrand_id(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_BRAND_ID)));
.getColumnIndexOrThrow("brand_id")));
sb.setBrand(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_BRAND)));
.getColumnIndexOrThrow("brand_name")));
sb.setImage(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_IMAGE)));
.getColumnIndexOrThrow("image_url")));
sb.setSku_id(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_SKU_ID)));
.getColumnIndexOrThrow("sku_id")));
sb.setSku(cursordata.getString(cursordata
.getColumnIndexOrThrow(CommonString.KEY_SKUNAME)));
.getColumnIndexOrThrow("sku_name")));
productData.add(sb);
cursordata.moveToNext();
@@ -66,4 +66,15 @@ public class AddittionalGetterSetter {
String key_id;
public String getBtn_toogle() {
return btn_toogle;
}
public void setBtn_toogle(String btn_toogle) {
this.btn_toogle = btn_toogle;
}
String btn_toogle;
}
@@ -26,6 +26,8 @@ public class CommonString {
public static final String KEY_LOGIN_DATA = "LOGIN_DATA";
public static final String KEY_CULTURE_ID = "CULTURE_ID";
public static final String KEY_STORE_ID = "STORE_ID";
public static final String KEY_Common_ID = "COMMON_ID";
public static final String KEY_STORE_NAME = "STORE_NAME";
public static final String KEY_VISIT_DATE = "VISIT_DATE";
public static final String KEY_CAMERA_ALLOW = "CAMERA_ALLOW";
@@ -47,6 +49,7 @@ public class CommonString {
public static final String KEY_REASON = "REASON";
public static final String KEY_COVERAGE_REMARK = "REMARK";
public static final String KEY_IMAGE = "IMAGE";
public static final String KEY_IMAGE_URL = "IMAGE_URL";
public static final String KEY_ID = "Id";
public static final String KEY_MERCHANDISER_ID = "MERCHANDISER_ID";
@@ -62,7 +65,7 @@ public class CommonString {
public static final String KEY_JOURNEY_PLAN = "JOURNEY_PLAN";
public static final String TABLE_INSERT_STOCK_DIALOG = "STOCK_DIALOG";
public static final String TABLE_INSERT_STOCK_ADDITIONAL_DATA = "ADDITIONAL_STOCK_DATA";
public static final String KEY_P = "P";
public static final String KEY_D = "D";
@@ -289,7 +292,7 @@ public class CommonString {
+ " INTEGER PRIMARY KEY AUTOINCREMENT," + KEY_STORE_ID + " VARCHAR,"
+ KEY_BRAND_ID + " VARCHAR," + KEY_BRAND + " VARCHAR,"
+ KEY_DISPLAY_ID +" VARCHAR,"
+ KEY_SKU_ID + " VARCHAR," + KEY_QUANTITY + " VARCHAR," + UNIQUE_KEY_ID + " VARCHAR,"
+ KEY_SKU_ID + " VARCHAR," + KEY_QUANTITY + " VARCHAR," + KEY_Common_ID + " VARCHAR,"
+ KEY_CATEGORY_ID + " VARCHAR,"
+ KEY_SKUNAME + " VARCHAR,"
+ KEY_PROCESS_ID + " VARCHAR)";
@@ -303,6 +306,41 @@ public class CommonString {
+ KEY_SKUNAME + " VARCHAR,"
+ KEY_IMAGE + " VARCHAR)";
public static final String TABLE_INSERT_STOCK_ADDITIONAL = "Stock_Additional_visibility";
public static final String CREATE_TABLE_INSERT_STOCK_ADDITIONAL_VISIBILITY = "CREATE TABLE IF NOT EXISTS "
+ TABLE_INSERT_STOCK_ADDITIONAL
+ "("
+ "KEY_ID"
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
+ "Store_Id"
+ " VARCHAR,"
+ "brand_name"
+ " VARCHAR,"
+ "brand_id"
+ " VARCHAR,"
+ "image_url"
+ " VARCHAR,"
+ "sku_id"
+ " VARCHAR,"
+ "sku_name"
+ " VARCHAR,"
+ "toggle_value"
+ " VARCHAR,"
+ "IMAGE2"
+ " VARCHAR"
+ ")";
public static final String TABLE_INSERT_ADDITIONAL_PROMO_COMPLIANCE = "Additional_Promo_Compliance_Data";
public static final String CREATE_TABLE_INSERT_ADDITIONAL_PROMO_COMPLIANCE = "CREATE TABLE IF NOT EXISTS "
@@ -379,4 +417,14 @@ public class CommonString {
//Gagan Code End
public static final String TABLE_INSERT_STOCK_ADDITIONAL_DATA = "ADDITIONAL_STOCK_DATA";
public static final String CREATE_TABLE_STOCK_ADDITIONAL_STOCK_DATA = "CREATE TABLE "
+ TABLE_INSERT_STOCK_ADDITIONAL_DATA + " (" + KEY_ID
+ " INTEGER PRIMARY KEY AUTOINCREMENT," + KEY_STORE_ID + " VARCHAR,"
+ KEY_BRAND_ID + " VARCHAR," + KEY_BRAND + " VARCHAR,"
+ KEY_SKU_ID + " VARCHAR,"
+ KEY_SKUNAME + " VARCHAR,"
+ KEY_IMAGE + " VARCHAR)";
}
@@ -11,12 +11,14 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.provider.MediaStore;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
@@ -33,6 +35,7 @@ import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.ToggleButton;
@@ -41,6 +44,7 @@ import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import cpm.com.gskmtorange.Database.GSKOrangeDB;
@@ -60,6 +64,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
ArrayList<AdditionalDialogGetterSetter> list = new ArrayList<AdditionalDialogGetterSetter>();
ArrayList<AddittionalGetterSetter> listdata = new ArrayList<AddittionalGetterSetter>();
ArrayList<AdditionalDialogGetterSetter> uploadlist = new ArrayList<AdditionalDialogGetterSetter>();
ArrayList<AdditionalDialogGetterSetter> defdata = new ArrayList<AdditionalDialogGetterSetter>();
Spinner spinner_brand, spinner_sku;
Spinner spinner_brand_list, spinner_sku_list;
@@ -79,15 +85,20 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
ArrayList<SkuGetterSetter> empty_list = new ArrayList<>();
String _pathforcheck,_path,str;
String _pathforcheck, _path, str, msg;
private SharedPreferences preferences;
String store_id,date,intime,img_str;
String store_id, date, intime, img_str, togglevalue = "1";
ImageView img_cam, img_clicked;
Button btn_add;
Button btn_add, btn_close;
EditText Edt_txt;
MyAdaptorStock adapterData;
ListView listviewlay;
String errormsg;
MyAdaptorAdditionalStock adapteradditional;
AddittionalGetterSetter adGt;
LinearLayout brandlayout, diaplylayout, cameralayout;
//RelativeLayout skulayout;
////String brand_id,SKU_ID;
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
@@ -118,7 +129,16 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
btnsku = (Button) findViewById(R.id.btn_sku);
btnaddlayout = (Button) findViewById(R.id.btadd);
listviewlay = (ListView) findViewById(R.id.listviewlv);
brandlayout = (LinearLayout) findViewById(R.id.tv_brandlayout);
diaplylayout = (LinearLayout) findViewById(R.id.tv_displaylayout);
cameralayout = (LinearLayout) findViewById(R.id.tv_cameralayout);
//skulayout = (RelativeLayout) findViewById(R.id.tv_skulayout);
btntoggle.setChecked(true);
str = CommonString.FILE_PATH;
///band List
brand_list = db.getBrandMasterData(store_id);
@@ -175,57 +195,125 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
}
});
listdata = db.getAdditionalStock(store_id);
for (int k = 0; k < listdata.size(); k++) {
String KeyID = listdata.get(k).getKey_id();
uploadlist = db.getDialogStock(KeyID);
}
if (listdata.size() > 0) {
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
listviewlay.setAdapter(adapteradditional);
listviewlay.invalidateViews();
}
btnaddlayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AddittionalGetterSetter adGt=new AddittionalGetterSetter();
adGt = new AddittionalGetterSetter();
adGt.setBrand(brand_list_name);
adGt.setBrand_id(brand_list_id);
adGt.setImage(img_str);
adGt.setSku(sku_list_name);
adGt.setSku_id(sku_list_id);
adGt.setStore_id(store_id);
adGt.setBtn_toogle(togglevalue);
db.InsertAdditionalData(adGt);
if (validateData(adGt, defdata)) {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
AdditionalVisibility.this);
// set title
alertDialogBuilder.setTitle("Do You Want To Save");
// set dialog message
alertDialogBuilder
.setMessage("")
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
db.InsertAdditionalData(adGt, defdata);
spinner_brand_list.setSelection(0);
spinner_sku_list.setSelection(0);
img_str = "";
brand_list_name = "";
brand_list_id = "";
sku_list_name = "";
sku_list_id = "";
defdata.clear();
btntoggle.setChecked(true);
togglevalue = "1";
brandlayout.setVisibility(View.VISIBLE);
diaplylayout.setVisibility(View.VISIBLE);
cameralayout.setVisibility(View.VISIBLE);
btnsku.setVisibility(View.VISIBLE);
listdata = db.getAdditionalStock(store_id);
if(listdata.size()>0)
{
if (listdata.size() > 0) {
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
listviewlay.setAdapter(adapteradditional);
listviewlay.invalidateViews();
}
else
{
} else {
}
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// if this button is clicked, just close
// the dialog box and do nothing
dialog.cancel();
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
} else {
Snackbar.make(view, errormsg, Snackbar.LENGTH_LONG).setAction("Action", null).show();
}
}
});
btntoggle.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (btntoggle.isChecked()) {
togglevalue = "1";
brandlayout.setVisibility(View.VISIBLE);
diaplylayout.setVisibility(View.VISIBLE);
cameralayout.setVisibility(View.VISIBLE);
btnsku.setVisibility(View.VISIBLE);
} else {
togglevalue = "0";
brandlayout.setVisibility(View.INVISIBLE);
diaplylayout.setVisibility(View.INVISIBLE);
cameralayout.setVisibility(View.INVISIBLE);
btnsku.setVisibility(View.INVISIBLE);
}
}
});
@@ -236,9 +324,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
+ "Image" + date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
_path = CommonString.FILE_PATH + _pathforcheck;
intime = getCurrentTime();
startCameraActivity();
}
@@ -254,6 +340,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
});
}
public String getCurrentTime() {
Calendar m_cal = Calendar.getInstance();
@@ -405,9 +492,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
}
public class CustomSkuMasterAdpter extends ArrayAdapter<String> {
private Activity activity;
@@ -471,15 +555,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
}
protected void startCameraActivity() {
try {
@@ -522,6 +597,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
e.printStackTrace();
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
@@ -535,10 +611,10 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
if (_pathforcheck != null && !_pathforcheck.equals("")) {
if (new File(str + _pathforcheck).exists()) {
Bitmap bmp = BitmapFactory.decodeFile(str + _pathforcheck);
img_cam.setImageBitmap(bmp);
img_clicked.setVisibility(View.GONE);
img_cam.setVisibility(View.VISIBLE);
// Bitmap bmp = BitmapFactory.decodeFile(str + _pathforcheck);
// img_cam.setImageBitmap(bmp);
// img_clicked.setVisibility(View.GONE);
// img_cam.setVisibility(View.VISIBLE);
img_str = _pathforcheck;
_pathforcheck = "";
}
@@ -560,34 +636,31 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
final Dialog dialog = new Dialog(AdditionalVisibility.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
dialog.setContentView(R.layout.t2p_sku_dialog_layout);
dialog.setContentView(R.layout.additionalvisibilitydialoglayout);
//pb = (ProgressBar) dialog.findViewById(R.id.progressBar1);
//dialog.setCancelable(false);
spinner_brand = (Spinner) dialog.findViewById(R.id.spinner_brand);
spinner_sku = (Spinner) dialog.findViewById(R.id.spinner_sku);
btn_add = (Button) dialog.findViewById(R.id.btn_add);
btn_close = (Button) dialog.findViewById(R.id.btn_cancel);
Edt_txt = (EditText) dialog.findViewById(R.id.et_stock);
listview = (ListView) dialog.findViewById(R.id.lv);
linearlay = (LinearLayout) dialog.findViewById(R.id.list_layout);
//list = db.getDialogStock(store_id);
list = db.getDialogStock(store_id);
if(list.size()>0)
{
if (defdata.size() > 0) {
linearlay.setVisibility(View.VISIBLE);
adapterData = new MyAdaptorStock(AdditionalVisibility.this,list);
adapterData = new MyAdaptorStock(AdditionalVisibility.this, defdata);
listview.setAdapter(adapterData);
listview.invalidateViews();
}
else{
} else {
}
spinner_sku.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
@@ -607,9 +680,13 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
}
});
btn_close.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.cancel();
}
});
btn_add.setOnClickListener(new View.OnClickListener() {
@@ -630,20 +707,28 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
ab.setQuantity(Edt_txt.getText().toString());
// ab.setCategory_id(category_id);
db.InsertStockDialog(ab);
if (validateDialogData(ab)) {
defdata.add(ab);
// db.InsertStockDialog(ab);
spinner_brand.setSelection(0);
spinner_sku.setSelection(0);
Edt_txt.setText("");
list = db.getDialogStock(store_id);
// list = db.getDialogStock(store_id);
linearlay.setVisibility(View.VISIBLE);
adapterData = new MyAdaptorStock(AdditionalVisibility.this,list);
adapterData = new MyAdaptorStock(AdditionalVisibility.this, defdata);
listview.setAdapter(adapterData);
listview.invalidateViews();
} else {
Snackbar.make(v, msg, Snackbar.LENGTH_LONG).setAction("Action", null).show();
}
// dialog.cancel();
}
@@ -712,8 +797,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
});
dialog.show();
}
@@ -799,7 +882,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
holder.qty_bought = (TextView) convertView.findViewById(R.id.qty_bought);
holder.delete = (Button) convertView.findViewById(R.id.delete_btn);
convertView.setTag(holder);
@@ -825,8 +907,9 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// db.deletedialogStockEntry(list.get(position1).getKEY_ID());
db.deletedialogStockEntry(list.get(position1).getKEY_ID());
defdata.remove(position1);
adapterData.notifyDataSetChanged();
@@ -834,9 +917,9 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
list.get(position1).getDisplay_id(),list.get(position1).getUnique_id());*/
list = db.getDialogStock(store_id);
//list = db.getDialogStock(store_id);
listview.setAdapter(new MyAdaptorStock(AdditionalVisibility.this, list));
listview.setAdapter(new MyAdaptorStock(AdditionalVisibility.this, defdata));
listview.invalidateViews();
}
@@ -859,7 +942,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
});
holder.brand.setText(list.get(position1).getBrand().toString());
holder.display.setText(list.get(position1).getSku_name().toString());
@@ -930,7 +1012,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
holder.qty_bought = (TextView) convertView.findViewById(R.id.qty_bought);
holder.delete = (Button) convertView.findViewById(R.id.delete_btn);
convertView.setTag(holder);
@@ -959,12 +1040,14 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
db.deleteStockEntry(listdata.get(position1).getKey_id());
adapterData.notifyDataSetChanged();
adapteradditional.notifyDataSetChanged();
listdata = db.getAdditionalStock(store_id);
listview.setAdapter(new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata));
listview.invalidateViews();
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
listviewlay.setAdapter(adapteradditional);
listviewlay.invalidateViews();
}
})
@@ -998,8 +1081,73 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
}
}
boolean validateData(AddittionalGetterSetter data, ArrayList<AdditionalDialogGetterSetter> dialog) {
boolean flag = true;
String brandid = data.getBrand_id();
String skuid = data.getSku_id();
String imageu = data.getImage();
String toggleid = data.getBtn_toogle();
if (toggleid.equalsIgnoreCase("0")) {
flag = true;
} else {
if (brandid.equalsIgnoreCase("") || skuid.equalsIgnoreCase("")) {
flag = false;
errormsg = "Please Select dropdown";
} else if (imageu == null || imageu.equalsIgnoreCase("")) {
flag = false;
errormsg = "Please Take a image";
} else if (dialog.size() == 0) {
errormsg = "Please fill sku data";
flag = false;
} else {
flag = true;
}
}
return flag;
}
boolean validateDialogData(AdditionalDialogGetterSetter data) {
boolean flag = true;
String brandid = data.getBrand_id();
String displayid = data.getSku_id();
String QTy = data.getQuantity();
if (brandid.equalsIgnoreCase("") || brandid == null) {
flag = false;
msg = "Please Select Dropdown";
} else if (displayid == null || displayid.equalsIgnoreCase("")) {
flag = false;
msg = "Please Select Dropdown";
} else if (QTy.equalsIgnoreCase("") || QTy == null) {
flag = false;
msg = "Please enter Quantity";
} else {
flag = true;
}
return flag;
}
}
@@ -119,12 +119,35 @@ public class CategoryListActivity extends AppCompatActivity {
//holder.categoryIcon.setImageResource(R.drawable.category);
if (categoryData.getCategory().equalsIgnoreCase("Oral Health")) {
if (db.checkMsl_AvailabilityData(store_id, categoryData.getCategory_id())
&& db.checkStockAndFacingData(store_id, categoryData.getCategory_id())
&& db.checkPromoComplianceData(store_id, categoryData.getCategory_id())) {
holder.categoryIcon.setImageResource(R.drawable.ohc_done);
} else {
holder.categoryIcon.setImageResource(R.drawable.ohc);
}
} else if (categoryData.getCategory().equalsIgnoreCase("Wellness")) {
if (db.checkMsl_AvailabilityData(store_id, categoryData.getCategory_id())
&& db.checkStockAndFacingData(store_id, categoryData.getCategory_id())
&& db.checkPromoComplianceData(store_id, categoryData.getCategory_id())) {
holder.categoryIcon.setImageResource(R.drawable.pdr_done);
} else {
holder.categoryIcon.setImageResource(R.drawable.pdr);
}
} else if (categoryData.getCategory().equalsIgnoreCase("Nutritionals")) {
if (db.checkMsl_AvailabilityData(store_id, categoryData.getCategory_id())
&& db.checkStockAndFacingData(store_id, categoryData.getCategory_id())
&& db.checkPromoComplianceData(store_id, categoryData.getCategory_id())) {
holder.categoryIcon.setImageResource(R.drawable.hfd_done);
} else {
holder.categoryIcon.setImageResource(R.drawable.hfd);
}
}
holder.lay_menu.setOnClickListener(new View.OnClickListener() {
@@ -321,7 +321,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
//String date = new Date().toLocaleString().toString();
//String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
_pathforcheck = "Stock_Cam1_" + store_id + "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
_pathforcheck = "Stock_Cam1_" + store_id + "_" + headerTitle.getBrand_id() + "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
child_position = groupPosition;
path = str + _pathforcheck;
@@ -349,7 +349,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
//String date = new Date().toLocaleString().toString();
//String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
_pathforcheck = "Stock_Cam2_" + store_id + "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
_pathforcheck = "Stock_Cam2_" + store_id + "_" + headerTitle.getBrand_id() + "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
child_position = groupPosition;
path = str + _pathforcheck;
@@ -628,7 +628,7 @@ public class UploadActivity extends AppCompatActivity {
return CommonString.KEY_FAILURE;
}
} else {
//new File(Path + path).delete();
new File(Path + path).delete();
}
return result.toString();
@@ -24,6 +24,19 @@ public class JourneyPlanGetterSetter {
ArrayList<String> CLASS_ID = new ArrayList<String>();
ArrayList<String> CAMERA_ALLOW = new ArrayList<String>();
public ArrayList<String> getCHANNEL_ID() {
return CHANNEL_ID;
}
public void setCHANNEL_ID(String CHANNEL_ID) {
this.CHANNEL_ID.add(CHANNEL_ID);
}
ArrayList<String> CHANNEL_ID = new ArrayList<String>();
public ArrayList<String> getCHECKOUT_STATUS() {
return CHECKOUT_STATUS;
}
@@ -174,6 +174,11 @@ public class XMLHandlers {
jcpGetterSetter.setGEO_TAG(xpp.nextText());
}
if (xpp.getName().equals("CHANNEL_ID")) {
jcpGetterSetter.setCHANNEL_ID(xpp.nextText());
}
}
xpp.next();
}
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="false" android:drawable="@color/grey_background" />
<item android:state_checked="true" android:drawable="@color/green" />
</selector>
@@ -19,9 +19,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginTop="10dp"
android:layout_weight="10"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:weightSum="25">
<TextView
@@ -115,9 +115,9 @@
android:id="@+id/delete_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_weight="10"
android:background="@color/grey_background"
android:layout_marginLeft="30dp"
android:text="Delete" />
</LinearLayout>
@@ -0,0 +1,180 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="300dp"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dp"
card_view:cardBackgroundColor="@color/colorPrimary"
card_view:cardCornerRadius="20dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="15dp"
android:paddingBottom="20dp"
android:paddingLeft="5dp"
android:text="@string/sku"
android:textColor="@color/white"
android:textSize="@dimen/text_size_normal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey_background"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="3">
<TextView
android:id="@+id/tv_brand"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:text="@string/brand" />
<Spinner
android:id="@+id/spinner_brand"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey_background"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="3">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:text="@string/sku" />
<Spinner
android:id="@+id/spinner_sku"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey_background"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="3">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:text="@string/stock" />
<EditText
android:id="@+id/et_stock"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:inputType="number" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey_background"
android:padding="10dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="horizontal">
<Button
android:id="@+id/btn_add"
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="@string/add"/>
<Button
android:id="@+id/btn_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/cancel"/>
</LinearLayout>
</RelativeLayout>
<!-- <android.support.v7.widget.RecyclerView
android:background="@color/grey_background"
android:id="@+id/rec_sku"
android:layout_width="match_parent"
android:layout_height="wrap_content"></android.support.v7.widget.RecyclerView>-->
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dp"
card_view:cardBackgroundColor="@color/colorOrange"
card_view:cardCornerRadius="20dp"
>
<LinearLayout
android:id="@+id/list_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="95"
android:visibility="gone"
>
<ListView
android:id="@+id/lv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:cacheColorHint="#00000000"
android:choiceMode="singleChoice"
android:divider="#ff9933"
android:dividerHeight="2dp"
android:fastScrollEnabled="true"
android:smoothScrollbar="true"></ListView>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
@@ -10,16 +10,6 @@
<include layout="@layout/contentadditionalvisibility" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_menu_save"
app:backgroundTint="@color/colorPrimary"
android:visibility="gone"
/>
</android.support.design.widget.CoordinatorLayout>
@@ -158,7 +158,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="@string/no"
android:textOn="@string/yes" />
android:textOn="@string/yes"
android:background="@drawable/toggle_selector_background"/>
</LinearLayout>
</LinearLayout>
@@ -196,7 +197,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="@string/no"
android:textOn="@string/yes" />
android:textOn="@string/yes"
android:background="@drawable/toggle_selector_background" />
</LinearLayout>
</LinearLayout>
@@ -234,7 +236,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="@string/no"
android:textOn="@string/yes" />
android:textOn="@string/yes"
android:background="@drawable/toggle_selector_background" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
@@ -21,6 +21,8 @@
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="0dp"
@@ -60,14 +62,16 @@
android:id="@+id/btntoggle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".5" />
</LinearLayout>
<LinearLayout
android:id="@+id/tv_brandlayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="30"
android:layout_weight="40"
android:background="@color/grey_background"
android:orientation="horizontal"
android:padding="5dp"
@@ -86,15 +90,16 @@
<Spinner
android:id="@+id/spinner_Brand1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_height="50dp"
android:layout_weight="2" />
</LinearLayout>
<LinearLayout
android:id="@+id/tv_displaylayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="30"
android:layout_weight="40"
android:background="@color/grey_background"
android:orientation="horizontal"
android:padding="5dp"
@@ -112,14 +117,14 @@
<Spinner
android:id="@+id/spinner_SkuMaster"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_height="50dp"
android:layout_weight="2"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/tv_cameralayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="15"
@@ -175,22 +180,17 @@
</LinearLayout>
<RelativeLayout
<!--<RelativeLayout
android:id="@+id/tv_skulayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="8"
android:background="@color/grey_background"
android:padding="5dp">
<Button
android:id="@+id/btn_sku"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="@color/colorPrimary"
android:text="@string/sku" />
</RelativeLayout>
</RelativeLayout>-->
<RelativeLayout
android:layout_width="match_parent"
@@ -198,19 +198,28 @@
android:layout_weight="9"
android:background="@color/grey_background"
android:padding="5dp">
<Button
android:id="@+id/btn_sku"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="@color/colorPrimary"
android:text="@string/sku" />
<Button
android:id="@+id/btadd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_alignParentRight="true"
android:background="@color/colorPrimary"
android:text="@string/add" />
</RelativeLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="10dp"
@@ -23,7 +23,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="5dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:weightSum="5">
<LinearLayout
@@ -91,7 +92,8 @@
android:id="@+id/toggle_available"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
android:layout_gravity="center"
android:background="@drawable/toggle_selector_background" />
</LinearLayout>
</LinearLayout>
@@ -89,7 +89,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="@string/no"
android:textOn="@string/yes" />
android:textOn="@string/yes"
android:background="@drawable/toggle_selector_background" />
</LinearLayout>
</LinearLayout>
@@ -127,7 +128,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="@string/no"
android:textOn="@string/yes"/>
android:textOn="@string/yes"
android:background="@drawable/toggle_selector_background"/>
</LinearLayout>
</LinearLayout>
@@ -165,7 +167,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="@string/no"
android:textOn="@string/yes"/>
android:textOn="@string/yes"
android:background="@drawable/toggle_selector_background"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
@@ -23,7 +23,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="5dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:weightSum="5">
<LinearLayout
+1 -1
View File
@@ -7,7 +7,7 @@
<color name="white">#FFFFFF</color>
<color name="black">#000000</color>
<color name="grey_background">#EEEEEE</color>
<color name="green">#FF27A404</color>
<color name="blue">#2196F3</color>
<color name="colorOrange">#FFE0B2</color>