Commit 6cf45268 by Jemsheer K D

Order Info Page

parent 1df5b1b9
......@@ -46,7 +46,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
package in.techware.carrefour.activity.info;
import android.arch.lifecycle.Observer;
import android.arch.lifecycle.ViewModelProviders;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.HapticFeedbackConstants;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import in.techware.carrefour.R;
import in.techware.carrefour.dialogs.ConfirmationDialog;
import in.techware.carrefour.activity.BaseAppCompatNoDrawerActivity;
import in.techware.carrefour.dialogs.PopupMessage;
import in.techware.carrefour.listeners.BarcodeUpdateListener;
import in.techware.carrefour.model.MenuBean;
import in.techware.carrefour.util.AppConstants;
import in.techware.carrefour.util.BarcodeUtil;
import in.techware.carrefour.util.TimeUtil;
import in.techware.carrefour.viewModels.ProductInfoViewModel;
public class OrderInfoActivity extends AppCompatActivity {
ConfirmationDialog confirmationDialog;
EditText itemCodeEditText;
EditText barCodeEditText;
EditText supplierDcEditText;
EditText stockBeginDatEditText;
EditText lastReceiptEditText;
EditText pendingOrdersEditText;
EditText orderDateEditText;
EditText nextDelDateEditText;
EditText pcbEditText;
EditText stockMinEditText;
EditText facingEditText;
EditText supplierLpoTypeEditText;
EditText supplierLeadTimeEditText;
public class OrderInfoActivity extends BaseAppCompatNoDrawerActivity {
private static final String TAG = "OrderInfoA";
private TextView txtToolbarLastUpdateDate;
private TextView txtDescription;
private EditText etxtBarcode;
private EditText etxtItemCode;
private EditText etxtSupplier;
private EditText etxtStockBeginningDay;
private EditText etxtLastReceptionDate;
private EditText etxtPendingOrders;
private EditText etxtNextOrderingDate;
private EditText etxtNextDeliveryDate;
private EditText etxtPCB;
private EditText etxtStockMinimum;
private EditText etxtFacing;
private EditText etxtSupplierLPOType;
private EditText etxtSupplierLeadTime;
private Button btnExit;
private Button btnLabel;
private Button btnMainPage;
private Button btnWeek;
private MenuBean selectedMenuBean;
private ProductInfoViewModel viewModel;
private View.OnClickListener clickListener;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_order_info);
if (getIntent().hasExtra("menuBean")) {
selectedMenuBean = (MenuBean) getIntent().getSerializableExtra("menuBean");
}
viewModel = (ProductInfoViewModel) ViewModelProviders.of(this).get(ProductInfoViewModel.class);
viewModel.setSelectedMenuBean(selectedMenuBean);
initToolbar();
initViews();
initViewModelCallbacks();
handleKeyboard();
// populateViewModel();
if (getSupportActionBar() != null) {
setTitle(getString(R.string.title_order_info).toUpperCase(), R.color.white);
getSupportActionBar().setTitle("");
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(true);
}
}
private void initToolbar() {
toolbar.removeAllViews();
View lytToolbar = getLayoutInflater().inflate(R.layout.layout_toolbar_product_info, toolbar);
txtTitle = lytToolbar.findViewById(R.id.txt_toolbar_product_info_title);
txtToolbarLastUpdateDate = lytToolbar.findViewById(R.id.txt_toolbar_product_info_last_update);
setDummyMenuVisibility(false);
}
private void initViews() {
itemCodeEditText = findViewById(R.id.etxt_item_code);
barCodeEditText = findViewById(R.id.etxt_barcode);
supplierDcEditText = findViewById(R.id.etxt_supp_dc);
stockBeginDatEditText = findViewById(R.id.text_stock_beginning_day);
lastReceiptEditText = findViewById(R.id.etxt_last_rec_date);
pendingOrdersEditText = findViewById(R.id.etxt_pending_orders);
orderDateEditText = findViewById(R.id.etxt_order_date);
nextDelDateEditText = findViewById(R.id.etxt_next_del_date);
pcbEditText = findViewById(R.id.etxt_pcb);
stockMinEditText = findViewById(R.id.etxt_stock_min);
facingEditText = findViewById(R.id.etxt_facing);
supplierLpoTypeEditText = findViewById(R.id.etxt_supplier_lpo_type);
supplierLeadTimeEditText = findViewById(R.id.etxt_supplier_lead_time);
confirmationDialog = new ConfirmationDialog(this);
confirmationDialog.setConfirmationDialogActionListener(new ConfirmationDialog.ConfirmationDialogActionListener() {
txtDescription = findViewById(R.id.txt_order_info_item_description);
etxtBarcode = findViewById(R.id.etxt_order_info_barcode);
etxtItemCode = findViewById(R.id.etxt_order_info_item_code);
etxtSupplier = findViewById(R.id.etxt_order_info_supplier_or_dc);
etxtStockBeginningDay = findViewById(R.id.etxt_order_info_stock_beginning_day);
etxtLastReceptionDate = findViewById(R.id.etxt_order_info_last_reception_date);
etxtPendingOrders = findViewById(R.id.etxt_order_info_pending_orders);
etxtNextOrderingDate = findViewById(R.id.etxt_order_info_next_ordering_date);
etxtNextDeliveryDate = findViewById(R.id.etxt_order_info_next_delivery_date);
etxtPCB = findViewById(R.id.etxt_order_info_pcb);
etxtStockMinimum = findViewById(R.id.etxt_order_info_stock_minimum);
etxtFacing = findViewById(R.id.etxt_order_info_facing);
etxtSupplierLPOType = findViewById(R.id.etxt_order_info_supplier_lpo_type);
etxtSupplierLeadTime = findViewById(R.id.etxt_order_info_supplier_lead_time);
btnMainPage = findViewById(R.id.btn_order_info_main_page);
btnExit = findViewById(R.id.btn_order_info_exit);
btnLabel = findViewById(R.id.btn_order_info_label);
btnWeek = findViewById(R.id.btn_order_info_week);
etxtBarcode.setEnabled(true);
etxtBarcode.setFocusable(true);
etxtBarcode.setTextIsSelectable(true);
etxtBarcode.setFocusableInTouchMode(true);
if (!etxtBarcode.hasFocus()) {
etxtBarcode.requestFocus();
}
clearViews();
btnMainPage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onOrderInfoMainPageClick(v);
}
});
btnExit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onOrderInfoExitClick(v);
}
});
btnLabel.setOnClickListener(new View.OnClickListener() {
@Override
public void onYesClicked() {
finishAffinity();
public void onClick(View v) {
onOrderInfoLabelClick(v);
}
});
btnWeek.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onOrderInfoWeekUnitClick(v);
}
});
etxtBarcode.setOnKeyListener(new View.OnKeyListener() {
@Override
public void onNoClicked() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
if ((event.getAction() == KeyEvent.ACTION_UP) && (keyCode == KeyEvent.KEYCODE_ENTER)) {
String barcode = etxtBarcode.getText().toString();
if (barcode.length() > 0) {
viewModel.clearProductInfo();
clearViews();
etxtBarcode.setText(BarcodeUtil.getFormattedBarcode(barcode));
viewModel.setBarcode(BarcodeUtil.getFormattedBarcode(barcode));
setProgressScreenVisibility(true, true);
viewModel.fetchProductInfo();
}
return true;
}
return false;
}
});
BarcodeUpdateListener barcodeUpdateListener = new BarcodeUpdateListener() {
@Override
public void onBarcodeUpdated(String barcode) {
viewModel.clearProductInfo();
clearViews();
etxtBarcode.setText(barcode);
viewModel.setBarcode(barcode);
setProgressScreenVisibility(true, true);
viewModel.fetchProductInfo();
}
};
addBarcodeUpdateListener(barcodeUpdateListener);
}
private void initViewModelCallbacks() {
viewModel.isFetchingFinished().observe(this, new Observer<Boolean>() {
@Override
public void onChanged(Boolean isFetchingFinished) {
if (isFetchingFinished) {
populateProductInfo();
}
}
});
}
private void handleKeyboard() {
if (getSharedPreferences(AppConstants.PREF_FILE, 0).getBoolean(AppConstants.KEYBOARD_STATUS, false)) {
itemCodeEditText.setFocusableInTouchMode(true);
barCodeEditText.setFocusableInTouchMode(true);
supplierDcEditText.setFocusableInTouchMode(true);
stockBeginDatEditText.setFocusableInTouchMode(true);
lastReceiptEditText.setFocusableInTouchMode(true);
pendingOrdersEditText.setFocusableInTouchMode(true);
orderDateEditText.setFocusableInTouchMode(true);
nextDelDateEditText.setFocusableInTouchMode(true);
pcbEditText.setFocusableInTouchMode(true);
stockMinEditText.setFocusableInTouchMode(true);
facingEditText.setFocusableInTouchMode(true);
supplierLpoTypeEditText.setFocusableInTouchMode(true);
supplierLeadTimeEditText.setFocusableInTouchMode(true);
}
}
public void onMainPageClick(View v) {
Intent intent = new Intent(getApplicationContext(), ProductInfoActivity.class);
startActivity(intent);
finish();
etxtBarcode.setFocusableInTouchMode(true);
etxtItemCode.setFocusableInTouchMode(true);
etxtSupplier.setFocusableInTouchMode(true);
etxtStockBeginningDay.setFocusableInTouchMode(true);
etxtLastReceptionDate.setFocusableInTouchMode(true);
etxtPendingOrders.setFocusableInTouchMode(true);
etxtNextOrderingDate.setFocusableInTouchMode(true);
etxtNextDeliveryDate.setFocusableInTouchMode(true);
etxtPCB.setFocusableInTouchMode(true);
etxtStockMinimum.setFocusableInTouchMode(true);
etxtFacing.setFocusableInTouchMode(true);
etxtSupplierLPOType.setFocusableInTouchMode(true);
etxtSupplierLeadTime.setFocusableInTouchMode(true);
} else {
// etxtStore.setOnFocusChangeListener(focusChangedListener);
// etxtBarcode.setOnFocusChangeListener(focusChangedListener);
// etxtQuantity.setOnFocusChangeListener(focusChangedListener);
etxtBarcode.setFocusableInTouchMode(false);
etxtItemCode.setFocusableInTouchMode(false);
etxtSupplier.setFocusableInTouchMode(false);
etxtStockBeginningDay.setFocusableInTouchMode(false);
etxtLastReceptionDate.setFocusableInTouchMode(false);
etxtPendingOrders.setFocusableInTouchMode(false);
etxtNextOrderingDate.setFocusableInTouchMode(false);
etxtNextDeliveryDate.setFocusableInTouchMode(false);
etxtPCB.setFocusableInTouchMode(false);
etxtStockMinimum.setFocusableInTouchMode(false);
etxtFacing.setFocusableInTouchMode(false);
etxtSupplierLPOType.setFocusableInTouchMode(false);
etxtSupplierLeadTime.setFocusableInTouchMode(false);
setClickListener(etxtBarcode);
setClickListener(etxtItemCode);
setClickListener(etxtSupplier);
setClickListener(etxtStockBeginningDay);
setClickListener(etxtLastReceptionDate);
setClickListener(etxtPendingOrders);
setClickListener(etxtNextOrderingDate);
setClickListener(etxtNextDeliveryDate);
setClickListener(etxtPCB);
setClickListener(etxtStockMinimum);
setClickListener(etxtFacing);
setClickListener(etxtSupplierLPOType);
setClickListener(etxtSupplierLeadTime);
}
}
private void setClickListener(final EditText etxt) {
clickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
etxt.setEnabled(true);
etxt.setTextIsSelectable(true);
etxt.setFocusable(true);
etxt.setFocusableInTouchMode(true);
if (etxt.isEnabled() && !etxt.hasFocus()) {
etxt.requestFocus();
}
public void onLabelPageClick(View v) {
Intent intent = new Intent(getApplicationContext(), LabelActivity.class);
startActivity(intent);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
}
};
}
private void setData() {
if (viewModel.getProductInfoBean() != null) {
String str = getString(R.string.label_updated_on)
+ TimeUtil.getDateFromUnix(TimeUtil.DATE_FORMAT_7, true, true,
TimeUtil.getCalendarFromString(viewModel.getProductInfoBean().getDateCreated()).getTimeInMillis(),
false);
txtToolbarLastUpdateDate.setText(str);
txtDescription.setText(viewModel.getProductInfoBean().getItemDescription());
etxtBarcode.setText("");
etxtItemCode.setText(viewModel.getProductInfoBean().getItemCode());
etxtSupplier.setText(viewModel.getProductInfoBean().getSupplier());
etxtStockBeginningDay.setText(BarcodeUtil.removeTrailingZeroes(viewModel.getProductInfoBean().getStockBeginningDay()));
etxtLastReceptionDate.setText(viewModel.getProductInfoBean().getLastReceptionDate());
etxtPendingOrders.setText(BarcodeUtil.removeTrailingZeroes(viewModel.getProductInfoBean().getPendingOrders()));
etxtNextOrderingDate.setText(viewModel.getProductInfoBean().getNextOrderDate());
etxtNextDeliveryDate.setText(viewModel.getProductInfoBean().getNextDeliveryDate());
etxtPCB.setText(BarcodeUtil.removeTrailingZeroes(viewModel.getProductInfoBean().getPCB()));
etxtStockMinimum.setText(BarcodeUtil.removeTrailingZeroes(viewModel.getProductInfoBean().getStockMinimum()));
etxtFacing.setText(BarcodeUtil.removeTrailingZeroes(viewModel.getProductInfoBean().getFacing()));
etxtSupplierLPOType.setText(viewModel.getProductInfoBean().getSupplierLPOType());
etxtSupplierLeadTime.setText(viewModel.getProductInfoBean().getSupplierLeadTime());
}
}
private void clearViews() {
txtToolbarLastUpdateDate.setText("");
txtDescription.setText("");
etxtBarcode.setText("");
etxtItemCode.setText("");
etxtSupplier.setText("");
etxtStockBeginningDay.setText("");
etxtLastReceptionDate.setText("");
etxtPendingOrders.setText("");
etxtNextOrderingDate.setText("");
etxtNextDeliveryDate.setText("");
etxtPCB.setText("");
etxtStockMinimum.setText("");
etxtFacing.setText("");
etxtSupplierLPOType.setText("");
etxtSupplierLeadTime.setText("");
}
private void populateProductInfo() {
if (viewModel.getProductInfoBean() != null) {
setData();
} else {
PopupMessage popupMessage = new PopupMessage(this);
popupMessage.show(getString(R.string.message_item_not_found), 0, getString(R.string.btn_ok));
clearViews();
}
setProgressScreenVisibility(false, false);
}
private void onOrderInfoMainPageClick(View view) {
view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
//mVibrator.vibrate(25);
startActivity(new Intent(getApplicationContext(), ProductInfoActivity.class)
.putExtra("menuBean", viewModel.getSelectedMenuBean())
.putExtra("bean", viewModel.getProductInfoBean())
.putExtra("barcode", viewModel.getBarcode()));
finish();
}
public void onOrderPageClick(View v) {
Intent intent = new Intent(getApplicationContext(), OrderInfoActivity.class);
startActivity(intent);
private void onOrderInfoLabelClick(View view) {
view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
//mVibrator.vibrate(25);
startActivity(new Intent(getApplicationContext(), LabelActivity.class)
.putExtra("menuBean", viewModel.getSelectedMenuBean())
.putExtra("bean", viewModel.getProductInfoBean())
.putExtra("barcode", viewModel.getBarcode()));
finish();
}
public void onWeekPageClick(View v) {
Intent intent = new Intent(getApplicationContext(), WeekMovementActivity.class);
startActivity(intent);
private void onOrderInfoWeekUnitClick(View view) {
view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
//mVibrator.vibrate(25);
startActivity(new Intent(getApplicationContext(), WeekMovementActivity.class)
.putExtra("menuBean", viewModel.getSelectedMenuBean())
.putExtra("bean", viewModel.getProductInfoBean())
.putExtra("barcode", viewModel.getBarcode()));
finish();
}
public void onExitClick(View v) {
confirmationDialog.show(R.string.message_do_you_really_want_to_exit);
private void onOrderInfoExitClick(View view) {
view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
//mVibrator.vibrate(25);
finish();
}
}
package in.techware.carrefour.activity.info;
import android.arch.lifecycle.Observer;
import android.arch.lifecycle.ViewModelProviders;
import android.content.Context;
import android.content.Intent;
......@@ -11,22 +12,14 @@ import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import java.util.HashMap;
import in.techware.carrefour.R;
import in.techware.carrefour.activity.BaseAppCompatNoDrawerActivity;
import in.techware.carrefour.app.App;
import in.techware.carrefour.config.Config;
import in.techware.carrefour.dialogs.PopupMessage;
import in.techware.carrefour.dialogs.ProductInfoUnitDialog;
import in.techware.carrefour.listeners.BarcodeUpdateListener;
import in.techware.carrefour.listeners.ProductInfoListener;
import in.techware.carrefour.model.FamilyBean;
import in.techware.carrefour.model.MenuBean;
import in.techware.carrefour.model.ProductInfoBean;
import in.techware.carrefour.net.DataManager;
import in.techware.carrefour.util.AppConstants;
import in.techware.carrefour.util.BarcodeUtil;
import in.techware.carrefour.util.TimeUtil;
......@@ -81,6 +74,8 @@ public class ProductInfoActivity extends BaseAppCompatNoDrawerActivity {
initToolbar();
initViews();
initViewModelCallbacks();
handleKeyboard();
// populateViewModel();
......@@ -140,6 +135,8 @@ public class ProductInfoActivity extends BaseAppCompatNoDrawerActivity {
etxtBarcode.requestFocus();
}
clearViews();
btnUnit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
......@@ -185,11 +182,7 @@ public class ProductInfoActivity extends BaseAppCompatNoDrawerActivity {
viewModel.setBarcode(BarcodeUtil.getFormattedBarcode(barcode));
setProgressScreenVisibility(true, true);
if (App.isNetworkAvailable()) {
fetchProductInfoFromWS();
} else {
fetchProductInfoFromFile();
}
viewModel.fetchProductInfo();
}
return true;
......@@ -209,15 +202,25 @@ public class ProductInfoActivity extends BaseAppCompatNoDrawerActivity {
viewModel.setBarcode(barcode);
setProgressScreenVisibility(true, true);
if (App.isNetworkAvailable()) {
fetchProductInfoFromWS();
} else {
fetchProductInfoFromFile();
}
viewModel.fetchProductInfo();
}
};
addBarcodeUpdateListener(barcodeUpdateListener);
}
private void initViewModelCallbacks() {
viewModel.isFetchingFinished().observe(this, new Observer<Boolean>() {
@Override
public void onChanged(Boolean isFetchingFinished) {
if (isFetchingFinished) {
populateProductInfo();
}
}
});
}
......@@ -379,45 +382,8 @@ public class ProductInfoActivity extends BaseAppCompatNoDrawerActivity {
}
}
private void fetchProductInfoFromWS() {
HashMap<String, String> urlParams = new HashMap<>();
urlParams.put("StoreID", Config.getInstance().getAppSettingsBean().getStoreID());
int type = AppConstants.PRODUCT_INFO_TYPE_NORMAL;
if (viewModel.getBarcode().startsWith("21")) {
urlParams.put("BarCode", viewModel.getBarcode().substring(0, 7));
type = AppConstants.PRODUCT_INFO_TYPE_MARKET;
} else {
urlParams.put("BarCode", viewModel.getBarcode());
}
DataManager.fetchProductInfo(urlParams, type, new ProductInfoListener() {
@Override
public void onLoadCompleted(ProductInfoBean productInfoBean) {
viewModel.setProductInfoBean(ProductInfoUtil.parseProductInfo(productInfoBean));
if (viewModel.getProductInfoBean() != null) {
setData();
} else {
PopupMessage popupMessage = new PopupMessage(ProductInfoActivity.this);
popupMessage.show(getString(R.string.message_item_not_found), 0, getString(R.string.btn_ok));
clearViews();
}
setProgressScreenVisibility(false, false);
}
@Override
public void onLoadFailed(String error) {
Toast.makeText(ProductInfoActivity.this, error, Toast.LENGTH_SHORT).show();
clearViews();
setProgressScreenVisibility(false, false);
}
});
}
private void fetchProductInfoFromFile() {
if (Config.getInstance().getProductInfoList() != null && !Config.getInstance().getProductInfoList().isEmpty()) {
viewModel.setProductInfoBean(Config.getInstance().searchProductInfo(viewModel.getBarcode()));
private void populateProductInfo() {
if (viewModel.getProductInfoBean() != null) {
setData();
} else {
......@@ -427,7 +393,6 @@ public class ProductInfoActivity extends BaseAppCompatNoDrawerActivity {
}
setProgressScreenVisibility(false, false);
}
}
private void onProductInfoUnitClick(View view) {
view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
......@@ -461,6 +426,7 @@ public class ProductInfoActivity extends BaseAppCompatNoDrawerActivity {
//mVibrator.vibrate(25);
startActivity(new Intent(getApplicationContext(), LabelActivity.class)
.putExtra("menuBean", viewModel.getSelectedMenuBean())
.putExtra("bean", viewModel.getProductInfoBean())
.putExtra("barcode", viewModel.getBarcode()));
finish();
......@@ -471,6 +437,7 @@ public class ProductInfoActivity extends BaseAppCompatNoDrawerActivity {
//mVibrator.vibrate(25);
startActivity(new Intent(getApplicationContext(), OrderInfoActivity.class)
.putExtra("menuBean", viewModel.getSelectedMenuBean())
.putExtra("bean", viewModel.getProductInfoBean())
.putExtra("barcode", viewModel.getBarcode()));
finish();
......@@ -481,6 +448,7 @@ public class ProductInfoActivity extends BaseAppCompatNoDrawerActivity {
//mVibrator.vibrate(25);
startActivity(new Intent(getApplicationContext(), WeekMovementActivity.class)
.putExtra("menuBean", viewModel.getSelectedMenuBean())
.putExtra("bean", viewModel.getProductInfoBean())
.putExtra("barcode", viewModel.getBarcode()));
finish();
......
package `in`.techware.carrefour.viewModels
import `in`.techware.carrefour.app.App
import `in`.techware.carrefour.config.Config
import `in`.techware.carrefour.listeners.ProductInfoListener
import `in`.techware.carrefour.model.MenuBean
import `in`.techware.carrefour.model.ProductInfoBean
import `in`.techware.carrefour.net.DataManager
import `in`.techware.carrefour.util.AppConstants
import `in`.techware.carrefour.util.menuUtils.ProductInfoUtil
import android.arch.lifecycle.MutableLiveData
import android.arch.lifecycle.ViewModel
import android.widget.Toast
import java.util.*
import kotlin.collections.set
/**
* Created by Jemsheer K D on 27 July, 2018.
......@@ -17,7 +27,8 @@ class ProductInfoViewModel : ViewModel() {
var selectedMenuBean: MenuBean? = null
var productInfoList: ArrayList<ProductInfoBean> = ArrayList()
var isFetchingFinished: MutableLiveData<Boolean> = MutableLiveData()
fun setData(bean: ProductInfoBean) {
......@@ -29,25 +40,51 @@ class ProductInfoViewModel : ViewModel() {
productInfoBean = null
}
fun indexOf(productInfoBean: ProductInfoBean): Int {
for (bean in productInfoList) {
if (bean.barcode == productInfoBean.barcode) {
return productInfoList.indexOf(bean)
fun fetchProductInfo() {
isFetchingFinished.value = false
if (App.isNetworkAvailable()) {
fetchProductInfoFromWS()
} else {
fetchProductInfoFromFile()
}
}
return -1
private fun fetchProductInfoFromWS() {
val urlParams = HashMap<String, String>()
urlParams["StoreID"] = Config.getInstance().appSettingsBean.storeID
var type = AppConstants.PRODUCT_INFO_TYPE_NORMAL
if (barcode.startsWith("21")) {
urlParams["BarCode"] = barcode.substring(0, 7)
type = AppConstants.PRODUCT_INFO_TYPE_MARKET
} else {
urlParams["BarCode"] = barcode
}
fun lastIndex(): Int {
return productInfoList.size - 1
DataManager.fetchProductInfo(urlParams, type, object : ProductInfoListener {
override fun onLoadCompleted(productInfoBeanWS: ProductInfoBean) {
productInfoBean = ProductInfoUtil.parseProductInfo(productInfoBeanWS)
isFetchingFinished.value = true
}
fun indexOf(barcode: String): Int {
for (bean in productInfoList) {
if (bean.barcode == barcode) {
return productInfoList.indexOf(bean)
override fun onLoadFailed(error: String) {
Toast.makeText(App.getInstance(), error, Toast.LENGTH_SHORT).show()
productInfoBean = null
isFetchingFinished.value = true
}
})
}
private fun fetchProductInfoFromFile() {
if (Config.getInstance().productInfoList != null && !Config.getInstance().productInfoList.isEmpty()) {
productInfoBean = Config.getInstance().searchProductInfo(barcode)
isFetchingFinished.value = true
} else {
productInfoBean = null
isFetchingFinished.value = true
}
return -1
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.constraint.ConstraintLayout 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:descendantFocusability="afterDescendants"
android:focusable="true"
android:focusableInTouchMode="true"
tools:context="in.techware.carrefour.activity.info.OrderInfoActivity">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:src="@drawable/bg_shade" />
<android.support.v4.widget.NestedScrollView
android:id="@+id/nestedScrollView"
style="@style/NestedScrollBarStyle"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toTopOf="@+id/linearLayout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<RelativeLayout
android:id="@+id/toolbar_layout"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="28dp"
android:background="@color/colorPrimary"
android:orientation="vertical">
<in.techware.carrefour.widgets.CustomTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:text="@string/order_info_label"
android:textColor="@color/white"
android:textSize="15dp" />
<in.techware.carrefour.widgets.CustomTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="16dp"
android:text="@string/updated_label_request_placeholder"
android:textColor="@color/white"
android:textSize="15dp" />
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingBottom="10dp">
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar_layout"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginTop="8dp"
android:layout_marginRight="14dp">
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<in.techware.carrefour.widgets.CustomEditText
android:id="@+id/etxt_item_code"
android:layout_width="100dp"
android:layout_height="16dp"
android:background="@drawable/shadow_click_dark_rectangle"
android:focusableInTouchMode="false"
android:paddingLeft="8dp"
android:text=""
/>
android:id="@+id/etxt_order_info_barcode"
style="@style/ItemInputBox"
android:layout_marginLeft="0dp"
android:cursorVisible="true"
android:enabled="false"
android:focusable="false"
android:focusableInTouchMode="true"
android:hint="@string/hint_barcode"
android:inputType="number"
android:maxLength="13"
android:textAppearance="?android:attr/textAppearanceSmall" />
<in.techware.carrefour.widgets.CustomTextView
android:id="@+id/text_barcode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_toRightOf="@+id/etxt_item_code"
android:layout_marginRight="8dp"
android:text="@string/label_item_code"
android:textColor="@color/carbon"
android:textSize="12sp" />
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/carbon" />
<in.techware.carrefour.widgets.CustomEditText
android:id="@+id/etxt_barcode"
android:layout_width="match_parent"
android:layout_height="16dp"
android:layout_marginLeft="8dp"
android:layout_toRightOf="@+id/text_barcode"
android:background="@drawable/shadow_click_dark_rectangle"
android:focusableInTouchMode="false"
android:paddingLeft="8dp"
android:text=""
/>
</RelativeLayout>
android:id="@+id/etxt_order_info_item_code"
style="@style/ItemInputBox.Disabled"
android:layout_marginLeft="0dp"
android:hint="@string/hint_item_code"
android:textAppearance="?android:attr/textAppearanceSmall" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginRight="14dp">
</LinearLayout>
<in.techware.carrefour.widgets.CustomTextView
android:id="@+id/etxt_waste_quantity"
android:id="@+id/txt_order_info_item_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="8dp"
android:layout_toRightOf="@+id/check_qty"
android:enabled="false"
android:paddingLeft="8dp"
android:text="@string/sport_drink_qty_label"
android:layout_marginTop="2dp"
android:gravity="center_vertical"
android:hint="@string/label_desc_of_item"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/text_red_1"
android:textSize="11sp"
/>
android:textColorHint="@color/text_red_1"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginTop="6dp"
android:layout_marginRight="14dp">
android:layout_marginTop="2dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<in.techware.carrefour.widgets.CustomTextView
android:id="@+id/text_supp_dc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/supplier_dc_value"
style="@style/ItemLabel"
android:minHeight="25dp"
android:text="@string/label_supplier_or_dc"
android:textAllCaps="false"
android:textColor="@color/text_4"
android:textSize="11sp" />
android:textSize="14sp"
android:textStyle="bold" />
<in.techware.carrefour.widgets.CustomEditText
android:id="@+id/etxt_supp_dc"
android:layout_width="100dp"
android:layout_height="16dp"
android:layout_alignParentRight="true"
android:layout_marginLeft="8dp"
android:background="@drawable/shadow_click_dark_rectangle"
android:focusableInTouchMode="false"
android:paddingLeft="8dp"
android:text=""
/>
</RelativeLayout>
<in.techware.carrefour.widgets.CustomEditText
android:id="@+id/etxt_order_info_supplier_or_dc"
style="@style/ItemInputBox.Disabled"
android:layout_marginLeft="0dp"
android:layout_weight=".6"
android:minHeight="25dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginTop="6dp"
android:layout_marginRight="14dp">
android:layout_marginTop="2dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<in.techware.carrefour.widgets.CustomTextView
android:id="@+id/text_stock_begin_day"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/ItemLabel"
android:minHeight="25dp"
android:text="@string/label_stock_beginning"
android:textAllCaps="false"
android:textColor="@color/text_4"
android:textSize="11sp" />
android:textSize="14sp"
android:textStyle="bold" />
<in.techware.carrefour.widgets.CustomEditText
android:id="@+id/text_stock_beginning_day"
android:layout_width="100dp"
android:layout_height="16dp"
android:layout_alignParentRight="true"
android:layout_marginLeft="8dp"
android:background="@drawable/shadow_click_dark_rectangle"
android:focusableInTouchMode="false"
android:paddingLeft="8dp"
android:text=""
/>
</RelativeLayout>
<in.techware.carrefour.widgets.CustomEditText
android:id="@+id/etxt_order_info_stock_beginning_day"
style="@style/ItemInputBox.Disabled"
android:layout_marginLeft="0dp"
android:layout_weight=".6"
android:minHeight="25dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginTop="6dp"
android:layout_marginRight="14dp"
android:layout_marginTop="2dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<in.techware.carrefour.widgets.CustomTextView
android:id="@+id/text_last_dec_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/last_recept_date_value"
android:textAllCaps="true"
android:textColor="@color/text_4"
android:textSize="11sp" />
style="@style/ItemLabel"
android:minHeight="25dp"
android:text="@string/label_last_reception_date"
android:textSize="14sp" />
<in.techware.carrefour.widgets.CustomEditText
android:id="@+id/etxt_last_rec_date"
android:layout_width="120dp"
android:layout_height="16dp"
android:layout_alignParentRight="true"
android:background="@drawable/shadow_click_dark_rectangle"
android:focusableInTouchMode="false"
android:paddingLeft="8dp"
android:text=""
/>
</RelativeLayout>
android:id="@+id/etxt_order_info_last_reception_date"
style="@style/ItemInputBox.Disabled"
android:layout_marginLeft="0dp"
android:layout_weight=".75"
android:minHeight="25dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginTop="6dp"
android:layout_marginRight="14dp"
android:layout_marginTop="2dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<in.techware.carrefour.widgets.CustomTextView
android:id="@+id/text_pending_orders"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pending_orders_value"
android:textAllCaps="true"
android:textColor="@color/text_4"
android:textSize="11sp" />
style="@style/ItemLabel"
android:minHeight="25dp"
android:text="@string/label_pending_orders"
android:textSize="14sp" />
<in.techware.carrefour.widgets.CustomEditText
android:id="@+id/etxt_pending_orders"
android:layout_width="120dp"
android:layout_height="16dp"
android:layout_alignParentRight="true"
android:background="@drawable/shadow_click_dark_rectangle"
android:focusableInTouchMode="false"
android:paddingLeft="8dp"
android:text=""
/>
</RelativeLayout>
android:id="@+id/etxt_order_info_pending_orders"
style="@style/ItemInputBox.Disabled"
android:layout_marginLeft="0dp"
android:layout_weight=".75"
android:minHeight="25dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginTop="6dp"
android:layout_marginRight="14dp"
android:layout_marginTop="2dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<in.techware.carrefour.widgets.CustomTextView
android:id="@+id/text_order_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/next_ordering_value"
android:textAllCaps="true"
android:textColor="@color/text_4"
android:textSize="11sp" />
style="@style/ItemLabel"
android:minHeight="25dp"
android:text="@string/label_next_ordering_date"
android:textSize="14sp" />
<in.techware.carrefour.widgets.CustomEditText
android:id="@+id/etxt_order_date"
android:layout_width="120dp"
android:layout_height="16dp"
android:layout_alignParentRight="true"
android:background="@drawable/shadow_click_dark_rectangle"
android:focusableInTouchMode="false"
android:paddingLeft="8dp"
android:text=""
/>
</RelativeLayout>
android:id="@+id/etxt_order_info_next_ordering_date"
style="@style/ItemInputBox.Disabled"
android:layout_marginLeft="0dp"
android:layout_weight=".75"
android:minHeight="25dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginTop="6dp"
android:layout_marginRight="14dp"
android:layout_marginTop="2dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<in.techware.carrefour.widgets.CustomTextView
android:id="@+id/text_next_del_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/next_delivery_value"
android:textAllCaps="false"
android:textColor="@color/text_4"
android:textSize="11sp" />
style="@style/ItemLabel"
android:minHeight="25dp"
android:text="@string/label_next_delivery_date"
android:textSize="14sp" />
<in.techware.carrefour.widgets.CustomEditText
android:id="@+id/etxt_next_del_date"
android:layout_width="120dp"
android:layout_height="16dp"
android:layout_alignParentRight="true"
android:background="@drawable/shadow_click_dark_rectangle"
android:focusableInTouchMode="false"
android:paddingLeft="8dp"
android:text=""
/>
</RelativeLayout>
android:id="@+id/etxt_order_info_next_delivery_date"
style="@style/ItemInputBox.Disabled"
android:layout_marginLeft="0dp"
android:layout_weight=".75"
android:minHeight="25dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginTop="6dp"
android:layout_marginRight="14dp"
android:layout_marginTop="2dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<in.techware.carrefour.widgets.CustomTextView
android:id="@+id/text_pcb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pcb_value"
android:textAllCaps="false"
android:textColor="@color/text_4"
android:textSize="11sp" />
style="@style/ItemLabel"
android:minHeight="25dp"
android:text="@string/label_pcb"
android:textSize="14sp" />
<in.techware.carrefour.widgets.CustomEditText
android:id="@+id/etxt_pcb"
android:layout_width="120dp"
android:layout_height="16dp"
android:layout_alignParentRight="true"
android:background="@drawable/shadow_click_dark_rectangle"
android:focusableInTouchMode="false"
android:paddingLeft="8dp"
android:text=""
/>
</RelativeLayout>
android:id="@+id/etxt_order_info_pcb"
style="@style/ItemInputBox.Disabled"
android:layout_marginLeft="0dp"
android:layout_weight=".75"
android:minHeight="25dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginTop="6dp"
android:layout_marginRight="14dp"
android:layout_marginTop="2dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<in.techware.carrefour.widgets.CustomTextView
android:id="@+id/text_stock_min"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/stock_min_value"
android:textAllCaps="false"
android:textColor="@color/text_4"
android:textSize="11sp" />
style="@style/ItemLabel"
android:minHeight="25dp"
android:text="@string/label_stock_minimum"
android:textSize="14sp" />
<in.techware.carrefour.widgets.CustomEditText
android:id="@+id/etxt_stock_min"
android:layout_width="120dp"
android:layout_height="16dp"
android:layout_alignParentRight="true"
android:background="@drawable/shadow_click_dark_rectangle"
android:focusableInTouchMode="false"
android:paddingLeft="8dp"
android:text=""
/>
</RelativeLayout>
android:id="@+id/etxt_order_info_stock_minimum"
style="@style/ItemInputBox.Disabled"
android:layout_marginLeft="0dp"
android:layout_weight=".75"
android:minHeight="25dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginTop="6dp"
android:layout_marginRight="14dp"
android:layout_marginTop="2dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<in.techware.carrefour.widgets.CustomTextView
android:id="@+id/text_facing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/ItemLabel"
android:minHeight="25dp"
android:text="@string/label_facing"
android:textAllCaps="false"
android:textColor="@color/text_4"
android:textSize="11sp" />
android:textSize="14sp" />
<in.techware.carrefour.widgets.CustomEditText
android:id="@+id/etxt_facing"
android:layout_width="120dp"
android:layout_height="16dp"
android:layout_alignParentRight="true"
android:background="@drawable/shadow_click_dark_rectangle"
android:focusableInTouchMode="false"
android:paddingLeft="8dp"
android:text=""
/>
</RelativeLayout>
android:id="@+id/etxt_order_info_facing"
style="@style/ItemInputBox.Disabled"
android:layout_marginLeft="0dp"
android:layout_weight=".75"
android:minHeight="25dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginTop="6dp"
android:layout_marginRight="14dp"
android:layout_marginTop="2dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<in.techware.carrefour.widgets.CustomTextView
android:id="@+id/text_supplier_lpo_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/lpo_type_value"
android:textAllCaps="false"
android:textColor="@color/text_4"
android:textSize="11sp" />
style="@style/ItemLabel"
android:minHeight="25dp"
android:text="@string/label_supplier_lpo_type"
android:textSize="14sp" />
<in.techware.carrefour.widgets.CustomEditText
android:id="@+id/etxt_supplier_lpo_type"
android:layout_width="120dp"
android:layout_height="16dp"
android:layout_alignParentRight="true"
android:background="@drawable/shadow_click_dark_rectangle"
android:focusableInTouchMode="false"
android:paddingLeft="8dp"
android:text=""
/>
</RelativeLayout>
android:id="@+id/etxt_order_info_supplier_lpo_type"
style="@style/ItemInputBox.Disabled"
android:layout_marginLeft="0dp"
android:layout_weight=".75"
android:minHeight="25dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginTop="6dp"
android:layout_marginRight="14dp"
android:layout_marginTop="2dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<in.techware.carrefour.widgets.CustomTextView
android:id="@+id/text_supp_lead_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/supplier_lead_time_value"
android:textAllCaps="false"
android:textColor="@color/text_4"
android:textSize="11sp" />
style="@style/ItemLabel"
android:minHeight="25dp"
android:text="@string/label_supplier_lead_time"
android:textSize="14sp" />
<in.techware.carrefour.widgets.CustomEditText
android:id="@+id/etxt_supplier_lead_time"
android:layout_width="120dp"
android:layout_height="16dp"
android:layout_alignParentRight="true"
android:background="@drawable/shadow_click_dark_rectangle"
android:focusableInTouchMode="false"
android:paddingLeft="8dp"
android:text=""
/>
</RelativeLayout>
android:id="@+id/etxt_order_info_supplier_lead_time"
style="@style/ItemInputBox.Disabled"
android:layout_marginLeft="0dp"
android:layout_weight=".75"
android:minHeight="25dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<LinearLayout
android:layout_width="wrap_content"
android:id="@+id/linearLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="14dp"
android:layout_marginBottom="24dp"
android:orientation="horizontal">
android:gravity="center"
android:orientation="horizontal"
android:paddingLeft="10dp"
android:paddingRight="10dp"
app:layout_constraintBottom_toTopOf="@+id/linearLayout2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<in.techware.carrefour.widgets.CustomButton
android:id="@+id/btn_back"
android:layout_width="66dp"
android:layout_height="22dp"
android:background="@drawable/btn_click_gray_dark_rectangle"
android:onClick="onExitClick"
android:text="@string/exit_placeholder"
android:id="@+id/btn_order_info_exit"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/btn_click_red_rectangle"
android:text="@string/btn_exit"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="13sp" />
android:textColor="@color/white" />
<in.techware.carrefour.widgets.CustomButton
android:id="@+id/btn_modify"
android:layout_width="78dp"
android:layout_height="22dp"
android:layout_marginLeft="8dp"
android:id="@+id/btn_order_info_main_page"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_marginLeft="4dp"
android:layout_weight="1"
android:background="@drawable/btn_click_gradient_rectangle"
android:onClick="onMainPageClick"
android:text="@string/main_page_placeholder"
android:text="@string/btn_main_page"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="13sp" />
android:textColor="@color/white" />
<in.techware.carrefour.widgets.CustomButton
android:id="@+id/btn_order"
android:layout_width="66dp"
android:layout_height="22dp"
android:layout_marginLeft="8dp"
android:id="@+id/btn_order_info_label"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_marginLeft="4dp"
android:layout_weight="1"
android:background="@drawable/btn_click_gradient_rectangle"
android:onClick="onLabelPageClick"
android:text="@string/label_placeholder"
android:text="@string/btn_label"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="13sp" />
android:textColor="@color/white" />
<in.techware.carrefour.widgets.CustomButton
android:id="@+id/btn_week"
android:layout_width="66dp"
android:layout_height="22dp"
android:layout_marginLeft="8dp"
android:id="@+id/btn_order_info_week"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_marginLeft="4dp"
android:layout_weight="1"
android:background="@drawable/btn_click_gradient_rectangle"
android:onClick="onWeekPageClick"
android:text="@string/week_placeholder"
android:text="@string/btn_week"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="13sp" />
android:textColor="@color/white" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<ProgressBar
android:id="@+id/progress_order_info_network_strength"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp"
android:layout_weight="1"
android:progress="40" />
</RelativeLayout>
<in.techware.carrefour.widgets.CustomTextView
android:id="@+id/txt_order_info_network_strength"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/percentage_progress_label"
android:textColor="@color/text_4" />
</LinearLayout>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
......@@ -136,19 +136,19 @@
<string name="label_survey_placeholder">Label Survey</string>
<string name="label_today_selling_price">Today Selling Price</string>
<string name="label_zone">Zone</string>
<string name="last_recept_date_value">Last reception date</string>
<string name="lpo_type_value">Supplier LPO Type</string>
<string name="label_last_reception_date">Last reception date</string>
<string name="label_supplier_lpo_type">Supplier LPO Type</string>
<string name="main_menu_placeholder">Main Menu</string>
<string name="main_page_placeholder">Main Page</string>
<string name="next_delivery_value">Next delivery date</string>
<string name="next_ordering_value">Next ordering date</string>
<string name="label_next_delivery_date">Next delivery date</string>
<string name="label_next_ordering_date">Next ordering date</string>
<string name="offsite_storage_in_label">Off-Site Storage IN</string>
<string name="offsite_storage_out_label">Off-Site Storage OUT</string>
<string name="order_info_label">Order Info</string>
<string name="order_placeholder">Order</string>
<string name="password_label">Password</string>
<string name="pcb_value">PCB</string>
<string name="pending_orders_value">Pending Orders</string>
<string name="label_pcb">PCB</string>
<string name="label_pending_orders">Pending Orders</string>
<string name="percentage_progress_label">46%</string>
<string name="pit_number_placeholder">PIT Number</string>
<string name="price_label">Price</string>
......@@ -161,11 +161,11 @@
<string name="shelf_print_label">Print Shelf Label</string>
<string name="spinner_arrow">\u02C5</string>
<string name="spinner_prompt">1-Freshness, Quality</string>
<string name="stock_min_value">Stock minimum</string>
<string name="label_stock_minimum">Stock minimum</string>
<string name="stock_take_placeholder">Stock Take</string>
<string name="store_placeholder">456</string>
<string name="supplier_dc_value">SUPPLIER or DC</string>
<string name="supplier_lead_time_value">Supplier Lead Time</string>
<string name="label_supplier_or_dc">SUPPLIER or DC</string>
<string name="label_supplier_lead_time">Supplier Lead Time</string>
<string name="title_expiry_action">Expiry Action</string>
<string name="title_file_transfer">File Transfer</string>
<string name="title_get_orders">Get Orders</string>
......@@ -867,6 +867,8 @@
<string name="sample_unit">Composed/Pack</string>
<string name="label_updated_on">Updated On-</string>
<string name="message_item_not_found">Item not found</string>
<string name="btn_main_page">Main Page</string>
<string name="title_order_info">Order Info</string>
<string-array name="menu_home">
......
......@@ -11,7 +11,7 @@ buildscript {
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0-alpha11'
classpath 'com.android.tools.build:gradle:3.3.0-alpha12'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'io.fabric.tools:gradle:1+'
......
#Fri Sep 14 10:22:14 IST 2018
#Thu Sep 27 11:09:58 IST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment