Merge pull request #40 from CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/GG_MappingPlanogram
Gg mapping planogram
This commit is contained in:
Generated
+1
-1
@@ -41,7 +41,7 @@
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -18,6 +18,7 @@ import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
|
||||
import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
|
||||
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||
@@ -50,8 +51,8 @@ import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
||||
public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
public static final String DATABASE_NAME = "GSK_ORANGE";
|
||||
public static final int DATABASE_VERSION = 13;
|
||||
private SQLiteDatabase db;
|
||||
TableBean tableBean;
|
||||
private SQLiteDatabase db;
|
||||
|
||||
public GSKOrangeDB(Context context) {
|
||||
super(context, DATABASE_NAME, null, DATABASE_VERSION);
|
||||
@@ -110,6 +111,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_T2P_COMPLIANCE);
|
||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_T2P_GAPS);
|
||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_T2P_SKU);
|
||||
|
||||
db.execSQL(TableBean.getMappingPlanogram());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1669,7 +1672,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
try {
|
||||
|
||||
dbcursor = db.rawQuery("SELECT * from JOURNEY_PLAN " +
|
||||
"where VISIT_DATE ='" + date + "' AND STORE_ID'=" + store_id + "'", null);
|
||||
"where VISIT_DATE ='" + date + "' AND STORE_ID='" + store_id + "'", null);
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
@@ -2553,4 +2556,27 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
return list;
|
||||
}
|
||||
|
||||
//Gagan start new code 2
|
||||
|
||||
public void InsertMAPPING_PLANOGRAM(MAPPING_PLANOGRAM_MasterGetterSetter data) {
|
||||
db.delete("MAPPING_PLANOGRAM", null, null);
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
try {
|
||||
for (int i = 0; i < data.getKEYACCOUNT_ID().size(); i++) {
|
||||
|
||||
values.put("KEYACCOUNT_ID", data.getKEYACCOUNT_ID().get(i));
|
||||
values.put("STORETYPE_ID", data.getSTORETYPE_ID().get(i));
|
||||
values.put("CLASS_ID", data.getCLASS_ID().get(i));
|
||||
values.put("PLANOGRAM_IMAGE", data.getPLANOGRAM_IMAGE().get(i));
|
||||
values.put("IMAGE_PATH", data.getIMAGE_PATH().get(i));
|
||||
|
||||
db.insert("MAPPING_PLANOGRAM", null, values);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.d("Exception ", " MAPPING_PLANOGRAM " + ex.toString());
|
||||
}
|
||||
}
|
||||
//Gagan end new code 2
|
||||
|
||||
}
|
||||
|
||||
+366
-371
@@ -72,14 +72,11 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
RecyclerView rec_t2p;
|
||||
|
||||
String categoryName, categoryId;
|
||||
|
||||
private SharedPreferences preferences;
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow;
|
||||
|
||||
String path = "", str = CommonString.FILE_PATH, _pathforcheck = "", img = "";
|
||||
int child_position = -1;
|
||||
|
||||
String error_msg;
|
||||
private SharedPreferences preferences;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -174,142 +171,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class T2PAdapter extends RecyclerView.Adapter<T2PAdapter.ViewHolder> {
|
||||
|
||||
private ArrayList<T2PGetterSetter> list;
|
||||
|
||||
public T2PAdapter(ArrayList<T2PGetterSetter> t2PList) {
|
||||
list = t2PList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.t2p_item_layout, parent, false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(final ViewHolder holder, final int position) {
|
||||
|
||||
final T2PGetterSetter mItem = list.get(position);
|
||||
holder.tv_brand.setText(mItem.getBrand());
|
||||
holder.tv_display.setText(mItem.getDisplay().trim());
|
||||
|
||||
//holder.tv_display.setTypeface(FontManager.getTypeface(getApplicationContext(),FontManager.FONTAWESOME));
|
||||
|
||||
/* Typeface iconFont = FontManager.getTypeface(getApplicationContext(), FontManager.FONTAWESOME);
|
||||
FontManager.markAsIconContainer(findViewById(R.id.icons_container), iconFont);
|
||||
*/
|
||||
holder.btn_gaps.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
showGapsDialog(mItem);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
holder.toggle_btn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
mItem.setPresent(((ToggleButton) v).getText().toString().equalsIgnoreCase("Yes"));
|
||||
|
||||
t2PAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
holder.btn_sku.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
showSkuDialog(mItem.getSkulist());
|
||||
}
|
||||
});
|
||||
|
||||
if (!img.equalsIgnoreCase("")) {
|
||||
if (position == child_position) {
|
||||
mItem.setImage(img);
|
||||
img = "";
|
||||
}
|
||||
}
|
||||
|
||||
if(camera_allow.equals("1")){
|
||||
|
||||
holder.img_cam.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
_pathforcheck = "T2P_Image_" + store_id + "_" + mItem.getBrand_id() + mItem.getDisplay_id() + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||
child_position = position;
|
||||
path = str + _pathforcheck;
|
||||
|
||||
startCameraActivity();
|
||||
}
|
||||
});
|
||||
|
||||
if (mItem.getImage().equals("")) {
|
||||
holder.img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
||||
} else {
|
||||
holder.img_cam.setBackgroundResource(R.mipmap.camera_green);
|
||||
}
|
||||
}
|
||||
else {
|
||||
holder.img_cam.setBackgroundResource(R.mipmap.camera_grey);
|
||||
}
|
||||
|
||||
|
||||
holder.toggle_btn.setChecked(mItem.isPresent());
|
||||
|
||||
if (mItem.getGapsChecklist().size() > 0) {
|
||||
holder.btn_gaps.setBackgroundColor(getResources().getColor(R.color.green));
|
||||
} else {
|
||||
holder.btn_gaps.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
}
|
||||
|
||||
if (mItem.getSkulist().size() > 0) {
|
||||
holder.btn_sku.setBackgroundColor(getResources().getColor(R.color.green));
|
||||
} else {
|
||||
holder.btn_sku.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
public final View mView;
|
||||
public final LinearLayout parentLayout;
|
||||
public final TextView tv_brand, tv_display;
|
||||
public final ImageView img_cam, img_remark;
|
||||
public final Button btn_gaps, btn_sku, btn_ref_img;
|
||||
public final ToggleButton toggle_btn;
|
||||
|
||||
|
||||
public ViewHolder(View view) {
|
||||
super(view);
|
||||
|
||||
mView = view;
|
||||
|
||||
tv_brand = (TextView) mView.findViewById(R.id.tv_brand);
|
||||
tv_display = (TextView) mView.findViewById(R.id.tv_display);
|
||||
img_cam = (ImageView) mView.findViewById(R.id.img_cam);
|
||||
img_remark = (ImageView) mView.findViewById(R.id.img_remark);
|
||||
btn_gaps = (Button) mView.findViewById(R.id.btn_gaps);
|
||||
btn_sku = (Button) mView.findViewById(R.id.btn_sku);
|
||||
btn_ref_img = (Button) mView.findViewById(R.id.btn_ref_image);
|
||||
parentLayout = (LinearLayout) mView.findViewById(R.id.parent_layout);
|
||||
toggle_btn = (ToggleButton) mView.findViewById(R.id.toggle_btn);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void showGapsDialog(final T2PGetterSetter t2p) {
|
||||
|
||||
final ArrayList<GapsChecklistGetterSetter> gapsChecklist;
|
||||
@@ -504,191 +365,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
|
||||
}
|
||||
|
||||
public class GapsAdapter extends RecyclerView.Adapter<GapsAdapter.ViewHolder> {
|
||||
|
||||
private ArrayList<GapsChecklistGetterSetter> list;
|
||||
|
||||
public GapsAdapter(ArrayList<GapsChecklistGetterSetter> gapsPList) {
|
||||
list = gapsPList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.gap_checklist_item, parent, false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(final ViewHolder holder, int position) {
|
||||
|
||||
final GapsChecklistGetterSetter mItem = list.get(position);
|
||||
holder.tv_checklist.setText(mItem.getChecklist());
|
||||
|
||||
holder.tb_present.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
mItem.setPresent(((ToggleButton) v).getText().toString().equalsIgnoreCase("Yes"));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
holder.tb_present.setChecked(mItem.isPresent());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
public final View mView;
|
||||
public final LinearLayout parentLayout;
|
||||
public final TextView tv_checklist;
|
||||
public final ToggleButton tb_present;
|
||||
|
||||
|
||||
public ViewHolder(View view) {
|
||||
super(view);
|
||||
|
||||
mView = view;
|
||||
|
||||
tv_checklist = (TextView) mView.findViewById(R.id.tv_checklist);
|
||||
tb_present = (ToggleButton) mView.findViewById(R.id.btn_is_present);
|
||||
parentLayout = (LinearLayout) mView.findViewById(R.id.parent_layout);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class CustomAdapter extends ArrayAdapter<String> {
|
||||
|
||||
private Activity activity;
|
||||
private ArrayList data;
|
||||
BrandMasterGetterSetter tempValues = null;
|
||||
LayoutInflater inflater;
|
||||
|
||||
/*************
|
||||
* CustomAdapter Constructor
|
||||
*****************/
|
||||
public CustomAdapter(
|
||||
T2PComplianceActivity activitySpinner,
|
||||
int textViewResourceId,
|
||||
ArrayList objects
|
||||
|
||||
) {
|
||||
super(activitySpinner, textViewResourceId, objects);
|
||||
|
||||
/********** Take passed values **********/
|
||||
activity = activitySpinner;
|
||||
data = objects;
|
||||
/*********** Layout inflator to call external xml layout () **********************/
|
||||
inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getDropDownView(int position, View convertView, ViewGroup parent) {
|
||||
return getCustomView(position, convertView, parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
return getCustomView(position, convertView, parent);
|
||||
}
|
||||
|
||||
// This funtion called for each row ( Called data.size() times )
|
||||
public View getCustomView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
/********** Inflate spinner_rows.xml file for each row ( Defined below ) ************/
|
||||
View row = inflater.inflate(R.layout.custom_spinner_item, parent, false);
|
||||
|
||||
/***** Get each Model object from Arraylist ********/
|
||||
tempValues = null;
|
||||
tempValues = (BrandMasterGetterSetter) data.get(position);
|
||||
|
||||
TextView label = (TextView) row.findViewById(R.id.tv_text);
|
||||
|
||||
if (position == 0) {
|
||||
|
||||
// Default selected Spinner item
|
||||
label.setText("Select");
|
||||
//sub.setText("");
|
||||
} else {
|
||||
// Set values for spinner each row
|
||||
label.setText(tempValues.getBRAND().get(0));
|
||||
}
|
||||
|
||||
return row;
|
||||
}
|
||||
}
|
||||
|
||||
public class CustomSkuAdapter extends ArrayAdapter<String> {
|
||||
|
||||
private Activity activity;
|
||||
private ArrayList data;
|
||||
SkuGetterSetter tempValues = null;
|
||||
LayoutInflater inflater;
|
||||
|
||||
/*************
|
||||
* CustomAdapter Constructor
|
||||
*****************/
|
||||
public CustomSkuAdapter(
|
||||
T2PComplianceActivity activitySpinner,
|
||||
int textViewResourceId,
|
||||
ArrayList objects
|
||||
|
||||
) {
|
||||
super(activitySpinner, textViewResourceId, objects);
|
||||
|
||||
/********** Take passed values **********/
|
||||
activity = activitySpinner;
|
||||
data = objects;
|
||||
/*********** Layout inflator to call external xml layout () **********************/
|
||||
inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getDropDownView(int position, View convertView, ViewGroup parent) {
|
||||
return getCustomView(position, convertView, parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
return getCustomView(position, convertView, parent);
|
||||
}
|
||||
|
||||
// This funtion called for each row ( Called data.size() times )
|
||||
public View getCustomView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
/********** Inflate spinner_rows.xml file for each row ( Defined below ) ************/
|
||||
View row = inflater.inflate(R.layout.custom_spinner_item, parent, false);
|
||||
|
||||
/***** Get each Model object from Arraylist ********/
|
||||
tempValues = null;
|
||||
tempValues = (SkuGetterSetter) data.get(position);
|
||||
|
||||
TextView label = (TextView) row.findViewById(R.id.tv_text);
|
||||
|
||||
if (position == 0) {
|
||||
|
||||
// Default selected Spinner item
|
||||
label.setText("Select");
|
||||
//sub.setText("");
|
||||
} else {
|
||||
// Set values for spinner each row
|
||||
label.setText(tempValues.getSKU());
|
||||
}
|
||||
|
||||
return row;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
@@ -794,6 +470,371 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
boolean flag = true;
|
||||
|
||||
for (int i = 0; i < t2PGetterSetters.size(); i++) {
|
||||
|
||||
if (camera_allow.equals("1") && t2PGetterSetters.get(i).getImage().equals("")) {
|
||||
flag = false;
|
||||
error_msg = getResources().getString(R.string.click_image);
|
||||
break;
|
||||
} else if (t2PGetterSetters.get(i).getGapsChecklist().size() == 0) {
|
||||
flag = false;
|
||||
error_msg = getResources().getString(R.string.fill_gaps_data);
|
||||
break;
|
||||
} else if (t2PGetterSetters.get(i).getSkulist().size() == 0) {
|
||||
flag = false;
|
||||
error_msg = getResources().getString(R.string.fill_sku_data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
//super.onBackPressed();
|
||||
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(T2PComplianceActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
finish();
|
||||
}
|
||||
})
|
||||
.setNegativeButton("Cancel ", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
|
||||
public class T2PAdapter extends RecyclerView.Adapter<T2PAdapter.ViewHolder> {
|
||||
|
||||
private ArrayList<T2PGetterSetter> list;
|
||||
|
||||
public T2PAdapter(ArrayList<T2PGetterSetter> t2PList) {
|
||||
list = t2PList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.t2p_item_layout, parent, false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(final ViewHolder holder, final int position) {
|
||||
|
||||
final T2PGetterSetter mItem = list.get(position);
|
||||
holder.tv_brand.setText(mItem.getBrand());
|
||||
holder.tv_display.setText(mItem.getDisplay().trim());
|
||||
|
||||
//holder.tv_display.setTypeface(FontManager.getTypeface(getApplicationContext(),FontManager.FONTAWESOME));
|
||||
|
||||
/* Typeface iconFont = FontManager.getTypeface(getApplicationContext(), FontManager.FONTAWESOME);
|
||||
FontManager.markAsIconContainer(findViewById(R.id.icons_container), iconFont);
|
||||
*/
|
||||
holder.btn_gaps.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
showGapsDialog(mItem);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
holder.toggle_btn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
mItem.setPresent(((ToggleButton) v).getText().toString().equalsIgnoreCase("Yes"));
|
||||
|
||||
t2PAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
holder.btn_sku.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
showSkuDialog(mItem.getSkulist());
|
||||
}
|
||||
});
|
||||
|
||||
if (!img.equalsIgnoreCase("")) {
|
||||
if (position == child_position) {
|
||||
mItem.setImage(img);
|
||||
img = "";
|
||||
}
|
||||
}
|
||||
|
||||
if(camera_allow.equals("1")){
|
||||
|
||||
holder.img_cam.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
_pathforcheck = "T2P_Image_" + store_id + "_" + mItem.getBrand_id() + mItem.getDisplay_id() + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||
child_position = position;
|
||||
path = str + _pathforcheck;
|
||||
|
||||
startCameraActivity();
|
||||
}
|
||||
});
|
||||
|
||||
if (mItem.getImage().equals("")) {
|
||||
holder.img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
||||
} else {
|
||||
holder.img_cam.setBackgroundResource(R.mipmap.camera_green);
|
||||
}
|
||||
}
|
||||
else {
|
||||
holder.img_cam.setBackgroundResource(R.mipmap.camera_grey);
|
||||
}
|
||||
|
||||
|
||||
holder.toggle_btn.setChecked(mItem.isPresent());
|
||||
|
||||
if (mItem.getGapsChecklist().size() > 0) {
|
||||
holder.btn_gaps.setBackgroundColor(getResources().getColor(R.color.green));
|
||||
} else {
|
||||
holder.btn_gaps.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
}
|
||||
|
||||
if (mItem.getSkulist().size() > 0) {
|
||||
holder.btn_sku.setBackgroundColor(getResources().getColor(R.color.green));
|
||||
} else {
|
||||
holder.btn_sku.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
public final View mView;
|
||||
public final LinearLayout parentLayout;
|
||||
public final TextView tv_brand, tv_display;
|
||||
public final ImageView img_cam, img_remark;
|
||||
public final Button btn_gaps, btn_sku, btn_ref_img;
|
||||
public final ToggleButton toggle_btn;
|
||||
|
||||
|
||||
public ViewHolder(View view) {
|
||||
super(view);
|
||||
|
||||
mView = view;
|
||||
|
||||
tv_brand = (TextView) mView.findViewById(R.id.tv_brand);
|
||||
tv_display = (TextView) mView.findViewById(R.id.tv_display);
|
||||
img_cam = (ImageView) mView.findViewById(R.id.img_cam);
|
||||
img_remark = (ImageView) mView.findViewById(R.id.img_remark);
|
||||
btn_gaps = (Button) mView.findViewById(R.id.btn_gaps);
|
||||
btn_sku = (Button) mView.findViewById(R.id.btn_sku);
|
||||
btn_ref_img = (Button) mView.findViewById(R.id.btn_ref_image);
|
||||
parentLayout = (LinearLayout) mView.findViewById(R.id.parent_layout);
|
||||
toggle_btn = (ToggleButton) mView.findViewById(R.id.toggle_btn);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class GapsAdapter extends RecyclerView.Adapter<GapsAdapter.ViewHolder> {
|
||||
|
||||
private ArrayList<GapsChecklistGetterSetter> list;
|
||||
|
||||
public GapsAdapter(ArrayList<GapsChecklistGetterSetter> gapsPList) {
|
||||
list = gapsPList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.gap_checklist_item, parent, false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(final ViewHolder holder, int position) {
|
||||
|
||||
final GapsChecklistGetterSetter mItem = list.get(position);
|
||||
holder.tv_checklist.setText(mItem.getChecklist());
|
||||
|
||||
holder.tb_present.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
mItem.setPresent(((ToggleButton) v).getText().toString().equalsIgnoreCase("Yes"));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
holder.tb_present.setChecked(mItem.isPresent());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
public final View mView;
|
||||
public final LinearLayout parentLayout;
|
||||
public final TextView tv_checklist;
|
||||
public final ToggleButton tb_present;
|
||||
|
||||
|
||||
public ViewHolder(View view) {
|
||||
super(view);
|
||||
|
||||
mView = view;
|
||||
|
||||
tv_checklist = (TextView) mView.findViewById(R.id.tv_checklist);
|
||||
tb_present = (ToggleButton) mView.findViewById(R.id.btn_is_present);
|
||||
parentLayout = (LinearLayout) mView.findViewById(R.id.parent_layout);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class CustomAdapter extends ArrayAdapter<String> {
|
||||
|
||||
BrandMasterGetterSetter tempValues = null;
|
||||
LayoutInflater inflater;
|
||||
private Activity activity;
|
||||
private ArrayList data;
|
||||
|
||||
/*************
|
||||
* CustomAdapter Constructor
|
||||
*****************/
|
||||
public CustomAdapter(
|
||||
T2PComplianceActivity activitySpinner,
|
||||
int textViewResourceId,
|
||||
ArrayList objects
|
||||
|
||||
) {
|
||||
super(activitySpinner, textViewResourceId, objects);
|
||||
|
||||
/********** Take passed values **********/
|
||||
activity = activitySpinner;
|
||||
data = objects;
|
||||
/*********** Layout inflator to call external xml layout () **********************/
|
||||
inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getDropDownView(int position, View convertView, ViewGroup parent) {
|
||||
return getCustomView(position, convertView, parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
return getCustomView(position, convertView, parent);
|
||||
}
|
||||
|
||||
// This funtion called for each row ( Called data.size() times )
|
||||
public View getCustomView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
/********** Inflate spinner_rows.xml file for each row ( Defined below ) ************/
|
||||
View row = inflater.inflate(R.layout.custom_spinner_item, parent, false);
|
||||
|
||||
/***** Get each Model object from Arraylist ********/
|
||||
tempValues = null;
|
||||
tempValues = (BrandMasterGetterSetter) data.get(position);
|
||||
|
||||
TextView label = (TextView) row.findViewById(R.id.tv_text);
|
||||
|
||||
if (position == 0) {
|
||||
|
||||
// Default selected Spinner item
|
||||
label.setText("Select");
|
||||
//sub.setText("");
|
||||
} else {
|
||||
// Set values for spinner each row
|
||||
label.setText(tempValues.getBRAND().get(0));
|
||||
}
|
||||
|
||||
return row;
|
||||
}
|
||||
}
|
||||
|
||||
public class CustomSkuAdapter extends ArrayAdapter<String> {
|
||||
|
||||
SkuGetterSetter tempValues = null;
|
||||
LayoutInflater inflater;
|
||||
private Activity activity;
|
||||
private ArrayList data;
|
||||
|
||||
/*************
|
||||
* CustomAdapter Constructor
|
||||
*****************/
|
||||
public CustomSkuAdapter(
|
||||
T2PComplianceActivity activitySpinner,
|
||||
int textViewResourceId,
|
||||
ArrayList objects
|
||||
|
||||
) {
|
||||
super(activitySpinner, textViewResourceId, objects);
|
||||
|
||||
/********** Take passed values **********/
|
||||
activity = activitySpinner;
|
||||
data = objects;
|
||||
/*********** Layout inflator to call external xml layout () **********************/
|
||||
inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getDropDownView(int position, View convertView, ViewGroup parent) {
|
||||
return getCustomView(position, convertView, parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
return getCustomView(position, convertView, parent);
|
||||
}
|
||||
|
||||
// This funtion called for each row ( Called data.size() times )
|
||||
public View getCustomView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
/********** Inflate spinner_rows.xml file for each row ( Defined below ) ************/
|
||||
View row = inflater.inflate(R.layout.custom_spinner_item, parent, false);
|
||||
|
||||
/***** Get each Model object from Arraylist ********/
|
||||
tempValues = null;
|
||||
tempValues = (SkuGetterSetter) data.get(position);
|
||||
|
||||
TextView label = (TextView) row.findViewById(R.id.tv_text);
|
||||
|
||||
if (position == 0) {
|
||||
|
||||
// Default selected Spinner item
|
||||
label.setText("Select");
|
||||
//sub.setText("");
|
||||
} else {
|
||||
// Set values for spinner each row
|
||||
label.setText(tempValues.getSKU());
|
||||
}
|
||||
|
||||
return row;
|
||||
}
|
||||
}
|
||||
|
||||
public class SkuAddedAdapter extends RecyclerView.Adapter<SkuAddedAdapter.ViewHolder> {
|
||||
|
||||
private ArrayList<SkuGetterSetter> list;
|
||||
@@ -843,50 +884,4 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
boolean flag = true;
|
||||
|
||||
for (int i = 0; i < t2PGetterSetters.size(); i++) {
|
||||
|
||||
if (camera_allow.equals("1") && t2PGetterSetters.get(i).getImage().equals("")) {
|
||||
flag = false;
|
||||
error_msg = getResources().getString(R.string.click_image);
|
||||
break;
|
||||
} else if (t2PGetterSetters.get(i).getGapsChecklist().size() == 0) {
|
||||
flag = false;
|
||||
error_msg = getResources().getString(R.string.fill_gaps_data);
|
||||
break;
|
||||
} else if (t2PGetterSetters.get(i).getSkulist().size() == 0) {
|
||||
flag = false;
|
||||
error_msg = getResources().getString(R.string.fill_sku_data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
//super.onBackPressed();
|
||||
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(T2PComplianceActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
finish();
|
||||
}
|
||||
})
|
||||
.setNegativeButton("Cancel ", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
||||
@@ -47,15 +48,10 @@ import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
||||
|
||||
public class DownloadActivity extends AppCompatActivity {
|
||||
|
||||
private Dialog dialog;
|
||||
private ProgressBar pb;
|
||||
private TextView percentage, message;
|
||||
Data data;
|
||||
int eventType;
|
||||
GSKOrangeDB db;
|
||||
private SharedPreferences preferences = null;
|
||||
String userId, culture_id;
|
||||
|
||||
JourneyPlanGetterSetter jcpgettersetter;
|
||||
SkuMasterGetterSetter skumastergettersetter;
|
||||
BrandMasterGetterSetter brandMasterGetterSetter;
|
||||
@@ -70,6 +66,11 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
MappingPromotionGetterSetter mappingPromotionGetterSetter;
|
||||
MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter mapping_additional_promotion_masterGetterSetter;
|
||||
STORE_PERFORMANCE_MasterGetterSetter store_performance_masterGetterSetter;
|
||||
MAPPING_PLANOGRAM_MasterGetterSetter mapping_planogram_masterGetterSetter;
|
||||
private Dialog dialog;
|
||||
private ProgressBar pb;
|
||||
private TextView percentage, message;
|
||||
private SharedPreferences preferences = null;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -84,6 +85,24 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
new UploadTask(DownloadActivity.this).execute();
|
||||
}
|
||||
|
||||
public void showAlert(String str) {
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(DownloadActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(str).setCancelable(false)
|
||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
/* Intent i = new Intent(activity, StorelistActivity.class);
|
||||
activity.startActivity(i);
|
||||
activity.finish();*/
|
||||
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
|
||||
class Data {
|
||||
int value;
|
||||
String name;
|
||||
@@ -137,7 +156,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
Object result = (Object) envelope.getResponse();
|
||||
Object result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
//InputStream stream = new ByteArrayInputStream(result.toString().getBytes("UTF-8"));
|
||||
@@ -177,7 +196,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -213,7 +232,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -249,7 +268,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -284,7 +303,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -319,7 +338,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -354,7 +373,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -389,7 +408,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -423,7 +442,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -457,7 +476,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -492,7 +511,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -527,7 +546,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -564,7 +583,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -600,7 +619,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
@@ -623,6 +642,42 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
//MAPPING_PLANOGRAM
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "MAPPING_PLANOGRAM");
|
||||
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();
|
||||
mapping_planogram_masterGetterSetter = XMLHandlers.MAPPING_PLANOGRAM_XMLHandler(xpp, eventType);
|
||||
|
||||
if (mapping_planogram_masterGetterSetter.getKEYACCOUNT_ID().size() > 0) {
|
||||
String table_mapping_planogram = mapping_planogram_masterGetterSetter.getTable_MAPPING_PLANOGRAM();
|
||||
if (table_mapping_planogram != null) {
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setMappingPlanogram(table_mapping_planogram);
|
||||
}
|
||||
} else {
|
||||
//return "MAPPING_PLANOGRAM";
|
||||
}
|
||||
data.value = 100;
|
||||
data.name = "MAPPING_PLANOGRAM Data Download";
|
||||
}
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
//Gagan end code
|
||||
|
||||
|
||||
@@ -645,6 +700,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
db.insertNonWorkingData(nonWorkingReasonGetterSetter);
|
||||
|
||||
db.InsertSTORE_PERFORMANCE(store_performance_masterGetterSetter);
|
||||
db.InsertMAPPING_PLANOGRAM(mapping_planogram_masterGetterSetter);
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
/*final AlertMessage message = new AlertMessage(
|
||||
@@ -704,22 +760,4 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void showAlert(String str) {
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(DownloadActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(str).setCancelable(false)
|
||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
/* Intent i = new Intent(activity, StorelistActivity.class);
|
||||
activity.startActivity(i);
|
||||
activity.finish();*/
|
||||
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
}
|
||||
|
||||
+34
-35
@@ -37,9 +37,8 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
CategoryListAdapter adapter;
|
||||
|
||||
GSKOrangeDB db;
|
||||
|
||||
private SharedPreferences preferences;
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id;
|
||||
private SharedPreferences preferences;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -93,10 +92,36 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(getApplicationContext(), 2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.main, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
int id = item.getItemId();
|
||||
|
||||
if (id == android.R.id.home) {
|
||||
finish();
|
||||
}
|
||||
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (id == R.id.action_settings) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
public class CategoryListAdapter extends RecyclerView.Adapter<CategoryListAdapter.MyViewHolder> {
|
||||
private LayoutInflater inflator;
|
||||
List<CategoryGetterSetter> list = Collections.emptyList();
|
||||
Context context;
|
||||
private LayoutInflater inflator;
|
||||
|
||||
public CategoryListAdapter(CategoryListActivity context, List<CategoryGetterSetter> list) {
|
||||
inflator = LayoutInflater.from(context);
|
||||
@@ -123,19 +148,19 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
&& db.checkStockAndFacingData(store_id, categoryData.getCategory_id())
|
||||
&& db.checkPromoComplianceData(store_id, categoryData.getCategory_id())) {
|
||||
|
||||
holder.categoryIcon.setImageResource(R.drawable.ohc_done);
|
||||
holder.categoryIcon.setImageResource(R.mipmap.oralcare_tick);
|
||||
} else {
|
||||
holder.categoryIcon.setImageResource(R.drawable.ohc);
|
||||
holder.categoryIcon.setImageResource(R.mipmap.oral_care);
|
||||
}
|
||||
} 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);
|
||||
holder.categoryIcon.setImageResource(R.mipmap.wellness_tick);
|
||||
} else {
|
||||
|
||||
holder.categoryIcon.setImageResource(R.drawable.pdr);
|
||||
holder.categoryIcon.setImageResource(R.mipmap.wellness);
|
||||
}
|
||||
} else if (categoryData.getCategory().equalsIgnoreCase("Nutritionals")) {
|
||||
|
||||
@@ -143,9 +168,9 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
&& db.checkStockAndFacingData(store_id, categoryData.getCategory_id())
|
||||
&& db.checkPromoComplianceData(store_id, categoryData.getCategory_id())) {
|
||||
|
||||
holder.categoryIcon.setImageResource(R.drawable.hfd_done);
|
||||
holder.categoryIcon.setImageResource(R.mipmap.nutritionals_tick);
|
||||
} else {
|
||||
holder.categoryIcon.setImageResource(R.drawable.hfd);
|
||||
holder.categoryIcon.setImageResource(R.mipmap.nutritionals);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,30 +204,4 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.main, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
int id = item.getItemId();
|
||||
|
||||
if (id == android.R.id.home) {
|
||||
finish();
|
||||
}
|
||||
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (id == R.id.action_settings) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
+30
-31
@@ -37,9 +37,8 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
|
||||
GSKOrangeDB db;
|
||||
String categoryName = "", categoryId;
|
||||
|
||||
private SharedPreferences preferences;
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id;
|
||||
private SharedPreferences preferences;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -110,9 +109,9 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
//data.setCategory_name("Stock & Facing");
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_stock_facing));
|
||||
if (db.checkStockAndFacingData(store_id, categoryId)) {
|
||||
data.setCategory_img(R.mipmap.stock_and_facing_done);
|
||||
data.setCategory_img(R.mipmap.stock_facing_done);
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.stock_and_facing);
|
||||
data.setCategory_img(R.mipmap.stock_facing);
|
||||
}
|
||||
categoryList.add(data);
|
||||
|
||||
@@ -159,10 +158,36 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.main, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
int id = item.getItemId();
|
||||
|
||||
if (id == android.R.id.home) {
|
||||
finish();
|
||||
}
|
||||
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (id == R.id.action_settings) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
public class DailyDataMenuAdapter extends RecyclerView.Adapter<DailyDataMenuAdapter.MyViewHolder> {
|
||||
private LayoutInflater inflator;
|
||||
List<DailyDataMenuGetterSetter> list = Collections.emptyList();
|
||||
Context context;
|
||||
private LayoutInflater inflator;
|
||||
|
||||
public DailyDataMenuAdapter(Context context, List<DailyDataMenuGetterSetter> list) {
|
||||
inflator = LayoutInflater.from(context);
|
||||
@@ -232,31 +257,5 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.main, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
int id = item.getItemId();
|
||||
|
||||
if (id == android.R.id.home) {
|
||||
finish();
|
||||
}
|
||||
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (id == R.id.action_settings) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+22
-23
@@ -54,9 +54,8 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
||||
GSKOrangeDB db;
|
||||
|
||||
String categoryName, categoryId, storeId;
|
||||
|
||||
private SharedPreferences preferences;
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id;
|
||||
private SharedPreferences preferences;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -248,6 +247,25 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
int id = item.getItemId();
|
||||
|
||||
if (id == android.R.id.home) {
|
||||
finish();
|
||||
}
|
||||
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (id == R.id.action_settings) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
public class ExpandableListAdapter extends BaseExpandableListAdapter {
|
||||
private Context _context;
|
||||
private List<MSL_AvailabilityGetterSetter> _listDataHeader;
|
||||
@@ -362,8 +380,8 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
||||
holder.txt_mbq = (TextView) convertView.findViewById(R.id.txt_mbq);
|
||||
holder.toggle_available = (ToggleButton) convertView.findViewById(R.id.toggle_available);
|
||||
|
||||
holder.toggle_available.setTextOff("No");
|
||||
holder.toggle_available.setTextOn("Yes");
|
||||
/*holder.toggle_available.setTextOff("No");
|
||||
holder.toggle_available.setTextOn("Yes");*/
|
||||
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
@@ -418,23 +436,4 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
||||
ToggleButton toggle_available;
|
||||
LinearLayout lin_category;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
int id = item.getItemId();
|
||||
|
||||
if (id == android.R.id.home) {
|
||||
finish();
|
||||
}
|
||||
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (id == R.id.action_settings) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
+357
-311
@@ -1,6 +1,7 @@
|
||||
package cpm.com.gskmtorange.gsk_dailyentry;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
@@ -8,7 +9,11 @@ import android.content.SharedPreferences;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@@ -22,12 +27,16 @@ import android.support.v7.widget.CardView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.BaseExpandableListAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ExpandableListView;
|
||||
import android.widget.ImageView;
|
||||
@@ -48,31 +57,27 @@ import java.util.List;
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
|
||||
|
||||
public class Stock_FacingActivity extends AppCompatActivity {
|
||||
static int child_position = -1;
|
||||
ExpandableListView expandableListView;
|
||||
TextView txt_stockFacingName;
|
||||
|
||||
ArrayList<Stock_FacingGetterSetter> headerDataList;
|
||||
ArrayList<Stock_FacingGetterSetter> childDataList;
|
||||
List<Stock_FacingGetterSetter> hashMapListHeaderData;
|
||||
HashMap<Stock_FacingGetterSetter, List<Stock_FacingGetterSetter>> hashMapListChildData;
|
||||
List<Integer> checkHeaderArray = new ArrayList<>();
|
||||
|
||||
ExpandableListAdapter adapter;
|
||||
GSKOrangeDB db;
|
||||
|
||||
String categoryName, categoryId, Error_Message = "";
|
||||
|
||||
String path = "", str = "", _pathforcheck = "", img1 = "", img2 = "";
|
||||
static int child_position = -1;
|
||||
boolean isDialogOpen = true;
|
||||
boolean checkflag = true;
|
||||
|
||||
private SharedPreferences preferences;
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow;
|
||||
private SharedPreferences preferences;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -270,308 +275,6 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
public class ExpandableListAdapter extends BaseExpandableListAdapter {
|
||||
private Context _context;
|
||||
private List<Stock_FacingGetterSetter> _listDataHeader;
|
||||
private HashMap<Stock_FacingGetterSetter, List<Stock_FacingGetterSetter>> _listDataChild;
|
||||
|
||||
public ExpandableListAdapter(Context context, List<Stock_FacingGetterSetter> listDataHeader,
|
||||
HashMap<Stock_FacingGetterSetter, List<Stock_FacingGetterSetter>> 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 Stock_FacingGetterSetter headerTitle = (Stock_FacingGetterSetter) getGroup(groupPosition);
|
||||
|
||||
if (convertView == null) {
|
||||
LayoutInflater infalInflater = (LayoutInflater) this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
convertView = infalInflater.inflate(R.layout.item_stock_facing_header, null, false);
|
||||
}
|
||||
|
||||
TextView txt_stockFaceupHeader = (TextView) convertView.findViewById(R.id.txt_stockFaceupHeader);
|
||||
LinearLayout lin_stockFaceupHeader = (LinearLayout) convertView.findViewById(R.id.lin_stockFaceupHeader);
|
||||
ImageView img_reference = (ImageView) convertView.findViewById(R.id.img_reference);
|
||||
ImageView img_camera1 = (ImageView) convertView.findViewById(R.id.img_camera1);
|
||||
ImageView img_camera2 = (ImageView) convertView.findViewById(R.id.img_camera2);
|
||||
ImageView img_edit = (ImageView) convertView.findViewById(R.id.img_edit);
|
||||
|
||||
txt_stockFaceupHeader.setTypeface(null, Typeface.BOLD);
|
||||
txt_stockFaceupHeader.setText(headerTitle.getSub_category() + "-" + headerTitle.getBrand());
|
||||
|
||||
if (headerTitle.getCompany_id().equals("1")) {
|
||||
txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
} else {
|
||||
txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.black));
|
||||
}
|
||||
|
||||
//Camera allow enable
|
||||
if (camera_allow.equalsIgnoreCase("1")) {
|
||||
|
||||
img_camera1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
//String date = new Date().toLocaleString().toString();
|
||||
//String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
||||
|
||||
_pathforcheck = "Stock_Cam1_" + store_id + "_" + headerTitle.getBrand_id() + "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||
child_position = groupPosition;
|
||||
path = str + _pathforcheck;
|
||||
|
||||
startCameraActivity1(groupPosition);
|
||||
}
|
||||
});
|
||||
|
||||
if (!img1.equalsIgnoreCase("")) {
|
||||
if (groupPosition == child_position) {
|
||||
headerTitle.setImage1(img1);
|
||||
img1 = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (headerTitle.getImage1().equals("")) {
|
||||
img_camera1.setBackgroundResource(R.mipmap.camera);
|
||||
} else {
|
||||
img_camera1.setBackgroundResource(R.mipmap.camera_done);
|
||||
}
|
||||
|
||||
|
||||
img_camera2.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
//String date = new Date().toLocaleString().toString();
|
||||
//String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
||||
|
||||
_pathforcheck = "Stock_Cam2_" + store_id + "_" + headerTitle.getBrand_id() + "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||
child_position = groupPosition;
|
||||
path = str + _pathforcheck;
|
||||
|
||||
startCameraActivity2(groupPosition);
|
||||
}
|
||||
});
|
||||
|
||||
if (!img2.equalsIgnoreCase("")) {
|
||||
if (groupPosition == child_position) {
|
||||
headerTitle.setImage2(img2);
|
||||
img2 = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (headerTitle.getImage2().equals("")) {
|
||||
img_camera2.setBackgroundResource(R.mipmap.camera);
|
||||
} else {
|
||||
img_camera2.setBackgroundResource(R.mipmap.camera_done);
|
||||
}
|
||||
} else {
|
||||
//Camera allow disable
|
||||
img_camera1.setBackgroundResource(R.mipmap.camera);
|
||||
img_camera2.setBackgroundResource(R.mipmap.camera);
|
||||
}
|
||||
|
||||
if (!checkflag) {
|
||||
if (checkHeaderArray.contains(groupPosition)) {
|
||||
txt_stockFaceupHeader.setTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
} else {
|
||||
txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.black));
|
||||
}
|
||||
}
|
||||
|
||||
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 Stock_FacingGetterSetter childData = (Stock_FacingGetterSetter) 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();
|
||||
}
|
||||
|
||||
holder.txt_skuName.setText(childData.getSku());
|
||||
|
||||
if (childData.getCompany_id().equals("1")) {
|
||||
holder.txt_skuName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
} else {
|
||||
holder.txt_skuName.setTextColor(getResources().getColor(R.color.black));
|
||||
}
|
||||
|
||||
|
||||
if (childData.getStock().equals("0")) {
|
||||
holder.ed_facing.setEnabled(false);
|
||||
} else {
|
||||
holder.ed_facing.setEnabled(true);
|
||||
}
|
||||
|
||||
final ViewHolder finalHolder = holder;
|
||||
holder.ed_stock.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
|
||||
final EditText caption = (EditText) v;
|
||||
String edStock = caption.getText().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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
holder.ed_stock.setText(childData.getStock());
|
||||
|
||||
holder.ed_facing.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
final EditText caption = (EditText) v;
|
||||
final String edFaceup = caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
||||
|
||||
if (!childData.getStock().equals("")) {
|
||||
if (!edFaceup.equals("")) {
|
||||
if (Integer.parseInt(edFaceup) <= Integer.parseInt(childData.getStock())) {
|
||||
childData.setFacing(edFaceup);
|
||||
} else {
|
||||
if (isDialogOpen) {
|
||||
isDialogOpen = !isDialogOpen;
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(Stock_FacingActivity.this);
|
||||
builder.setMessage("Faceup can not be greater than 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 {
|
||||
childData.setFacing("");
|
||||
}
|
||||
} else {
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
holder.ed_facing.setText(childData.getFacing());
|
||||
|
||||
if (!checkflag) {
|
||||
boolean tempflag = false;
|
||||
|
||||
if (holder.ed_stock.getText().toString().equals("")) {
|
||||
holder.ed_stock.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
holder.ed_stock.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.ed_stock.setHint("Empty");
|
||||
tempflag = true;
|
||||
}
|
||||
|
||||
if (holder.ed_facing.getText().toString().equals("")) {
|
||||
holder.ed_facing.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
holder.ed_facing.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.ed_facing.setHint("Empty");
|
||||
tempflag = true;
|
||||
}
|
||||
|
||||
if (tempflag) {
|
||||
holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
} else {
|
||||
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||
}
|
||||
}
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
boolean validateData(List<Stock_FacingGetterSetter> listDataHeader,
|
||||
HashMap<Stock_FacingGetterSetter, List<Stock_FacingGetterSetter>> listDataChild) {
|
||||
boolean flag = true;
|
||||
@@ -812,6 +515,12 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
return cdate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.planogram, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
@@ -823,11 +532,348 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
finish();
|
||||
}
|
||||
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (id == R.id.action_settings) {
|
||||
//Planogram Dialog
|
||||
if (id == R.id.action_planogram) {
|
||||
//final Dialog dialog = new Dialog(Stock_FacingActivity.this, android.R.style.Theme_Black_NoTitleBar_Fullscreen);
|
||||
final Dialog dialog = new Dialog(Stock_FacingActivity.this);
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
//dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
dialog.setContentView(R.layout.planogram_dialog_layout);
|
||||
dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
||||
|
||||
ImageView img_planogram = (ImageView) dialog.findViewById(R.id.img_planogram);
|
||||
|
||||
String planogram_image = "";
|
||||
if (new File(str + planogram_image).exists()) {
|
||||
Bitmap bmp = BitmapFactory.decodeFile(str + planogram_image);
|
||||
img_planogram.setImageBitmap(bmp);
|
||||
} else {
|
||||
img_planogram.setBackgroundResource(R.drawable.sad_cloud);
|
||||
}
|
||||
|
||||
/*if (new File(str + "Stock_Cam1_3_9_01122017_162052.jpg").exists()) {
|
||||
Bitmap bmp = BitmapFactory.decodeFile(str + "Stock_Cam1_3_9_01122017_162052.jpg");
|
||||
img_planogram.setImageBitmap(bmp);
|
||||
} else {
|
||||
img_planogram.setBackgroundResource(R.drawable.sad_cloud);
|
||||
}*/
|
||||
|
||||
|
||||
ImageView cancel = (ImageView) dialog.findViewById(R.id.img_cancel);
|
||||
cancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
dialog.show();
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
public class ExpandableListAdapter extends BaseExpandableListAdapter {
|
||||
private Context _context;
|
||||
private List<Stock_FacingGetterSetter> _listDataHeader;
|
||||
private HashMap<Stock_FacingGetterSetter, List<Stock_FacingGetterSetter>> _listDataChild;
|
||||
|
||||
public ExpandableListAdapter(Context context, List<Stock_FacingGetterSetter> listDataHeader,
|
||||
HashMap<Stock_FacingGetterSetter, List<Stock_FacingGetterSetter>> 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 Stock_FacingGetterSetter headerTitle = (Stock_FacingGetterSetter) getGroup(groupPosition);
|
||||
|
||||
if (convertView == null) {
|
||||
LayoutInflater infalInflater = (LayoutInflater) this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
convertView = infalInflater.inflate(R.layout.item_stock_facing_header, null, false);
|
||||
}
|
||||
|
||||
TextView txt_stockFaceupHeader = (TextView) convertView.findViewById(R.id.txt_stockFaceupHeader);
|
||||
TextView txt_sosHeader = (TextView) convertView.findViewById(R.id.txt_sosHeader);
|
||||
LinearLayout lin_stockFaceupHeader = (LinearLayout) convertView.findViewById(R.id.lin_stockFaceupHeader);
|
||||
ImageView img_camera1 = (ImageView) convertView.findViewById(R.id.img_camera1);
|
||||
ImageView img_camera2 = (ImageView) convertView.findViewById(R.id.img_camera2);
|
||||
//ImageView img_reference = (ImageView) convertView.findViewById(R.id.img_reference);
|
||||
//ImageView img_edit = (ImageView) convertView.findViewById(R.id.img_edit);
|
||||
|
||||
txt_stockFaceupHeader.setTypeface(null, Typeface.BOLD);
|
||||
txt_stockFaceupHeader.setText(headerTitle.getSub_category() + "-" + headerTitle.getBrand());
|
||||
|
||||
if (headerTitle.getCompany_id().equals("1")) {
|
||||
txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
} else {
|
||||
txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.black));
|
||||
}
|
||||
|
||||
//Camera allow enable
|
||||
if (camera_allow.equalsIgnoreCase("1")) {
|
||||
|
||||
img_camera1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
//String date = new Date().toLocaleString().toString();
|
||||
//String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
||||
|
||||
_pathforcheck = "Stock_Cam1_" + store_id + "_" + headerTitle.getBrand_id() + "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||
child_position = groupPosition;
|
||||
path = str + _pathforcheck;
|
||||
|
||||
startCameraActivity1(groupPosition);
|
||||
}
|
||||
});
|
||||
|
||||
if (!img1.equalsIgnoreCase("")) {
|
||||
if (groupPosition == child_position) {
|
||||
headerTitle.setImage1(img1);
|
||||
img1 = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (headerTitle.getImage1().equals("")) {
|
||||
img_camera1.setBackgroundResource(R.mipmap.camera_orange);
|
||||
} else {
|
||||
img_camera1.setBackgroundResource(R.mipmap.camera_green);
|
||||
}
|
||||
|
||||
|
||||
img_camera2.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
//String date = new Date().toLocaleString().toString();
|
||||
//String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
||||
|
||||
_pathforcheck = "Stock_Cam2_" + store_id + "_" + headerTitle.getBrand_id() + "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||
child_position = groupPosition;
|
||||
path = str + _pathforcheck;
|
||||
|
||||
startCameraActivity2(groupPosition);
|
||||
}
|
||||
});
|
||||
|
||||
if (!img2.equalsIgnoreCase("")) {
|
||||
if (groupPosition == child_position) {
|
||||
headerTitle.setImage2(img2);
|
||||
img2 = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (headerTitle.getImage2().equals("")) {
|
||||
img_camera2.setBackgroundResource(R.mipmap.camera_orange);
|
||||
} else {
|
||||
img_camera2.setBackgroundResource(R.mipmap.camera_green);
|
||||
}
|
||||
} else {
|
||||
//Camera allow disable
|
||||
img_camera1.setBackgroundResource(R.mipmap.camera_grey);
|
||||
img_camera2.setBackgroundResource(R.mipmap.camera_grey);
|
||||
}
|
||||
|
||||
if (!checkflag) {
|
||||
if (checkHeaderArray.contains(groupPosition)) {
|
||||
txt_stockFaceupHeader.setTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
} else {
|
||||
txt_stockFaceupHeader.setTextColor(getResources().getColor(R.color.black));
|
||||
}
|
||||
}
|
||||
|
||||
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 Stock_FacingGetterSetter childData = (Stock_FacingGetterSetter) 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();
|
||||
}
|
||||
|
||||
holder.txt_skuName.setText(childData.getSku());
|
||||
|
||||
if (childData.getCompany_id().equals("1")) {
|
||||
holder.txt_skuName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
} else {
|
||||
holder.txt_skuName.setTextColor(getResources().getColor(R.color.black));
|
||||
}
|
||||
|
||||
|
||||
if (childData.getStock().equals("0")) {
|
||||
holder.ed_facing.setEnabled(false);
|
||||
} else {
|
||||
holder.ed_facing.setEnabled(true);
|
||||
}
|
||||
|
||||
final ViewHolder finalHolder = holder;
|
||||
holder.ed_stock.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
|
||||
final EditText caption = (EditText) v;
|
||||
String edStock = caption.getText().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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
holder.ed_stock.setText(childData.getStock());
|
||||
|
||||
holder.ed_facing.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
final EditText caption = (EditText) v;
|
||||
final String edFaceup = caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
||||
|
||||
if (!childData.getStock().equals("")) {
|
||||
if (!edFaceup.equals("")) {
|
||||
if (Integer.parseInt(edFaceup) <= Integer.parseInt(childData.getStock())) {
|
||||
childData.setFacing(edFaceup);
|
||||
} else {
|
||||
if (isDialogOpen) {
|
||||
isDialogOpen = !isDialogOpen;
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(Stock_FacingActivity.this);
|
||||
builder.setMessage("Faceup can not be greater than 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 {
|
||||
childData.setFacing("");
|
||||
}
|
||||
} else {
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
holder.ed_facing.setText(childData.getFacing());
|
||||
|
||||
if (!checkflag) {
|
||||
boolean tempflag = false;
|
||||
|
||||
if (holder.ed_stock.getText().toString().equals("")) {
|
||||
holder.ed_stock.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
holder.ed_stock.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.ed_stock.setHint("Empty");
|
||||
tempflag = true;
|
||||
}
|
||||
|
||||
if (holder.ed_facing.getText().toString().equals("")) {
|
||||
holder.ed_facing.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
holder.ed_facing.setHintTextColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
holder.ed_facing.setHint("Empty");
|
||||
tempflag = true;
|
||||
}
|
||||
|
||||
if (tempflag) {
|
||||
holder.cardView.setCardBackgroundColor(getResources().getColor(android.R.color.holo_red_dark));
|
||||
} else {
|
||||
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
|
||||
}
|
||||
}
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,33 +48,28 @@ import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
||||
|
||||
public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
private Dialog dialog;
|
||||
private ProgressBar pb;
|
||||
private TextView percentage, message;
|
||||
GSKOrangeDB db;
|
||||
ArrayList<CoverageBean> coverageList;
|
||||
|
||||
private FailureGetterSetter failureGetterSetter = null;
|
||||
private SharedPreferences preferences;
|
||||
String date, userId, app_version;
|
||||
|
||||
StoreBean storeData;
|
||||
String datacheck = "";
|
||||
String[] words;
|
||||
String validity;
|
||||
int mid;
|
||||
private int factor, k = 0;
|
||||
String errormsg = "", Path;
|
||||
|
||||
Data data;
|
||||
|
||||
ArrayList<MSL_AvailabilityGetterSetter> msl_availabilityList;
|
||||
ArrayList<Stock_FacingGetterSetter> stock_facingHeaderList, stock_facingChildList;
|
||||
ArrayList<Promo_Compliance_DataGetterSetter> promotionSkuList, additionalPromotionList;
|
||||
ArrayList<T2PGetterSetter> t2PGetterSetters;
|
||||
ArrayList<AddittionalGetterSetter> additionalVisibilityList;
|
||||
ArrayList<AdditionalDialogGetterSetter> additionalVisibilitySkuList;
|
||||
|
||||
private Dialog dialog;
|
||||
private ProgressBar pb;
|
||||
private TextView percentage, message;
|
||||
private FailureGetterSetter failureGetterSetter = null;
|
||||
private SharedPreferences preferences;
|
||||
private int factor, k = 0;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -97,6 +92,85 @@ public class UploadActivity extends AppCompatActivity {
|
||||
new UploadTask(this).execute();
|
||||
}
|
||||
|
||||
public String UploadImage(String path, String folder_name) throws Exception {
|
||||
errormsg = "";
|
||||
BitmapFactory.Options o = new BitmapFactory.Options();
|
||||
o.inJustDecodeBounds = true;
|
||||
BitmapFactory.decodeFile(Path + path, o);
|
||||
|
||||
// The new size we want to scale to
|
||||
final int REQUIRED_SIZE = 1639;
|
||||
|
||||
// Find the correct scale value. It should be the power of 2.
|
||||
int width_tmp = o.outWidth, height_tmp = o.outHeight;
|
||||
int scale = 1;
|
||||
|
||||
while (true) {
|
||||
if (width_tmp < REQUIRED_SIZE && height_tmp < REQUIRED_SIZE)
|
||||
break;
|
||||
width_tmp /= 2;
|
||||
height_tmp /= 2;
|
||||
scale *= 2;
|
||||
}
|
||||
|
||||
// Decode with inSampleSize
|
||||
BitmapFactory.Options o2 = new BitmapFactory.Options();
|
||||
o2.inSampleSize = scale;
|
||||
Bitmap bitmap = BitmapFactory.decodeFile(Path + path, o2);
|
||||
|
||||
ByteArrayOutputStream bao = new ByteArrayOutputStream();
|
||||
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, bao);
|
||||
byte[] ba = bao.toByteArray();
|
||||
String ba1 = Base64.encodeBytes(ba);
|
||||
|
||||
SoapObject request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_IMAGE);
|
||||
|
||||
String[] split = path.split("/");
|
||||
String path1 = split[split.length - 1];
|
||||
|
||||
request.addProperty("img", ba1);
|
||||
request.addProperty("name", path1);
|
||||
request.addProperty("FolderName", folder_name);
|
||||
|
||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UPLOAD_IMAGE, envelope);
|
||||
|
||||
Object result = envelope.getResponse();
|
||||
|
||||
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
if (result.toString().equalsIgnoreCase(CommonString.KEY_FALSE)) {
|
||||
return CommonString.KEY_FALSE;
|
||||
}
|
||||
|
||||
SAXParserFactory saxPF = SAXParserFactory.newInstance();
|
||||
SAXParser saxP = saxPF.newSAXParser();
|
||||
XMLReader xmlR = saxP.getXMLReader();
|
||||
|
||||
// for failure
|
||||
FailureXMLHandler failureXMLHandler = new FailureXMLHandler();
|
||||
xmlR.setContentHandler(failureXMLHandler);
|
||||
|
||||
InputSource is = new InputSource();
|
||||
is.setCharacterStream(new StringReader(result.toString()));
|
||||
xmlR.parse(is);
|
||||
|
||||
failureGetterSetter = failureXMLHandler.getFailureGetterSetter();
|
||||
|
||||
if (failureGetterSetter.getStatus().equalsIgnoreCase(CommonString.KEY_FAILURE)) {
|
||||
errormsg = failureGetterSetter.getErrorMsg();
|
||||
return CommonString.KEY_FAILURE;
|
||||
}
|
||||
} else {
|
||||
new File(Path + path).delete();
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
class Data {
|
||||
int value;
|
||||
String name;
|
||||
@@ -185,7 +259,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UPLOAD_STORE_COVERAGE, envelope);
|
||||
|
||||
Object result = (Object) envelope.getResponse();
|
||||
Object result = envelope.getResponse();
|
||||
|
||||
datacheck = result.toString();
|
||||
words = datacheck.split("\\;");
|
||||
@@ -217,6 +291,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
+ "[CATEGORY_ID]" + Integer.parseInt(msl_availabilityList.get(j).getCategory_id()) + "[/CATEGORY_ID]"
|
||||
+ "[BRAND_ID]" + Integer.parseInt(msl_availabilityList.get(j).getBrand_id()) + "[/BRAND_ID]"
|
||||
+ "[SKU_ID]" + Integer.parseInt(msl_availabilityList.get(j).getSku_id()) + "[/SKU_ID]"
|
||||
+ "[MBQ]" + Integer.parseInt(msl_availabilityList.get(j).getMbq()) + "[/MBQ]"
|
||||
//+ "[SKU]" + msl_availabilityList.get(j).getSku() + "[/SKU]"
|
||||
+ "[TOGGLE_VALUE]" + Integer.parseInt(msl_availabilityList.get(j).getToggleValue()) + "[/TOGGLE_VALUE]"
|
||||
+ "[/MSL_AVAILABILITY_DATA]";
|
||||
@@ -240,7 +315,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
@@ -309,7 +384,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
@@ -368,7 +443,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
@@ -427,7 +502,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
@@ -532,7 +607,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
@@ -666,7 +741,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
@@ -759,7 +834,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_COVERAGE_STATUS, envelope);
|
||||
|
||||
result = (Object) envelope.getResponse();
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_COVERAGE_STATUS;
|
||||
@@ -802,83 +877,4 @@ public class UploadActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String UploadImage(String path, String folder_name) throws Exception {
|
||||
errormsg = "";
|
||||
BitmapFactory.Options o = new BitmapFactory.Options();
|
||||
o.inJustDecodeBounds = true;
|
||||
BitmapFactory.decodeFile(Path + path, o);
|
||||
|
||||
// The new size we want to scale to
|
||||
final int REQUIRED_SIZE = 1639;
|
||||
|
||||
// Find the correct scale value. It should be the power of 2.
|
||||
int width_tmp = o.outWidth, height_tmp = o.outHeight;
|
||||
int scale = 1;
|
||||
|
||||
while (true) {
|
||||
if (width_tmp < REQUIRED_SIZE && height_tmp < REQUIRED_SIZE)
|
||||
break;
|
||||
width_tmp /= 2;
|
||||
height_tmp /= 2;
|
||||
scale *= 2;
|
||||
}
|
||||
|
||||
// Decode with inSampleSize
|
||||
BitmapFactory.Options o2 = new BitmapFactory.Options();
|
||||
o2.inSampleSize = scale;
|
||||
Bitmap bitmap = BitmapFactory.decodeFile(Path + path, o2);
|
||||
|
||||
ByteArrayOutputStream bao = new ByteArrayOutputStream();
|
||||
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, bao);
|
||||
byte[] ba = bao.toByteArray();
|
||||
String ba1 = Base64.encodeBytes(ba);
|
||||
|
||||
SoapObject request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_IMAGE);
|
||||
|
||||
String[] split = path.split("/");
|
||||
String path1 = split[split.length - 1];
|
||||
|
||||
request.addProperty("img", ba1);
|
||||
request.addProperty("name", path1);
|
||||
request.addProperty("FolderName", folder_name);
|
||||
|
||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UPLOAD_IMAGE, envelope);
|
||||
|
||||
Object result = (Object) envelope.getResponse();
|
||||
|
||||
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
if (result.toString().equalsIgnoreCase(CommonString.KEY_FALSE)) {
|
||||
return CommonString.KEY_FALSE;
|
||||
}
|
||||
|
||||
SAXParserFactory saxPF = SAXParserFactory.newInstance();
|
||||
SAXParser saxP = saxPF.newSAXParser();
|
||||
XMLReader xmlR = saxP.getXMLReader();
|
||||
|
||||
// for failure
|
||||
FailureXMLHandler failureXMLHandler = new FailureXMLHandler();
|
||||
xmlR.setContentHandler(failureXMLHandler);
|
||||
|
||||
InputSource is = new InputSource();
|
||||
is.setCharacterStream(new StringReader(result.toString()));
|
||||
xmlR.parse(is);
|
||||
|
||||
failureGetterSetter = failureXMLHandler.getFailureGetterSetter();
|
||||
|
||||
if (failureGetterSetter.getStatus().equalsIgnoreCase(CommonString.KEY_FAILURE)) {
|
||||
errormsg = failureGetterSetter.getErrorMsg();
|
||||
return CommonString.KEY_FAILURE;
|
||||
}
|
||||
} else {
|
||||
new File(Path + path).delete();
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
}
|
||||
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by gagang on 12-01-2017.
|
||||
*/
|
||||
|
||||
public class MAPPING_PLANOGRAM_MasterGetterSetter {
|
||||
String table_MAPPING_PLANOGRAM;
|
||||
|
||||
ArrayList<String> KEYACCOUNT_ID = new ArrayList<>();
|
||||
ArrayList<String> STORETYPE_ID = new ArrayList<>();
|
||||
ArrayList<String> CLASS_ID = new ArrayList<>();
|
||||
ArrayList<String> PLANOGRAM_IMAGE = new ArrayList<>();
|
||||
ArrayList<String> IMAGE_PATH = new ArrayList<>();
|
||||
|
||||
public String getTable_MAPPING_PLANOGRAM() {
|
||||
return table_MAPPING_PLANOGRAM;
|
||||
}
|
||||
|
||||
public void setTable_MAPPING_PLANOGRAM(String table_MAPPING_PLANOGRAM) {
|
||||
this.table_MAPPING_PLANOGRAM = table_MAPPING_PLANOGRAM;
|
||||
}
|
||||
|
||||
public ArrayList<String> getKEYACCOUNT_ID() {
|
||||
return KEYACCOUNT_ID;
|
||||
}
|
||||
|
||||
public void setKEYACCOUNT_ID(String KEYACCOUNT_ID) {
|
||||
this.KEYACCOUNT_ID.add(KEYACCOUNT_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getSTORETYPE_ID() {
|
||||
return STORETYPE_ID;
|
||||
}
|
||||
|
||||
public void setSTORETYPE_ID(String STORETYPE_ID) {
|
||||
this.STORETYPE_ID.add(STORETYPE_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getCLASS_ID() {
|
||||
return CLASS_ID;
|
||||
}
|
||||
|
||||
public void setCLASS_ID(String CLASS_ID) {
|
||||
this.CLASS_ID.add(CLASS_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getPLANOGRAM_IMAGE() {
|
||||
return PLANOGRAM_IMAGE;
|
||||
}
|
||||
|
||||
public void setPLANOGRAM_IMAGE(String PLANOGRAM_IMAGE) {
|
||||
this.PLANOGRAM_IMAGE.add(PLANOGRAM_IMAGE);
|
||||
}
|
||||
|
||||
public ArrayList<String> getIMAGE_PATH() {
|
||||
return IMAGE_PATH;
|
||||
}
|
||||
|
||||
public void setIMAGE_PATH(String IMAGE_PATH) {
|
||||
this.IMAGE_PATH.add(IMAGE_PATH);
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ public class TableBean {
|
||||
//Gagan start code
|
||||
public static String MAPPING_ADDITIONAL_PROMOTION;
|
||||
public static String STORE_PERFORMANCE;
|
||||
public static String MAPPING_PLANOGRAM;
|
||||
|
||||
//Gagan end code
|
||||
|
||||
@@ -139,5 +140,13 @@ public class TableBean {
|
||||
STORE_PERFORMANCE = storePerformance;
|
||||
}
|
||||
|
||||
public static String getMappingPlanogram() {
|
||||
return MAPPING_PLANOGRAM;
|
||||
}
|
||||
|
||||
public static void setMappingPlanogram(String mappingPlanogram) {
|
||||
MAPPING_PLANOGRAM = mappingPlanogram;
|
||||
}
|
||||
|
||||
//Gagan end code
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
||||
@@ -670,5 +671,41 @@ public class XMLHandlers {
|
||||
}
|
||||
return st;
|
||||
}
|
||||
|
||||
public static MAPPING_PLANOGRAM_MasterGetterSetter MAPPING_PLANOGRAM_XMLHandler(XmlPullParser xpp, int eventType) {
|
||||
MAPPING_PLANOGRAM_MasterGetterSetter st = new MAPPING_PLANOGRAM_MasterGetterSetter();
|
||||
|
||||
try {
|
||||
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||
|
||||
if (xpp.getName().equals("META_DATA")) {
|
||||
st.setTable_MAPPING_PLANOGRAM(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("KEYACCOUNT_ID")) {
|
||||
st.setKEYACCOUNT_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("STORETYPE_ID")) {
|
||||
st.setSTORETYPE_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("CLASS_ID")) {
|
||||
st.setCLASS_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("PLANOGRAM_IMAGE")) {
|
||||
st.setPLANOGRAM_IMAGE(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("IMAGE_PATH")) {
|
||||
st.setIMAGE_PATH(xpp.nextText());
|
||||
}
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
} catch (XmlPullParserException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return st;
|
||||
}
|
||||
//Gagan End Code
|
||||
}
|
||||
|
||||
@@ -93,7 +93,9 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/toggle_selector_background" />
|
||||
android:background="@drawable/toggle_selector_background"
|
||||
android:textOff="@string/no"
|
||||
android:textOn="@string/yes" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -23,35 +23,48 @@
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingRight="10dp">
|
||||
android:layout_weight="1.5"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="5dp"
|
||||
android:weightSum="2">
|
||||
<!--android:gravity="center_vertical"-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_stockFaceupHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="25dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.4"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="5dp"
|
||||
android:text="Brand Name"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_sosHeader"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight=".6"
|
||||
android:paddingRight="5dp"
|
||||
android:text="@string/stock_facing_sos"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />
|
||||
</LinearLayout>
|
||||
|
||||
<!--Camera Images-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_weight=".5"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
<!--<ImageView
|
||||
android:id="@+id/img_reference"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:src="@mipmap/star" />
|
||||
android:src="@mipmap/star" />-->
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_camera1"
|
||||
@@ -67,13 +80,14 @@
|
||||
android:layout_marginRight="10dp" />
|
||||
<!--android:src="@drawable/ic_menu_camera"-->
|
||||
|
||||
<ImageView
|
||||
<!--<ImageView
|
||||
android:id="@+id/img_edit"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:src="@mipmap/no_camera" />
|
||||
android:src="@mipmap/no_camera" />-->
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?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="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- <android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
card_view:cardCornerRadius="20dp">-->
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<!--Title and Image-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#90888888"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/colorPrimary"
|
||||
android:padding="10dp"
|
||||
android:text="@string/stock_facing_planogram_dialog_title"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_planogram"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="10dp"
|
||||
android:src="@drawable/sad_cloud"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!--Cancel Image-->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right"
|
||||
android:layout_margin="5dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_cancel"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:src="@mipmap/cancel" />
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
<!--</android.support.v7.widget.CardView>-->
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/action_planogram"
|
||||
android:icon="@mipmap/star"
|
||||
android:orderInCategory="100"
|
||||
android:title="planogram"
|
||||
app:showAsAction="always" />
|
||||
</menu>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 995 B |
@@ -71,6 +71,7 @@
|
||||
<string name="stock_facing_stock">X</string>
|
||||
<string name="stock_facing_faceup">Önyüz</string>
|
||||
<string name="stock_facing_sos_target">Raf Payı Hedefi</string>
|
||||
<string name="stock_facing_sos">Raf Payi</string>
|
||||
|
||||
<string name="title_activity_promo_compliance">Promosyon</string>
|
||||
|
||||
@@ -95,6 +96,9 @@
|
||||
<string name="category_performance_lsv">Son Ziyaret</string>
|
||||
|
||||
<string name="title_activity_store_wise_performance">Mağaza Performansı</string>
|
||||
|
||||
<!--Gagan End Code -->
|
||||
|
||||
<!--Gagan start new code 2-->
|
||||
<string name="stock_facing_planogram_dialog_title">Planogram</string>
|
||||
<!--Gagan end new code 2-->
|
||||
</resources>
|
||||
@@ -80,6 +80,7 @@
|
||||
<string name="stock_facing_stock">Stock</string>
|
||||
<string name="stock_facing_faceup">Facing</string>
|
||||
<string name="stock_facing_sos_target">SOS Target</string>
|
||||
<string name="stock_facing_sos">SOS</string>
|
||||
|
||||
<!--Gagan end code-->
|
||||
|
||||
@@ -147,5 +148,8 @@
|
||||
<string name="fill_gaps_data">Please fill GAP data</string>
|
||||
<string name="data_will_be_lost">Want to proceed usaved data will be deleted</string>
|
||||
|
||||
<!--Gagan start new code 2-->
|
||||
<string name="stock_facing_planogram_dialog_title">Planogram</string>
|
||||
<!--Gagan end new code 2-->
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user