Msl_Availability_StockFacing_New Merge into Main Project
This commit is contained in:
+14
-18
@@ -113,6 +113,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
// TODO Auto-generated method stub
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.additionalvisibilitylayout);
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
@@ -703,9 +704,19 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
// if this button is clicked, just close
|
||||
// the dialog box and do nothing
|
||||
btntoggle.setChecked(true);
|
||||
|
||||
//btntoggle.setChecked(true);
|
||||
dialog.cancel();
|
||||
|
||||
togglevalue = "1";
|
||||
btntoggle.setChecked(true);
|
||||
brandlayout.setVisibility(View.GONE);
|
||||
diaplylayout.setVisibility(View.VISIBLE);
|
||||
cameralayout.setVisibility(View.VISIBLE);
|
||||
btnsku.setVisibility(View.VISIBLE);
|
||||
btnaddlayout.setVisibility(View.VISIBLE);
|
||||
cardvew.setVisibility(View.VISIBLE);
|
||||
listviewlay.setVisibility(View.INVISIBLE);
|
||||
maincard.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -824,7 +835,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class CustomAdapter extends ArrayAdapter<String> {
|
||||
|
||||
private Activity activity;
|
||||
@@ -949,7 +959,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class CustomSkuMasterAdpter extends ArrayAdapter<String> {
|
||||
|
||||
private Activity activity;
|
||||
@@ -1012,7 +1021,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void startCameraActivity() {
|
||||
try {
|
||||
|
||||
@@ -1116,7 +1124,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
|
||||
public void showSkuDialog() {
|
||||
|
||||
final ArrayList<BrandMasterGetterSetter> brandList = db.getBrandT2PData(store_type_id, class_id, key_account_id, categoryId);
|
||||
@@ -1311,7 +1318,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
@@ -1337,7 +1343,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
|
||||
public class MyAdaptorStock extends BaseAdapter {
|
||||
|
||||
private LayoutInflater mInflater;
|
||||
@@ -1451,7 +1456,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class MyAdaptorAdditionalStock extends BaseAdapter {
|
||||
|
||||
private LayoutInflater mInflater;
|
||||
@@ -1491,21 +1495,15 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
|
||||
@Override
|
||||
public View getView(final int position1, View convertView, ViewGroup parent) {
|
||||
|
||||
final ViewHolder holder;
|
||||
|
||||
if (convertView == null) {
|
||||
|
||||
convertView = mInflater
|
||||
.inflate(R.layout.additionallistlayout, null);
|
||||
convertView = mInflater.inflate(R.layout.additionallistlayout, null);
|
||||
holder = new ViewHolder();
|
||||
|
||||
holder.brand = (TextView) convertView.findViewById(R.id.brand_name);
|
||||
|
||||
holder.display = (TextView) convertView.findViewById(R.id.display_name);
|
||||
holder.qty_bought = (TextView) convertView.findViewById(R.id.qty_bought);
|
||||
|
||||
|
||||
holder.delete = (Button) convertView.findViewById(R.id.delete_btn);
|
||||
|
||||
convertView.setTag(holder);
|
||||
@@ -1517,7 +1515,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdditionalVisibility.this);
|
||||
alertDialogBuilder.setTitle(getResources().getString(R.string.dialog_title));
|
||||
|
||||
@@ -1671,7 +1668,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static boolean updateResources(Context context, String language) {
|
||||
|
||||
|
||||
|
||||
+74
-54
@@ -24,7 +24,6 @@ import android.provider.MediaStore;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.CardView;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
@@ -57,8 +56,6 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
|
||||
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
||||
import cpm.com.gskmtorange.GetterSetter.BrandAvabilityGetterSetter;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
@@ -87,13 +84,14 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
String error_msg;
|
||||
private SharedPreferences preferences;
|
||||
Spinner spinner_brand;
|
||||
Button btn_add,btn_close;
|
||||
Button btn_add, btn_close;
|
||||
ListView listview;
|
||||
LinearLayout linearlay;
|
||||
//CardView cardlay;
|
||||
String brand_name="",brand_id="";
|
||||
ArrayList<BrandAvabilityGetterSetter> brand_new_list=new ArrayList<BrandAvabilityGetterSetter>();
|
||||
String brand_name = "", brand_id = "";
|
||||
ArrayList<BrandAvabilityGetterSetter> brand_new_list = new ArrayList<BrandAvabilityGetterSetter>();
|
||||
ArrayList<BrandAvabilityGetterSetter> brandList;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -247,7 +245,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
*/
|
||||
|
||||
|
||||
|
||||
holder.btn_gaps.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -284,8 +281,53 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
mItem.setImage2("");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(T2PComplianceActivity.this);
|
||||
alertDialogBuilder.setTitle(getResources().getString(R.string.dialog_title));
|
||||
|
||||
// set dialog message
|
||||
alertDialogBuilder
|
||||
.setMessage(getResources().getString(R.string.data_will_be_lost))
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
mItem.setPresent(false);
|
||||
mItem.getGapsChecklist().clear();
|
||||
mItem.getSkulist().clear();
|
||||
|
||||
//Camera
|
||||
if (!mItem.getImage().equals("")) {
|
||||
new File(str + mItem.getImage()).delete();
|
||||
mItem.setImage("");
|
||||
}
|
||||
|
||||
//Camera 1
|
||||
if (!mItem.getImage1().equals("")) {
|
||||
new File(str + mItem.getImage1()).delete();
|
||||
mItem.setImage1("");
|
||||
}
|
||||
|
||||
//Camera 2
|
||||
if (!mItem.getImage2().equals("")) {
|
||||
new File(str + mItem.getImage2()).delete();
|
||||
mItem.setImage2("");
|
||||
}
|
||||
|
||||
t2PAdapter.notifyDataSetChanged();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
dialog.cancel();
|
||||
mItem.setPresent(true);
|
||||
t2PAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
|
||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||
alertDialog.show();
|
||||
}
|
||||
t2PAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
@@ -336,7 +378,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
holder.img_cam.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
_pathforcheck = "T2P_Image_" + store_id+ categoryId+ "_" + mItem.getBrand_id() +
|
||||
_pathforcheck = "T2P_Image_" + store_id + categoryId + "_" + mItem.getBrand_id() +
|
||||
mItem.getDisplay_id() + visit_date.replace("/", "") + "_" +
|
||||
getCurrentTime().replace(":", "") + ".jpg";
|
||||
child_position = position;
|
||||
@@ -349,7 +391,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
if (mItem.getImage().equals("")) {
|
||||
|
||||
|
||||
|
||||
if (mItem.isPresent()) {
|
||||
|
||||
holder.img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
||||
@@ -366,7 +407,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
holder.img_cam1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
_pathforcheck1 = "T2P_Image1_" + store_id+categoryId + "_" + mItem.getBrand_id() +
|
||||
_pathforcheck1 = "T2P_Image1_" + store_id + categoryId + "_" + mItem.getBrand_id() +
|
||||
mItem.getDisplay_id() + visit_date.replace("/", "") + "_" +
|
||||
getCurrentTime().replace(":", "") + ".jpg";
|
||||
child_position1 = position;
|
||||
@@ -394,7 +435,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
holder.img_cam2.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
_pathforcheck2 = "T2P_Image2_" + store_id + categoryId+"_" + mItem.getBrand_id() +
|
||||
_pathforcheck2 = "T2P_Image2_" + store_id + categoryId + "_" + mItem.getBrand_id() +
|
||||
mItem.getDisplay_id() + visit_date.replace("/", "") + "_" +
|
||||
getCurrentTime().replace(":", "") + ".jpg";
|
||||
child_position2 = position;
|
||||
@@ -418,53 +459,41 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
holder.img_cam2.setBackgroundResource(R.mipmap.camera_green);
|
||||
}
|
||||
} else {
|
||||
// holder.img_cam.setBackgroundResource(R.mipmap.camera_grey);
|
||||
// holder.img_cam1.setBackgroundResource(R.mipmap.camera_grey);
|
||||
// holder.img_cam2.setBackgroundResource(R.mipmap.camera_grey);
|
||||
// holder.img_cam.setBackgroundResource(R.mipmap.camera_grey);
|
||||
// holder.img_cam1.setBackgroundResource(R.mipmap.camera_grey);
|
||||
// holder.img_cam2.setBackgroundResource(R.mipmap.camera_grey);
|
||||
holder.img_cam1.setVisibility(View.INVISIBLE);
|
||||
holder.img_cam2.setVisibility(View.INVISIBLE);
|
||||
|
||||
holder.img_cam.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
/* Intent in =new Intent(T2PComplianceActivity.this,T2pBrand_Avaibility.class);
|
||||
in.putExtra("categoryName", categoryName);
|
||||
in.putExtra("categoryId", categoryId);
|
||||
startActivity(in);*/
|
||||
|
||||
showBrandAvabilitydialog(mItem.getBrandlist());
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
if(mItem.getBrandlist().size()>0)
|
||||
{
|
||||
|
||||
if (mItem.getBrandlist().size() > 0) {
|
||||
holder.img_cam.setBackgroundResource(R.mipmap.new_no_camera_done_edit);
|
||||
}else{
|
||||
} else {
|
||||
|
||||
if (mItem.isPresent()) {
|
||||
|
||||
holder.img_cam.setBackgroundResource(R.mipmap.new_no_camera_edit);
|
||||
} else {
|
||||
//if not present camera disabled
|
||||
holder.img_cam.setBackgroundResource(R.mipmap.no_camera);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
boolean is_enabled = mItem.isPresent();
|
||||
|
||||
holder.toggle_btn.setChecked(is_enabled);
|
||||
holder.img_cam.setEnabled(is_enabled);
|
||||
holder.img_cam.setEnabled(is_enabled);
|
||||
holder.img_cam1.setEnabled(is_enabled);
|
||||
holder.img_cam2.setEnabled(is_enabled);
|
||||
holder.btn_gaps.setEnabled(is_enabled);
|
||||
@@ -490,7 +519,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
holder.btn_sku.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -508,12 +536,10 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
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);
|
||||
@@ -525,9 +551,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -805,18 +829,18 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
|
||||
//temp value in case camera is gallery app above jellybean
|
||||
String packag = list.get(n).loadLabel(packageManager).toString();
|
||||
if (packag.equalsIgnoreCase("Gallery") || packag.equalsIgnoreCase("Galeri") ||packag.equalsIgnoreCase("الاستوديو") ) {
|
||||
if (packag.equalsIgnoreCase("Gallery") || packag.equalsIgnoreCase("Galeri") || packag.equalsIgnoreCase("الاستوديو")) {
|
||||
gallery_package = list.get(n).packageName;
|
||||
}
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera")|| packag.equalsIgnoreCase("الكاميرا")) {
|
||||
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera")|| packag.equalsIgnoreCase("الكاميرا")) {
|
||||
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
||||
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
@@ -932,8 +956,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
flag = false;
|
||||
error_msg = getResources().getString(R.string.click_image);
|
||||
break;
|
||||
}
|
||||
else if (camera_allow.equals("0") && t2PGetterSetters.get(i).getBrandlist().size() == 0) {
|
||||
} else if (camera_allow.equals("0") && t2PGetterSetters.get(i).getBrandlist().size() == 0) {
|
||||
flag = false;
|
||||
error_msg = getResources().getString(R.string.title_activity_fill_brand);
|
||||
break;
|
||||
@@ -1230,7 +1253,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
|
||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
||||
}else{
|
||||
} else {
|
||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
||||
}
|
||||
|
||||
@@ -1311,10 +1334,9 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
//// new <code></code>
|
||||
|
||||
|
||||
public void showBrandAvabilitydialog(final ArrayList<BrandAvabilityGetterSetter> brandGetdata) {
|
||||
|
||||
public void showBrandAvabilitydialog(final ArrayList<BrandAvabilityGetterSetter> brandGetdata) {
|
||||
|
||||
final ArrayList<BrandAvabilityGetterSetter> brandList = db.getBrandAvailbilitydata(store_id, categoryId,keyAccount_id,class_id,storeType_id);
|
||||
final ArrayList<BrandAvabilityGetterSetter> brandList = db.getBrandAvailbilitydata(store_id, categoryId, keyAccount_id, class_id, storeType_id);
|
||||
|
||||
BrandAvabilityGetterSetter brand = new BrandAvabilityGetterSetter();
|
||||
brand.setBRAND(getResources().getString(R.string.select));
|
||||
@@ -1334,7 +1356,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
|
||||
listview = (ListView) dialog.findViewById(R.id.lv);
|
||||
linearlay = (LinearLayout) dialog.findViewById(R.id.list_layout);
|
||||
// cardlay = (CardView) dialog.findViewById(R.id.cardId);
|
||||
// cardlay = (CardView) dialog.findViewById(R.id.cardId);
|
||||
|
||||
// Create custom adapter object ( see below CustomAdapter.java )
|
||||
T2PComplianceActivity.CustomBRANDAdapter adapter = new T2PComplianceActivity.CustomBRANDAdapter(T2PComplianceActivity.this, R.layout.custom_spinner_item, brandList);
|
||||
@@ -1343,13 +1365,13 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
|
||||
if (brandGetdata.size() > 0) {
|
||||
linearlay.setVisibility(View.VISIBLE);
|
||||
// cardlay.setVisibility(View.VISIBLE);
|
||||
// cardlay.setVisibility(View.VISIBLE);
|
||||
adapterData = new T2PComplianceActivity.MyAdaptorStock(T2PComplianceActivity.this, brandGetdata);
|
||||
listview.setAdapter(adapterData);
|
||||
listview.invalidateViews();
|
||||
} else {
|
||||
linearlay.setVisibility(View.GONE);
|
||||
// cardlay.setVisibility(View.GONE);
|
||||
// cardlay.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
spinner_brand.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@@ -1386,7 +1408,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
public void onClick(View v) {
|
||||
BrandAvabilityGetterSetter ab = new BrandAvabilityGetterSetter();
|
||||
|
||||
if (!brand_name.equalsIgnoreCase("") && brand_name!=null){
|
||||
if (!brand_name.equalsIgnoreCase("") && brand_name != null) {
|
||||
|
||||
BrandAvabilityGetterSetter brand = new BrandAvabilityGetterSetter();
|
||||
|
||||
@@ -1399,15 +1421,13 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
listview.setAdapter(adapterData);
|
||||
listview.invalidateViews();
|
||||
|
||||
// cardlay.setVisibility(View.VISIBLE);
|
||||
// cardlay.setVisibility(View.VISIBLE);
|
||||
linearlay.setVisibility(View.VISIBLE);
|
||||
spinner_brand.setSelection(0);
|
||||
brand_name="";
|
||||
brand_id="";
|
||||
brand_name = "";
|
||||
brand_id = "";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Snackbar.make(v, "Please select dropdown", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
}
|
||||
|
||||
+62
-18
@@ -733,23 +733,6 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
||||
finalHolder.stock.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
holder.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 (!edFaceup.equals("")) {
|
||||
String faceup = edFaceup.replaceFirst("^0+(?!$)", "");
|
||||
childData.setFacing(faceup);
|
||||
} else {
|
||||
childData.setFacing("");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
holder.facing.setText(childData.getFacing());
|
||||
|
||||
|
||||
holder.stock.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
@@ -783,10 +766,71 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
holder.stock.setText(childData.getStock());
|
||||
|
||||
|
||||
final ViewHolder finalHolder1 = holder;
|
||||
holder.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+(?!$)", "");
|
||||
|
||||
//Toggle is no selected
|
||||
if (childData.getToggleValue().equals("0")) {
|
||||
|
||||
//if stock is emplty
|
||||
if (childData.getStock().equals("")) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(MSL_Availability_StockFacingActivity.this);
|
||||
builder.setMessage(getString(R.string.msl_availability_new_stock_value))
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
} else {
|
||||
if (edFaceup != null && !edFaceup.equals("")) {
|
||||
|
||||
String faceup = edFaceup.replaceFirst("^0+(?!$)", "");
|
||||
if (Integer.parseInt(faceup) <= Integer.parseInt(childData.getStock())) {
|
||||
|
||||
if (!edFaceup.equals("")) {
|
||||
childData.setFacing(faceup);
|
||||
} else {
|
||||
childData.setFacing("");
|
||||
}
|
||||
} else {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(MSL_Availability_StockFacingActivity.this);
|
||||
builder.setMessage(getString(R.string.check_faceup))
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.dismiss();
|
||||
finalHolder1.facing.setText("");
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!edFaceup.equals("")) {
|
||||
String faceup = edFaceup.replaceFirst("^0+(?!$)", "");
|
||||
childData.setFacing(faceup);
|
||||
} else {
|
||||
childData.setFacing("");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
holder.facing.setText(childData.getFacing());
|
||||
|
||||
|
||||
//empty check color change
|
||||
if (!checkflag) {
|
||||
boolean tempflag = false;
|
||||
|
||||
@@ -2,20 +2,16 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="100">
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="96dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:weightSum="100">
|
||||
|
||||
android:paddingRight="10dp">
|
||||
|
||||
<LinearLayout
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="2dp"
|
||||
@@ -26,10 +22,8 @@
|
||||
android:weightSum="25">
|
||||
|
||||
<TextView
|
||||
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
android:layout_weight="10"
|
||||
android:text="@string/brandname"
|
||||
android:textStyle="bold" />
|
||||
@@ -39,41 +33,34 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="15"
|
||||
android:inputType="text">
|
||||
|
||||
</TextView>
|
||||
android:inputType="text" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_weight="10"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="50">
|
||||
android:weightSum="2">
|
||||
|
||||
<TextView
|
||||
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
android:layout_weight="30"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="10dp"
|
||||
android:text="@string/displayname"
|
||||
android:textAppearance="?android:attr/textAppearanceListItem"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/display_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
android:layout_weight="15">
|
||||
|
||||
</TextView>
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="10dp"
|
||||
android:textAppearance="?android:attr/textAppearanceListItem" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/third"
|
||||
android:layout_width="match_parent"
|
||||
@@ -88,7 +75,6 @@
|
||||
android:id="@+id/facing"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
android:layout_weight="10"
|
||||
android:text="Quantity"
|
||||
android:textStyle="bold" />
|
||||
@@ -98,35 +84,23 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="15"
|
||||
android:inputType="number">
|
||||
|
||||
</TextView>
|
||||
android:inputType="number" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<!-- </LinearLayout> -->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="10"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="25">
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/delete_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right"
|
||||
android:layout_marginRight="30dp"
|
||||
android:layout_weight="7"
|
||||
android:background="@color/grey_background"
|
||||
android:text="@string/delete"
|
||||
android:layout_gravity="right"/>
|
||||
|
||||
android:text="@string/delete" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -15,10 +15,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
app:srcCompat="@drawable/save_icon"
|
||||
app:backgroundTint="@color/colorAccent"
|
||||
/>
|
||||
|
||||
|
||||
app:srcCompat="@drawable/save_icon" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
@@ -100,6 +100,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:inputType="number"
|
||||
android:maxLength="5"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222"
|
||||
android:textColorHint="#666" />
|
||||
@@ -118,6 +119,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:inputType="number"
|
||||
android:maxLength="5"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222"
|
||||
android:textColorHint="#666"
|
||||
|
||||
@@ -300,4 +300,5 @@
|
||||
<string name="faceup_value">Please fill faceup value or fill 0 </string>
|
||||
<string name="stock_value">Please fill stock value or fill 0 </string>
|
||||
<string name="check_stock">Stock can not be greater equal than MBQ value</string>
|
||||
<string name="msl_availability_new_stock_value">Please first fill the stock value </string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user