This commit is contained in:
Gagan290
2016-12-29 12:15:47 +05:30
parent 1a810172d5
commit fbd9780d0f
10 changed files with 189 additions and 849 deletions
+12 -4
View File
@@ -50,22 +50,30 @@
<activity
android:name=".gsk_dailyentry.CategoryListActivity"
android:theme="@style/AppTheme.NoActionBar" />
android:configChanges="screenSize|orientation|keyboardHidden"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<!--android:label="@string/title_activity_category_list"-->
<activity
android:name=".gsk_dailyentry.CategoryWisePerformanceActivity"
android:theme="@style/AppTheme.NoActionBar" />
android:configChanges="screenSize|orientation|keyboardHidden"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<!-- android:label="@string/title_activity_category_wise_performance" -->
<activity
android:name=".gsk_dailyentry.DailyDataMenuActivity"
android:theme="@style/AppTheme.NoActionBar" />
android:configChanges="screenSize|orientation|keyboardHidden"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<!--android:label="@string/title_activity_daily_main_menu"-->
<activity
android:name=".gsk_dailyentry.MSL_AvailabilityActivity"
android:theme="@style/AppTheme.NoActionBar" />
android:configChanges="screenSize|orientation|keyboardHidden"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<!--android:label="@string/title_activity_msl__availability"-->
</application>
@@ -22,6 +22,7 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.ToggleButton;
import java.util.ArrayList;
import java.util.HashMap;
@@ -32,6 +33,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
public class MSL_AvailabilityActivity extends AppCompatActivity {
ExpandableListView expandableListView;
TextView txt_mslAvailabilityName;
ArrayList<MSL_AvailabilityGetterSetter> headerDataList;
ArrayList<MSL_AvailabilityGetterSetter> childDataList;
@@ -51,10 +53,10 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
expandableListView = (ExpandableListView) findViewById(R.id.expandableListView);
txt_mslAvailabilityName = (TextView) findViewById(R.id.txt_mslAvailabilityName);
prepareList();
adapter = new ExpandableListAdapter(this, hashMapListHeaderData, hashMapListChildData);
expandableListView.setAdapter(adapter);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
@@ -132,7 +134,6 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
private void prepareList() {
headerDataList = new ArrayList<>();
MSL_AvailabilityGetterSetter msl = new MSL_AvailabilityGetterSetter();
msl.setBrandName("Parodontax header 1");
msl.setMbq("6");
@@ -141,8 +142,14 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
msl = new MSL_AvailabilityGetterSetter();
msl.setBrandName("Parodontax header 2");
msl.setMbq("6");
msl.setAvailable("No");
msl.setMbq("7");
msl.setAvailable("Yes");
headerDataList.add(msl);
msl = new MSL_AvailabilityGetterSetter();
msl.setBrandName("Parodontax header 3");
msl.setMbq("8");
msl.setAvailable("Yes");
headerDataList.add(msl);
@@ -158,33 +165,23 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
MSL_AvailabilityGetterSetter msl1 = new MSL_AvailabilityGetterSetter();
msl.setBrandName("Parodontax 1");
msl.setMbq("6");
msl.setMbq("1");
msl.setAvailable("No");
childDataList.add(msl1);
msl1 = new MSL_AvailabilityGetterSetter();
msl.setBrandName("Parodontax 2");
msl.setMbq("6");
msl.setMbq("2");
msl.setAvailable("No");
childDataList.add(msl1);
/*msl1 = new MSL_AvailabilityGetterSetter();
msl.setBrandName("Parodontax 3");
msl.setMbq("6");
msl.setAvailable("No");
childDataList.add(msl1);
msl1 = new MSL_AvailabilityGetterSetter();
msl.setBrandName("Parodontax 4");
msl.setMbq("6");
msl.setAvailable("No");
childDataList.add(msl1);*/
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
}
}
adapter = new ExpandableListAdapter(this, hashMapListHeaderData, hashMapListChildData);
expandableListView.setAdapter(adapter);
}
public class ExpandableListAdapter extends BaseExpandableListAdapter {
@@ -216,20 +213,19 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
@Override
public View getGroupView(final int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
final MSL_AvailabilityGetterSetter headerTitle = (MSL_AvailabilityGetterSetter) getGroup(groupPosition);
MSL_AvailabilityGetterSetter headerTitle = (MSL_AvailabilityGetterSetter) getGroup(groupPosition);
if (convertView == null) {
LayoutInflater infalInflater = (LayoutInflater) this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = infalInflater.inflate(R.layout.list_group_opening, null, false);
convertView = infalInflater.inflate(R.layout.item_msl_availability_header, null, false);
}
//final int position = convertView.getId();
TextView txt_header = (TextView) convertView.findViewById(R.id.txt_Header);
TextView txt_categoryHeader = (TextView) convertView.findViewById(R.id.txt_categoryHeader);
RelativeLayout rel_header = (RelativeLayout) convertView.findViewById(R.id.rel_categoryHeader);
ImageView img_camera = (ImageView) convertView.findViewById(R.id.img_camera);
RelativeLayout rel_header = (RelativeLayout) convertView.findViewById(R.id.rel_header);
txt_header.setTypeface(null, Typeface.BOLD);
txt_header.setText(headerTitle.getBrandName());
txt_categoryHeader.setTypeface(null, Typeface.BOLD);
txt_categoryHeader.setText(headerTitle.getBrandName());
/*img_camera.setOnClickListener(new View.OnClickListener() {
@Override
@@ -292,354 +288,22 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
if (convertView == null) {
LayoutInflater infalInflater = (LayoutInflater) this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = infalInflater.inflate(R.layout.list_item_openingstk, null, false);
convertView = infalInflater.inflate(R.layout.item_msl_availability_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_faceup = (EditText) convertView.findViewById(R.id.ed_faceup);
holder.lin_item = (LinearLayout) convertView.findViewById(R.id.lin_item);
holder.ed_mbq = (EditText) convertView.findViewById(R.id.ed_mbq);
holder.toggle_available = (ToggleButton) convertView.findViewById(R.id.toggle_available);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.txt_skuName.setText(childData.getBrandName());
/*if (childData.getFocus().equals("1")) {
holder.lin_item.setBackgroundColor(getResources().getColor(R.color.green));
} else if (childData.getInno().equals("1")) {
holder.lin_item.setBackgroundColor(getResources().getColor(R.color.yellow));
}
_listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition).setSku_cd(childData.getSku_cd());
holder.txt_skuName.setText(childData.getSku());
//MFD Visibility
if (childData.getMfd().equals("1")) {
holder.lin_oldest_MFD.setVisibility(View.VISIBLE);
holder.lin_latest_MFD.setVisibility(View.VISIBLE);
} else {
holder.lin_oldest_MFD.setVisibility(View.GONE);
holder.lin_latest_MFD.setVisibility(View.GONE);
}
if (childData.getStock().equals("0")) {
holder.ed_faceup.setEnabled(false);
holder.btn_old_Date.setEnabled(false);
holder.btn_new_Date.setEnabled(false);
} else {
holder.ed_faceup.setEnabled(true);
holder.btn_old_Date.setEnabled(true);
holder.btn_new_Date.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+(?!$)", "");
_listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition).setStock(stock);
if (edStock.equals("0")) {
_listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition).setFaceup("0");
childData.setOldDate("");
childData.setNewDate("");
finalHolder.ed_faceup.setEnabled(false);
finalHolder.btn_old_Date.setEnabled(false);
finalHolder.btn_new_Date.setEnabled(false);
} else {
_listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition).setFaceup(childData.getFaceup());
finalHolder.ed_faceup.setEnabled(true);
finalHolder.btn_old_Date.setEnabled(true);
finalHolder.btn_new_Date.setEnabled(true);
}
} else {
_listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition).setStock("");
finalHolder.ed_faceup.setEnabled(true);
finalHolder.btn_old_Date.setEnabled(true);
finalHolder.btn_new_Date.setEnabled(true);
}
}
});
holder.ed_stock.setText(_listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition).getStock());
holder.ed_faceup.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())) {
_listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition).setFaceup(edFaceup);
} else {
if (isDialogOpen) {
isDialogOpen = !isDialogOpen;
AlertDialog.Builder builder = new AlertDialog.Builder(OrderEntryActivity.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 {
_listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition).setFaceup("");
}
} else {
if (isDialogOpen) {
isDialogOpen = !isDialogOpen;
AlertDialog.Builder builder = new AlertDialog.Builder(OrderEntryActivity.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_faceup.setText(_listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition).getFaceup());
holder.btn_new_Date.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final Calendar c = Calendar.getInstance();
mYear = c.get(Calendar.YEAR);
mMonth = c.get(Calendar.MONTH);
mDay = c.get(Calendar.DAY_OF_MONTH);
// Launch Date Picker Dialog
DatePickerDialog dpd = new DatePickerDialog(OrderEntryActivity.this,
new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
// Display Selected date in textbox
try {
if (childData.getOldDate().equals("")) {
String sDate = (monthOfYear + 1) + "/" + dayOfMonth + "/" + year;
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
Date date1 = sdf.parse(sDate);
Date visitDate = sdf.parse(visit_date);
if (date1.compareTo(visitDate) != 1) {
String date = (monthOfYear + 1) + "/" + dayOfMonth + "/" + year;
_listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition).setNewDate(date);
expListView.invalidateViews();
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(OrderEntryActivity.this);
builder.setMessage("Latest Date can not be greater than the current date ")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
AlertDialog alert = builder.create();
alert.show();
}
} else {
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
Date oldDate = sdf.parse(childData.getOldDate());
String sDate = (monthOfYear + 1) + "/" + dayOfMonth + "/" + year;
Date newDate = sdf.parse(sDate);
Date visitDate = sdf.parse(visit_date);
if (newDate.compareTo(oldDate) == -1) {
AlertDialog.Builder builder = new AlertDialog.Builder(OrderEntryActivity.this);
builder.setMessage("Latest Date can not be less than the oldest date ")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
AlertDialog alert = builder.create();
alert.show();
} else {
if (newDate.compareTo(visitDate) != 1) {
String date = (monthOfYear + 1) + "/" + dayOfMonth + "/" + year;
_listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition).setNewDate(date);
expListView.invalidateViews();
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(OrderEntryActivity.this);
builder.setMessage("Latest Date can not be greater than the current date ")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
AlertDialog alert = builder.create();
alert.show();
}
}
}
} catch (ParseException e) {
e.printStackTrace();
}
}
}
, mYear, mMonth, mDay);
dpd.show();
}
});
if (childData.getNewDate().equals("")) {
holder.txt_showNewDate.setText("");
} else {
holder.txt_showNewDate.setText(childData.getNewDate());
}
holder.btn_old_Date.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final Calendar c = Calendar.getInstance();
mYear = c.get(Calendar.YEAR);
mMonth = c.get(Calendar.MONTH);
mDay = c.get(Calendar.DAY_OF_MONTH);
// Launch Date Picker Dialog
DatePickerDialog dpd = new DatePickerDialog(OrderEntryActivity.this,
new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
// Display Selected date in textbox
try {
if (!childData.getNewDate().equals("")) {
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
String sDate = (monthOfYear + 1) + "/" + dayOfMonth + "/" + year;
Date date1 = sdf.parse(sDate);//pick date
Date date2 = sdf.parse(childData.getNewDate()); //latest date selected
Date visitDate = sdf.parse(visit_date);//current date
if (date1.compareTo(visitDate) != 1) { //Compare Oldest Date and Current Date
if (date1.compareTo(date2) != 1) { //Compare Oldest Date and Latest Date
String date = (monthOfYear + 1) + "/" + dayOfMonth + "/" + year;
_listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition).setOldDate(date);
expListView.invalidateViews();
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(OrderEntryActivity.this);
builder.setMessage("Oldest Date can not be greater than the latest date ")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
AlertDialog alert = builder.create();
alert.show();
}
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(OrderEntryActivity.this);
builder.setMessage("Oldest Date can not be greater than the current date ")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
AlertDialog alert = builder.create();
alert.show();
}
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(OrderEntryActivity.this);
builder.setMessage("First Select the Latest Date ")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
AlertDialog alert = builder.create();
alert.show();
}
} catch (ParseException e) {
e.printStackTrace();
}
}
}, mYear, mMonth, mDay);
dpd.show();
}
});
if (childData.getOldDate().equals("")) {
holder.txt_showOldDate.setText("");
} else {
holder.txt_showOldDate.setText(childData.getOldDate());
}
if (!checkflag) {
boolean tempflag = false;
if (holder.ed_stock.getText().toString().equals("")) {
holder.ed_stock.setBackgroundColor(getResources().getColor(R.color.grey_background));
holder.ed_stock.setHintTextColor(getResources().getColor(R.color.red));
holder.ed_stock.setHint("Empty");
tempflag = true;
}
if (holder.ed_faceup.getText().toString().equals("")) {
holder.ed_faceup.setBackgroundColor(getResources().getColor(R.color.grey_background));
holder.ed_faceup.setHintTextColor(getResources().getColor(R.color.red));
holder.ed_faceup.setHint("Empty");
tempflag = true;
}
if (!holder.ed_stock.getText().toString().equals("0")) {
if (holder.txt_showOldDate.getText().toString().equals("")) {
holder.txt_showOldDate.setHintTextColor(getResources().getColor(R.color.red));
holder.txt_showOldDate.setHint("Select Oldest MFD ");
}
} else if (holder.ed_stock.getText().toString().equals("0")) {
holder.txt_showOldDate.setHint("");
}
if (!holder.ed_stock.getText().toString().equals("0")) {
if (holder.txt_showNewDate.getText().toString().equals("")) {
holder.txt_showNewDate.setHintTextColor(getResources().getColor(R.color.red));
holder.txt_showNewDate.setHint("Select Latest MFD ");
}
} else if (holder.ed_stock.getText().toString().equals("0")) {
holder.txt_showNewDate.setHint("");
}
if (tempflag) {
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.red));
} else {
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.white));
}
}*/
holder.ed_mbq.setText(childData.getMbq());
return convertView;
}
@@ -656,13 +320,11 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
}
public class ViewHolder {
EditText ed_stock, ed_faceup;
EditText ed_mbq;
CardView cardView;
TextView txt_skuName, txt_showOldDate, txt_showNewDate;
LinearLayout lin_item, lin_latest_MFD, lin_oldest_MFD;
Button btn_old_Date, btn_new_Date;
//public MutableWatcher mWatcher;
//public int mYear, mMonth, mDay, mHour, mMinute;
TextView txt_skuName;
ToggleButton toggle_available;
LinearLayout lin_category;
}
@Override
@@ -28,6 +28,7 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email" />
android:backgroundTint="@color/colorPrimary"
app:srcCompat="@drawable/save_icon" />
</android.support.design.widget.CoordinatorLayout>
@@ -28,6 +28,7 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:backgroundTint="@color/colorPrimary"
app:srcCompat="@drawable/save_icon" />
</android.support.design.widget.CoordinatorLayout>
@@ -28,6 +28,7 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:backgroundTint="@color/colorPrimary"
app:srcCompat="@drawable/save_icon" />
</android.support.design.widget.CoordinatorLayout>
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
@@ -17,7 +16,6 @@
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_msl__availability" />
@@ -28,6 +26,7 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email" />
android:backgroundTint="@color/colorPrimary"
app:srcCompat="@drawable/save_icon" />
</android.support.design.widget.CoordinatorLayout>
@@ -8,12 +8,31 @@
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/activity_msl__availability">
<ExpandableListView
android:id="@+id/expandableListView"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:cacheColorHint="#00000000"
android:divider="@null"
android:dividerHeight="0dp"
android:scrollingCache="false" />
android:background="@color/white"
android:orientation="vertical">
<TextView
android:id="@+id/txt_mslAvailabilityName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFF1710F"
android:paddingBottom="10dp"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:text="Must Have Availability"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@android:color/black" />
<ExpandableListView
android:id="@+id/expandableListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:cacheColorHint="#00000000"
android:divider="@null"
android:dividerHeight="0dp"
android:scrollingCache="false" />
</LinearLayout>
</RelativeLayout>
@@ -0,0 +1,112 @@
<?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:background="@color/white"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
card_view:cardCornerRadius="10dp">
<LinearLayout
android:id="@+id/lin_category"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="5">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2.5"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="SKU"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#222" />
<TextView
android:id="@+id/txt_skuName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingRight="5dp"
android:paddingTop="5dp"
android:text="SKU Name Value "
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#222" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.25"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="MBQ"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#222" />
<EditText
android:id="@+id/ed_mbq"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:inputType="number"
android:maxLength="7"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#222"
android:textColorHint="#666" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.25"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="Available"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#222" />
<ToggleButton
android:id="@+id/toggle_available"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</LinearLayout>
@@ -14,12 +14,12 @@
card_view:cardCornerRadius="10dp">
<RelativeLayout
android:id="@+id/rel_header"
android:id="@+id/rel_categoryHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/txt_Header"
android:id="@+id/txt_categoryHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
@@ -1,463 +0,0 @@
<?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:background="@color/white"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:orientation="vertical">
<!--android:padding="1dp"-->
<!--android:background="@drawable/item_border"-->
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
card_view:cardCornerRadius="10dp">
<!--card_view:cardBackgroundColor="@color/white"-->
<LinearLayout
android:id="@+id/lin_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="10">
<TextView
android:id="@+id/txt_skuName"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:paddingBottom="5dp"
android:paddingLeft="15dp"
android:paddingRight="5dp"
android:paddingTop="5dp"
android:text="SKU Name"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#222" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#888" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="7">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".3"
android:gravity="center"
android:text="MBQ"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#222" />
<EditText
android:id="@+id/ed_stock"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginRight="15dp"
android:layout_weight=".7"
android:gravity="center_horizontal"
android:inputType="number"
android:maxLength="7"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#222"
android:textColorHint="#666" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".3"
android:gravity="center"
android:text="Available"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#222" />
<EditText
android:id="@+id/ed_faceup"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginRight="15dp"
android:layout_weight=".7"
android:gravity="center_horizontal"
android:inputType="number"
android:maxLength="7"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#222"
android:textColorHint="#666" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</LinearLayout>
<!--
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey_background"
android:orientation="vertical">
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_weight="35"
card_view:cardBackgroundColor="@color/white"
card_view:cardCornerRadius="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="55dip"
android:orientation="horizontal"
android:weightSum="10">
&lt;!&ndash; <ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:src="@drawable/store" />&ndash;&gt;
<TextView
android:id="@+id/lblListItem"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="10"
android:gravity="center_vertical"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:text="jghdfcjvhjkcgm fcchckgjhmfgfjchgjk gffvdh"
android:textColor="@color/teal_dark"
android:textSize="17dip" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="5dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:background="@color/teal_dark" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="7">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:visibility="gone"
android:weightSum="2">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="As_Per_Mccain"
android:textColor="@color/teal_dark"
android:textSize="16sp" />
<TextView
android:id="@+id/etAs_Per_Mccain"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#9E9E9E"
android:gravity="center"
android:paddingBottom="7dp"
android:paddingTop="7dp"
android:textColor="@color/teal_dark"
android:textSize="20sp"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:background="@color/teal_dark"
android:visibility="gone" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="total_stock"
android:textColor="@color/teal_dark"
android:textSize="16sp" />
<EditText
android:id="@+id/etOpening_Stock_total_stock"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textColor="@color/teal_dark" />
</LinearLayout>
<LinearLayout
android:id="@+id/openmccaindf_la"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:background="@color/teal_dark" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="facing"
android:textColor="@color/teal_dark"
android:textSize="16sp" />
<EditText
android:id="@+id/etOpening_Stock_Facing"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textColor="@color/teal_dark" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:background="@color/teal_dark" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="stock_under_days"
android:textColor="@color/teal_dark"
android:textSize="16sp" />
<EditText
android:id="@+id/etStock_Under_6"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:maxLength="5"
android:textColor="@color/teal_dark" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="7-12 month"
android:textColor="@color/teal_dark"
android:textSize="16sp" />
<EditText
android:id="@+id/etStock_Under12"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:maxLength="5"
android:textColor="@color/teal_dark" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text=">13 month"
android:textColor="@color/teal_dark"
android:textSize="16sp" />
<EditText
android:id="@+id/etStock_greater12"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:maxLength="5"
android:textColor="@color/teal_dark" />
</LinearLayout>
<LinearLayout
android:id="@+id/openmccaindf_layaout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:background="@color/teal_dark" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:visibility="gone"
android:weightSum="2">
<Button
android:id="@+id/button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="stock_date" />
&lt;!&ndash; <TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="@string/stock_date"
android:textColor="@color/teal_dark"
android:textSize="16sp" />&ndash;&gt;
&lt;!&ndash; <EditText
android:id="@+id/etStock_Under"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textColor="@color/teal_dark" />&ndash;&gt;
<TextView
android:id="@+id/textView9"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:textSize="20sp"
android:textStyle="bold" />
&lt;!&ndash; <EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:inputType="date"
android:ems="10"
android:id="@+id/editText2"
android:layout_weight="1" />&ndash;&gt;
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>-->