Commit 42606efe authored by zhang_z's avatar zhang_z

Merge remote-tracking branch 'origin/master'

parents c435df0c f4054c77
......@@ -75,9 +75,18 @@
android:screenOrientation="portrait"
android:theme="@style/AppTheme"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity android:name=".ui.help.HelpActivity" />
<activity android:name=".ui.feedback.FeedBackActivity" />
<activity android:name=".ui.statistics.StatisticsActivity" />
<activity
android:name=".ui.help.HelpActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity
android:name=".ui.feedback.FeedBackActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity
android:name=".ui.statistics.StatisticsActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity
android:name=".ui.vip.VipActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
......@@ -88,11 +97,18 @@
android:name=".ui.marketing.ms.MsActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity
android:name=".ui.manage.otherselect.OtherSelectActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity
android:name=".ui.manage.manageMenu.ManageMenuActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity android:name=".ui.manage.replenishment.ReplenishmentActivity"></activity>
<activity
android:name=".ui.manage.replenishment.ReplenishmentActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
</application>
</manifest>
\ No newline at end of file
......@@ -11,6 +11,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.databinding.ActivityMarketingMenuBinding;
import com.xingdata.zzdpos.ui.manage.otherselect.OtherSelectActivity;
import com.xingdata.zzdpos.ui.manage.replenishment.ReplenishmentActivity;
import com.xingdata.zzdpos.ui.marketing.integral.IntegralActivity;
import com.xingdata.zzdpos.ui.marketing.marketingMenu.MarketingMenuActivity;
......@@ -74,7 +75,7 @@ public class ManageMenuActivity extends AppCompatActivity {
}
break;
case C.MENU.MENU_MANAGER_OTHER: {
ActivityUtils.startActivity(ManageMenuActivity.this, OtherSelectActivity.class);
}
break;
case C.MENU.MENU_MANAGER_INVENTORY: {
......
package com.xingdata.zzdpos.ui.manage.otherselect;
import android.view.KeyEvent;
import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityOtherSelectBinding;
import com.xingdata.zzdpos.model.Ossku;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.ui.manage.otherselect.fragment.OtherListFragment;
public class OtherSelectActivity extends BaseActivity<OtherSelectPresenter, ActivityOtherSelectBinding> implements OtherSelectContract.View {
private OtherListFragment mOtherListFragment = new OtherListFragment();
@Override
public int getLayoutId() {
return R.layout.activity_other_select;
}
@Override
public void initView() {
loadRootFragment(R.id.fragment_container, mOtherListFragment, false, false);
mViewBinding.lyTitle.edTitle.setOnKeyListener((v, keyCode, event) -> {
if (keyCode == KeyEvent.KEYCODE_ENTER)
search(mViewBinding.lyTitle.edTitle.getText().toString().trim());
return false;
});
}
@Override
public void isShowLoading(Boolean is) {
}
@Override
public void loadOssku(Pager<Ossku> osskuList, boolean isRefresh) {
mOtherListFragment.setData(osskuList, isRefresh);
}
@Override
protected void onPause() {
KeyboardUtils.hideSoftInput(this);
super.onPause();
}
private void search(String string) {
KeyboardUtils.hideSoftInput(this);
if (string.length() == 0) {
ToastUtils.showShort("请输入搜索内容");
return;
}
mPresenter.searchGoodsFirst(string);
}
}
package com.xingdata.zzdpos.ui.manage.otherselect;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView;
import com.xingdata.zzdpos.model.Ossku;
import com.xingdata.zzdpos.model.Pager;
/**
* Created by Eurus on 2017/11/23.
*/
public interface OtherSelectContract {
interface View extends BaseView {
void isShowLoading(Boolean is);
/**
* 加载列表
*/
void loadOssku(Pager<Ossku> osskuList, boolean isRefresh);
}
abstract class Presenter extends BasePresenter<View> {
/**
* 临库查询界面 - 查找
*
* @param keyword 搜索关键字
*/
public abstract void searchGoodsFirst(String keyword);
/**
* 临库查询界面 - 查找
*
* @param keyword 搜索关键字
*/
abstract void searchGoods(String keyword);
/**
* 临库查询页面 - 加载更多
*/
public abstract void loadMore();
/**
* 临库查询页面 - 刷新
*/
public abstract void refresh();
}
}
package com.xingdata.zzdpos.ui.manage.otherselect;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.api.ApiFactory;
public class OtherSelectPresenter extends OtherSelectContract.Presenter {
private int nowPageNumber = 1;
private int nowPageSize = 10;
private String wd;
@Override
public void onAttached() {
}
@Override
public void searchGoodsFirst(String keyword) {
wd = keyword;
nowPageNumber = 1;
searchGoods(wd);
}
@Override
void searchGoods(String keyword) {
mView.isShowLoading(true);
ApiFactory.Sssku.getOtherShopSsku(keyword, nowPageNumber, nowPageSize).doFinally(() -> {
mView.isShowLoading(false);
})
.subscribe(osskus -> {
if (osskus.getTotalRow() == 0) {
ToastUtils.showShort("没有搜到当前商品,请重新输入");
}
//判断是否能加载更多
mView.loadOssku(osskus, nowPageNumber == 1);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void loadMore() {
this.nowPageNumber++;
searchGoods(wd);
}
@Override
public void refresh() {
this.nowPageNumber = 1;
searchGoods(wd);
}
}
package com.xingdata.zzdpos.ui.manage.otherselect.adpter;
import android.support.annotation.Nullable;
import android.view.View;
import android.view.ViewGroup;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemOtherSelectBinding;
import com.xingdata.zzdpos.model.Ossku;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.util.List;
public class OtherSelectAdapter extends BaseAdapter<Ossku, ItemOtherSelectBinding> {
public OtherSelectAdapter(@Nullable List<Ossku> data) {
super(R.layout.item_other_select, data);
}
@Override
protected void convert(ItemOtherSelectBinding mViewBinding, Ossku item) {
mViewBinding.tvGoodsName.setText(item.getSpuName());
mViewBinding.tvGoodsCode.setText(item.getSpuBarcode() + "");
// mViewBinding.tvGoodsPrice.setText(ConvertUtil.fenToYuan(item.getSkuRetailPrice1(), false));
mViewBinding.tvGoodsSize.setText("规格/" + item.getSpuUnitName());
mViewBinding.imgGoods.setImageURI(item.getSpuImg());
// mViewBinding.tvNum.setText(item.getSkuStock() + "个");
mViewBinding.tvShop.setText(item.getShopName());
// mViewBinding.tvAddress.setText(item.getCityAddress());
// mViewBinding.tvTel.setText(item.getContactTel());
}
}
package com.xingdata.zzdpos.ui.manage.otherselect.fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentOtherListBinding;
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 java.util.ArrayList;
/**
* Created by Administrator on 2017/11/23.
*/
public class OtherDetailFragment extends BaseFragment<OtherSelectPresenter, FragmentOtherListBinding> {
private OtherSelectAdapter mOtherSelectAdapter;
@Override
public int getLayoutId() {
return R.layout.fragment_other_list;
}
@Override
public void initView() {
mOtherSelectAdapter = new OtherSelectAdapter(new ArrayList<>());
mOtherSelectAdapter.setEmptyView(getEmptyView(R.string.empty_other_select));
mViewBinding.recyclerOtherSelcet.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.recyclerOtherSelcet.setAdapter(mOtherSelectAdapter);
mOtherSelectAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
// Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class);
// intent.putExtra(Saleorder.class.getName(), mStatisticsAdapter.getData().get(position).getId());
// ActivityUtils.startActivity(intent);
}
});
mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh);
mOtherSelectAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.recyclerOtherSelcet);
}
private void onRefresh() {
mPresenter.refresh();
}
private void onLoadMore() {
mPresenter.loadMore();
}
/**
* 设置数据
*
* @param pager 数据
* @param isRefresh 是否刷新
*/
public void setData(Pager<Ossku> pager, boolean isRefresh) {
if (isRefresh) {
mOtherSelectAdapter.setEnableLoadMore(true);
mViewBinding.srlProduct.setRefreshing(false);
}
if (isRefresh) mOtherSelectAdapter.setNewData(pager.getList());
else if (pager.getList().size() > 0) mOtherSelectAdapter.addData(pager.getList());
if (pager.isLastPage()) mOtherSelectAdapter.loadMoreEnd(isRefresh);
else mOtherSelectAdapter.loadMoreComplete();
}
private View getEmptyView(int resHint) {
View view = getLayoutInflater().inflate(R.layout.view_empty, null);
view.setBackgroundResource(R.color.white_caocao);
((TextView) view.findViewById(R.id.tv_empty)).setText(resHint);
return view;
}
}
package com.xingdata.zzdpos.ui.manage.otherselect.fragment;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.KeyEvent;
import android.view.View;
import android.widget.TextView;
import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentOrderListBinding;
import com.xingdata.zzdpos.databinding.FragmentOtherListBinding;
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 java.util.ArrayList;
import java.util.List;
/**
* Created by Administrator on 2017/11/23.
*/
public class OtherListFragment extends BaseFragment<OtherSelectPresenter, FragmentOtherListBinding> {
private OtherSelectAdapter mOtherSelectAdapter;
@Override
public int getLayoutId() {
return R.layout.fragment_other_list;
}
@Override
public void initView() {
mOtherSelectAdapter = new OtherSelectAdapter(new ArrayList<>());
mOtherSelectAdapter.setEmptyView(getEmptyView(R.string.empty_other_select));
mViewBinding.recyclerOtherSelcet.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.recyclerOtherSelcet.setAdapter(mOtherSelectAdapter);
mOtherSelectAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
// Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class);
// intent.putExtra(Saleorder.class.getName(), mStatisticsAdapter.getData().get(position).getId());
// ActivityUtils.startActivity(intent);
}
});
mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh);
mOtherSelectAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.recyclerOtherSelcet);
}
private void onRefresh() {
mPresenter.refresh();
}
private void onLoadMore() {
mPresenter.loadMore();
}
/**
* 设置数据
*
* @param pager 数据
* @param isRefresh 是否刷新
*/
public void setData(Pager<Ossku> pager, boolean isRefresh) {
if (isRefresh) {
mOtherSelectAdapter.setEnableLoadMore(true);
mViewBinding.srlProduct.setRefreshing(false);
}
if (isRefresh) mOtherSelectAdapter.setNewData(pager.getList());
else if (pager.getList().size() > 0) mOtherSelectAdapter.addData(pager.getList());
if (pager.isLastPage()) mOtherSelectAdapter.loadMoreEnd(isRefresh);
else mOtherSelectAdapter.loadMoreComplete();
}
private View getEmptyView(int resHint) {
View view = getLayoutInflater().inflate(R.layout.view_empty, null);
view.setBackgroundResource(R.color.white_caocao);
((TextView) view.findViewById(R.id.tv_empty)).setText(resHint);
return view;
}
}
......@@ -34,7 +34,7 @@ public class ReplenishmentActivity extends BaseActivity<ReplenishmentPresenter,
@Override
public void addPsbSuc() {
// mReplenishmentDetailFragment.pop();
mReplenishmentDetailFragment.pop();
mPresenter.refreshPsb();
}
......@@ -62,12 +62,11 @@ public class ReplenishmentActivity extends BaseActivity<ReplenishmentPresenter,
@Override
public void openReplenishmentDetailFragment(Psb psb) {
// if (isAllowFragment) {
// isAllowFragment = false;
// mReplenishmentDetailFragment.setPsb(psb);
// start(mReplenishmentDetailFragment);
//
// }
if (isAllowFragment) {
isAllowFragment = false;
mReplenishmentDetailFragment.setPsb(psb);
start(mReplenishmentDetailFragment);
}
}
......
......@@ -82,11 +82,7 @@ public class ReplenishmentPresenter extends ReplenishmentContract.Presenter {
mView.isShowLoading(false);
})
.subscribe(psbNew -> {
// psbNew.setOutChannelNameabcn(psb.getOutChannelNameabcn());
// psbNew.setCityAddress(psb.getCityAddress());
// psbNew.setCityProvName(psb.getCityProvName());
// psbNew.setCityName(psb.getCityName());
// psbNew.setCityCountyName(psb.getCityCountyName());
mView.openReplenishmentDetailFragment(psbNew);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
......
......@@ -3,7 +3,9 @@ package com.xingdata.zzdpos.ui.manage.replenishment.fragment;
import android.annotation.SuppressLint;
import android.graphics.drawable.Drawable;
import android.renderscript.ScriptGroup;
import android.support.v7.widget.LinearLayoutManager;
import android.text.InputType;
import android.view.KeyEvent;
import android.view.View;
import android.widget.TextView;
......@@ -23,6 +25,7 @@ import com.xingdata.zzdpos.ui.login.LoginPresenter;
import com.xingdata.zzdpos.ui.manage.replenishment.ReplenishmentPresenter;
import com.xingdata.zzdpos.ui.manage.replenishment.adpter.ReplenishmentDetailAdapter;
import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.OnClickListener;
import java.util.ArrayList;
......@@ -50,46 +53,75 @@ public class ReplenishmentDetailFragment extends BaseFragment<ReplenishmentPrese
@Override
public void initView() {
mViewBinding.lyTitle.edTitle.setHint(R.string.inventory_add_et_hint);
Drawable drawableTop = getResources().getDrawable(R.mipmap.but_up);
Drawable drawableBottom = getResources().getDrawable(R.mipmap.but_unfurled);
drawableTop.setBounds(0, 0, (int) mViewBinding.tvShopTitle.getTextSize() - 10, (int) mViewBinding.tvShopTitle.getTextSize() - 10);
drawableBottom.setBounds(0, 0, (int) mViewBinding.tvShopTitle.getTextSize() - 10, (int) mViewBinding.tvShopTitle.getTextSize() - 10);
mViewBinding.tvShopTitle.setCompoundDrawables(null, null, drawableTop, null);
mViewBinding.tvSupplierTitle.setCompoundDrawables(null, null, drawableTop, null);
initRecycycler();
// mViewBinding.btnSearch.setOnClickListener(view -> {
// scrollToItem(mViewBinding.etKeyword.getText().toString().trim());
// });
// mViewBinding.etKeyword.setOnKeyListener((v, keyCode, event) -> {
// if (keyCode == KeyEvent.KEYCODE_ENTER)
// scrollToItem(mViewBinding.etKeyword.getText().toString().trim());
// return false;
// });
// mViewBinding.btnCanel.setOnClickListener(view -> {
// this.pop();
// });
//
// mViewBinding.btnEnd.setOnClickListener(view -> {
// if (mPsb == null || mPsb.getPsbStatus() == null) {
// Psb psb = new Psb();
// psb.setPsbType("0");
// psb.setSsskuList(mReplenishmentDetailAdapter.getData());
// mPresenter.clickReplenishmentSubmit(psb);
// } else {
// switch (mPsb.getPsbStatus()) {
// case 3:
// mPsb.setPsbdetailList(mReplenishmentDetailAdapter.getData());
// mPresenter.clickReplenishmentUpdate(mPsb);
// break;
// case 1:
// mPresenter.clickReplenishmentConfirm(mPsb.getPsbNo());
// break;
// }
// }
// });
// mViewBinding.btnPrint.setOnClickListener(new OnClickListener() {
// @Override
// protected void myOnClickListener(View v) {
// ZX_PrintPOS.getInstance(mContext).printOrder(1, mPsb);
// }
// });
}
//
mViewBinding.tvShopTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
if (mViewBinding.llShop.getVisibility() != View.VISIBLE) {
mViewBinding.llShop.setVisibility(View.VISIBLE);
mViewBinding.tvShopTitle.setCompoundDrawables(null, null, drawableBottom, null);
} else {
mViewBinding.llShop.setVisibility(View.GONE);
mViewBinding.tvShopTitle.setCompoundDrawables(null, null, drawableTop, null);
}
}
});
mViewBinding.tvSupplierTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
if (mViewBinding.llSupplier.getVisibility() != View.VISIBLE) {
mViewBinding.llSupplier.setVisibility(View.VISIBLE);
mViewBinding.tvSupplierTitle.setCompoundDrawables(null, null, drawableBottom, null);
} else {
mViewBinding.llSupplier.setVisibility(View.GONE);
mViewBinding.tvSupplierTitle.setCompoundDrawables(null, null, drawableTop, null);
}
}
});
mViewBinding.lyTitle.ivRight.setVisibility(View.GONE);
mViewBinding.lyTitle.edTitle.setOnKeyListener((v, keyCode, event) -> {
if (keyCode == KeyEvent.KEYCODE_ENTER)
scrollToItem(mViewBinding.lyTitle.edTitle.getText().toString().trim());
return false;
});
mViewBinding.lyTitle.ivBack.setOnClickListener(view -> {
this.pop();
});
mViewBinding.btnOk.setOnClickListener(view -> {
if (mPsb == null || mPsb.getPsbStatus() == null) {
Psb psb = new Psb();
psb.setPsbType("0");
psb.setSsskuList(mReplenishmentDetailAdapter.getData());
mPresenter.clickReplenishmentSubmit(psb);
} else {
switch (mPsb.getPsbStatus()) {
case 3:
mPsb.setPsbdetailList(mReplenishmentDetailAdapter.getData());
mPresenter.clickReplenishmentUpdate(mPsb);
break;
case 1:
mPresenter.clickReplenishmentConfirm(mPsb.getPsbNo());
break;
}
}
});
mViewBinding.btnCancel.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
pop();
}
});
}
//
private void initRecycycler() {
mViewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
if (mPsb != null && mPsb.getPsbStatus() != null) {
......@@ -162,24 +194,24 @@ public class ReplenishmentDetailFragment extends BaseFragment<ReplenishmentPrese
mViewBinding.setShopAddress(LoginPresenter.loginReturnBean.getCityProvName() + LoginPresenter.loginReturnBean.getCityName() + LoginPresenter.loginReturnBean.getCityCountyName() + LoginPresenter.loginReturnBean.getCityAddress());
mViewBinding.setShopTel(LoginPresenter.loginReturnBean.getContactTel());
// if (mPsb != null && mPsb.getPsbStatus() != null) {
// switch (mPsb.getPsbStatus()) {
// case 3:
// mViewBinding.btnEnd.setText("修改订单");
// mViewBinding.btnPrint.setVisibility(View.VISIBLE);
// break;
// case 1:
// mViewBinding.btnEnd.setText("确认收货");
// mViewBinding.btnPrint.setVisibility(View.VISIBLE);
// break;
// case 0:
// mViewBinding.btnEnd.setVisibility(View.GONE);
// mViewBinding.btnPrint.setVisibility(View.VISIBLE);
// break;
// default:
// break;
// }
// }
if (mPsb != null && mPsb.getPsbStatus() != null) {
switch (mPsb.getPsbStatus()) {
case 3:
mViewBinding.btnOk.setText("修改订单");
break;
case 1:
mViewBinding.btnOk.setText("确认收货");
break;
case 0:
mViewBinding.llBottom.setVisibility(View.GONE);
break;
default:
break;
}
}
}
......@@ -214,16 +246,16 @@ public class ReplenishmentDetailFragment extends BaseFragment<ReplenishmentPrese
/**
* 获取空页面
*
*
* @return 空页面
*/
protected View getEmptyView() {
@SuppressLint("InflateParams") View view = getLayoutInflater().inflate(R.layout.view_empty, null);
TextView textView=((TextView) view.findViewById(R.id.tv_empty));
TextView textView = ((TextView) view.findViewById(R.id.tv_empty));
textView.setText(R.string.replenishment_detail_full);
textView.setTextColor(getResources().getColor(R.color.black));
return view;
}
private void scrollToItem(String string) {
if (string.length() == 0) {
......
......@@ -4,6 +4,7 @@ package com.xingdata.zzdpos.ui.manage.replenishment.fragment;
import android.databinding.DataBindingUtil;
import android.graphics.Typeface;
import android.support.design.widget.TabLayout;
import android.text.InputType;
import android.view.View;
import android.widget.TextView;
......@@ -72,6 +73,8 @@ public class ReplenishmentFragment extends BaseFragment<ReplenishmentPresenter,
});
mViewBinding.icTitle.ivRight.setVisibility(View.GONE);
mViewBinding.icTitle.edTitle.setHint("请输入供货商名称");
mViewBinding.icTitle.edTitle.setInputType(InputType.TYPE_CLASS_TEXT);
mViewBinding.icTitle.edTitle.setOnClickListener(view -> {
if (mViewBinding.icTitle.edTitle.getText().toString().trim().length() == 0) {
ToastUtils.showShort("请输入供货商名称");
......
......@@ -8,6 +8,7 @@ import android.view.View;
import android.widget.TextView;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
......@@ -32,7 +33,7 @@ import java.util.regex.Pattern;
public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresenter, FragmentReplenishmentListBinding> {
private ReplenishmentAdapter mReplenishmentAdapter;
private List<Psb> psbArrayList = new ArrayList<>();
private long mExitTime = 0;
@Override
public int getLayoutId() {
......@@ -52,13 +53,13 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent
mViewBinding.recycler.setAdapter(mReplenishmentAdapter);
}
mReplenishmentAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class);
intent.putExtra(Saleorder.class.getName(), mReplenishmentAdapter.getData().get(position).getId());
ActivityUtils.startActivity(intent);
mReplenishmentAdapter.setOnItemClickListener((adapter, view, position) -> {
if ((System.currentTimeMillis() - mExitTime) > 500) {
mPresenter.queryPsbDetail(mReplenishmentAdapter.getData().get(position));
} else {
ToastUtils.showLong("您操作太快了");
}
});
mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh);
......@@ -84,6 +85,10 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent
* @param isRefresh 是否刷新
*/
public void setData(List<Psb> psbList, boolean isRefresh) {
if (mReplenishmentAdapter==null){
this.psbArrayList=psbList;
return;
}
if (isRefresh) {
mReplenishmentAdapter.setEnableLoadMore(true);
......
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
<include
android:id="@+id/ly_title"
layout="@layout/title_order" />
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/all_padding"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
</FrameLayout>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_padding_left_right"
android:background="@drawable/singleline_white_gray"
android:paddingBottom="@dimen/all_padding">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming"
app:layout_constraintTop_toTopOf="parent" />
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/img_goods"
android:layout_width="65dp"
android:layout_height="65dp"
android:layout_marginStart="@dimen/all_padding_left_right"
android:layout_marginTop="@dimen/all_padding"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:placeholderImage="@mipmap/icon_goods_default" />
<TextView
android:id="@+id/tv_goods_name"
style="@style/other_select_blacktext_style"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_padding_left_right"
android:layout_marginStart="@dimen/all_padding_left_right"
android:text="贝斯克莱因和美妖精生日巧克力蛋糕"
app:layout_constraintStart_toEndOf="@id/img_goods"
app:layout_constraintTop_toTopOf="@id/img_goods" />
<TextView
android:id="@+id/tv_goods_code_hint"
android:layout_width="wrap_content"
android:layout_height="28dp"
android:layout_marginStart="@dimen/dp_4"
android:layout_marginTop="@dimen/all_padding"
android:text="条码:"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintStart_toStartOf="@id/tv_goods_name"
app:layout_constraintTop_toBottomOf="@id/tv_goods_name" />
<TextView
android:id="@+id/tv_goods_code"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:text="12783163981789"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintBottom_toBottomOf="@id/tv_goods_code_hint"
app:layout_constraintStart_toEndOf="@id/tv_goods_code_hint"
app:layout_constraintTop_toTopOf="@id/tv_goods_code_hint" />
<TextView
android:id="@+id/tv_goods_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/frame_frame_zhouyu_bg"
android:padding="@dimen/dp_4"
android:text="规格"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintStart_toStartOf="@id/tv_goods_code_hint"
app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_padding_left_right"
android:padding="@dimen/dp_4"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" />
</android.support.constraint.ConstraintLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srl_product"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/ll_title"
>
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_other_selcet"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<data>
</data>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_padding_left_right"
android:background="@drawable/singleline_white_gray"
android:paddingBottom="@dimen/all_padding">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming"
app:layout_constraintTop_toTopOf="parent" />
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/img_goods"
android:layout_width="65dp"
android:layout_height="65dp"
android:layout_marginStart="@dimen/all_padding_left_right"
android:layout_marginTop="@dimen/all_padding"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:placeholderImage="@mipmap/icon_goods_default" />
<TextView
android:id="@+id/tv_goods_name"
style="@style/other_select_blacktext_style"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_padding_left_right"
android:layout_marginStart="@dimen/all_padding_left_right"
android:text="贝斯克莱因和美妖精生日巧克力蛋糕"
app:layout_constraintStart_toEndOf="@id/img_goods"
app:layout_constraintTop_toTopOf="@id/img_goods" />
<TextView
android:id="@+id/tv_goods_code_hint"
android:layout_width="wrap_content"
android:layout_height="28dp"
android:layout_marginStart="@dimen/dp_4"
android:layout_marginTop="@dimen/all_padding"
android:text="条码:"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintStart_toStartOf="@id/tv_goods_name"
app:layout_constraintTop_toBottomOf="@id/tv_goods_name" />
<TextView
android:id="@+id/tv_goods_code"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:text="12783163981789"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintBottom_toBottomOf="@id/tv_goods_code_hint"
app:layout_constraintStart_toEndOf="@id/tv_goods_code_hint"
app:layout_constraintTop_toTopOf="@id/tv_goods_code_hint" />
<TextView
android:id="@+id/tv_goods_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/frame_frame_zhouyu_bg"
android:padding="@dimen/dp_4"
android:text="规格"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintStart_toStartOf="@id/tv_goods_code_hint"
app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" />
<TextView
android:id="@+id/tv_shop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_padding_left_right"
android:drawableStart="@mipmap/icon_stores"
android:padding="@dimen/dp_4"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" />
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
......@@ -29,7 +29,6 @@
android:layout_marginEnd="@dimen/all_padding_left_right"
android:layout_marginStart="@dimen/all_padding_left_right"
android:text="贝斯克莱因和美妖精生日巧克力蛋糕"
app:layout_constraintStart_toEndOf="@id/img_goods"
app:layout_constraintTop_toTopOf="@id/img_goods" />
......@@ -58,10 +57,10 @@
android:id="@+id/tv_goods_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="规格"
android:textSize="@dimen/all_text_size_small"
android:background="@drawable/frame_frame_zhouyu_bg"
android:padding="@dimen/dp_4"
android:text="规格"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintBottom_toBottomOf="@id/tv_goods_code"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_goods_code" />
......@@ -91,15 +90,6 @@
app:layout_constraintTop_toTopOf="@id/tv_price_hint" />
<View
android:layout_width="@dimen/all_line_width"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/lyt_main_bg"
app:layout_constraintBottom_toBottomOf="@id/img_goods"
app:layout_constraintTop_toTopOf="@id/img_goods" />
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="wrap_content"
......@@ -107,8 +97,7 @@
android:gravity="center"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@id/tv_price_hint"
app:layout_constraintEnd_toEndOf="parent"
>
app:layout_constraintEnd_toEndOf="parent">
<ImageButton
android:id="@+id/btn_down"
......@@ -117,14 +106,14 @@
android:layout_marginEnd="@dimen/all_margin"
android:layout_weight="1"
android:background="@color/white"
android:src="@mipmap/but_reduce"
tools:layout_editor_absoluteX="602dp"
tools:layout_editor_absoluteY="97dp" />
android:src="@mipmap/but_reduce" />
<EditText
android:id="@+id/et_count"
android:layout_width="50dp"
android:layout_height="match_parent"
android:layout_marginBottom="@dimen/dp_4"
android:layout_marginTop="@dimen/dp_4"
android:layout_weight="1"
android:background="@drawable/selector_edit_frame_blue_background"
android:gravity="center"
......@@ -132,8 +121,7 @@
android:inputType="number"
android:maxLength="4"
android:saveEnabled="false"
tools:layout_editor_absoluteX="540dp"
tools:layout_editor_absoluteY="192dp" />
android:textSize="@dimen/all_text_size_low" />
<ImageButton
android:id="@+id/btn_up"
......@@ -204,7 +192,6 @@
app:layout_constraintTop_toBottomOf="@id/tv_stock_hint" />
</android.support.constraint.ConstraintLayout>
......
......@@ -9,6 +9,7 @@
<dimen name="all_spacing">6dp</dimen>
<dimen name="all_sub_title_size">20sp</dimen>
<dimen name="big_text_size">18sp</dimen>
<dimen name="big_big_text_size">20sp</dimen>
<dimen name="sbig_text_size">25sp</dimen>
<dimen name="all_text_size">16sp</dimen>
<dimen name="all_text_size_small_title">17sp</dimen>
......
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