Commit 01372794 authored by 王海's avatar 王海

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	app/src/main/java/com/xingdata/zzdpos/base/BaseDialog.java
parents 141632db 19f00c42
......@@ -11,6 +11,7 @@
<w>huangxin</w>
<w>inputer</w>
<w>kongming</w>
<w>kongrong</w>
<w>kongrun</w>
<w>likui</w>
<w>liubei</w>
......@@ -19,6 +20,7 @@
<w>nong</w>
<w>patt</w>
<w>shixiu</w>
<w>skus</w>
<w>sunquan</w>
<w>xishi</w>
<w>yanqing</w>
......
......@@ -66,6 +66,10 @@
android:name=".ui.settle.SettleActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity
android:name=".ui.store.StoreActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity
android:name=".ui.announcement.AnnouncementActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
......
......@@ -6,15 +6,14 @@ import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.app.AppCompatDialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ScreenUtils;
......@@ -32,8 +31,7 @@ import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBinding> extends
DialogFragment {
public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBinding> extends AppCompatDialogFragment {
private DialogBaseBinding mBaseBinding;
private Disposable mDisp;
......@@ -44,11 +42,15 @@ public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBind
public boolean isShowing;
static {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
}
public abstract int getLayoutId();
public BaseDialog() {
mContext = getActivity();
}
public void onCancelClick(View view) {
KeyboardUtils.hideSoftInput(mViewBinding.getRoot());
......@@ -116,14 +118,12 @@ public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBind
private View getEasyFragmentDialog(@NonNull LayoutInflater inflater, ViewGroup container) {
mViewBinding = DataBindingUtil.inflate(inflater, getLayoutId(), container, false);
this.initView();
return mViewBinding.getRoot();
}
private BaseActivity getBaseActivity() {
protected BaseActivity getBaseActivity() {
return (BaseActivity) getActivity();
}
......@@ -162,8 +162,7 @@ public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBind
if (!isShowing) {
super.show(activity.getSupportFragmentManager(), this.getTag());
isShowing = true;
Observable.interval(0, 1, TimeUnit.SECONDS).take(recLen + 1).map(new Function<Long,
Long>() {
Observable.interval(0, 1, TimeUnit.SECONDS).take(recLen + 1).map(new Function<Long, Long>() {
@Override
public Long apply(@io.reactivex.annotations.NonNull Long aLong) throws Exception {
return recLen - aLong;
......
......@@ -17,9 +17,11 @@ public abstract class BaseSelectedAdapter<T, B extends ViewDataBinding> extends
private OnItemClickListener mOnItemClickListener;
private boolean isEnabled = true;
private boolean isAutoClickItem;
public BaseSelectedAdapter(int layoutResId, @Nullable List<T> data) {
super(layoutResId, data);
isAutoClickItem = true;
super.setOnItemClickListener((adapter, view, position) -> {
if (!isEnabled) return;
notifyItemChanged(mSelectedPosition);
......@@ -28,9 +30,24 @@ public abstract class BaseSelectedAdapter<T, B extends ViewDataBinding> extends
});
}
public BaseSelectedAdapter(int layoutResId, @Nullable List<T> data, boolean isAutoClickItem) {
super(layoutResId, data);
this.isAutoClickItem = isAutoClickItem;
super.setOnItemClickListener((adapter, view, position) -> {
if (!isEnabled) return;
notifyItemChanged(mSelectedPosition);
notifyItemChanged(position);
mSelectedPosition = position;
if (!this.isAutoClickItem) {
mOnItemClickListener.onItemClick(this, view, mSelectedPosition);
}
});
}
@Override
protected void convert(BaseViewHolder helper, T item) {
if (mOnItemClickListener != null && mSelectedPosition == helper.getAdapterPosition())
if (mOnItemClickListener != null && mSelectedPosition == helper.getAdapterPosition() && isAutoClickItem)
mOnItemClickListener.onItemClick(this, helper.itemView, mSelectedPosition);
this.convert(helper, (B) helper.mViewBinding, item);
}
......@@ -49,13 +66,6 @@ public abstract class BaseSelectedAdapter<T, B extends ViewDataBinding> extends
this.mOnItemClickListener = listener;
}
public T getSelectedItemObject() {
if (mSelectedPosition > 0) {
return getData().get(mSelectedPosition);
} else {
return null;
}
}
public int getSelectedPosition() {
return mSelectedPosition;
......
package com.xingdata.zzdpos.base;
import android.app.Dialog;
import android.content.Context;
import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomSheetBehavior;
import android.support.design.widget.BottomSheetDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
public abstract class BaseSheetDialog<P extends BasePresenter, B extends ViewDataBinding> extends BaseDialog<P, B> {
public BottomSheetBehavior mBehavior;
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
mContext = getActivity();
mPresenter = (P) getBaseActivity().mPresenter;
getBaseActivity().mDialogs.add(0, this);
MyBottomSheetDialog dialog = new MyBottomSheetDialog(mContext);
mViewBinding = DataBindingUtil.inflate(LayoutInflater.from(mContext), getLayoutId(), null, false);
dialog.setContentView(mViewBinding.getRoot());
mBehavior = BottomSheetBehavior.from((View) mViewBinding.getRoot().getParent());
this.initView();
return dialog;
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return null;
}
private class MyBottomSheetDialog extends BottomSheetDialog {
public MyBottomSheetDialog(@NonNull Context context) {
super(context);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int screenHeight = getScreenHeight(getContext());
getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, screenHeight == 0 ? ViewGroup.LayoutParams.MATCH_PARENT : screenHeight);
}
int getScreenHeight(Context context) {
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
return wm != null ? wm.getDefaultDisplay().getHeight() : 0;
}
}
}
......@@ -6,8 +6,10 @@ import com.xingdata.zzdpos.base.BaseModel;
import com.xingdata.zzdpos.model.HandoverInfo;
import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.model.Pay;
import com.xingdata.zzdpos.model.Sskugrp;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.ui.settle.SettlePresenter;
import com.xingdata.zzdpos.ui.store.StorePresenter;
import java.util.ArrayList;
import java.util.List;
......@@ -23,8 +25,6 @@ import io.realm.Sort;
public class DBFactory {
public static class Main {
/**
* 查询交班记录
*/
......@@ -35,7 +35,6 @@ public class DBFactory {
.findFirst();
}
/**
* 更改交班记录
*/
......@@ -46,7 +45,19 @@ public class DBFactory {
realm.copyToRealmOrUpdate(handoverInfo);
}
});
}
}
public static class Store {
/**
* 查询商品分组
*
* @return 商品分组
*/
public static Observable<List<Sskugrp>> querySkugrp() {
return Observable.just(DB.getInstance().get(StorePresenter.class).where(Sskugrp.class).findAll())
.flatMap(sskugrps -> Observable.just(getList(sskugrps)));
}
}
......
......@@ -13,9 +13,8 @@ import com.xingdata.zzdpos.databinding.FragmentCasherBinding;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.ui.main.adapter.MenuRecyclerAdapter;
import com.xingdata.zzdpos.ui.payment.PaymentActivity;
import com.xingdata.zzdpos.ui.sendticke.SendTicketActivity;
import com.xingdata.zzdpos.ui.splash.SplashActivity;
import com.xingdata.zzdpos.ui.statistics.StatisticsActivity;
import com.xingdata.zzdpos.ui.store.StoreActivity;
import com.xingdata.zzdpos.ui.vip.VipActivity;
import com.xingdata.zzdpos.util.MyMenuItemDecoration;
import com.xingdata.zzdpos.util.OnClickListener;
......@@ -63,7 +62,7 @@ public class CasherFragment extends BaseFragment<MainPresenter, FragmentCasherBi
break;
case C.MENU.MENU_TICKET://优惠券
ActivityUtils.startActivity(getActivity(), SendTicketActivity.class);
ActivityUtils.startActivity(getActivity(), com.xingdata.zzdpos.ui.sendticke.SendTicketActivity.class);
break;
case C.MENU.MENU_STATISTICS://统计
ActivityUtils.startActivity(getActivity(), StatisticsActivity.class);
......@@ -81,10 +80,10 @@ public class CasherFragment extends BaseFragment<MainPresenter, FragmentCasherBi
ActivityUtils.startActivity(getActivity(), PaymentActivity.class);
}
});
mViewBinding.tvSplash.setOnClickListener(new OnClickListener() {
mViewBinding.tvStore.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
ActivityUtils.startActivity(getActivity(), SplashActivity.class);
ActivityUtils.startActivity(getActivity(), StoreActivity.class);
}
});
mViewBinding.btnHandover.setOnClickListener(new OnClickListener() {
......
......@@ -26,7 +26,7 @@ public class PayAdapter extends BaseAdapter<Pay, ItemPayBinding> {
break;
case C.PAY_CHANNEL.WECHAT:
resLogo = R.mipmap.pay_wechat;
resBackground = R.color.green_kongrun;
resBackground = R.color.green_kongrong;
break;
case C.PAY_CHANNEL.ALI:
resLogo = R.mipmap.pay_alipay;
......
......@@ -77,21 +77,11 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle
* @param vip 会员信息
*/
public void loadVip(Vip vip) {
if (vip.isDefaultVip()) {
for (int i = 0; i < mPayAdapter.getData().size(); i++) {
if (mPayAdapter.getData().get(i).isNeedVip()) mPayAdapter.remove(i);
}
} else {
for (int i = 0; i < mPays.size(); i++) {
if (mPays.get(i).isNeedVip() && (mPays.get(i).getPayType() != C.PAY_CHANNEL.CARD || vip.getAcctCbal() > mViewBinding.getOrderPayAmt())) {
mPayAdapter.addData(mPays.get(i));
}
}
}
mPayAdapter.setNewData(getAvlPays(vip));
mViewBinding.setDefualtVip(vip.isDefaultVip());
mViewBinding.setName(vip.getVipName());
mViewBinding.setPhone(ConvertUtil.longToString(vip.getVipMobile()));
mViewBinding.setPhone(vip.getVipMobile());
mViewBinding.setBalance(vip.getAcctCbal());
mViewBinding.cbPoint.setChecked(false);
......@@ -141,14 +131,21 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle
* 加载支付方式
*/
public void loadPays(List<Pay> pays) {
mPays.addAll(pays);
List<Pay> _pays = new ArrayList<>();
for (int i = 0; i < pays.size(); i++) {
pays.get(i).init();
if (!pays.get(i).isNeedVip()) _pays.add(pays.get(i));
}
mPayAdapter.setNewData(_pays);
mPays.addAll(pays);
mPayAdapter.setNewData(getAvlPays(Vip.createDefault()));
}
List<Pay> getAvlPays(Vip vip) {
List<Pay> _pays = new ArrayList<>();
for (int i = 0; i < mPays.size(); i++) {
if (!mPays.get(i).isNeedVip() || (!vip.isDefaultVip() && (mPays.get(i).getPayType() != C.PAY_CHANNEL.CARD || vip.getAcctCbal() >= mViewBinding.getOrderPayAmt())))
_pays.add(mPays.get(i));
}
return _pays;
}
}
package com.xingdata.zzdpos.ui.store;
import android.view.inputmethod.EditorInfo;
import com.blankj.utilcode.util.KeyboardUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseSku;
import com.xingdata.zzdpos.databinding.ActivityStoreBinding;
import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.model.Sskugrp;
import java.util.List;
public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBinding> implements StoreContract.View {
@Override
public int getLayoutId() {
return R.layout.activity_store;
}
@Override
public void initView() {
mViewBinding.ivCart.setOnClickListener(view -> mPresenter.clickCartLogo());
mViewBinding.tvSettle.setOnClickListener(view -> mPresenter.clickSettle());
mViewBinding.etSearch.setOnEditorActionListener((textView, i, keyEvent) -> {
if (i == EditorInfo.IME_ACTION_SEARCH) {
KeyboardUtils.hideSoftInput(textView);
mPresenter.searchSku(textView.getText().toString());
}
return false;
});
}
@Override
public <Sku extends BaseSku> void loadSkus(List<Sku> skus, boolean isRefresh) {
}
@Override
public void loadSkugrps(List<Sskugrp> sskugrps) {
}
@Override
public void loadMss(List<Ms> mss) {
}
@Override
public <Sku extends BaseSku> void loadSearchResult(List<Sku> skus, boolean isRefresh) {
}
}
package com.xingdata.zzdpos.ui.store;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseSku;
import com.xingdata.zzdpos.base.BaseView;
import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.model.Saledetail;
import com.xingdata.zzdpos.model.Sskugrp;
import java.util.List;
interface StoreContract {
interface View extends BaseView {
/**
* 加载商品
*
* @param skus 商品列表
* @param isRefresh 是否刷新列表
* @param <Sku> 商品类型
*/
<Sku extends BaseSku> void loadSkus(List<Sku> skus, boolean isRefresh);
/**
* 加载商品分组
*
* @param sskugrps 商品分组列表
*/
void loadSkugrps(List<Sskugrp> sskugrps);
/**
* 加载营销方案
*
* @param mss 营销方案列表
*/
void loadMss(List<Ms> mss);
/**
* 加载搜索结果
*
* @param skus 商品列表
* @param isRefresh 是否刷新列表
* @param <Sku> 商品类型
*/
<Sku extends BaseSku> void loadSearchResult(List<Sku> skus, boolean isRefresh);
}
abstract class Presenter extends BasePresenter<View> {
/**
* 总体 - 点击结算按钮
*/
public abstract void clickSettle();
/**
* 总体 - 点击购物车logo
*/
public abstract void clickCartLogo();
/**
* 商店页面 - 初始化
*/
public abstract void initStore();
/**
* 商店页面 - 刷新商品
*/
public abstract void refreshSku();
/**
* 商店页面 - 加载更多商品
*/
public abstract void loadMoreSku();
/**
* 商店页面 - 点击搜索
*/
public abstract void searchSku(String keyword);
/**
* 商店页面 - 切换分组
*
* @param sskugrp 分组
*/
public abstract void clickSkugrp(Sskugrp sskugrp);
/**
* 商店页面 - 点击添加商品
*
* @param sku 商品
* @param <Sku> 商品类型
*/
public abstract <Sku extends BaseSku> void clickAddSku(Sku sku);
/**
* 商店页面 - 点击删除商品
*
* @param sku 商品
* @param <Sku> 商品类型
*/
public abstract <Sku extends BaseSku> void clickRemoveSku(Sku sku);
/**
* 购物车页面 - 点击添加购物信息
*
* @param saledetail 购物信息
*/
public abstract void clickAddSaledetail(Saledetail saledetail);
/**
* 购物车页面 - 点击删除购物信息
*
* @param saledetail 购物信息
*/
public abstract void clickRemoveSaledetail(Saledetail saledetail);
}
......
package com.xingdata.zzdpos.ui.store;
import com.xingdata.zzdpos.base.BaseSku;
import com.xingdata.zzdpos.db.DBFactory;
import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.model.Saledetail;
import com.xingdata.zzdpos.model.Sskugrp;
import java.util.List;
public class StorePresenter extends StoreContract.Presenter {
/**
* 当前购物车信息
*/
private List<Saledetail> mSaledetails;
/**
* 当前营销计划
*/
private List<Ms> mMss;
private int mStorePageNum;
private Long mSkuGrpId;
private int mSearchPageNum;
private String mKeyword;
@Override
public void onAttached() {
this.initRealm();
}
@Override
public void clickSettle() {
}
@Override
public void clickCartLogo() {
}
@Override
public void initStore() {
}
@Override
public void refreshSku() {
}
@Override
public void loadMoreSku() {
}
@Override
public void searchSku(String keyword) {
}
@Override
public void clickSkugrp(Sskugrp sskugrp) {
}
@Override
public <Sku extends BaseSku> void clickAddSku(Sku sku) {
}
@Override
public <Sku extends BaseSku> void clickRemoveSku(Sku sku) {
}
@Override
public void clickAddSaledetail(Saledetail saledetail) {
}
@Override
public void clickRemoveSaledetail(Saledetail saledetail) {
}
private void getSkugrp() {
mCompositeDisposable.add(
DBFactory.Store.querySkugrp().subscribe(
sskugrps -> {
Sskugrp sskugrp = new Sskugrp();
sskugrp.setSkuGrpId(-1L);
sskugrp.setSkuGrpName("组合商品");
sskugrp.setSelected(false);
sskugrps.add(0, sskugrp);
sskugrp = new Sskugrp();
sskugrp.setSkuGrpId(0L);
sskugrp.setSkuGrpName("全部分组");
sskugrp.setSelected(true);
sskugrps.add(0, sskugrp);
mView.loadSkugrps(sskugrps);
})
);
}
}
package com.xingdata.zzdpos.ui.store.adapter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemStoreMsBinding;
import com.xingdata.zzdpos.model.Ms;
import java.util.ArrayList;
public class MsAdapter extends BaseAdapter<Ms, ItemStoreMsBinding> {
public MsAdapter() {
super(R.layout.item_store_ms, new ArrayList<>());
}
@Override
protected void convert(ItemStoreMsBinding mViewBinding, Ms item) {
}
}
package com.xingdata.zzdpos.ui.store.adapter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.base.BaseSku;
import com.xingdata.zzdpos.databinding.ItemStoreSkuBinding;
import java.util.ArrayList;
public class SkuAdapter<T extends BaseSku> extends BaseAdapter<T, ItemStoreSkuBinding> {
public SkuAdapter() {
super(R.layout.item_store_sku, new ArrayList<>());
}
@Override
protected void convert(ItemStoreSkuBinding mViewBinding, T item) {
}
}
package com.xingdata.zzdpos.ui.store.adapter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseSelectedAdapter;
import com.xingdata.zzdpos.base.BaseViewHolder;
import com.xingdata.zzdpos.databinding.ItemStoreSkugrpBinding;
import com.xingdata.zzdpos.model.Sskugrp;
import java.util.ArrayList;
public class SkugrpAdapter extends BaseSelectedAdapter<Sskugrp, ItemStoreSkugrpBinding> {
public SkugrpAdapter() {
super(R.layout.item_store_skugrp, new ArrayList<>(), false);
}
@Override
protected void convert(BaseViewHolder helper, ItemStoreSkugrpBinding mViewBinding, Sskugrp item) {
}
}
package com.xingdata.zzdpos.ui.store.dialog;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseSheetDialog;
import com.xingdata.zzdpos.databinding.DialogStoreCartBinding;
import com.xingdata.zzdpos.ui.store.StorePresenter;
public class CartDialog extends BaseSheetDialog<StorePresenter, DialogStoreCartBinding> {
@Override
public int getLayoutId() {
return R.layout.dialog_store_cart;
}
@Override
public void initView() {
}
}
package com.xingdata.zzdpos.ui.store.dialog;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseSheetDialog;
import com.xingdata.zzdpos.databinding.DialogStoreMsBinding;
import com.xingdata.zzdpos.ui.store.StorePresenter;
public class MsDialog extends BaseSheetDialog<StorePresenter, DialogStoreMsBinding> {
@Override
public int getLayoutId() {
return R.layout.dialog_store_ms;
}
@Override
public void initView() {
}
}
package com.xingdata.zzdpos.ui.store.fragment;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentStoreScanBinding;
import com.xingdata.zzdpos.ui.store.StorePresenter;
public class ScanFragment extends BaseFragment<StorePresenter, FragmentStoreScanBinding> {
@Override
public int getLayoutId() {
return R.layout.fragment_store_scan;
}
@Override
public void initView() {
}
}
package com.xingdata.zzdpos.ui.store.fragment;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentStoreSearchBinding;
import com.xingdata.zzdpos.ui.store.StorePresenter;
public class SearchFragment extends BaseFragment<StorePresenter, FragmentStoreSearchBinding> {
@Override
public int getLayoutId() {
return R.layout.fragment_store_search;
}
@Override
public void initView() {
}
}
package com.xingdata.zzdpos.ui.store.fragment;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentStoreBinding;
import com.xingdata.zzdpos.ui.store.StorePresenter;
import com.xingdata.zzdpos.ui.store.adapter.SkuAdapter;
import com.xingdata.zzdpos.ui.store.adapter.SkugrpAdapter;
public class StoreFragment extends BaseFragment<StorePresenter, FragmentStoreBinding> {
private SkuAdapter mSkuAdapter;
private SkugrpAdapter mSkugrpAdapter;
@Override
public int getLayoutId() {
return R.layout.fragment_store_search;
}
@Override
public void initView() {
mPresenter.initStore();
}
}
......@@ -8,18 +8,38 @@ import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.vip.fragment.VipInfoFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipLevleFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipListFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipTitleFragment;
import com.xingdata.zzdpos.util.OnClickListener;
public class VipActivity extends BaseActivity<VipPresenter, ActivityVipBinding> implements VipContract.View {
private VipInfoFragment vipInfoFragment = new VipInfoFragment();
public class VipActivity extends BaseActivity<VipPresenter, ActivityVipBinding> implements VipContract.View {
private VipListFragment vipListFragment = new VipListFragment();
private VipLevleFragment vipLevleFragment = new VipLevleFragment();
private VipTitleFragment vipTitleFragment = new VipTitleFragment();
@Override
public int getLayoutId() {
return R.layout.activity_vip;
}
@Override
public void initView() {
loadRootFragment(R.id.vip_level_frame, vipLevleFragment, false, false);
loadRootFragment(R.id.vip_title_frame, vipTitleFragment, false, false);
loadRootFragment(R.id.vip_list_frame, vipListFragment, false, false);
}
@Override
public void addVip() {
}
@Override
public String addVipSus() {
return null;
}
@Override
......
......@@ -10,15 +10,23 @@ import com.xingdata.zzdpos.model.Vip;
interface VipContract {
interface View extends BaseView {
void addVip();
String addVipSus();
Pager<Vip> getVipLevelSus();
Pager<Level> getVipListSus();
String getVipNumberSus();
}
abstract class Presenter extends BasePresenter<VipContract.View> {
public abstract void getVipList(int levelId, int pageNumber);
public abstract void getVipLevel();
public abstract void getVipNumber();
public abstract void addVip();
}
}
\ No newline at end of file
package com.xingdata.zzdpos.ui.vip;
import com.xingdata.zzdpos.ui.vip.fragment.VipInfoFragment;
public class VipPresenter extends VipContract.Presenter {
public VipInfoFragment vipInfoFragment = new VipInfoFragment();
@Override
public void onAttached() {
}
......@@ -20,4 +24,9 @@ public class VipPresenter extends VipContract.Presenter {
public void getVipNumber() {
}
@Override
public void addVip() {
mView.addVip();
}
}
package com.xingdata.zzdpos.ui.vip.adapter;
import android.content.Context;
import android.support.annotation.Nullable;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemVipListItemBinding;
import com.xingdata.zzdpos.model.Vip;
import java.util.List;
/**
* Created by JM_DEV on 2017/12/25.
*/
public class VipListAdapter extends BaseAdapter<Vip, ItemVipListItemBinding> {
private Context mContext;
public VipListAdapter(Context mContext, @Nullable List<Vip> data) {
super(R.layout.item_vip_list_item, data);
this.mContext=mContext;
}
@Override
protected void convert(ItemVipListItemBinding mViewBinding, Vip item) {
mViewBinding.vipName.setText(item.getVipName());
mViewBinding.vipMobile.setText(String.valueOf(item.getVipMobile()));
mViewBinding.vipDiscount.setText(String.valueOf(item.getVipDefDiscount()));
}
}
package com.xingdata.zzdpos.ui.vip.adapter;
import android.content.Context;
import android.support.annotation.Nullable;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemVipListItemBinding;
import com.xingdata.zzdpos.databinding.ItemVipRechargeItemBinding;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.model.VipRechangeOrder;
import java.util.List;
/**
* Created by JM_DEV on 2017/12/25.
*/
public class VipRechargeAdapter extends BaseAdapter<VipRechangeOrder, ItemVipRechargeItemBinding> {
private Context mContext;
public VipRechargeAdapter(Context mContext, @Nullable List<VipRechangeOrder> data) {
super(R.layout.item_vip_list_item, data);
this.mContext=mContext;
}
@Override
protected void convert(ItemVipRechargeItemBinding mViewBinding, VipRechangeOrder item) {
// mViewBinding.vipName.setText(item.getVipName());
// mViewBinding.vipMobile.setText(String.valueOf(item.getVipMobile()));
// mViewBinding.vipDiscount.setText(String.valueOf(item.getVipDefDiscount()));
}
}
......@@ -4,25 +4,47 @@ package com.xingdata.zzdpos.ui.vip.fragment;
* Created by JM_DEV on 2017/12/21.
*/
import android.support.v7.widget.LinearLayoutManager;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentViplevelTitleBinding;
import com.xingdata.zzdpos.databinding.FragmentVipinfoBinding;
import com.xingdata.zzdpos.model.VipRechangeOrder;
import com.xingdata.zzdpos.ui.vip.VipPresenter;
import com.xingdata.zzdpos.ui.vip.adapter.VipRechargeAdapter;
import java.util.ArrayList;
import java.util.List;
/**
* 会员信息界面
*/
public class VipInfoFragment extends BaseFragment<VipPresenter, FragmentViplevelTitleBinding> {
public class VipInfoFragment extends BaseFragment<VipPresenter, FragmentVipinfoBinding> {
private VipRechargeAdapter vipRechargeAdapter;
private List<VipRechangeOrder> orders = new ArrayList<>();
@Override
public int getLayoutId() {
return R.layout.fragment_viplevel_title;
return R.layout.fragment_vipinfo;
}
@Override
public void initView() {
// RadioButton radioButton = new RadioButton(getActivity());
// radioButton.setText("AAAAAAAAAAAAAAA");
// mViewBinding.vipLevelRadioGroup.addView(radioButton);
vipRechargeAdapter = new VipRechargeAdapter(getActivity(), orders);
mViewBinding.rechargeRecyclerView.setLayoutManager( new LinearLayoutManager(getActivity()));
mViewBinding.rechargeRecyclerView.setAdapter(vipRechargeAdapter);
mViewBinding.rechargeRefresh.setOnRefreshListener(this::onRefresh);
}
private void onRefresh() {
vipRechargeAdapter.addData(new ArrayList<VipRechangeOrder>());
mViewBinding.rechargeRefresh.setRefreshing(false);
ToastUtils.showShort("刷新成功");
}
@Override
public boolean onBackPressedSupport() {
pop();
return true;
}
}
......@@ -36,7 +36,7 @@ public class VipLevleFragment extends BaseFragment<VipPresenter, FragmentVipleve
for (int i = 0; i < 5; i++) {
mViewBinding.vipLevelRadioGroup.addView(addRadioButton(layoutParams));
}
setRadioButtonChecked(true, ((RadioButton) mViewBinding.vipLevelRadioGroup.getChildAt(0)));
((RadioButton) mViewBinding.vipLevelRadioGroup.getChildAt(0)).setChecked(true);
mViewBinding.vipLevelRadioGroup.setOnCheckedChangeListener((radioGroup, n) -> {
for (int i = 0; i < mViewBinding.vipLevelRadioGroup.getChildCount(); i++) {
//动态设置按钮颜色
......
......@@ -4,25 +4,52 @@ package com.xingdata.zzdpos.ui.vip.fragment;
* Created by JM_DEV on 2017/12/21.
*/
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentVipListBinding;
import com.xingdata.zzdpos.databinding.FragmentViplevelTitleBinding;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.vip.VipPresenter;
import com.xingdata.zzdpos.ui.vip.adapter.VipListAdapter;
import java.util.ArrayList;
import java.util.List;
/**
* 会员列表
*/
public class VipListFragment extends BaseFragment<VipPresenter, FragmentViplevelTitleBinding> {
public class VipListFragment extends BaseFragment<VipPresenter, FragmentVipListBinding> {
private VipListAdapter vipListAdapter;
private List<Vip> vips = new ArrayList<>();
@Override
public int getLayoutId() {
return R.layout.fragment_viplevel_title;
return R.layout.fragment_vip_list;
}
@Override
public void initView() {
// RadioButton radioButton = new RadioButton(getActivity());
// radioButton.setText("AAAAAAAAAAAAAAA");
// mViewBinding.vipLevelRadioGroup.addView(radioButton);
vipListAdapter = new VipListAdapter(getActivity(), vips);
mViewBinding.vipRecyclerView.setLayoutManager( new LinearLayoutManager(getActivity()));
mViewBinding.vipRecyclerView.setAdapter(vipListAdapter);
mViewBinding.vipRefresh.setOnRefreshListener(this::onRefresh);
mViewBinding.vipRecyclerView.setOnClickListener(view -> {
start(new VipInfoFragment());
});
}
private void onRefresh() {
Vip vip = new Vip();
vip.setVipName("张山");
vip.setVipMobile(13311221212L);
vip.setVipDefDiscount(80);
vipListAdapter.addData(vip);
ToastUtils.showShort("刷新成功");
mViewBinding.vipRefresh.setRefreshing(false);
}
}
......@@ -20,9 +20,6 @@ public class VipRecordFragment extends BaseFragment<VipPresenter, FragmentViplev
@Override
public void initView() {
// RadioButton radioButton = new RadioButton(getActivity());
// radioButton.setText("AAAAAAAAAAAAAAA");
// mViewBinding.vipLevelRadioGroup.addView(radioButton);
}
}
package com.xingdata.zzdpos.ui.vip.fragment;
/**
* Created by JM_DEV on 2017/12/21.
*/
import android.annotation.SuppressLint;
import android.view.Gravity;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentViplevelTitleBinding;
import com.xingdata.zzdpos.databinding.FragmentViptitleBinding;
import com.xingdata.zzdpos.ui.vip.VipPresenter;
public class VipTitleFragment extends BaseFragment<VipPresenter, FragmentViptitleBinding> {
@Override
public int getLayoutId() {
return R.layout.fragment_viptitle;
}
@Override
public void initView() {
mViewBinding.addButton.setOnClickListener(view -> {
start(mPresenter.vipInfoFragment);
});
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/white_caocao" />
</shape>
\ No newline at end of file
......@@ -48,6 +48,7 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:inputType="number"
android:labelFor="@+id/et_search"
android:textColor="@color/black_likui"
android:textColorHint="@color/gray_huanggai"
android:textSize="@dimen/all_text_size" />
......
<?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>
<import type="android.view.View" />
<import type="com.xingdata.zzdpos.util.ConvertUtil" />
<variable
name="cartCount"
type="int" />
<variable
name="orderPayAmt"
type="long" />
<variable
name="msDisAmt"
type="long" />
</data>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.constraint.ConstraintLayout
android:id="@+id/cl_title"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:animateLayoutChanges="true"
android:background="@color/white_caocao"
app:layout_constraintBottom_toTopOf="@id/f_store"
app:layout_constraintTop_toTopOf="parent">
<ImageButton
android:id="@+id/btn_back"
android:layout_width="@dimen/title_height"
android:layout_height="match_parent"
android:background="?attr/actionBarItemBackground"
android:contentDescription="@string/all_go_back"
android:gravity="center"
android:padding="@dimen/all_margin"
android:src="@mipmap/back_black"
app:layout_constraintLeft_toLeftOf="parent" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/all_spacing"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@id/btn_back"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="parent">
<EditText
android:id="@+id/et_search"
style="@style/searchBarEditor"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/all_spacing"
android:layout_weight="1"
android:hint="@string/store_search_hint"
android:inputType="text"
android:labelFor="@+id/et_search"
android:textColor="@color/black_likui"
android:textColorHint="@color/gray_huanggai"
android:textSize="@dimen/all_text_size" />
<ImageButton
android:id="@+id/btn_scan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/transparent"
android:contentDescription="@string/store_scan"
android:foreground="?android:attr/actionBarItemBackground"
android:src="@mipmap/but_sweep_yard" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_gravity="bottom"
android:background="@color/gray_huanggai"
app:layout_constraintBottom_toBottomOf="parent" />
</android.support.constraint.ConstraintLayout>
<FrameLayout
android:id="@+id/f_store"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@id/fl_cart"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/cl_title" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gray_huanggai"
app:layout_constraintBottom_toTopOf="@id/fl_cart" />
<FrameLayout
android:id="@+id/fl_cart"
android:layout_width="0dp"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<LinearLayout
android:id="@+id/fl_ms"
android:layout_width="0dp"
android:layout_height="@dimen/all_margin_big"
android:layout_marginBottom="@dimen/all_line_width"
android:alpha="0.87"
android:background="@color/cyan_sunquan"
android:gravity="center"
android:orientation="horizontal"
android:visibility="@{msDisAmt>0?View.VISIBLE:View.GONE}"
app:layout_constraintBottom_toTopOf="@id/fl_cart"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/store_ms_dis"
android:textColor="@color/black_zhangfei"
android:textSize="@dimen/all_text_size" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{ConvertUtil.fenToYuan(msDisAmt)}"
android:textColor="@color/red_guanyu"
android:textSize="@dimen/all_text_size" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/unit_rmb_yuan"
android:textColor="@color/black_zhangfei"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_spacing"
android:animateLayoutChanges="true"
app:layout_constraintBottom_toTopOf="@id/fl_cart"
app:layout_constraintLeft_toRightOf="@id/fl_logo"
app:layout_constraintTop_toBottomOf="@id/fl_cart">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/store_pay_amt"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_spacing"
android:text="@string/money_rmb"
android:textColor="@color/red_guanyu"
android:textSize="@dimen/all_text_size" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@{ConvertUtil.fenToYuan(orderPayAmt)}"
android:textColor="@color/red_guanyu"
android:textSize="@dimen/all_sub_title_size"
android:textStyle="bold" />
</LinearLayout>
<TextView
android:id="@+id/tv_settle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_margin"
android:background="@drawable/shape_red_round_rectangle_more_round"
android:foreground="?android:attr/actionBarItemBackground"
android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin_big"
android:paddingStart="@dimen/all_margin_big"
android:paddingTop="@dimen/all_spacing"
android:text="@string/store_btn_settle"
android:textColor="@color/white_caocao"
app:layout_constraintBottom_toTopOf="@id/fl_cart"
app:layout_constraintRight_toRightOf="@id/fl_cart"
app:layout_constraintTop_toBottomOf="@id/fl_cart" />
<FrameLayout
android:id="@+id/fl_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_margin_big"
android:animateLayoutChanges="true"
app:layout_constraintBottom_toBottomOf="@id/tv_settle"
app:layout_constraintLeft_toLeftOf="@id/fl_cart">
<ImageView
android:id="@+id/iv_cart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_spacing"
android:contentDescription="@string/store_cart"
android:foreground="?attr/actionBarItemBackground"
android:src="@mipmap/shopping_cart" />
<TextView
android:layout_width="@dimen/store_cart_count"
android:layout_height="@dimen/store_cart_count"
android:layout_gravity="end"
android:background="@drawable/shape_white_oval"
android:gravity="center"
android:text='@{cartCount+""}'
android:textColor="@color/red_guanyu"
android:textSize="@{cartCount &lt; 100?@dimen/all_caption_size:@dimen/all_tiny_size}"
android:textStyle="bold"
android:visibility="@{cartCount>0?View.VISIBLE:View.GONE}" />
</FrameLayout>
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg"
android:orientation="vertical">
<LinearLayout
<FrameLayout
android:id="@+id/vip_title_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<include
layout="@layout/title_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" />
<ImageView
android:layout_width="50dp"
android:layout_height="match_parent"
android:background="@mipmap/swipe_card_bg" />
<ImageView
android:layout_width="50dp"
android:layout_height="match_parent"
android:background="@mipmap/scan_bg" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/line1" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="@dimen/view_line_L5"
android:background="@color/line1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_smallstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="本店会员" />
<TextView
style="@style/default_blacktext_smallstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="今日新增" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_bigstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="150"
android:textSize="22sp"
android:textStyle="bold" />
<TextView
style="@style/default_blacktext_bigstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="10"
android:textSize="22sp"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="@dimen/view_line_L5"
android:background="@color/line1" />
android:layout_height="wrap_content"/>
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/all_margin_left"
......@@ -103,13 +18,13 @@
<FrameLayout
android:id="@+id/vip_level_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_weight="3"></FrameLayout>
<FrameLayout
android:id="@+id/vip_frame"
android:id="@+id/vip_list_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"></FrameLayout>
</LinearLayout>
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/transparent_border"
android:gravity="center"
android:orientation="vertical">
</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">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/transparent_border"
android:gravity="center"
android:orientation="vertical">
</LinearLayout>
</layout>
\ No newline at end of file
......@@ -41,7 +41,7 @@
android:textColor="#FFF" />
<TextView
android:id="@+id/tv_splash"
android:id="@+id/tv_store"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
......
......@@ -27,7 +27,7 @@
<variable
name="phone"
type="String" />
type="long" />
<variable
name="disRate"
......@@ -61,7 +61,7 @@
android:background="@color/gray_zhouyu"
android:orientation="vertical">
<ScrollView
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
......@@ -127,7 +127,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{phone}"
android:text="@{ConvertUtil.longToString(phone)}"
android:textColor="@color/black_likui"
android:textSize="@dimen/all_caption_size" />
</LinearLayout>
......@@ -351,7 +351,7 @@
</LinearLayout>
</ScrollView>
</android.support.v4.widget.NestedScrollView>
<LinearLayout
android:id="@+id/ll_sheet"
......@@ -403,7 +403,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_red_round_rectangle_more_round"
android:foreground="?android:attr/selectableItemBackgroundBorderless"
android:foreground="?android:attr/actionBarItemBackground"
android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin_big"
android:paddingStart="@dimen/all_margin_big"
......
<?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">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
</android.support.design.widget.CoordinatorLayout>
</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">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
</android.support.design.widget.CoordinatorLayout>
</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">
<data>
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_gravity="bottom"
android:background="@color/gray_huanggai" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/gray_huanggai" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_skugrp"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/green_kongrong">
</android.support.v7.widget.RecyclerView>
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_sku"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
android:background="@color/blue_mawu">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/vip_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/vipRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg"
android:orientation="vertical">
<include layout="@layout/title_pop" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin"
android:layout_weight="1"
android:background="@color/white"
android:orientation="vertical">
<TextView
style="@style/default_blacktext_bigstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="张思" />
<TextView
style="@style/default_blacktext_smallstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="13311525312" />
</LinearLayout>
<TextView
style="@style/default_blacktext_smallstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_margin="@dimen/all_margin"
android:text="@string/vip_info_discount" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/line_bg"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
style="@style/default_blacktext_smallstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="可用金額" />
<TextView
style="@style/default_blacktext_bigstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="50.00"
android:textColor="@color/reddeep" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="40dp"
android:background="@color/line_bg"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
style="@style/default_blacktext_smallstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="可用金額" />
<TextView
style="@style/default_blacktext_bigstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="160.00"
android:textColor="@color/reddeep" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/line_bg"></View>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/recharge_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/rechargeRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<data>
<variable
name="onClickListener"
type="android.view.View.OnClickListener" />
<variable
name="onCheckedChangeListener"
type="android.widget.RadioGroup.OnCheckedChangeListener" />
</data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<include
layout="@layout/title_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" />
<ImageView
android:layout_width="50dp"
android:layout_height="match_parent"
android:background="@mipmap/swipe_card_bg" />
<ImageView
android:id="@+id/onScan"
android:layout_width="50dp"
android:layout_height="match_parent"
android:background="@mipmap/scan_bg"
android:onClick="@{onClickListener}" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="@dimen/view_line_L5"
android:background="@color/line1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:background="@color/white"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_smallstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="本店会员" />
<TextView
style="@style/default_blacktext_smallstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="今日新增" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_bigstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="150"
android:textSize="22sp"
android:textStyle="bold" />
<TextView
style="@style/default_blacktext_bigstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="10"
android:textSize="22sp"
android:textStyle="bold" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@color/white"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/addVip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_centerVertical="true"
android:onClick="@{onClickListener}"
android:orientation="horizontal">
<ImageButton
android:id="@+id/addButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_margin="5dp"
android:background="@mipmap/add_bg" />
<TextView
style="@style/default_blacktext_bigstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="添加会员"
android:textColor="@color/deep_red"
android:textSize="22sp" />
</LinearLayout>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="@dimen/view_line_L5"
android:background="@color/line1" />
</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">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground">
</android.support.constraint.ConstraintLayout>
</layout>
<?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">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground">
</android.support.constraint.ConstraintLayout>
</layout>
<?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">
<data>
<variable
name="selected"
type="boolean" />
</data>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="120dp"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground">
<View
android:layout_width="@dimen/all_spacing"
android:layout_height="@dimen/all_sub_title_size"
android:layout_gravity="center_vertical"
android:background="@color/red_guanyu" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="全部商品"
android:textStyle="bold"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size" />
</FrameLayout>
<FrameLayout
android:layout_width="120dp"
android:layout_height="?attr/actionBarSize"
android:background="@color/gray_zhouyu"
android:foreground="?android:attr/selectableItemBackground">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textStyle="normal"
android:text="全部商品"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
</FrameLayout>
</LinearLayout>
</layout>
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:text="张小萌"
android:id="@+id/vip_name"
style="@style/default_blacktext_bigstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="13311556556"
android:id="@+id/vip_mobile"
style="@style/default_blacktext_smallstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:text="85折"
android:id="@+id/vipDiscount"
style="@style/default_blacktext_smallstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/all_margin"
android:background="@mipmap/pay_alipay" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/rechange_type"
style="@style/default_blacktext_bigstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="支付宝支付" />
<TextView
android:id="@+id/rechange_time"
style="@style/default_blacktext_smallstyle"
android:layout_width="wrap_content"
android:textColor="@color/black_likui"
android:layout_height="wrap_content"
android:text="08-09 10:10" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_margin="@dimen/all_margin"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical">
<TextView
android:id="@+id/rechange_money"
style="@style/default_blacktext_bigstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+充值金额" />
<TextView
android:id="@+id/rechange_shop"
android:textColor="@color/black_likui"
style="@style/default_blacktext_smallstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="充值总店" />
</LinearLayout>
</LinearLayout>
</layout>
\ No newline at end of file
......@@ -5,26 +5,24 @@
<variable
name="onClickListener"
type="com.xingdata.zzdpos.util.OnClickListener"/>
type="com.xingdata.zzdpos.util.OnClickListener" />
</data>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@drawable/singleline_white_gray"
android:orientation="horizontal">
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@drawable/singleline_white_gray"
android:orientation="horizontal">
<ImageButton
android:id="@+id/iv_back"
android:layout_width="?attr/actionBarSize"
android:layout_width="60dp"
android:layout_height="match_parent"
android:background="@color/transparent"
android:onClick="@{onClickListener}"
android:padding="@dimen/all_margin"
android:src="@mipmap/back_black"/>
android:background="@mipmap/go_back"
android:onClick="@{onClickListener}" />
<TextView
android:id="@+id/tv_title"
......@@ -33,7 +31,7 @@
android:layout_centerInParent="true"
android:text="标题"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/text_secondary_title"/>
android:textSize="@dimen/text_secondary_title" />
</RelativeLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<layout>
<data>
<variable
name="onClickListener"
type="com.xingdata.zzdpos.util.OnClickListener" />
</data>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@drawable/singleline_white_gray"
android:orientation="horizontal">
<ImageButton
android:id="@+id/iv_back"
android:layout_width="?attr/actionBarSize"
android:layout_height="match_parent"
android:background="@mipmap/go_back"
android:onClick="@{onClickListener}" />
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="标题"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/text_secondary_title" />
<ImageButton
android:id="@+id/pop_menu"
android:layout_width="60dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="@mipmap/pop_menu"
android:onClick="@{onClickListener}" />
</RelativeLayout>
</layout>
\ No newline at end of file
......@@ -80,7 +80,6 @@
<color name="line1">#e6e6e6</color>
<color name="grey1">#E2E2E2</color>
<!-- 界面背景色 -->
<color name="lyt_main_bg">#efeff4</color>
......@@ -140,7 +139,7 @@
<color name="blue_mawu">#3f75a2</color>
<color name="green_chengyaojin">#088b38</color>
<color name="green_kongrun">#35ba6a</color>
<color name="green_kongrong">#35ba6a</color>
<color name="orange_shixiu">#e88108</color>
......
......@@ -11,6 +11,7 @@
<dimen name="all_text_size">16sp</dimen>
<dimen name="all_text_size_small">12sp</dimen>
<dimen name="all_caption_size">12sp</dimen>
<dimen name="all_tiny_size">9sp</dimen>
<dimen name="all_title_size">26sp</dimen>
<dimen name="all_padding">10dp</dimen>
<dimen name="all_text_size_big">22sp</dimen>
......@@ -194,5 +195,8 @@
<dimen name="settle_pay_item">108dp</dimen>
<dimen name="settle_pay_logo">72dp</dimen>
<!--商店-->
<dimen name="store_cart_count">20dp</dimen>
</resources>
......@@ -129,6 +129,8 @@
<string name="vip_message_point_amt_hint">积分可抵金额</string>
<string name="vip_message_point_cr_hint">(100积分=1元)</string>
<string name="vip_message_ticket_none">不使用优惠券</string>
<string name="vip_info_discount">折扣:%s折</string>
<!--抹零页面-->
......@@ -184,9 +186,7 @@
<string name="store_group">商品分组 </string>
<string name="store_sssku">标准商品 </string>
<string name="store_ussku">组合商品 </string>
<string name="store_search">商品查询</string>
<string name="store_search_beside">邻库查询</string>
<string name="store_search_hint">商品名称/商品条码/商品助记码</string>
<string name="store_empty_hint">没有搜到此商品\n请重新搜索,或前往商品维护进行添加~</string>
<string name="store_scan_empty_hint">没有找到此商品</string>
......@@ -532,6 +532,14 @@
<string name="settle_ticket_unit"></string>
<string name="settle_ticket_info">元优惠券</string>
<!--商店-->
<string name="store_pay_amt">合计:</string>
<string name="store_cart">购物车</string>
<string name="store_btn_settle">选好了</string>
<string name="store_ms_dis">已减</string>
<string name="store_scan">扫描</string>
<string name="store_search_hint">请输入商品名称/助记码/条码</string>
<!--帮助POS-->
<string name="help_hint">帮助</string>
<string name="help_phone">400–800–9406</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