Commit 47cc1a85 authored by 陈前's avatar 陈前

UI

parent a9db9497
...@@ -38,9 +38,7 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm ...@@ -38,9 +38,7 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
private List<Sssku> topCsList = new ArrayList<>(); private List<Sssku> topCsList = new ArrayList<>();
private InventoryGoodsAdapter mInventoryGoodsAdapter; private InventoryGoodsAdapter mInventoryGoodsAdapter;
private CsCartDialog mCartDialog = new CsCartDialog(); private CsCartDialog mCartDialog = new CsCartDialog();
private Drawable drawable;
private RecyclerViewUtil.ListCardItemDecoration emptyItemDecoration;
private RecyclerViewUtil.ListCardItemDecoration listItemDecoration;
/** /**
* 当前购物车信息 * 当前购物车信息
*/ */
...@@ -56,9 +54,7 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm ...@@ -56,9 +54,7 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
@Override @Override
public void initView() { public void initView() {
drawable = getResources().getDrawable(R.drawable.singleline_zhouyu_huanggai);
emptyItemDecoration = new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable, 1);
listItemDecoration = new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable, 0);
initRecycler(); initRecycler();
mViewBinding.setCartCount(0); mViewBinding.setCartCount(0);
mViewBinding.icTitle.edTitle.setVisibility(View.GONE); mViewBinding.icTitle.edTitle.setVisibility(View.GONE);
...@@ -114,20 +110,21 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm ...@@ -114,20 +110,21 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
mInventoryGoodsAdapter = new InventoryGoodsAdapter(topCsList); mInventoryGoodsAdapter = new InventoryGoodsAdapter(topCsList);
mInventoryGoodsAdapter.setEmptyView(getEmptyView()); mInventoryGoodsAdapter.setEmptyView(getEmptyView());
mInventoryGoodsAdapter.setOnItemLongClickListener((adapter, view, position) -> { mInventoryGoodsAdapter.setOnItemLongClickListener((adapter, view, position) -> {
PromptDialog delDialog = new PromptDialog(); if (bottomCsList.size() == 0) {
delDialog.setDialogType(PromptDialog.PROMPTDIALOG_SELECT, "是否删除").setClick(new View.OnClickListener() { mPresenter.cancelInventoryAdd(mCs);
@Override } else {
public void onClick(View view) { PromptDialog promptDialog = new PromptDialog();
adapter.getData().remove(position); promptDialog.setDialogType(PromptDialog.PROMPTDIALOG_SELECT, "退出前是否删除本次盘库记录").setClick(view1 -> {
adapter.notifyDataSetChanged(); mPresenter.cancelInventoryAdd(mCs);
delDialog.dismiss(); promptDialog.dismiss();
}
}, new View.OnClickListener() { }, view1 -> {
@Override promptDialog.dismiss();
public void onClick(View view) { pop();
delDialog.dismiss();
} }).setCancelables(false).show((BaseActivity) mContext);
}).setCancelables(false).show((BaseActivity) mContext); }
return false; return false;
}); });
mInventoryGoodsAdapter.setOnItemChildClickListener((adapter, view, position) -> { mInventoryGoodsAdapter.setOnItemChildClickListener((adapter, view, position) -> {
...@@ -146,10 +143,8 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm ...@@ -146,10 +143,8 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
} }
}); });
Drawable drawable = getResources().getDrawable(R.drawable.singleline_zhouyu_huanggai);
mViewBinding.recyclerView.addItemDecoration(new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable));
mViewBinding.recyclerView.setAdapter(mInventoryGoodsAdapter); mViewBinding.recyclerView.setAdapter(mInventoryGoodsAdapter);
mViewBinding.recyclerView.addItemDecoration(emptyItemDecoration);
} }
...@@ -166,9 +161,14 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm ...@@ -166,9 +161,14 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
} }
} }
} }
mInventoryGoodsAdapter.notifyDataSetChanged();
updateRecycler();
} }
private void updateRecycler() {
mInventoryGoodsAdapter.notifyDataSetChanged();
}
public void addInventoryGoodsItem(Sssku sssku) { public void addInventoryGoodsItem(Sssku sssku) {
if (!topCsList.contains(sssku)) { if (!topCsList.contains(sssku)) {
...@@ -183,7 +183,7 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm ...@@ -183,7 +183,7 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
} }
mInventoryGoodsAdapter.notifyDataSetChanged(); updateRecycler();
} }
public void addInventoryDetailItem(CsDetail csDetail, Sssku sssku) { public void addInventoryDetailItem(CsDetail csDetail, Sssku sssku) {
...@@ -219,16 +219,21 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm ...@@ -219,16 +219,21 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
@Override @Override
public boolean onBackPressedSupport() { public boolean onBackPressedSupport() {
PromptDialog promptDialog = new PromptDialog(); if (bottomCsList.size() == 0) {
promptDialog.setDialogType(PromptDialog.PROMPTDIALOG_SELECT, "退出前是否删除本次盘库记录").setClick(view1 -> {
mPresenter.cancelInventoryAdd(mCs); mPresenter.cancelInventoryAdd(mCs);
promptDialog.dismiss(); } else {
PromptDialog promptDialog = new PromptDialog();
promptDialog.setDialogType(PromptDialog.PROMPTDIALOG_SELECT, "退出前是否删除本次盘库记录").setClick(view1 -> {
mPresenter.cancelInventoryAdd(mCs);
promptDialog.dismiss();
}, view1 -> { }, view1 -> {
promptDialog.dismiss(); promptDialog.dismiss();
pop(); pop();
}).setCancelables(false).show((BaseActivity) mContext);
}
}).setCancelables(false).show((BaseActivity) mContext);
return true; return true;
} }
......
...@@ -34,7 +34,6 @@ import java.util.List; ...@@ -34,7 +34,6 @@ import java.util.List;
public class OtherListFragment extends BaseFragment<OtherSelectPresenter, FragmentOtherListBinding> { public class OtherListFragment extends BaseFragment<OtherSelectPresenter, FragmentOtherListBinding> {
private OtherSelectAdapter mOtherSelectAdapter; private OtherSelectAdapter mOtherSelectAdapter;
private Drawable drawable; private Drawable drawable;
private RecyclerViewUtil.ListCardItemDecoration emptyItemDecoration;
private RecyclerViewUtil.ListCardItemDecoration listItemDecoration; private RecyclerViewUtil.ListCardItemDecoration listItemDecoration;
...@@ -46,13 +45,12 @@ public class OtherListFragment extends BaseFragment<OtherSelectPresenter, Fragme ...@@ -46,13 +45,12 @@ public class OtherListFragment extends BaseFragment<OtherSelectPresenter, Fragme
@Override @Override
public void initView() { public void initView() {
drawable = getResources().getDrawable(R.drawable.singleline_zhouyu_huanggai); drawable = getResources().getDrawable(R.drawable.singleline_zhouyu_huanggai);
emptyItemDecoration = new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable, 1);
listItemDecoration = new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable, 0); listItemDecoration = new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable, 0);
mOtherSelectAdapter = new OtherSelectAdapter(new ArrayList<>()); mOtherSelectAdapter = new OtherSelectAdapter(new ArrayList<>());
mOtherSelectAdapter.setEmptyView(getEmptyView(R.string.empty_other_select)); mOtherSelectAdapter.setEmptyView(getEmptyView(R.string.empty_other_select));
mViewBinding.recyclerOtherSelcet.setLayoutManager(new LinearLayoutManager(getActivity())); mViewBinding.recyclerOtherSelcet.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.recyclerOtherSelcet.setAdapter(mOtherSelectAdapter); mViewBinding.recyclerOtherSelcet.setAdapter(mOtherSelectAdapter);
mViewBinding.recyclerOtherSelcet.addItemDecoration(emptyItemDecoration);
// mOtherSelectAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { // mOtherSelectAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
// @Override // @Override
...@@ -90,13 +88,10 @@ public class OtherListFragment extends BaseFragment<OtherSelectPresenter, Fragme ...@@ -90,13 +88,10 @@ public class OtherListFragment extends BaseFragment<OtherSelectPresenter, Fragme
mOtherSelectAdapter.setNewData(pager.getList()); mOtherSelectAdapter.setNewData(pager.getList());
if (pager.getList().size() == 0) { if (pager.getList().size() == 0) {
mViewBinding.recyclerOtherSelcet.removeItemDecoration(listItemDecoration); mViewBinding.recyclerOtherSelcet.removeItemDecoration(listItemDecoration);
mViewBinding.recyclerOtherSelcet.removeItemDecoration(emptyItemDecoration);
mViewBinding.recyclerOtherSelcet.addItemDecoration(emptyItemDecoration);
mViewBinding.recyclerOtherSelcet.invalidateItemDecorations(); mViewBinding.recyclerOtherSelcet.invalidateItemDecorations();
} else { } else {
mViewBinding.recyclerOtherSelcet.removeItemDecoration(listItemDecoration); mViewBinding.recyclerOtherSelcet.removeItemDecoration(listItemDecoration);
mViewBinding.recyclerOtherSelcet.removeItemDecoration(emptyItemDecoration);
mViewBinding.recyclerOtherSelcet.addItemDecoration(listItemDecoration); mViewBinding.recyclerOtherSelcet.addItemDecoration(listItemDecoration);
mViewBinding.recyclerOtherSelcet.invalidateItemDecorations(); mViewBinding.recyclerOtherSelcet.invalidateItemDecorations();
} }
......
...@@ -6,17 +6,18 @@ ...@@ -6,17 +6,18 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/lyt_main_bg"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"
style="@style/dialog_title" style="@style/dialog_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
<View android:layout_marginBottom="@dimen/all_padding" />
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gray_kongming" />
<ViewStub <ViewStub
android:id="@+id/vs_center" android:id="@+id/vs_center"
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -6,7 +6,15 @@ ...@@ -6,7 +6,15 @@
<data> <data>
</data> </data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_bounced_padding"
android:background="@drawable/singleline_zhouyu_huanggai"
/>
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -206,6 +214,6 @@ ...@@ -206,6 +214,6 @@
app:layout_constraintTop_toTopOf="@id/linearLayout" /> app:layout_constraintTop_toTopOf="@id/linearLayout" />
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
</LinearLayout>
</layout> </layout>
\ No newline at end of file
...@@ -483,7 +483,7 @@ ...@@ -483,7 +483,7 @@
<!-- 菜单POS --> <!-- 菜单POS -->
<string name="menu_cashier">收银</string> <string name="menu_cashier">收银</string>
<string name="menu_service">服务</string> <string name="menu_service">服务</string>
<string name="menu_myself">个人</string> <string name="menu_myself">我的</string>
<string name="menu_billing">开单</string> <string name="menu_billing">开单</string>
<string name="menu_receivables">收款</string> <string name="menu_receivables">收款</string>
<string name="menu_vip">会员</string> <string name="menu_vip">会员</string>
......
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