//PromoCompliance Default Toggle Changes

This commit is contained in:
Gagan290
2017-02-03 18:05:52 +05:30
parent 15b06c26c7
commit 734ddee591
11 changed files with 642 additions and 131 deletions
@@ -42,6 +42,8 @@ import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.Promo_Compliance_DataGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.Promo_Compliance_DataGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.STORE_PERFORMANCE_MasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.STORE_PERFORMANCE_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.ShelfMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
@@ -128,6 +130,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
db.execSQL(TableBean.getAdditionalDisplay()); db.execSQL(TableBean.getAdditionalDisplay());
db.execSQL(TableBean.getMappingSosTarget()); db.execSQL(TableBean.getMappingSosTarget());
db.execSQL(TableBean.getShelfMaster());
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
Toast.makeText(context, "Error -" + e.toString(), Toast.LENGTH_SHORT).show(); Toast.makeText(context, "Error -" + e.toString(), Toast.LENGTH_SHORT).show();
@@ -3546,4 +3550,52 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
} }
} }
public void InsertSHELF_MASTER(ShelfMasterGetterSetter data) {
db.delete("SHELF_MASTER", null, null);
ContentValues values = new ContentValues();
try {
for (int i = 0; i < data.getSHELF_ID().size(); i++) {
values.put("SHELF_ID", data.getSHELF_ID().get(i));
values.put("SHELF", data.getSHELF().get(i));
db.insert("SHELF_MASTER", null, values);
}
} catch (Exception ex) {
Log.d("Exception ", " SHELF_MASTER " + ex.toString());
}
}
public ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> getSHELF_MASTERData() {
Cursor cursordata = null;
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> Data = new ArrayList<>();
try {
StockFacing_PlanogramTrackerDataGetterSetter sb1 = new StockFacing_PlanogramTrackerDataGetterSetter();
sb1.setShelf_id("0");
sb1.setShelf("Select");
Data.add(sb1);
cursordata = db.rawQuery("SELECT * FROM SHELF_MASTER ", null);
if (cursordata != null) {
cursordata.moveToFirst();
while (!cursordata.isAfterLast()) {
StockFacing_PlanogramTrackerDataGetterSetter sb = new StockFacing_PlanogramTrackerDataGetterSetter();
sb.setShelf_id(cursordata.getString(cursordata.getColumnIndexOrThrow("SHELF_ID")));
sb.setShelf(cursordata.getString(cursordata.getColumnIndexOrThrow("SHELF")));
Data.add(sb);
cursordata.moveToNext();
}
cursordata.close();
}
} catch (Exception ex) {
Log.d("Exception ", " Get SHELF_MASTER " + ex.toString());
}
return Data;
}
} }
@@ -59,6 +59,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.STORE_PERFORMANCE_MasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.STORE_PERFORMANCE_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.ShelfMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.TableBean; import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
@@ -86,8 +87,9 @@ public class DownloadActivity extends AppCompatActivity {
STORE_PERFORMANCE_MasterGetterSetter store_performance_masterGetterSetter; STORE_PERFORMANCE_MasterGetterSetter store_performance_masterGetterSetter;
ADDITIONAL_DISPLAY_MASTERGetterSetter additional_display_getter_setter; ADDITIONAL_DISPLAY_MASTERGetterSetter additional_display_getter_setter;
MAPPING_SOS_TARGET_MasterGetterSetter mapping_sos_target_masterGetterSetter; MAPPING_SOS_TARGET_MasterGetterSetter mapping_sos_target_masterGetterSetter;
MAPPING_PLANOGRAM_MasterGetterSetter mapping_planogram_masterGetterSetter; MAPPING_PLANOGRAM_MasterGetterSetter mapping_planogram_masterGetterSetter;
ShelfMasterGetterSetter shelfMasterGetterSetter;
private Dialog dialog; private Dialog dialog;
private ProgressBar pb; private ProgressBar pb;
private TextView percentage, message; private TextView percentage, message;
@@ -776,6 +778,43 @@ public class DownloadActivity extends AppCompatActivity {
publishProgress(data); publishProgress(data);
//SHELF_MASTER
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
request.addProperty("UserName", userId);
request.addProperty("Type", "SHELF_MASTER");
request.addProperty("cultureid", culture_id);
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
result = envelope.getResponse();
if (result.toString() != null) {
xpp.setInput(new StringReader(result.toString()));
xpp.next();
eventType = xpp.getEventType();
shelfMasterGetterSetter = XMLHandlers.shelfMasterXMLHandler(xpp, eventType);
String table_ShelfMaster = shelfMasterGetterSetter.getTable_SHELF_MASTER();
if (table_ShelfMaster != null) {
resultHttp = CommonString.KEY_SUCCESS;
TableBean.setShelfMaster(table_ShelfMaster);
}
if (shelfMasterGetterSetter.getSHELF_ID().size() > 0) {
data.value = 96;
data.name = "SHELF_MASTER " + getResources().getString(R.string.download_data);
}
}
publishProgress(data);
//Images DownLoads
//MAPPING_PLANOGRAM Image save into folder //MAPPING_PLANOGRAM Image save into folder
if (mapping_planogram_masterGetterSetter != null) { if (mapping_planogram_masterGetterSetter != null) {
@@ -912,19 +951,18 @@ public class DownloadActivity extends AppCompatActivity {
db.InsertMAPPING_PLANOGRAM(mapping_planogram_masterGetterSetter); db.InsertMAPPING_PLANOGRAM(mapping_planogram_masterGetterSetter);
db.InsertADDITIONAL_DISPLAY(additional_display_getter_setter); db.InsertADDITIONAL_DISPLAY(additional_display_getter_setter);
db.InsertMAPPING_SOS_TARGET(mapping_sos_target_masterGetterSetter); db.InsertMAPPING_SOS_TARGET(mapping_sos_target_masterGetterSetter);
db.InsertSHELF_MASTER(shelfMasterGetterSetter);
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
ResultFlag = false; ResultFlag = false;
str = CommonString.MESSAGE_EXCEPTION; str = CommonString.MESSAGE_EXCEPTION;
return CommonString.MESSAGE_EXCEPTION; return CommonString.MESSAGE_EXCEPTION;
} } catch (SocketTimeoutException e) {
catch (SocketTimeoutException e) {
ResultFlag = false; ResultFlag = false;
str = CommonString.MESSAGE_SOCKETEXCEPTION; str = CommonString.MESSAGE_SOCKETEXCEPTION;
return CommonString.MESSAGE_SOCKETEXCEPTION; return CommonString.MESSAGE_SOCKETEXCEPTION;
} } catch (InterruptedIOException e) {
catch (InterruptedIOException e){
ResultFlag = false; ResultFlag = false;
str = CommonString.MESSAGE_EXCEPTION; str = CommonString.MESSAGE_EXCEPTION;
@@ -935,8 +973,7 @@ public class DownloadActivity extends AppCompatActivity {
ResultFlag = false; ResultFlag = false;
str = CommonString.MESSAGE_SOCKETEXCEPTION; str = CommonString.MESSAGE_SOCKETEXCEPTION;
return CommonString.MESSAGE_SOCKETEXCEPTION; return CommonString.MESSAGE_SOCKETEXCEPTION;
} } catch (XmlPullParserException e) {
catch (XmlPullParserException e) {
ResultFlag = false; ResultFlag = false;
str = CommonString.MESSAGE_XmlPull; str = CommonString.MESSAGE_XmlPull;
return CommonString.MESSAGE_XmlPull; return CommonString.MESSAGE_XmlPull;
@@ -947,20 +984,12 @@ public class DownloadActivity extends AppCompatActivity {
return CommonString.MESSAGE_EXCEPTION; return CommonString.MESSAGE_EXCEPTION;
} }
if(ResultFlag) if (ResultFlag) {
{
return ""; return "";
} } else {
else
{
return str; return str;
} }
} }
@Override @Override
@@ -980,9 +1009,7 @@ public class DownloadActivity extends AppCompatActivity {
dialog.dismiss(); dialog.dismiss();
showAlert(getString(R.string.data_downloaded_successfully)); showAlert(getString(R.string.data_downloaded_successfully));
} } else {
else
{
dialog.dismiss(); dialog.dismiss();
showAlert(getString(R.string.datanotfound) + " " + s); showAlert(getString(R.string.datanotfound) + " " + s);
} }
@@ -1,40 +1,69 @@
package cpm.com.gskmtorange.gsk_dailyentry; package cpm.com.gskmtorange.gsk_dailyentry;
import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.res.Resources;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.os.Bundle; import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.CardView;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.text.Editable; import android.view.LayoutInflater;
import android.text.TextWatcher;
import android.view.View; import android.view.View;
import android.view.ViewGroup;
import android.view.Window; import android.view.Window;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.BaseExpandableListAdapter;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ExpandableListView;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.R; import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.xmlGetterSetter.StockFacing_PlanogramTrackerDataGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
public class StockFacing_PlanogramTrackerActivity extends AppCompatActivity { public class StockFacing_PlanogramTrackerActivity extends AppCompatActivity {
Button btn_addShelf, btn_addSKU; Button btn_addShelf, btn_addSKU;
RecyclerView recyclerView; ExpandableListView expandableListView;
String brand, brand_id, company_id, sub_category, sub_category_id; String brand, brand_id, company_id, sub_category, sub_category_id;
String addShelfPosition = ""; String addShelfPosition = "";
ArrayAdapter<String> shelfPositionAdapter, shelfAdapter;
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> shelfList;
GSKOrangeDB db;
ExpandableListAdapter adapter;
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> headerDataList = new ArrayList<>();
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> childDataList;
List<StockFacing_PlanogramTrackerDataGetterSetter> hashMapListHeaderData;
HashMap<StockFacing_PlanogramTrackerDataGetterSetter, List<StockFacing_PlanogramTrackerDataGetterSetter>> hashMapListChildData;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_stock_facing__planogram_tracker); setContentView(R.layout.activity_stock_facing__planogram_tracker);
try {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
db = new GSKOrangeDB(this);
db.open();
btn_addShelf = (Button) findViewById(R.id.btn_addShelf); btn_addShelf = (Button) findViewById(R.id.btn_addShelf);
btn_addSKU = (Button) findViewById(R.id.btn_addSKU); expandableListView = (ExpandableListView) findViewById(R.id.exp_stockFacing_PlanogramTrackerListView);
recyclerView = (RecyclerView) findViewById(R.id.recyclerView_stockFacingPlanogramTracker);
Intent intent = getIntent(); Intent intent = getIntent();
brand = intent.getStringExtra("brand"); brand = intent.getStringExtra("brand");
@@ -43,16 +72,25 @@ public class StockFacing_PlanogramTrackerActivity extends AppCompatActivity {
sub_category = intent.getStringExtra("sub_category"); sub_category = intent.getStringExtra("sub_category");
sub_category_id = intent.getStringExtra("sub_category_id"); sub_category_id = intent.getStringExtra("sub_category_id");
/*FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});*/
btn_addSKU.setEnabled(false); //Shelf Position Adapter
shelfPositionAdapter = new ArrayAdapter<String>(StockFacing_PlanogramTrackerActivity.this, android.R.layout.simple_list_item_1);
shelfPositionAdapter.add(getResources().getString(R.string.select)); //Select
for (int i = 7; i >= 1; i--) {
shelfPositionAdapter.add(String.valueOf(i));
}
//Shelf List
shelfList = new ArrayList<>();
shelfList = db.getSHELF_MASTERData();
shelfAdapter = new ArrayAdapter<String>(StockFacing_PlanogramTrackerActivity.this, android.R.layout.simple_list_item_1);
for (int j = 0; j < shelfList.size(); j++) {
shelfAdapter.add(shelfList.get(j).getShelf());
}
//Add Shelf Header Data
prepareHeaderList(headerDataList);
btn_addShelf.setOnClickListener(new View.OnClickListener() { btn_addShelf.setOnClickListener(new View.OnClickListener() {
@Override @Override
@@ -62,9 +100,45 @@ public class StockFacing_PlanogramTrackerActivity extends AppCompatActivity {
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT)); dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
dialog.setContentView(R.layout.dialog_stock_facing_planogram_tracker); dialog.setContentView(R.layout.dialog_stock_facing_planogram_tracker);
final EditText ed_shelf_position = (EditText) dialog.findViewById(R.id.ed_shelf_position);
Button addShelf = (Button) dialog.findViewById(R.id.dialog_btn_addShelf); Button addShelf = (Button) dialog.findViewById(R.id.dialog_btn_addShelf);
Button cancel = (Button) dialog.findViewById(R.id.dialog_btn_cancel); Button cancel = (Button) dialog.findViewById(R.id.dialog_btn_cancel);
Spinner sp_addShelf = (Spinner) dialog.findViewById(R.id.sp_addShelf);
Spinner sp_shelfPosition = (Spinner) dialog.findViewById(R.id.sp_shelfPosition);
sp_addShelf.setAdapter(shelfAdapter);
sp_shelfPosition.setAdapter(shelfPositionAdapter);
final StockFacing_PlanogramTrackerDataGetterSetter data = new StockFacing_PlanogramTrackerDataGetterSetter();
sp_addShelf.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long l) {
for (int i1 = 0; i1 < shelfList.size(); i1++) {
if (position == i1) {
//Selected spinner position value
data.setSp_addShelf_id(shelfList.get(i1).getShelf_id());
data.setSp_addShelf(shelfList.get(i1).getShelf());
}
}
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
sp_shelfPosition.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long l) {
data.setSp_shelfPosition(parent.getItemAtPosition(position).toString());
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
cancel.setOnClickListener(new View.OnClickListener() { cancel.setOnClickListener(new View.OnClickListener() {
@Override @Override
@@ -76,17 +150,16 @@ public class StockFacing_PlanogramTrackerActivity extends AppCompatActivity {
addShelf.setOnClickListener(new View.OnClickListener() { addShelf.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
addShelfPosition = ed_shelf_position.getText().toString().trim();
if (!addShelfPosition.equals("")) { if (!data.getSp_addShelf_id().equals("0") && !data.getSp_shelfPosition().equals("Select")) {
headerDataList.add(data);
dialog.dismiss(); dialog.dismiss();
prepareHeaderList(headerDataList);
btn_addSKU.setEnabled(true);
} else { } else {
/*Snackbar.make(view1, getResources().getString(R.string.empty_field), Snackbar.LENGTH_LONG) /*Snackbar.make(view1, getResources().getString(R.string.empty_field), Snackbar.LENGTH_LONG)
.setAction("Action", null).show();*/ .setAction("Action", null).show();*/
Toast.makeText(StockFacing_PlanogramTrackerActivity.this, Toast.makeText(StockFacing_PlanogramTrackerActivity.this, getResources().getString(R.string.empty_field), Toast.LENGTH_SHORT).show();
getResources().getString(R.string.empty_field), Toast.LENGTH_SHORT).show();
} }
} }
}); });
@@ -95,14 +168,147 @@ public class StockFacing_PlanogramTrackerActivity extends AppCompatActivity {
} }
}); });
String s = addShelfPosition;
btn_addSKU.setOnClickListener(new View.OnClickListener() { /*FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
Toast.makeText(StockFacing_PlanogramTrackerActivity.this, "Add SKU", Toast.LENGTH_SHORT).show(); Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});*/
} catch (Resources.NotFoundException e) {
e.printStackTrace();
}
}
private void prepareHeaderList(ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> headerDataList) {
try {
hashMapListHeaderData = new ArrayList<>();
hashMapListChildData = new HashMap<>();
//Header Data
if (headerDataList.size() > 0) {
hashMapListHeaderData.addAll(headerDataList);
// adapter.notifyDataSetChanged();
}
adapter = new ExpandableListAdapter(this, hashMapListHeaderData, hashMapListChildData);
expandableListView.setAdapter(adapter);
} catch (Exception e) {
e.printStackTrace();
}
}
public class ExpandableListAdapter extends BaseExpandableListAdapter {
private Context _context;
private List<StockFacing_PlanogramTrackerDataGetterSetter> _listDataHeader;
private HashMap<StockFacing_PlanogramTrackerDataGetterSetter, List<StockFacing_PlanogramTrackerDataGetterSetter>> _listDataChild;
public ExpandableListAdapter(Context context, List<StockFacing_PlanogramTrackerDataGetterSetter> listDataHeader,
HashMap<StockFacing_PlanogramTrackerDataGetterSetter, List<StockFacing_PlanogramTrackerDataGetterSetter>> listChildData) {
this._context = context;
this._listDataHeader = listDataHeader;
this._listDataChild = listChildData;
}
@Override
public Object getGroup(int groupPosition) {
return this._listDataHeader.get(groupPosition);
}
@Override
public int getGroupCount() {
return this._listDataHeader.size();
}
@Override
public long getGroupId(int groupPosition) {
return groupPosition;
}
@Override
public View getGroupView(final int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
final StockFacing_PlanogramTrackerDataGetterSetter headerTitle =
(StockFacing_PlanogramTrackerDataGetterSetter) getGroup(groupPosition);
if (headerTitle != null) {
if (convertView == null) {
LayoutInflater infalInflater = (LayoutInflater) this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = infalInflater.inflate(R.layout.item_stock_facing_planogram_header, null, false);
TextView txt_shelfHeader = (TextView) convertView.findViewById(R.id.txt_shelfHeader);
Button btn_addSku = (Button) convertView.findViewById(R.id.btn_addSku);
txt_shelfHeader.setText(headerTitle.getSp_addShelf() + " (Position : " + headerTitle.getSp_shelfPosition() + ")");
btn_addSku.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
} }
}); });
} }
}
return convertView;
}
@Override
public Object getChild(int groupPosition, int childPosititon) {
return this._listDataChild.get(this._listDataHeader.get(groupPosition)).get(childPosititon);
}
@Override
public int getChildrenCount(int groupPosition) {
return this._listDataChild.get(this._listDataHeader.get(groupPosition)).size();
}
@Override
public long getChildId(int groupPosition, int childPosition) {
return childPosition;
}
@Override
public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
final StockFacing_PlanogramTrackerDataGetterSetter childData =
(StockFacing_PlanogramTrackerDataGetterSetter) getChild(groupPosition, childPosition);
ViewHolder holder = null;
if (convertView == null) {
LayoutInflater infalInflater = (LayoutInflater) this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = infalInflater.inflate(R.layout.item_stock_facing_child, null, false);
holder = new ViewHolder();
holder.cardView = (CardView) convertView.findViewById(R.id.card_view);
holder.lin_category = (LinearLayout) convertView.findViewById(R.id.lin_category);
holder.txt_skuName = (TextView) convertView.findViewById(R.id.txt_skuName);
holder.ed_stock = (EditText) convertView.findViewById(R.id.ed_stock);
holder.ed_facing = (EditText) convertView.findViewById(R.id.ed_facing);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
return convertView;
}
@Override
public boolean hasStableIds() {
return false;
}
@Override
public boolean isChildSelectable(int groupPosition, int childPosition) {
return true;
}
}
public class ViewHolder {
EditText ed_stock, ed_facing;
CardView cardView;
TextView txt_skuName;
LinearLayout lin_category;
}
} }
@@ -0,0 +1,34 @@
package cpm.com.gskmtorange.xmlGetterSetter;
import java.util.ArrayList;
public class ShelfMasterGetterSetter {
String table_SHELF_MASTER;
ArrayList<String> SHELF_ID = new ArrayList<>();
ArrayList<String> SHELF = new ArrayList<>();
public String getTable_SHELF_MASTER() {
return table_SHELF_MASTER;
}
public void setTable_SHELF_MASTER(String table_SHELF_MASTER) {
this.table_SHELF_MASTER = table_SHELF_MASTER;
}
public ArrayList<String> getSHELF_ID() {
return SHELF_ID;
}
public void setSHELF_ID(String SHELF_ID) {
this.SHELF_ID.add(SHELF_ID);
}
public ArrayList<String> getSHELF() {
return SHELF;
}
public void setSHELF(String SHELF) {
this.SHELF.add(SHELF);
}
}
@@ -0,0 +1,47 @@
package cpm.com.gskmtorange.xmlGetterSetter;
import java.util.ArrayList;
public class StockFacing_PlanogramTrackerDataGetterSetter {
String shelf_id, shelf, sp_addShelf_id, sp_addShelf, sp_shelfPosition;
public String getShelf_id() {
return shelf_id;
}
public void setShelf_id(String shelf_id) {
this.shelf_id = shelf_id;
}
public String getShelf() {
return shelf;
}
public void setShelf(String shelf) {
this.shelf = shelf;
}
public String getSp_addShelf_id() {
return sp_addShelf_id;
}
public void setSp_addShelf_id(String sp_addShelf_id) {
this.sp_addShelf_id = sp_addShelf_id;
}
public String getSp_addShelf() {
return sp_addShelf;
}
public void setSp_addShelf(String sp_addShelf) {
this.sp_addShelf = sp_addShelf;
}
public String getSp_shelfPosition() {
return sp_shelfPosition;
}
public void setSp_shelfPosition(String sp_shelfPosition) {
this.sp_shelfPosition = sp_shelfPosition;
}
}
@@ -24,7 +24,7 @@ public class TableBean {
public static String STORE_PERFORMANCE; public static String STORE_PERFORMANCE;
public static String MAPPING_PLANOGRAM; public static String MAPPING_PLANOGRAM;
public static String MAPPING_SOS_TARGET; public static String MAPPING_SOS_TARGET;
public static String SHELF_MASTER;
public static String getAdditionalDisplay() { public static String getAdditionalDisplay() {
@@ -169,5 +169,13 @@ public class TableBean {
MAPPING_SOS_TARGET = mappingSosTarget; MAPPING_SOS_TARGET = mappingSosTarget;
} }
public static String getShelfMaster() {
return SHELF_MASTER;
}
public static void setShelfMaster(String shelfMaster) {
SHELF_MASTER = shelfMaster;
}
//Gagan end code //Gagan end code
} }
@@ -22,6 +22,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.STORE_PERFORMANCE_MasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.STORE_PERFORMANCE_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.ShelfMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter; import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter;
@@ -783,5 +784,31 @@ public class XMLHandlers {
return st; return st;
} }
public static ShelfMasterGetterSetter shelfMasterXMLHandler(XmlPullParser xpp, int eventType) {
ShelfMasterGetterSetter st = new ShelfMasterGetterSetter();
try {
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
if (xpp.getEventType() == XmlPullParser.START_TAG) {
if (xpp.getName().equals("META_DATA")) {
st.setTable_SHELF_MASTER(xpp.nextText());
}
if (xpp.getName().equals("SHELF_ID")) {
st.setSHELF_ID(xpp.nextText());
}
if (xpp.getName().equals("SHELF")) {
st.setSHELF(xpp.nextText());
}
}
xpp.next();
}
} catch (XmlPullParserException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return st;
}
} }
@@ -31,7 +31,7 @@
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/white" /> android:textColor="@color/white" />
<Button <!--<Button
android:id="@+id/btn_addSKU" android:id="@+id/btn_addSKU"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -41,7 +41,7 @@
android:padding="5dp" android:padding="5dp"
android:text="Add SKU" android:text="Add SKU"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/white" /> android:textColor="@color/white" />-->
</RelativeLayout> </RelativeLayout>
<View <View
@@ -49,9 +49,18 @@
android:layout_height="1dp" android:layout_height="1dp"
android:background="@color/grey_dark_background" /> android:background="@color/grey_dark_background" />
<android.support.v7.widget.RecyclerView <!--<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView_stockFacingPlanogramTracker" android:id="@+id/recyclerView_stockFacingPlanogramTracker"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />-->
<ExpandableListView
android:id="@+id/exp_stockFacing_PlanogramTrackerListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:cacheColorHint="#00000000"
android:divider="@null"
android:dividerHeight="0dp"
android:scrollingCache="false" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
@@ -41,7 +41,6 @@
</LinearLayout> </LinearLayout>
<View <View
android:id="@+id/view_divider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="2dp" android:layout_height="2dp"
android:background="@color/colorPrimary" /> android:background="@color/colorPrimary" />
@@ -50,21 +49,22 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="vertical">
<!--Add Shelf View-->
<LinearLayout <LinearLayout
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:orientation="horizontal" android:orientation="horizontal"
android:padding="10dp"
android:weightSum="2"> android:weightSum="2">
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1.5"
android:gravity="center_vertical" android:orientation="vertical">
android:orientation="vertical"
android:padding="10dp">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -129,44 +129,81 @@
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/colorPrimary" /> android:textColor="@color/colorPrimary" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="vertical"
android:padding="10dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Position on Shelf"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/colorPrimary" />
<EditText
android:id="@+id/ed_shelf_position"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center_horizontal"
android:hint=""
android:maxLength="10"
android:inputType="number"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:textColorHint="@color/colorPrimary" />
</LinearLayout>
</LinearLayout>
</LinearLayout> </LinearLayout>
<View <View
android:id="@+id/view_divider1" android:id="@+id/view_divider1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_marginBottom="5dp"
android:background="@color/colorPrimary" />
<!--Add Shelf and Shelf Position-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
<!--Add Shelf-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingTop="5dp"
android:text="Add Shelf"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/colorPrimary" />
<Spinner
android:id="@+id/sp_addShelf"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<!--Shelf Position-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingTop="5dp"
android:text="Position on Shelf"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/colorPrimary" />
<Spinner
android:id="@+id/sp_shelfPosition"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="5dp"
android:background="@color/colorPrimary" /> android:background="@color/colorPrimary" />
<!--Bottom Buttom--> <!--Bottom Buttom-->
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical">
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
card_view:cardBackgroundColor="@color/light_orange_background"
card_view:cardCornerRadius="10dp">
<LinearLayout
android:id="@+id/lin_stockFaceupHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.2"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:id="@+id/txt_shelfHeader"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:paddingLeft="20dp"
android:paddingRight="5dp"
android:text="Brand Name"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/colorPrimaryDark" />
</LinearLayout>
<!--Camera Images-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".8"
android:gravity="center_vertical|right"
android:orientation="horizontal"
android:padding="2dp">
<Button
android:id="@+id/btn_addSku"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:background="@color/colorPrimary"
android:text="Add SKU"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/white" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
+1 -1
View File
@@ -8,7 +8,7 @@
<color name="black">#000000</color> <color name="black">#000000</color>
<color name="grey_background">#EEEEEE</color> <color name="grey_background">#EEEEEE</color>
<color name="grey_dark_background">#888</color> <color name="grey_dark_background">#888</color>
<color name="light_orange_background">#FFF4D19D</color> <color name="light_orange_background">#FFF9E0BA</color>
<color name="green">#FF27A404</color> <color name="green">#FF27A404</color>
<color name="blue">#2196F3</color> <color name="blue">#2196F3</color>