Commit f6b3f276 authored by 王海's avatar 王海

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	.idea/modules.xml
#	app/src/main/res/values/strings.xml
parents f0254c63 c4a3caf6
......@@ -2,9 +2,8 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/TangKuPos.iml" filepath="$PROJECT_DIR$/TangKuPos.iml" />
<module fileurl="file://C:\Users\JM_DEV\AndroidStudioProjects\TangKuPos2\TangKuPos.iml" filepath="C:\Users\JM_DEV\AndroidStudioProjects\TangKuPos2\TangKuPos.iml" />
<module fileurl="file://D:\AndroidStudioProject\TangKuPos\TangKuPos2.iml" filepath="D:\AndroidStudioProject\TangKuPos\TangKuPos2.iml" />
<module fileurl="file://$PROJECT_DIR$/TangKuPos2.iml" filepath="$PROJECT_DIR$/TangKuPos2.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
......
......@@ -207,7 +207,6 @@ public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBind
if (null != mDisp && (!mDisp.isDisposed())) {
mDisp.dispose();
}
super.dismiss();
}
}
......
......@@ -179,7 +179,7 @@ public class BaleEditFragment extends BaseFragment<BalePresenter, FragmentBaleEd
mScanFragment.setOnScanCompletedListener(new ScanFragment
.OnScanCompletedListener() {
@Override
public void OnScanCompleted(String barcode) {
public void onScanCompleted(String barcode) {
pop();
mPresenter.mBaleSeachShopFragment.seachBarcode(barcode);
start(mPresenter.mBaleSeachShopFragment);
......
......@@ -83,7 +83,7 @@ public class BaleIndexFragment extends BaseFragment<BalePresenter, FragmentBaleI
(new ScanFragment
.OnScanCompletedListener() {
@Override
public void OnScanCompleted
public void onScanCompleted
(String barcode) {
pop();
loadingDialog.show(
......
......@@ -197,7 +197,7 @@ public class InventoryActivity extends BaseActivity<InventoryPresenter, Activity
mScanFragment = new ScanFragment();
mScanFragment.setOnScanCompletedListener(new ScanFragment.OnScanCompletedListener() {
@Override
public void OnScanCompleted(String barcode) {
public void onScanCompleted(String barcode) {
mPresenter.getProductByBarcode(barcode);
}
});
......
......@@ -27,6 +27,7 @@ import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.dialog.PromptDialog;
import com.xingdata.zzdpos.ui.manage.inventory.InventoryPresenter;
import com.xingdata.zzdpos.ui.manage.inventory.adpter.InventoryAdapter;
import com.xingdata.zzdpos.util.DensityUtil;
import com.xingdata.zzdpos.util.MyMenuItemDecoration;
import com.xingdata.zzdpos.util.OnClickListener;
import com.xingdata.zzdpos.util.RecyclerViewUtil;
......@@ -71,7 +72,7 @@ public class InventoryFragment extends BaseFragment<InventoryPresenter, Fragment
Drawable drawable = getResources().getDrawable(R.drawable.singleline_zhouyu_huanggai);
mInventoryAdapter.bindToRecyclerView( mViewBinding.recyclerInventory);
mViewBinding.recyclerInventory.addItemDecoration(new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable));
mViewBinding.recyclerInventory.addItemDecoration(new RecyclerViewUtil.ListCardItemDecoration(getActivity(), DensityUtil.dip2px(getActivity(),16), drawable));
mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh);
mInventoryAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.recyclerInventory);
......
......@@ -64,7 +64,7 @@ public class OtherSelectActivity extends BaseActivity<OtherSelectPresenter,
mScanFragment = new ScanFragment();
mScanFragment.setOnScanCompletedListener(new ScanFragment.OnScanCompletedListener() {
@Override
public void OnScanCompleted(String barcode) {
public void onScanCompleted(String barcode) {
mOtherListFragment.search(barcode);
}
});
......
......@@ -22,6 +22,7 @@ import com.xingdata.zzdpos.model.Ossku;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.ui.manage.otherselect.OtherSelectPresenter;
import com.xingdata.zzdpos.ui.manage.otherselect.adpter.OtherSelectAdapter;
import com.xingdata.zzdpos.util.DensityUtil;
import com.xingdata.zzdpos.util.RecyclerViewUtil;
......@@ -46,7 +47,7 @@ public class OtherListFragment extends BaseFragment<OtherSelectPresenter, Fragme
@Override
public void initView() {
drawable = getResources().getDrawable(R.drawable.singleline_zhouyu_huanggai);
listItemDecoration = new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable, 0);
listItemDecoration = new RecyclerViewUtil.ListCardItemDecoration(getActivity(), DensityUtil.dip2px(getActivity(), 16), drawable, 0);
mOtherSelectAdapter = new OtherSelectAdapter(new ArrayList<>());
mOtherSelectAdapter.setEmptyView(getEmptyView(R.string.empty_other_select));
mViewBinding.recyclerOtherSelcet.setLayoutManager(new LinearLayoutManager(getActivity()));
......@@ -111,9 +112,10 @@ public class OtherListFragment extends BaseFragment<OtherSelectPresenter, Fragme
}
public void setKeyword(String s){
public void setKeyword(String s) {
mViewBinding.edTitle.setText(s);
}
private View getEmptyView(int resHint) {
View view = getLayoutInflater().inflate(R.layout.view_empty, null);
view.setBackgroundResource(R.color.gray_zhouyu);
......
......@@ -57,7 +57,7 @@ public class ReplenishmentActivity extends BaseActivity<ReplenishmentPresenter,
mScanFragment = new ScanFragment();
mScanFragment.setOnScanCompletedListener(new ScanFragment.OnScanCompletedListener() {
@Override
public void OnScanCompleted(String barcode) {
public void onScanCompleted(String barcode) {
mReplenishmentDetailFragment.scrollToItem(barcode);
}
});
......
......@@ -24,6 +24,7 @@ import com.xingdata.zzdpos.ui.manage.replenishment.ReplenishmentPresenter;
import com.xingdata.zzdpos.ui.manage.replenishment.adpter.ReplenishmentAdapter;
import com.xingdata.zzdpos.ui.statistics.StatisticsDetailActivity;
import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsOrderGroupAdapter;
import com.xingdata.zzdpos.util.DensityUtil;
import com.xingdata.zzdpos.util.RecyclerViewUtil;
import java.util.ArrayList;
......@@ -49,12 +50,12 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent
mReplenishmentAdapter = new ReplenishmentAdapter(new ArrayList<>());
mViewBinding.recycler.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.recycler.setAdapter(mReplenishmentAdapter);
mViewBinding.recycler.addItemDecoration(new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable));
mViewBinding.recycler.addItemDecoration(new RecyclerViewUtil.ListCardItemDecoration(getActivity(), DensityUtil.dip2px(getActivity(),16), drawable));
} else {
mViewBinding.recycler.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.recycler.setAdapter(mReplenishmentAdapter);
mViewBinding.recycler.addItemDecoration(new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable));
mViewBinding.recycler.addItemDecoration(new RecyclerViewUtil.ListCardItemDecoration(getActivity(), DensityUtil.dip2px(getActivity(),16), drawable));
}
mReplenishmentAdapter.setOnItemClickListener((adapter, view, position) -> {
......
......@@ -145,7 +145,6 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin
this.showTitleBarByTitleMode(C.TITLE_MODE.SKU_EDITOR);
mViewBinding.tvEditorHint.setText("已有");
mViewBinding.tvEditorHint.setBackgroundResource(R.drawable.shape_orange_r1);
mViewBinding.tvTitle.setText(R.string.sssku_add);
this.start(mEditorFragment.setSssku(sku).setEditMode(C.SKU_EDITOR_MODE.ADD));
break;
......
......@@ -226,7 +226,7 @@ public class SsskuPresenter extends SsskuContract.Presenter {
if (sssku1.getSkuGrpId().longValue() == mSkuGrpId || mSkuGrpId == 0L) {
mView.updateSku(sssku1);
} else {
mView.deleteSku(sssku1.getSkuId());
mView.deleteSku(sssku1.getId());
}
}, throwable -> mView.showMsg(throwable.getMessage()));
break;
......
......@@ -5,6 +5,7 @@ import android.annotation.SuppressLint;
import android.support.v4.app.ActivityCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.widget.TextView;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
......@@ -60,6 +61,7 @@ public class ManagerFragment extends BaseFragment<SsskuPresenter, FragmentSsskuM
// set empty
@SuppressLint("InflateParams") View view = getLayoutInflater().inflate(R.layout.view_empty, null);
((TextView) view.findViewById(R.id.tv_empty)).setText(R.string.sku_empty_hint);
mSkuAdapter.setEmptyView(view);
mSkuAdapter.isUseEmpty(false);
......@@ -80,7 +82,7 @@ public class ManagerFragment extends BaseFragment<SsskuPresenter, FragmentSsskuM
mViewBinding.srlSku.setRefreshing(false);
mSkuAdapter.setNewData(skus);
} else if (skus.size() > 0) mSkuAdapter.addData(skus);
if (skus.size() < C.PRODUCT.PAGE_SIZE) mSkuAdapter.loadMoreEnd(isRefresh);
if (skus.size() <= C.PRODUCT.PAGE_SIZE) mSkuAdapter.loadMoreEnd(false);
else mSkuAdapter.loadMoreComplete();
}
......@@ -108,10 +110,13 @@ public class ManagerFragment extends BaseFragment<SsskuPresenter, FragmentSsskuM
public void loadSkugrpState(Long skugrpId) {
for (int i = 0; i < mSkugrpAdapter.getData().size(); i++) {
if (mSkugrpAdapter.getData().get(i).getSkuGrpId().longValue() == skugrpId) {
int oldSelected = mSkugrpAdapter.getSelectedPosition();
mSkugrpAdapter.setSelectedPosition(i);
mSkugrpAdapter.notifyItemChanged(oldSelected);
mSkugrpAdapter.notifyItemChanged(i);
break;
}
}
mSkugrpAdapter.notifyDataSetChanged();
}
/**
......@@ -151,7 +156,7 @@ public class ManagerFragment extends BaseFragment<SsskuPresenter, FragmentSsskuM
*/
public void updateSku(Sssku sssku) {
for (int i = 0; i < mSkuAdapter.getData().size(); i++) {
if (mSkuAdapter.getData().get(i).getSkuId().longValue() == sssku.getSkuId().longValue()) {
if (mSkuAdapter.getData().get(i).getId().longValue() == sssku.getSkuId().longValue()) {
mSkuAdapter.setData(i, sssku);
return;
}
......@@ -165,7 +170,7 @@ public class ManagerFragment extends BaseFragment<SsskuPresenter, FragmentSsskuM
*/
public void deleteSku(Long skuId) {
for (int i = 0; i < mSkuAdapter.getData().size(); i++) {
if (mSkuAdapter.getData().get(i).getSkuId().longValue() == skuId) {
if (mSkuAdapter.getData().get(i).getId().longValue() == skuId) {
mSkuAdapter.remove(i);
return;
}
......
......@@ -71,7 +71,7 @@ public class SearchFragment extends BaseFragment<SsskuPresenter, FragmentSsskuSe
mSkuAdapter.setEnableLoadMore(true);
mSkuAdapter.setNewData(skus);
} else if (skus.size() > 0) mSkuAdapter.addData(skus);
if (skus.size() < C.PRODUCT.PAGE_SIZE) mSkuAdapter.loadMoreEnd(isRefresh);
if (skus.size() <= C.PRODUCT.PAGE_SIZE) mSkuAdapter.loadMoreEnd(isRefresh);
else mSkuAdapter.loadMoreComplete();
}
......
......@@ -95,7 +95,6 @@ public class MsAdapter extends BaseAdapter<Ms, ItemMsBinding> {
strType = mContext.getResources().getString(R.string.ms_type_gift_info, ConvertUtil.fenToYuan(ms.getPayAmt()), ConvertUtil.fenToYuan(ms.getGiftSkuPrice()), ms.getGiftSkuName());
break;
}
return strGroup + strType;
}
}
......@@ -56,7 +56,7 @@ public class ManagerFragment extends BaseFragment<MsPresenter, FragmentMsManager
mViewBinding.srlMs.setRefreshing(false);
mMsAdapter.setNewData(mss);
} else if (mss.size() > 0) mMsAdapter.addData(mss);
if (mss.size() < C.PRODUCT.PAGE_SIZE) mMsAdapter.loadMoreEnd(isRefresh);
if (mss.size() <= C.PRODUCT.PAGE_SIZE) mMsAdapter.loadMoreEnd(isRefresh);
else mMsAdapter.loadMoreComplete();
}
......
......@@ -69,7 +69,7 @@ public class SearchFragment<Sku extends BaseSku> extends BaseFragment<MsPresente
mSkuAdapter.setEnableLoadMore(true);
mSkuAdapter.setNewData(skus);
} else if (skus.size() > 0) mSkuAdapter.addData(skus);
if (skus.size() < C.PRODUCT.PAGE_SIZE) mSkuAdapter.loadMoreEnd(isRefresh);
if (skus.size() <= C.PRODUCT.PAGE_SIZE) mSkuAdapter.loadMoreEnd(isRefresh);
else mSkuAdapter.loadMoreComplete();
}
......
......@@ -2,6 +2,8 @@ package com.xingdata.zzdpos.ui.marketing.ms.view;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.EditText;
import com.blankj.utilcode.util.StringUtils;
import com.xingdata.zzdpos.C;
......@@ -11,11 +13,27 @@ import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.InputFilters;
/**
* 满减返现页面
*/
public class TypeMoneyOffView extends BaseTypeView<ViewTypeMoneyOffBinding> {
private View.OnFocusChangeListener mOnFocusChangeListener;
public TypeMoneyOffView() {
mOnFocusChangeListener = (view, b) -> {
if (view instanceof EditText) {
EditText editText = (EditText) view;
if (b && editText.getText().toString().equals("0.00")) {
editText.setText("");
} else if (!b && editText.getText().length() == 0) {
editText.setText("0.00");
}
}
};
}
@Override
public int getLayoutId() {
return R.layout.view_type_money_off;
......@@ -44,7 +62,6 @@ public class TypeMoneyOffView extends BaseTypeView<ViewTypeMoneyOffBinding> {
}
}
});
mViewBinding.etDisAmt.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
......@@ -62,6 +79,9 @@ public class TypeMoneyOffView extends BaseTypeView<ViewTypeMoneyOffBinding> {
}
}
});
mViewBinding.etAmt.setOnFocusChangeListener(mOnFocusChangeListener);
mViewBinding.etDisAmt.setOnFocusChangeListener(mOnFocusChangeListener);
}
@Override
......@@ -77,11 +97,13 @@ public class TypeMoneyOffView extends BaseTypeView<ViewTypeMoneyOffBinding> {
String strAmt = mViewBinding.etAmt.getText().toString();
if (StringUtils.isEmpty(strAmt)) return false;
if (ConvertUtil.yuanToFen(strAmt) <= 0) return false;
ms.setPayAmt(ConvertUtil.yuanToFen(strAmt));
String strDisAmt = mViewBinding.etDisAmt.getText().toString();
if (StringUtils.isEmpty(strDisAmt)) return false;
if (ConvertUtil.yuanToFen(strDisAmt) > ConvertUtil.yuanToFen(strAmt)) return false;
if (ConvertUtil.yuanToFen(strDisAmt) <= 0) return false;
ms.setGiftOffAmt(ConvertUtil.yuanToFen(strDisAmt));
return true;
......
......@@ -23,6 +23,7 @@ public class ScanFragment<P extends BasePresenter> extends BaseFragment<P, Fragm
}
private OnScanCompletedListener mOnScanCompletedListener;
private OnBackPressedListener mOnBackPressedListener;
public OnScanCompletedListener getOnScanCompletedListener() {
return mOnScanCompletedListener;
......@@ -32,8 +33,20 @@ public class ScanFragment<P extends BasePresenter> extends BaseFragment<P, Fragm
this.mOnScanCompletedListener = onScanCompletedListener;
}
public OnBackPressedListener getOnBackPressedListener() {
return mOnBackPressedListener;
}
public void setOnBackPressedListener(OnBackPressedListener onBackPressedListener) {
this.mOnBackPressedListener = onBackPressedListener;
}
public interface OnScanCompletedListener {
void OnScanCompleted(String barcode);
void onScanCompleted(String barcode);
}
public interface OnBackPressedListener {
void onBackPressed();
}
@Override
......@@ -44,14 +57,12 @@ public class ScanFragment<P extends BasePresenter> extends BaseFragment<P, Fragm
return new ScanFragment.CustomViewFinderView(context);
}
};
mResultHandler = result -> {
if (mOnScanCompletedListener != null) {
mOnScanCompletedListener.OnScanCompleted(result.getText());
mOnScanCompletedListener.onScanCompleted(result.getText());
}
resetScanner();
};
mScannerView.setResultHandler(mResultHandler);
mViewBinding.contentFrame.addView(mScannerView);
}
......@@ -75,6 +86,12 @@ public class ScanFragment<P extends BasePresenter> extends BaseFragment<P, Fragm
new Handler().postDelayed(() -> mScannerView.resumeCameraPreview(mResultHandler), 1000);
}
@Override
public boolean onBackPressedSupport() {
if (mOnBackPressedListener != null) mOnBackPressedListener.onBackPressed();
return super.onBackPressedSupport();
}
private static class CustomViewFinderView extends ViewFinderView {
public CustomViewFinderView(Context context) {
......
......@@ -56,10 +56,7 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
public void initView() {
this.loadRootFragment(R.id.f_settle, mSettleFragment);
mViewBinding.setTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.btnBack.setOnClickListener(view -> {
getTopFragment().onBackPressedSupport();
onBackPressedSupport();
});
mViewBinding.btnBack.setOnClickListener(view -> getTopFragment().onBackPressedSupport());
mViewBinding.etSearch.setOnEditorActionListener((textView, i, keyEvent) -> {
if (i == EditorInfo.IME_ACTION_SEARCH) {
KeyboardUtils.hideSoftInput(textView);
......@@ -73,6 +70,10 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
});
}
@Override
public void onBackPressedSupport() {
}
@Override
public void showMsg(String msg) {
ToastUtils.showShort(msg);
......@@ -133,6 +134,8 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
public void showPayFragment(Saleorder saleorder) {
switch (saleorder.getPayType()) {
case C.PAY_CHANNEL.CASH:
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.tvTitle.setText(R.string.settle_channel_cash);
this.start(mCashPayFragment.setSaleorder(saleorder));
break;
case C.PAY_CHANNEL.TALLY:
......@@ -140,18 +143,25 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
mPasswordDialog.setSaleorder(saleorder).show(this);
break;
case C.PAY_CHANNEL.BANK:
break;
case C.PAY_CHANNEL.ALI:
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.tvTitle.setText(R.string.settle_channel_ali);
mScanFragment.setOnScanCompletedListener(barcode -> {
this.pop();
mPresenter.payInAli(barcode);
});
mScanFragment.setOnBackPressedListener(this::backToSettleFragment);
this.start(mScanFragment);
break;
case C.PAY_CHANNEL.WECHAT:
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.tvTitle.setText(R.string.settle_channel_wechat);
mScanFragment.setOnScanCompletedListener(barcode -> {
this.pop();
mPresenter.payInWechat(barcode);
});
mScanFragment.setOnBackPressedListener(this::backToSettleFragment);
this.start(mScanFragment);
break;
}
......
......@@ -4,6 +4,7 @@ import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentPayCashBinding;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.ui.settle.SettleActivity;
import com.xingdata.zzdpos.ui.settle.SettlePresenter;
import com.xingdata.zzdpos.ui.settle.view.InputerView;
import com.xingdata.zzdpos.util.ConvertUtil;
......@@ -68,4 +69,9 @@ public class CashPayFragment extends BaseFragment<SettlePresenter, FragmentPayCa
}
}
@Override
public boolean onBackPressedSupport() {
((SettleActivity) getActivity()).backToSettleFragment();
return super.onBackPressedSupport();
}
}
......@@ -2,6 +2,7 @@ package com.xingdata.zzdpos.ui.settle.fragment;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomSheetBehavior;
import android.support.v4.app.ActivityCompat;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.StaggeredGridLayoutManager;
......@@ -80,8 +81,10 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle
if (BottomSheetBehavior.from(mViewBinding.llSheet).getState() == BottomSheetBehavior.STATE_EXPANDED) {
BottomSheetBehavior.from(mViewBinding.llSheet).setState(BottomSheetBehavior.STATE_COLLAPSED);
return true;
} else {
ActivityCompat.finishAfterTransition(getActivity());
return super.onBackPressedSupport();
}
return super.onBackPressedSupport();
}
/**
......@@ -95,6 +98,7 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle
mViewBinding.llStore.setVisibility(View.GONE);
mPresenter.initPaymentInfo();
BottomSheetBehavior.from(mViewBinding.llSheet).setState(BottomSheetBehavior.STATE_EXPANDED);
mViewBinding.tvSettle.setAlpha(0);
break;
case C.SETTLE_MODE.STORE:
mViewBinding.llStore.setVisibility(View.VISIBLE);
......
......@@ -51,6 +51,10 @@ public class VipFragment extends BaseFragment<SettlePresenter, FragmentSettleVip
if (vips.size() == 1) {
mPresenter.selectVip(vips.get(0));
this.pop();
} else if (vips.size() == 0) {
mVipAdapter.setNewData(vips);
mViewBinding.setEmpty(vips.size() == 0);
((TextView) mVipAdapter.getEmptyView().findViewById(R.id.tv_empty)).setText(R.string.settle_vip_search_none);
} else {
mViewBinding.setEmpty(vips.size() == 0);
mVipAdapter.setNewData(vips);
......
......@@ -38,7 +38,7 @@ public class StatisticsRechargeGroupAdapter extends BaseSectionQuickAdapter<VipR
helper.setText(R.id.tv_left_top,item.getUserName());
helper.setText(R.id.tv_left_bottom,com.blankj.utilcode.util.TimeUtils.millis2String(item.getCreateTime(),new SimpleDateFormat(StringUtil.mmddhhmmmDatePattern)));
helper.setText(R.id.tv_right_top,"+"+ ConvertUtil.fenToYuan(item.getCardAmtPay(),false));
((ImageView)helper.getView(R.id.img_left)).setImageResource(R.mipmap.ic_text_recharge);
((ImageView)helper.getView(R.id.img_left)).setImageResource(R.mipmap.ic_filling);
}
......
......@@ -35,7 +35,7 @@ public class StatisticsTicketGroupAdapter extends BaseSectionQuickAdapter<Ticket
protected void convert(BaseViewHolder helper, Ticket item) {
helper.setText(R.id.tv_left_top, ConvertUtil.fenToYuanNoZero(item.getTicketValAmt()) + "元优惠券");
helper.setText(R.id.tv_left_bottom, TimeUtils.date2String(item.getCreateTime(),new SimpleDateFormat(StringUtil.mmddhhmmmDatePattern)));
((ImageView) helper.getView(R.id.img_left)).setImageResource(R.mipmap.ic_text_ticket);
((ImageView) helper.getView(R.id.img_left)).setImageResource(R.mipmap.icon_record);
}
......
......@@ -87,7 +87,7 @@ public class SearchFragment extends BaseFragment<StorePresenter, FragmentStoreSe
mSkuAdapter.setEnableLoadMore(true);
mSkuAdapter.setNewData(skus);
} else if (skus.size() > 0) mSkuAdapter.addData(skus);
if (skus.size() < C.PRODUCT.PAGE_SIZE) mSkuAdapter.loadMoreEnd(isRefresh);
if (skus.size() <= C.PRODUCT.PAGE_SIZE) mSkuAdapter.loadMoreEnd(isRefresh);
else mSkuAdapter.loadMoreComplete();
}
......
......@@ -72,11 +72,13 @@ public class StoreFragment extends BaseFragment<StorePresenter, FragmentStoreBin
mViewBinding.tvSearch.setOnClickListener(view -> mPresenter.searchBarFocusChanged(true));
// set empty
@SuppressLint("InflateParams") View view = getLayoutInflater().inflate(R.layout.view_empty, null);
mSkuAdapter.setEmptyView(view);
@SuppressLint("InflateParams") View emptyView = getLayoutInflater().inflate(R.layout.view_empty, null);
mSkuAdapter.setEmptyView(emptyView);
mSkuAdapter.isUseEmpty(false);
// init data
mPresenter.initStore();
}
......@@ -114,10 +116,13 @@ public class StoreFragment extends BaseFragment<StorePresenter, FragmentStoreBin
public void loadSkugrpState(Long skugrpId) {
for (int i = 0; i < mSkugrpAdapter.getData().size(); i++) {
if (mSkugrpAdapter.getData().get(i).getSkuGrpId().longValue() == skugrpId) {
int oldSelected = mSkugrpAdapter.getSelectedPosition();
mSkugrpAdapter.setSelectedPosition(i);
mSkugrpAdapter.notifyItemChanged(oldSelected);
mSkugrpAdapter.notifyItemChanged(i);
break;
}
}
mSkugrpAdapter.notifyDataSetChanged();
}
/**
......@@ -213,7 +218,7 @@ public class StoreFragment extends BaseFragment<StorePresenter, FragmentStoreBin
mViewBinding.srlSku.setRefreshing(false);
mSkuAdapter.setNewData(skus);
} else if (skus.size() > 0) mSkuAdapter.addData(skus);
if (skus.size() < C.PRODUCT.PAGE_SIZE) mSkuAdapter.loadMoreEnd(isRefresh);
if (skus.size() <= C.PRODUCT.PAGE_SIZE) mSkuAdapter.loadMoreEnd(false);
else mSkuAdapter.loadMoreComplete();
}
......
......@@ -8,8 +8,6 @@ import android.annotation.SuppressLint;
import android.support.v7.widget.LinearLayoutManager;
import android.view.Gravity;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RadioButton;
......@@ -71,7 +69,7 @@ public class VipListFragment extends BaseFragment<VipPresenter, FragmentVipListB
});
scanFragment.setOnScanCompletedListener(new ScanFragment.OnScanCompletedListener() {
@Override
public void OnScanCompleted(String barcode) {
public void onScanCompleted(String barcode) {
ToastUtils.showShort(barcode);
scanFragment.pop();
}
......
......@@ -67,7 +67,6 @@
android:id="@+id/et_search"
style="@style/searchBarEditor"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:hint="@string/store_search_hint"
android:inputType="text"
......@@ -223,7 +222,7 @@
android:id="@+id/fl_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_margin_big"
android:layout_marginStart="@dimen/all_margin"
android:animateLayoutChanges="true"
app:layout_constraintBottom_toBottomOf="@id/tv_settle"
app:layout_constraintLeft_toLeftOf="@id/fl_cart">
......
......@@ -71,7 +71,7 @@
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
android:gravity="center_vertical|end"
android:paddingEnd="@dimen/all_margin"
android:paddingEnd="@null"
android:paddingStart="@dimen/all_margin"
app:layout_constraintBottom_toTopOf="@id/rl_cart"
app:layout_constraintLeft_toLeftOf="parent"
......@@ -80,12 +80,10 @@
<TextView
android:id="@+id/tv_clear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:foreground="?android:attr/selectableItemBackground"
android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin_big"
android:paddingStart="@dimen/all_margin_big"
android:paddingTop="@dimen/all_spacing"
android:layout_height="match_parent"
android:gravity="center"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin"
android:text="@string/store_clear_all"
android:textColor="@color/black_baozheng" />
......
......@@ -27,7 +27,6 @@
style="@style/searchBarEditor"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginBottom="@dimen/padding_small"
android:layout_marginEnd="@dimen/all_bounced_padding"
android:layout_marginStart="@dimen/all_bounced_padding"
......@@ -35,6 +34,7 @@
android:drawablePadding="@dimen/all_padding"
android:hint="@string/other_select_edit_hint"
android:imeOptions="actionSearch"
android:inputType="number"
android:textColor="@color/black_likui"
android:textSize="@dimen/all_text_size_low"
app:layout_constraintTop_toTopOf="parent" />
......
......@@ -56,7 +56,13 @@
android:background="@color/white_caocao"
android:gravity="center_vertical"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
android:paddingStart="@null">
<ImageView
android:layout_width="@dimen/all_margin"
android:layout_height="wrap_content"
android:contentDescription="@null"
android:src="@mipmap/point" />
<TextView
android:layout_width="wrap_content"
......@@ -77,7 +83,7 @@
android:lines="1"
android:text="@{name}"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
android:textSize="@dimen/all_body_size" />
</LinearLayout>
......@@ -147,7 +153,7 @@
android:gravity="center_vertical"
android:text="@{dateStart}"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
android:textSize="@dimen/all_body_size" />
</LinearLayout>
......@@ -184,7 +190,7 @@
android:gravity="center_vertical"
android:text="@{dateEnd}"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
android:textSize="@dimen/all_body_size" />
</LinearLayout>
<ViewStub
......@@ -239,7 +245,7 @@
android:gravity="center_vertical"
android:text="@{user}"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
android:textSize="@dimen/all_body_size" />
</LinearLayout>
<View
......@@ -275,7 +281,7 @@
android:gravity="center_vertical"
android:text="@{area}"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
android:textSize="@dimen/all_body_size" />
</LinearLayout>
<View
......
......@@ -94,9 +94,7 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="parent"
app:placeholderImage="@mipmap/img_number01"
app:roundAsCircle="true"
app:roundingBorderColor="@color/gray_huanggai"
app:roundingBorderWidth="@dimen/all_line_width" />
app:roundAsCircle="true" />
<com.facebook.drawee.view.SimpleDraweeView
......@@ -122,7 +120,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{name}"
android:textColor="@color/black_zhangfei"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<TextView
......@@ -150,7 +148,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_spacing"
android:text="@{@string/settle_vip_dis_rate_hint + disRate + @string/settle_vip_dis_rate}"
android:textColor="@color/black_zhangfei"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_caption_size"
android:visibility="@{defualtVip?View.INVISIBLE:View.VISIBLE}"
app:layout_constraintBottom_toTopOf="parent"
......
......@@ -28,8 +28,8 @@
style="@style/searchBarEditor"
android:layout_width="match_parent"
android:gravity="center_vertical"
android:textColor="@color/black_likui"
android:text="@string/store_search_hint" />
android:text="@string/store_search_hint"
android:textColor="@color/black_likui" />
</LinearLayout>
<View
......@@ -45,7 +45,8 @@
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingBottom="@dimen/all_margin"
android:paddingTop="@dimen/all_margin">
android:paddingTop="@dimen/all_margin"
android:visibility="gone">
<LinearLayout
android:layout_width="0dp"
......
......@@ -42,20 +42,20 @@
android:background="@color/gray_huanggai" />
</FrameLayout>
<LinearLayout
android:id="@+id/ll_ms"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginBottom="@dimen/all_spacing"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin"
android:layout_marginTop="@dimen/all_spacing"
android:background="@drawable/shape_black_b1"
android:foreground="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:padding="@dimen/all_spacing"
android:visibility="@{msCount>0 ?View.VISIBLE:View.GONE}">
android:visibility="@{msCount>0?View.VISIBLE:View.GONE}">
<TextView
android:id="@+id/tv_ms_type"
......@@ -89,9 +89,9 @@
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_height="0dp"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/gray_huanggai" />
android:visibility="@{msCount>0?View.GONE:View.VISIBLE}" />
<android.support.constraint.ConstraintLayout
android:id="@+id/cl_store"
......@@ -124,6 +124,12 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/gray_huanggai" />
</android.support.constraint.ConstraintLayout>
</LinearLayout>
......
......@@ -40,8 +40,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?attr/selectableItemBackground"
android:background="@drawable/singleline_white_gray">
android:background="@color/white_caocao"
android:foreground="?attr/selectableItemBackground">
<LinearLayout
......
......@@ -49,7 +49,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
android:background="@drawable/shape_gray_r1"
android:background="@drawable/shape_black_b2"
android:padding="@dimen/all_spacing"
android:text="@{@string/sku_size+spuUnitName}"
android:textSize="@dimen/all_caption_size"
......
......@@ -15,7 +15,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:paddingEnd="@dimen/all_margin"
android:paddingEnd="@null"
android:paddingStart="@dimen/all_margin"
android:paddingTop="@dimen/all_margin">
......@@ -78,7 +78,7 @@
android:layout_height="wrap_content"
android:contentDescription="@string/store_reduce"
android:foreground="?android:attr/actionBarItemBackground"
android:padding="@dimen/all_spacing"
android:padding="@dimen/all_margin"
android:src="@mipmap/but_reduce"
android:visibility="gone" />
......@@ -89,7 +89,7 @@
android:layout_marginEnd="@dimen/all_spacing"
android:layout_marginStart="@dimen/all_spacing"
android:text='@{count+""}'
android:textColor="@color/black_likui"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size"
android:visibility="gone" />
......@@ -99,14 +99,13 @@
android:layout_height="wrap_content"
android:contentDescription="@string/store_increase"
android:foreground="?android:attr/actionBarItemBackground"
android:padding="@dimen/all_spacing"
android:padding="@dimen/all_margin"
android:src="@mipmap/but_increase02" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="@dimen/all_line_width"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/gray_kongming"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
......
......@@ -59,7 +59,13 @@
android:layout_height="?attr/actionBarSize"
android:gravity="center_vertical"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
android:paddingStart="@null">
<ImageView
android:layout_width="@dimen/all_margin"
android:layout_height="wrap_content"
android:contentDescription="@null"
android:src="@mipmap/point" />
<TextView
android:layout_width="wrap_content"
......@@ -79,7 +85,7 @@
android:inputType="number"
android:maxLength="2"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
android:textSize="@dimen/all_body_size" />
</LinearLayout>
......
......@@ -33,7 +33,8 @@
android:background="@color/transparent"
android:inputType="numberDecimal"
android:labelFor="@+id/et_amt"
android:saveEnabled="false" />
android:saveEnabled="false"
android:textSize="@dimen/all_body_size" />
<TextView
android:layout_width="wrap_content"
......@@ -75,7 +76,8 @@
android:layout_weight="1"
android:background="@color/transparent"
android:inputType="numberDecimal"
android:labelFor="@+id/et_dis_amt" />
android:labelFor="@+id/et_dis_amt"
android:textSize="@dimen/all_body_size" />
<TextView
android:layout_width="wrap_content"
......
......@@ -230,9 +230,9 @@
<dimen name="button1_marginHorizontal">24dp</dimen>
<dimen name="button1_width">120dp</dimen>
<dimen name="button2_height">35dp</dimen>
<dimen name="button2_marginHorizontal">16dp</dimen>
<dimen name="button2_width">105dp</dimen>
<dimen name="button2_height">@dimen/button1_height</dimen>
<dimen name="button2_marginHorizontal">@dimen/button1_marginHorizontal</dimen>
<dimen name="button2_width">@dimen/button1_width</dimen>
<dimen name="button3_height">44dp</dimen>
<dimen name="button3_marginHorizontal">16dp</dimen>
......
......@@ -162,15 +162,15 @@
<string name="card_num_hint">请输入储值卡卡号</string>
<!--结算页面 <WHERE>_<DESCRIPTION>-->
<string name="settle_channel_hint">请选择支付方式</string>
<string name="settle_channel_cash">现金</string>
<string name="settle_channel_cash">现金支付</string>
<string name="settle_channel_cash_not_enough">金额不足,无法支付</string>
<string name="settle_channel_wechat">微信</string>
<string name="settle_channel_wechat">微信支付</string>
<string name="settle_channel_wechat_hint">正在进行微信支付…</string>
<string name="settle_channel_ali">支付宝</string>
<string name="settle_channel_ali">支付宝支付</string>
<string name="settle_channel_ali_hint">正在进行支付宝支付…</string>
<string name="settle_channel_bank">银行卡</string>
<string name="settle_channel_bank">银行卡支付</string>
<string name="settle_channel_bank_hint">正在POS机上完成刷卡支付…</string>
<string name="settle_channel_card">会员卡</string>
<string name="settle_channel_card">会员卡支付</string>
<string name="settle_channel_card_hint">请提醒客户在副屏输入密码</string>
<string name="settle_channel_card_reset_hint">【在副屏连击三次确认按钮,则重置密码】</string>
<string name="settle_channel_balance">余额</string>
......@@ -583,6 +583,7 @@
<string name="settle_vip_search_hint">请输入会员手机号</string>
<string name="settle_vip_search_empty">请输入会员手机号进行搜索~</string>
<string name="settle_vip_search_empty_no_seach">没有搜到此会员</string>
<string name="settle_vip_search_none">没有搜到此会员~</string>
<string name="settle_vip_none">不需要会员</string>
<!--支付里的优惠券-->
......@@ -731,5 +732,8 @@
<string name="sku_update_vip">调整会员</string>
<string name="sku_name_hint">请输入商品名称</string>
<string name="sku_empty_hint">没有找到对应商品~</string>
</resources>
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