Commit 28ba590e authored by 王海's avatar 王海

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	app/src/main/AndroidManifest.xml
#	app/src/main/res/values/dimens.xml
parents 11465d72 023764ee
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
android:configChanges="keyboard|orientation|screenSize|keyboardHidden" android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:label="@string/main_title" android:label="@string/main_title"
android:launchMode="singleTask" android:launchMode="singleTask"
android:windowSoftInputMode="adjustUnspecified|stateHidden" > android:windowSoftInputMode="adjustUnspecified|stateHidden">
</activity> </activity>
<activity <activity
...@@ -60,6 +60,10 @@ ...@@ -60,6 +60,10 @@
android:configChanges="keyboard|orientation|screenSize|keyboardHidden" android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:label="@string/title_activity_ticket" android:label="@string/title_activity_ticket"
android:theme="@style/AppTheme" /> android:theme="@style/AppTheme" />
<activity
android:name=".ui.settle.SettleActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -14,6 +14,11 @@ public class C { ...@@ -14,6 +14,11 @@ public class C {
public static final int MENU_TICKET = 104; public static final int MENU_TICKET = 104;
public static final int MENU_STATISTICS = 105; public static final int MENU_STATISTICS = 105;
public static final int MENU_MANAGER = 106; public static final int MENU_MANAGER = 106;
public static final int MENU_ANNOUNCEMENT = 107;
public static final int MENU_FEED = 108;
public static final int MENU_UPDATE = 109;
public static final int MENU_HELP = 110;
public static final int MENU_EXIT = 111;
} }
...@@ -396,6 +401,8 @@ public class C { ...@@ -396,6 +401,8 @@ public class C {
public final class EXTRA_KEY { public final class EXTRA_KEY {
public static final String EXCEPTION = "extra.key.exception"; public static final String EXCEPTION = "extra.key.exception";
public static final String SETTLE_MODE = "extra.key.settle.mode";
public static final String SETTLE_EXTRA = "extra.key.settle.extra";
} }
...@@ -465,4 +472,9 @@ public class C { ...@@ -465,4 +472,9 @@ public class C {
//商品 //商品
public static final int SKU = 4; public static final int SKU = 4;
} }
public final class SETTLE_MODE {
public static final int PAYMENT = 1;
public static final int STORE = 2;
}
} }
package com.xingdata.zzdpos.ui.announcement;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityAnnouncementBinding;
import com.xingdata.zzdpos.ui.announcement.fragment.AnnouncementFragment;
public class AnnouncementActivity extends BaseActivity<AnnouncementPresenter, ActivityAnnouncementBinding> implements AnnouncementContract.View {
private AnnouncementFragment mAnnouncementFragment = new AnnouncementFragment();
@Override
public int getLayoutId() {
return R.layout.activity_announcement;
}
@Override
public void initView() {
// mViewBinding.imgBack.setOnClickListener(view -> {
// finish();
// });
// loadRootFragment(R.id.f_right, mAnnouncementDetailFragment, false, false);
// loadRootFragment(R.id.f_left, mAnnouncementTitleFragment, false, false);
}
//
//
// @Override
// public void showAnnouncementDetail(Notice s) {
// mAnnouncementDetailFragment.showAnnouncementDetail(s);
// }
//
// @Override
// public void loadNotice(Pager<Notice> noticePager, boolean isRefresh) {
// mAnnouncementTitleFragment.setData(noticePager, isRefresh);
// }
}
package com.xingdata.zzdpos.ui.announcement;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView;
public interface AnnouncementContract {
interface View extends BaseView {
//
// /**
// * 显示公告内容
// */
// void showAnnouncementDetail(Notice s);
// /**
// * 加载列表
// */
// void loadNotice(Pager<Notice> noticePager, boolean isRefresh);
}
abstract class Presenter extends BasePresenter<View> {
// /**
// * 初始化查询公告列表
// *
// */
// abstract void queryNoticeList();
//
// /**
// * 点击公告标题
// */
// abstract void clickTitleItem(Notice notice);
}
}
package com.xingdata.zzdpos.ui.announcement;
public class AnnouncementPresenter extends AnnouncementContract.Presenter {
private int nowPageNumber = 1;
private int nowPageSize = 10;
@Override
public void onAttached() {
}
//
// @Override
// public void queryNoticeList() {
// ApiFactory.Notice.queryNotice(nowPageNumber, nowPageSize).doFinally(() -> {
//// mView.isShowLoading(false);
// })
// .subscribe(noticePager -> {
// if (noticePager.getTotalRow() == 0) {
// ToastUtils.showShort("抱歉,暂无公告");
// }
// //判断是否能加载更多
// mView.loadNotice(noticePager, nowPageNumber == 1);
// }, throwable -> {
// ToastUtils.showShort(throwable.getMessage());
// });
// }
//
// @Override
// public void clickTitleItem(Notice s) {
// mView.showAnnouncementDetail(s);
// }
//}
}
\ No newline at end of file
//package com.xingdata.zzdpos.ui.announcement.adapter;
//
//
//import android.support.annotation.Nullable;
//import android.view.View;
//import android.view.ViewGroup;
//
//import com.blankj.utilcode.util.TimeUtils;
//import com.xingdata.zzdhd.R;
//import com.xingdata.zzdhd.base.BaseAdapter;
//import com.xingdata.zzdhd.base.BaseViewHolder;
//import com.xingdata.zzdhd.databinding.ItemAnnouncementBinding;
//import com.xingdata.zzdhd.model.Notice;
//
//import java.util.List;
//
//public class AnnouncementAdapter extends BaseAdapter<Notice, ItemAnnouncementBinding> {
// public Integer isClickPos =0;
//
// public AnnouncementAdapter(@Nullable List<Notice> data) {
// super(R.layout.item_announcement, data);
//
// }
//
// @Override
// protected void convert(BaseViewHolder helper, Notice item) {
// if (helper.getAdapterPosition()==isClickPos){
// helper.getConvertView().findViewById(R.id.line_is_clicked).setVisibility(View.VISIBLE);
// }
//
// super.convert(helper, item);
// }
//
// @Override
// protected void convert(ItemAnnouncementBinding mViewBinding, Notice item) {
// mViewBinding.tvTitle.setText(item.getNoticeTitle());
// mViewBinding.tvDate.setText(TimeUtils.millis2String(item.getCreateTime()));
// }
//
//
// @Override
// protected View getItemView(int layoutResId, ViewGroup parent) {
// return super.getItemView(layoutResId, parent);
// }
//
//
//}
package com.xingdata.zzdpos.ui.announcement.fragment;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentAnnouncementBinding;
import com.xingdata.zzdpos.ui.announcement.AnnouncementPresenter;
public class AnnouncementFragment extends BaseFragment<AnnouncementPresenter, FragmentAnnouncementBinding> {
// private AnnouncementAdapter announcementAdapter;
@Override
public int getLayoutId() {
return R.layout.fragment_announcement;
}
@Override
protected boolean isLazy() {
return false;
}
@Override
public void initView() {
//
// initRecycler();
// mPresenter.queryNoticeList();
}
// private void initRecycler() {
// mViewBinding.announcementRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
// announcementAdapter = new AnnouncementAdapter(new ArrayList<>());
// announcementAdapter.bindToRecyclerView(mViewBinding.announcementRecycler);
// announcementAdapter.setOnItemClickListener((adapter, view, position) -> {
// if (announcementAdapter.isClickPos != null) {
// adapter.getViewByPosition(mViewBinding.announcementRecycler, announcementAdapter.isClickPos, R.id.line_is_clicked).setVisibility(View.INVISIBLE);
// }
// view.findViewById(R.id.line_is_clicked).setVisibility(View.VISIBLE);
// announcementAdapter.isClickPos = position;
// clickItem(announcementAdapter.getData().get(position));
// });
//
//
// }
//
//
// private void clickItem(Notice s) {
// mPresenter.clickTitleItem(s);
// }
//
//
// /**
// * 设置数据
// *
// * @param pager 数据
// * @param isRefresh 是否刷新
// */
// public void setData(Pager<Notice> pager, boolean isRefresh) {
// if (isRefresh) {
// announcementAdapter.setEnableLoadMore(true);
// mViewBinding.srlProduct.setRefreshing(false);
// }
// if (isRefresh) announcementAdapter.setNewData(pager.getList());
// else if (pager.getList().size() > 0) announcementAdapter.addData(pager.getList());
// if (pager.isLastPage()) announcementAdapter.loadMoreEnd(isRefresh);
// else announcementAdapter.loadMoreComplete();
//
// //获取第一条的公告
// if (announcementAdapter.getData() != null) {
// clickItem(announcementAdapter.getData().get(0));
// }
// }
//
}
...@@ -2,24 +2,39 @@ package com.xingdata.zzdpos.ui.main; ...@@ -2,24 +2,39 @@ package com.xingdata.zzdpos.ui.main;
import android.app.Activity; import android.app.Activity;
import android.databinding.DataBindingUtil;
import android.support.design.widget.TabLayout; import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.app.FragmentPagerAdapter;
import android.view.View;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity; import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityMainBinding; import com.xingdata.zzdpos.databinding.ActivityMainBinding;
import com.xingdata.zzdpos.databinding.ItemMenuBottomBinding;
import com.xingdata.zzdpos.ui.main.adapter.FragmentViewAdapter; import com.xingdata.zzdpos.ui.main.adapter.FragmentViewAdapter;
import com.xingdata.zzdpos.ui.main.fragment.CasherFragment; import com.xingdata.zzdpos.ui.main.fragment.CasherFragment;
import com.xingdata.zzdpos.ui.main.fragment.MyselfFragment;
import com.xingdata.zzdpos.ui.main.fragment.ServiceFragment;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.Scheduler;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBinding> { public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBinding> {
private int[] titleInts={R.string.menu_cashier,R.string.menu_service,R.string.menu_myself}; private int[] titleInts = {R.string.menu_cashier, R.string.menu_service, R.string.menu_myself};
private int[] iconList ={R.mipmap.icon_menu_cashier_1,R.mipmap.icon_menu_service_0,R.mipmap.icon_menu_myself_0}; private int[] iconList = {R.mipmap.icon_menu_cashier_1, R.mipmap.icon_menu_service_0, R.mipmap.icon_menu_myself_0};
private FragmentPagerAdapter mFragmentPagerAdapter; private FragmentPagerAdapter mFragmentPagerAdapter;
// private List<View> views=new ArrayList<>();
private List<ItemMenuBottomBinding> itemMenuBottomBindings = new ArrayList<>();
@Override @Override
public int getLayoutId() { public int getLayoutId() {
...@@ -31,27 +46,61 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin ...@@ -31,27 +46,61 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
List<Fragment> fragments = new ArrayList<>(); List<Fragment> fragments = new ArrayList<>();
fragments.add(new CasherFragment()); fragments.add(new CasherFragment());
fragments.add(new CasherFragment()); fragments.add(new ServiceFragment());
fragments.add(new CasherFragment()); fragments.add(new MyselfFragment());
mFragmentPagerAdapter = new FragmentViewAdapter(fragments, getSupportFragmentManager()); mFragmentPagerAdapter = new FragmentViewAdapter(fragments, getSupportFragmentManager());
mViewBinding.fragmentContainer.setAdapter(mFragmentPagerAdapter); mViewBinding.fragmentContainer.setAdapter(mFragmentPagerAdapter);
mViewBinding.tabLayout.setupWithViewPager(mViewBinding.fragmentContainer); mViewBinding.tabLayout.setupWithViewPager(mViewBinding.fragmentContainer);
setupTabIcons(); initMenuBottomView();
}
private void initMenuBottomView() {
Observable.create(new ObservableOnSubscribe<View>() {
@Override
public void subscribe(ObservableEmitter<View> e) throws Exception {
e.onNext(getLayoutInflater().inflate(R.layout.item_menu_bottom, null));
e.onNext(getLayoutInflater().inflate(R.layout.item_menu_bottom, null));
e.onNext(getLayoutInflater().inflate(R.layout.item_menu_bottom, null));
}
}).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Consumer<View>() {
int i = 0;
@Override
public void accept(View view) throws Exception {
ItemMenuBottomBinding itemMenuBottomBinding = DataBindingUtil.bind(view);
itemMenuBottomBinding.text.setText(titleInts[i]);
if (i==0){
itemMenuBottomBinding.text.setTextColor(getResources().getColor(R.color.red_guanyu));
}
itemMenuBottomBinding.img.setImageResource(iconList[i]);
itemMenuBottomBindings.add(itemMenuBottomBinding);
mViewBinding.tabLayout.getTabAt(i).setCustomView(view);
i++;
}
});
mViewBinding.tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { mViewBinding.tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override @Override
public void onTabSelected(TabLayout.Tab tab) { public void onTabSelected(TabLayout.Tab tab) {
switch (tab.getPosition()) { switch (tab.getPosition()) {
case 0: case 0:
tab.setIcon(R.mipmap.icon_menu_cashier_1); itemMenuBottomBindings.get(0).img.setImageResource(R.mipmap.icon_menu_cashier_1);
itemMenuBottomBindings.get(0).text.setTextColor(getResources().getColor(R.color.red_guanyu));
break; break;
case 1: case 1:
tab.setIcon(R.mipmap.icon_menu_service_1); itemMenuBottomBindings.get(1).img.setImageResource(R.mipmap.icon_menu_service_1);
itemMenuBottomBindings.get(1).text.setTextColor(getResources().getColor(R.color.red_guanyu));
break; break;
case 2: case 2:
tab.setIcon(R.mipmap.icon_menu_myself_1); itemMenuBottomBindings.get(2).img.setImageResource(R.mipmap.icon_menu_myself_1);
itemMenuBottomBindings.get(2).text.setTextColor(getResources().getColor(R.color.red_guanyu));
break; break;
} }
} }
...@@ -60,13 +109,16 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin ...@@ -60,13 +109,16 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
public void onTabUnselected(TabLayout.Tab tab) { public void onTabUnselected(TabLayout.Tab tab) {
switch (tab.getPosition()) { switch (tab.getPosition()) {
case 0: case 0:
tab.setIcon(R.mipmap.icon_menu_cashier_0); itemMenuBottomBindings.get(0).img.setImageResource(R.mipmap.icon_menu_cashier_0);
itemMenuBottomBindings.get(0).text.setTextColor(getResources().getColor(R.color.black_likui));
break; break;
case 1: case 1:
tab.setIcon(R.mipmap.icon_menu_service_0); itemMenuBottomBindings.get(1).img.setImageResource(R.mipmap.icon_menu_service_0);
itemMenuBottomBindings.get(1).text.setTextColor(getResources().getColor(R.color.black_likui));
break; break;
case 2: case 2:
tab.setIcon(R.mipmap.icon_menu_myself_0); itemMenuBottomBindings.get(2).img.setImageResource(R.mipmap.icon_menu_myself_0);
itemMenuBottomBindings.get(2).text.setTextColor(getResources().getColor(R.color.black_likui));
break; break;
} }
} }
...@@ -80,13 +132,4 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin ...@@ -80,13 +132,4 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
} }
private void setupTabIcons() {
for (int i = 0; i < 3; i++) {
mViewBinding.tabLayout.getTabAt(i).setIcon(iconList[i]).setText(titleInts[i]);
}
}
} }
package com.xingdata.zzdpos.ui.main.adapter;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemMyselfStringBinding;
import com.xingdata.zzdpos.databinding.ItemStringBinding;
import java.util.List;
/**
* Created by Administrator on 2017/12/21.
*/
public class MySelfRecyclerAdapter extends BaseAdapter<Integer, ItemMyselfStringBinding> {
private Context mContext;
private Integer titleId;
private Integer imgId;
public MySelfRecyclerAdapter(Context mContext, @Nullable List<Integer> integers) {
super(R.layout.item_myself_string, integers);
this.mContext = mContext;
}
@Override
protected void convert(ItemMyselfStringBinding mViewBinding, Integer item) {
switch (item) {
case C.MENU.MENU_ANNOUNCEMENT:
titleId = R.string.menu_announcement;
imgId = R.mipmap.ic_announcement;
break;
case C.MENU.MENU_FEED:
titleId = R.string.menu_feed;
imgId = R.mipmap.ic_feedback;
break;
case C.MENU.MENU_UPDATE:
titleId = R.string.menu_update;
imgId = R.mipmap.ic_upgrade;
break;
case C.MENU.MENU_HELP:
titleId = R.string.menu_help;
imgId = R.mipmap.ic_helping;
break;
case C.MENU.MENU_EXIT:
titleId = R.string.menu_exit;
imgId = R.mipmap.ic_out;
break;
}
mViewBinding.itemTv.setText(titleId);
Drawable drawable=mContext.getDrawable(imgId);
drawable.setBounds(0,0,(int)mViewBinding.itemTv.getTextSize()+20,(int)mViewBinding.itemTv.getTextSize()+20);
Drawable drawableRight=mContext.getDrawable(R.mipmap.drop_down);
drawableRight.setBounds(0,0,(int)mViewBinding.itemTv.getTextSize(),(int)mViewBinding.itemTv.getTextSize());
mViewBinding.itemTv.setCompoundDrawables(drawable,null,drawableRight,null);
}
}
package com.xingdata.zzdpos.ui.main.fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import com.blankj.utilcode.util.ActivityUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentMyselfBinding;
import com.xingdata.zzdpos.ui.announcement.AnnouncementActivity;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.ui.main.adapter.MySelfRecyclerAdapter;
import java.util.ArrayList;
import java.util.List;
public class MyselfFragment extends BaseFragment<MainPresenter, FragmentMyselfBinding> {
private MySelfRecyclerAdapter mMySelfRecyclerAdapter;
private List<Integer> integers;
@Override
public int getLayoutId() {
return R.layout.fragment_myself;
}
@Override
public void initView() {
mViewBinding.fragmentMyselfRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
integers = new ArrayList<>();
integers.add(107);
integers.add(108);
integers.add(109);
integers.add(110);
integers.add(111);
mMySelfRecyclerAdapter = new MySelfRecyclerAdapter(getActivity(), integers);
mMySelfRecyclerAdapter.bindToRecyclerView(mViewBinding.fragmentMyselfRecycler);
// mViewBinding.fragmentCasherRecycler.addItemDecoration(new MyItemDecoration(getActivity(), 2, R.color.black_zhangfei));
mMySelfRecyclerAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
switch ((int) adapter.getData().get(position)) {
case C.MENU.MENU_ANNOUNCEMENT://公告
ActivityUtils.startActivity(getActivity(), AnnouncementActivity.class);
break;
case C.MENU.MENU_FEED://反馈
break;
case C.MENU.MENU_UPDATE://升级
break;
case C.MENU.MENU_HELP://帮助
break;
case C.MENU.MENU_EXIT://退出
break;
}
}
});
}
}
package com.xingdata.zzdpos.ui.main.fragment;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentServiceBinding;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.ui.main.adapter.MenuRecyclerAdapter;
import java.util.List;
public class ServiceFragment extends BaseFragment<MainPresenter,FragmentServiceBinding> {
private MenuRecyclerAdapter mMenuRecyclerAdapter;
private List<Integer> integers;
@Override
public int getLayoutId() {
return R.layout.fragment_service;
}
@Override
public void initView() {
}
}
package com.xingdata.zzdpos.ui.payment; package com.xingdata.zzdpos.ui.payment;
import android.content.Intent;
import com.blankj.utilcode.util.ActivityUtils;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity; import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityPaymentBinding; import com.xingdata.zzdpos.databinding.ActivityPaymentBinding;
import com.xingdata.zzdpos.ui.payment.fragment.PaymentFragment; import com.xingdata.zzdpos.ui.payment.fragment.PaymentFragment;
import com.xingdata.zzdpos.ui.settle.SettleActivity;
public class PaymentActivity extends BaseActivity<PaymentPresenter, ActivityPaymentBinding> implements PaymentContract.View { public class PaymentActivity extends BaseActivity<PaymentPresenter, ActivityPaymentBinding> implements PaymentContract.View {
...@@ -19,4 +24,12 @@ public class PaymentActivity extends BaseActivity<PaymentPresenter, ActivityPaym ...@@ -19,4 +24,12 @@ public class PaymentActivity extends BaseActivity<PaymentPresenter, ActivityPaym
loadRootFragment(R.id.f_payment, mPaymentFragment); loadRootFragment(R.id.f_payment, mPaymentFragment);
} }
@Override
public void showSettle(Long amt) {
Intent intent = new Intent(PaymentActivity.this, SettleActivity.class);
intent.putExtra(C.EXTRA_KEY.SETTLE_MODE, C.SETTLE_MODE.PAYMENT);
intent.putExtra(C.EXTRA_KEY.SETTLE_EXTRA, amt);
ActivityUtils.startActivity(intent);
}
} }
...@@ -7,9 +7,14 @@ import com.xingdata.zzdpos.base.BaseView; ...@@ -7,9 +7,14 @@ import com.xingdata.zzdpos.base.BaseView;
interface PaymentContract { interface PaymentContract {
interface View extends BaseView { interface View extends BaseView {
/**
* 显示结算页面
*/
void showSettle(Long amt);
} }
abstract class Presenter extends BasePresenter<PaymentContract.View> { abstract class Presenter extends BasePresenter<View> {
/** /**
* 收款界面 - 点击收款 * 收款界面 - 点击收款
* *
......
...@@ -8,6 +8,6 @@ public class PaymentPresenter extends PaymentContract.Presenter { ...@@ -8,6 +8,6 @@ public class PaymentPresenter extends PaymentContract.Presenter {
@Override @Override
public void clickSettle(Long amt) { public void clickSettle(Long amt) {
mView.showSettle(amt);
} }
} }
...@@ -9,7 +9,7 @@ import com.xingdata.zzdpos.util.ConvertUtil; ...@@ -9,7 +9,7 @@ import com.xingdata.zzdpos.util.ConvertUtil;
public class PaymentFragment extends BaseFragment<PaymentPresenter, FragmentPaymentBinding> { public class PaymentFragment extends BaseFragment<PaymentPresenter, FragmentPaymentBinding> {
private CalculatorView mCalculatorView = new CalculatorView(); private CalculatorView<PaymentPresenter> mCalculatorView = new CalculatorView<>();
@Override @Override
public int getLayoutId() { public int getLayoutId() {
...@@ -19,10 +19,9 @@ public class PaymentFragment extends BaseFragment<PaymentPresenter, FragmentPaym ...@@ -19,10 +19,9 @@ public class PaymentFragment extends BaseFragment<PaymentPresenter, FragmentPaym
@Override @Override
public void initView() { public void initView() {
loadRootFragment(R.id.f_inputer, mCalculatorView); loadRootFragment(R.id.f_inputer, mCalculatorView);
mCalculatorView.setOnResultChangeListener((exp, result) -> { mCalculatorView.setOnResultChangeListener((exp, result) -> {
mViewBinding.tvExp.setText(exp);
String strResult = ConvertUtil.fenToYuan(result); String strResult = ConvertUtil.fenToYuan(result);
mViewBinding.tvExp.setText(exp);
mViewBinding.tvResult.setText(strResult); mViewBinding.tvResult.setText(strResult);
mViewBinding.tvAmt.setText(strResult); mViewBinding.tvAmt.setText(strResult);
}); });
......
...@@ -7,15 +7,15 @@ import android.widget.TextView; ...@@ -7,15 +7,15 @@ import android.widget.TextView;
import com.blankj.utilcode.util.LogUtils; import com.blankj.utilcode.util.LogUtils;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment; import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.databinding.ViewCalculatorBinding; import com.xingdata.zzdpos.databinding.ViewCalculatorBinding;
import com.xingdata.zzdpos.ui.payment.PaymentPresenter;
import com.xingdata.zzdpos.util.ConvertUtil; import com.xingdata.zzdpos.util.ConvertUtil;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
public class CalculatorView extends BaseFragment<PaymentPresenter, ViewCalculatorBinding> { public class CalculatorView<P extends BasePresenter> extends BaseFragment<P, ViewCalculatorBinding> {
private String mExp; private String mExp;
private String mValue; private String mValue;
...@@ -123,7 +123,7 @@ public class CalculatorView extends BaseFragment<PaymentPresenter, ViewCalculato ...@@ -123,7 +123,7 @@ public class CalculatorView extends BaseFragment<PaymentPresenter, ViewCalculato
/** /**
* 解析计算四则运算表达式,例:2+((3+4)*2-22)/2*3 * 解析计算四则运算表达式
* *
* @param exp 算式 * @param exp 算式
* @return 结果 * @return 结果
......
package com.xingdata.zzdpos.ui.settle;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivitySettleBinding;
import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.settle.fragment.SettleFragment;
import java.util.List;
public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettleBinding> implements SettleContract.View {
private SettleFragment mSettleFragment = new SettleFragment();
@Override
public int getLayoutId() {
return R.layout.activity_settle;
}
@Override
public void initView() {
this.loadRootFragment(R.id.f_settle, mSettleFragment);
}
@Override
public void initSettleFragment(int settleMode) {
}
@Override
public void showSettleFragment() {
}
@Override
public void showVipFragment() {
}
@Override
public void loadVips(List<Vip> vips) {
}
@Override
public void loadVip(Vip vip) {
mSettleFragment.loadVip(vip);
}
@Override
public void showTicketFragment() {
}
@Override
public void loadTickets(List<Ticket> tickets) {
}
@Override
public void loadTicket(Ticket ticket) {
}
@Override
public void showPayFragment(int payChannel) {
}
}
package com.xingdata.zzdpos.ui.settle;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView;
import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.model.Vip;
import java.util.List;
public interface SettleContract {
interface View extends BaseView {
/**
* 初始化结算页面
*
* @param settleMode 结算模式
*/
void initSettleFragment(int settleMode);
/**
* 显示结算Fragment
*/
void showSettleFragment();
/**
* 显示会员Fragment
*/
void showVipFragment();
/**
* 加载会员列表
*
* @param vips 会员列表
*/
void loadVips(List<Vip> vips);
/**
* 加载会员信息
*
* @param vip 会员信息
*/
void loadVip(Vip vip);
/**
* 显示优惠券Fragment
*/
void showTicketFragment();
/**
* 加载优惠券列表
*
* @param tickets 优惠券列表
*/
void loadTickets(List<Ticket> tickets);
/**
* 加载优惠券信息
*
* @param ticket 优惠券信息
*/
void loadTicket(Ticket ticket);
/**
* 显示支付页面
*
* @param payChannel 支付渠道
*/
void showPayFragment(int payChannel);
}
abstract class Presenter extends BasePresenter<View> {
/**
* 结算页面 - 点击会员View
*/
public abstract void clickVipView();
/**
* 会员界面 - 查找会员
*
* @param keyword 搜索关键字
*/
public abstract void searchVip(String keyword);
/**
* 会员页面 - 选择会员
*
* @param vip 会员
*/
public abstract void selectVip(Vip vip);
/**
* 结算页面 - 点击优惠券View
*/
public abstract void clickTicketView();
/**
* 结算页面 - 查询优惠券
*/
public abstract void searchTicket(Long vipId);
/**
* 优惠券页面 - 选择优惠券
*
* @param ticket 使用的优惠券
*/
public abstract void selectTicket(Ticket ticket);
/**
* 结算页面 - 切换积分状态
*
* @param isUsePoint 是否使用积分
*/
public abstract void changePointState(boolean isUsePoint);
/**
* 点击支付渠道
*
* @param payChannel 支付渠道
*/
public abstract void clickPayChannelView(int payChannel);
/**
* 现金结算页面 - 现金支付
*
* @param inputAmt 输入金额
* @param changeAmt 找零金额
*/
public abstract void payInCash(Long inputAmt, Long changeAmt);
/**
* 支付宝结算页面 - 支付宝支付
*
* @param payCode 支付码
*/
public abstract void payInAli(String payCode);
/**
* 微信结算页面 - 微信支付
*
* @param payCode 支付码
*/
public abstract void payInWechat(String payCode);
/**
* 银行卡结算页面 - 银行卡支付
*/
public abstract void payInBank();
/**
* 储值卡结算页面 - 储值卡
*
* @param cardNo 卡号
* @param password 密码
*/
public abstract void payInCard(Long cardNo, String password);
/**
* 赊账结算页面 - 赊账
*/
public abstract void payInTally();
}
}
package com.xingdata.zzdpos.ui.settle;
import com.blankj.utilcode.util.LogUtils;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.model.Pay;
import com.xingdata.zzdpos.model.Saledetail;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.util.ArrayList;
import java.util.List;
public class SettlePresenter extends SettleContract.Presenter {
private Vip mVip;
/**
* 当前的营销活动列表
*/
private List<Ms> mMsList;
/**
* 当前设备的支付渠道信息
*/
private List<Pay> mPayChannels;
/**
* 当前购物车的商品明细
*/
private List<Saledetail> mCartProducts;
/**
* 当前订单信息
*/
private Saleorder mOrderInfo;
@Override
public void onAttached() {
int settleMode = getIntent().getIntExtra(C.EXTRA_KEY.SETTLE_MODE, -1);
switch (settleMode) {
case C.SETTLE_MODE.PAYMENT:
LogUtils.e("创建收款订单,订单金额" + ConvertUtil.fenToYuan(getIntent().getLongExtra(C.EXTRA_KEY.SETTLE_EXTRA, 0), true));
break;
}
}
@Override
public void clickVipView() {
mView.showVipFragment();
}
@Override
public void searchVip(String keyword) {
ApiFactory.User.queryUserDetailByKeyword(keyword)
.subscribe(
vip -> {
List<Vip> vips = new ArrayList<>();
vips.add(vip);
mView.loadVips(vips);
},
throwable -> {
});
}
@Override
public void selectVip(Vip vip) {
mView.showSettleFragment();
mView.loadVip(vip);
}
@Override
public void clickTicketView() {
mView.showTicketFragment();
}
@Override
public void searchTicket(Long vipId) {
ApiFactory.Ticket.query(vipId)
.subscribe(
tickets -> {
mView.loadTickets(tickets);
},
throwable -> {
});
}
@Override
public void selectTicket(Ticket ticket) {
mView.loadTicket(ticket);
}
@Override
public void changePointState(boolean isUsePoint) {
}
@Override
public void clickPayChannelView(int payChannel) {
mView.showPayFragment(payChannel);
}
@Override
public void payInCash(Long inputAmt, Long changeAmt) {
}
@Override
public void payInAli(String payCode) {
}
@Override
public void payInWechat(String payCode) {
}
@Override
public void payInBank() {
}
@Override
public void payInCard(Long cardNo, String password) {
}
@Override
public void payInTally() {
}
}
package com.xingdata.zzdpos.ui.settle.fragment;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentPayCashBinding;
import com.xingdata.zzdpos.ui.settle.SettlePresenter;
public class CashPayFragment extends BaseFragment<SettlePresenter, FragmentPayCashBinding> {
@Override
public int getLayoutId() {
return R.layout.fragment_pay_cash;
}
@Override
public void initView() {
}
}
package com.xingdata.zzdpos.ui.settle.fragment;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomSheetBehavior;
import android.view.View;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentSettleBinding;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.settle.SettlePresenter;
import com.xingdata.zzdpos.util.ConvertUtil;
public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettleBinding> {
@Override
public int getLayoutId() {
return R.layout.fragment_settle;
}
@Override
public void initView() {
mViewBinding.clVip.setOnClickListener(view -> mViewBinding.setDefualtVip(false));
mViewBinding.setDefualtVip(true);
mViewBinding.setName("张洋");
mViewBinding.setPhone("15201451212");
mViewBinding.setDisRate("8.5");
mViewBinding.tvSettle.setOnClickListener(view -> {
BottomSheetBehavior.from(mViewBinding.llSheet).setState(BottomSheetBehavior.STATE_EXPANDED);
});
BottomSheetBehavior.from(mViewBinding.llSheet).setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
@Override
public void onStateChanged(@NonNull View bottomSheet, int newState) {
if (newState == BottomSheetBehavior.STATE_EXPANDED) {
mViewBinding.tvSettle.setVisibility(View.GONE);
} else {
mViewBinding.tvSettle.setVisibility(View.VISIBLE);
}
}
@Override
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
}
});
}
/**
* 加载会员
*
* @param vip 会员信息
*/
public void loadVip(Vip vip) {
mViewBinding.setName(vip.getVipName());
mViewBinding.setPhone(ConvertUtil.longToString(vip.getVipMobile()));
if (vip.getVipDefDiscount() < 100 && vip.getVipDefDiscount() > 0) {
mViewBinding.setDisRate(String.valueOf((double) vip.getVipDefDiscount() / 10));
}
}
}
package com.xingdata.zzdpos.ui.settle.view;
import android.view.View;
import android.widget.TextView;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.databinding.ViewInputerBinding;
import com.xingdata.zzdpos.util.ConvertUtil;
public class InpterView<P extends BasePresenter> extends BaseFragment<P, ViewInputerBinding> {
private String mValue;
private OnResultChangeListener mOnResultChangeListener;
private onSettleClickListener mOnSettleClickListener;
public interface OnResultChangeListener {
void onResultChange(Long result);
}
public interface onSettleClickListener {
void onSettleClick(Long result);
}
@Override
public int getLayoutId() {
return R.layout.view_inputer;
}
@Override
public void initView() {
View.OnClickListener mOnClickListener = view -> {
switch (view.getId()) {
case R.id.tv_del:
delete();
break;
case R.id.tv_clear:
clear();
break;
case R.id.tv_settle:
settle();
break;
default:
if (view instanceof TextView) {
}
break;
}
if (mOnResultChangeListener != null) {
mOnResultChangeListener.onResultChange(ConvertUtil.yuanToFen(mValue));
}
};
mViewBinding.setOnClick(mOnClickListener);
}
/**
* 删除
*/
private void delete() {
if (mValue.length() > 0) mValue = mValue.substring(0, mValue.length() - 1);
}
/**
* 结账
*/
private void settle() {
if (mOnSettleClickListener != null) {
mOnSettleClickListener.onSettleClick(ConvertUtil.yuanToFen(mValue));
}
}
/**
* 清空
*/
private void clear() {
mValue = "";
if (mOnResultChangeListener != null) {
mOnResultChangeListener.onResultChange(ConvertUtil.yuanToFen(mValue));
}
}
public void setOnResultChangeListener(OnResultChangeListener onResultChangeListener) {
this.mOnResultChangeListener = onResultChangeListener;
mOnResultChangeListener.onResultChange(ConvertUtil.yuanToFen(mValue));
}
public void setOnSettleClickListener(onSettleClickListener onSettleClickListener) {
this.mOnSettleClickListener = onSettleClickListener;
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/settle_btn_radius" />
<solid android:color="@color/red_guanyu" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</layout>
\ No newline at end of file
...@@ -11,26 +11,39 @@ ...@@ -11,26 +11,39 @@
<android.support.design.widget.TabLayout <android.support.design.widget.TabLayout
android:id="@+id/tab_layout" android:id="@+id/tab_layout"
style="@style/Base.Widget.Design.TabLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/white_caocao" android:background="@color/white_caocao"
android:elevation="@dimen/view_line_L2"
android:gravity="center_vertical|center_horizontal" android:gravity="center_vertical|center_horizontal"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingTop="@dimen/all_padding"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:tabIndicatorHeight="0dp" app:tabGravity="fill"
app:tabTextAppearance="@android:style/TextAppearance.Holo.Small"> app:tabSelectedTextColor="@color/red_guanyu"
app:tabTextAppearance="@android:style/TextAppearance.Holo.Small"
app:tabTextColor="@color/black_likui">
</android.support.design.widget.TabLayout> </android.support.design.widget.TabLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L1"
android:background="@color/gray_zhouyu"
app:layout_constraintTop_toTopOf="@id/tab_layout" />
<android.support.v4.view.ViewPager <android.support.v4.view.ViewPager
android:id="@+id/fragment_container" android:id="@+id/fragment_container"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@id/tab_layout" app:layout_constraintBottom_toTopOf="@id/tab_layout"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0">
</android.support.v4.view.ViewPager> </android.support.v4.view.ViewPager>
......
<?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">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao">
<ImageButton
android:layout_width="@dimen/title_height"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"
android:contentDescription="@string/all_go_back"
android:gravity="center"
android:padding="@dimen/all_margin"
android:src="@mipmap/back_black" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/payment_title"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_gravity="bottom"
android:background="@color/gray_huanggai" />
</FrameLayout>
<FrameLayout
android:id="@+id/f_settle"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</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">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<TextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:gravity="center"
android:text="@string/announcement_meun"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srl_product"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="@dimen/all_margin"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title">
<android.support.v7.widget.RecyclerView
android:id="@+id/announcement_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
tools:context="com.example.administrator.tangkupos.CasherFragment"> tools:context="com.example.administrator.tangkupos.CasherFragment">
<!-- TODO: Update blank fragment layout --> <!-- TODO: Update blank fragment layout -->
...@@ -18,7 +19,7 @@ ...@@ -18,7 +19,7 @@
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:background="@color/black" android:background="@color/black_zhangfei"
android:gravity="center" android:gravity="center"
android:paddingTop="30dp" android:paddingTop="30dp"
android:weightSum="2" android:weightSum="2"
...@@ -50,6 +51,8 @@ ...@@ -50,6 +51,8 @@
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/fragment_casher_recycler" android:id="@+id/fragment_casher_recycler"
android:layout_marginTop="@dimen/all_padding"
android:layout_marginBottom="@dimen/all_padding"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:background="@color/gray_zhouyu" android:background="@color/gray_zhouyu"
......
...@@ -192,11 +192,12 @@ ...@@ -192,11 +192,12 @@
style="@style/button_positive" style="@style/button_positive"
android:layout_width="@dimen/create_store_btn_width" android:layout_width="@dimen/create_store_btn_width"
android:layout_height="@dimen/create_store_btn_height" android:layout_height="@dimen/create_store_btn_height"
android:layout_alignParentLeft="true" android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:onClick="@{onClickListener}" android:onClick="@{onClickListener}"
android:text="@string/login_createstorefragment_btn_last" android:text="@string/login_createstorefragment_btn_last"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/et_textsize"/> android:textSize="@dimen/et_textsize" />
<Button <Button
android:id="@+id/btn_next" android:id="@+id/btn_next"
......
<layout>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
tools:context="com.example.administrator.tangkupos.CasherFragment">
<!-- TODO: Update blank fragment layout -->
<android.support.constraint.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.38" />
<android.support.constraint.ConstraintLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@mipmap/bg_myself"
android:gravity="center"
android:paddingTop="30dp"
android:weightSum="2"
app:layout_constraintBottom_toBottomOf="@id/guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/user_img"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_margin="@dimen/all_margin"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:placeholderImage="@mipmap/img_head"
app:placeholderImageScaleType="centerInside"
app:roundAsCircle="true" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/padding_medium"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@mipmap/drop_down_fff"
app:layout_constraintStart_toEndOf="@id/user_img"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="李小乐"
android:textColor="@color/white_caocao"
android:textSize="@dimen/big_text_size" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_padding"
android:text="18710251009"
android:textColor="@color/white_caocao"
android:textSize="@dimen/small_text_size" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:orientation="horizontal"
android:paddingTop="@dimen/all_padding">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="北京市丰台区南四环西路186号"
android:textColor="@color/white_caocao"
android:textSize="@dimen/small_text_size" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_position" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/drop_down_fff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/all_margin"
android:src="@mipmap/drop_down_fff"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/fragment_myself_recycler"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/all_padding"
android:layout_marginTop="@dimen/all_padding"
android:background="@color/gray_zhouyu"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/guideline" />
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
...@@ -16,16 +16,18 @@ ...@@ -16,16 +16,18 @@
android:gravity="bottom" android:gravity="bottom"
android:paddingBottom="@dimen/all_margin"> android:paddingBottom="@dimen/all_margin">
<TextView <TextView
android:id="@+id/tv_exp" android:id="@+id/tv_exp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_spacing" android:layout_marginBottom="@dimen/all_spacing"
android:layout_marginEnd="@dimen/all_margin" android:layout_marginEnd="@dimen/all_margin"
android:gravity="end|center_vertical" android:gravity="end"
android:textColor="@color/white_caocao" android:textColor="@color/white_caocao"
android:textSize="@dimen/all_title_size" android:textSize="@dimen/all_title_size"
app:layout_constraintBottom_toTopOf="@id/tv_result" app:layout_constraintBottom_toTopOf="@id/tv_result"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" /> app:layout_constraintRight_toRightOf="parent" />
<TextView <TextView
...@@ -47,6 +49,7 @@ ...@@ -47,6 +49,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_margin" android:layout_marginEnd="@dimen/all_margin"
android:gravity="end|center_vertical" android:gravity="end|center_vertical"
android:maxLines="1"
android:textColor="@color/white_caocao" android:textColor="@color/white_caocao"
android:textSize="@dimen/fragment_settle_bigtextsize" android:textSize="@dimen/fragment_settle_bigtextsize"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
......
<layout>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
tools:context="com.example.administrator.tangkupos.CasherFragment">
<!-- TODO: Update blank fragment layout -->
<android.support.constraint.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.38" />
<TextView
android:id="@+id/tool_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:elevation="@dimen/view_line_L1"
android:gravity="center"
android:minHeight="?attr/actionBarSize"
android:padding="0dp"
android:text="@string/menu_service"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/big_text_size"
app:layout_constraintTop_toTopOf="parent">
</TextView>
<ScrollView
android:layout_width="0dp"
android:layout_height="0dp"
android:scrollbars="none"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tool_bar">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@mipmap/bg_service"
/>
</ScrollView>
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
/>
</LinearLayout>
</layout>
<?xml version="1.0" encoding="utf-8"?>
<layout>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dp">
<TextView
android:id="@+id/item_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginBottom="@dimen/all_padding"
android:background="@color/white_caocao"
android:drawablePadding="@dimen/all_padding"
android:elevation="@dimen/view_line_L050"
android:gravity="left"
android:padding="@dimen/vicescreen_shoppingcart_pandding"
android:singleLine="true"
android:textColor="@color/black"
android:textSize="@dimen/all_text_size" />
</FrameLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" > android:layout_height="wrap_content" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView <TextView
android:id="@+id/item_tv" android:id="@+id/item_tv"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -20,6 +17,5 @@ ...@@ -20,6 +17,5 @@
android:textSize="14sp" /> android:textSize="14sp" />
</RelativeLayout> </RelativeLayout>
</layout>
</RelativeLayout> \ No newline at end of file
\ No newline at end of file
This diff is collapsed.
...@@ -10,22 +10,23 @@ ...@@ -10,22 +10,23 @@
<dimen name="all_sub_title_size">20sp</dimen> <dimen name="all_sub_title_size">20sp</dimen>
<dimen name="all_text_size">16sp</dimen> <dimen name="all_text_size">16sp</dimen>
<dimen name="all_text_size_small">12sp</dimen> <dimen name="all_text_size_small">12sp</dimen>
<dimen name="all_caption_size">12sp</dimen>
<dimen name="all_title_size">26sp</dimen> <dimen name="all_title_size">26sp</dimen>
<dimen name="all_padding">10dp</dimen> <dimen name="all_padding">10dp</dimen>
<dimen name="all_text_size_big">22sp</dimen> <dimen name="all_text_size_big">22sp</dimen>
<dimen name="all_text_size_super_big">25sp</dimen> <dimen name="all_text_size_super_big">25sp</dimen>
<dimen name="all_margin_left">15dp</dimen> <dimen name="all_margin_left">15dp</dimen>
<dimen name="title_height">65dp</dimen> <dimen name="title_height">50dp</dimen>
<dimen name="small_text_size">13sp</dimen> <dimen name="small_text_size">13sp</dimen>
<dimen name="big_text_size">18sp</dimen> <dimen name="big_text_size">18sp</dimen>
<dimen name="sbig_text_size">25sp</dimen> <dimen name="sbig_text_size">25sp</dimen>
<integer name="all_top_weight">2</integer> <integer name="all_top_weight">2</integer>
<integer name="all_content_weight">25</integer> <integer name="all_content_weight">25</integer>
<!--RADIUS--> <!--RADIUS-->
<!--RADIUS-->
<dimen name="card_radius_medium">14dp</dimen> <dimen name="card_radius_medium">14dp</dimen>
<!--PADDING--> <!--PADDING-->
<dimen name="padding_big">24dp</dimen> <dimen name="padding_big">24dp</dimen>
<dimen name="padding_medium">16dp</dimen>
<!--EditText 边框粗细--> <!--EditText 边框粗细-->
<dimen name="edit_border">0.5dp</dimen> <dimen name="edit_border">0.5dp</dimen>
<!--一级标题--> <!--一级标题-->
...@@ -131,6 +132,7 @@ ...@@ -131,6 +132,7 @@
<dimen name="vicescreen_shoppingcart_pandding">10dp</dimen> <dimen name="vicescreen_shoppingcart_pandding">10dp</dimen>
<dimen name="view_line_L1">1dp</dimen> <dimen name="view_line_L1">1dp</dimen>
<dimen name="view_line_L2">2dp</dimen>
<dimen name="view_line_L050">0.5dp</dimen> <dimen name="view_line_L050">0.5dp</dimen>
<dimen name="view_line_L5">5dp</dimen> <dimen name="view_line_L5">5dp</dimen>
<dimen name="view_line_height">0.5dp</dimen> <dimen name="view_line_height">0.5dp</dimen>
...@@ -179,4 +181,11 @@ ...@@ -179,4 +181,11 @@
<dimen name="editor_item_height">60dp</dimen> <dimen name="editor_item_height">60dp</dimen>
<!--结算-->
<dimen name="settle_vip_head">40dp</dimen>
<dimen name="settle_vip_level">16dp</dimen>
<dimen name="settle_btn_radius">24dp</dimen>
</resources> </resources>
...@@ -155,9 +155,6 @@ ...@@ -155,9 +155,6 @@
<string name="card_num">卡号:</string> <string name="card_num">卡号:</string>
<string name="card_num_hint">请输入储值卡卡号</string> <string name="card_num_hint">请输入储值卡卡号</string>
<!--结算页面 <WHERE>_<DESCRIPTION>--> <!--结算页面 <WHERE>_<DESCRIPTION>-->
<string name="settle_title">结算页面</string>
<string name="settle_amt">应收:</string>
<string name="settle_channel_hint">请选择支付方式</string> <string name="settle_channel_hint">请选择支付方式</string>
<string name="settle_channel_cash">现金</string> <string name="settle_channel_cash">现金</string>
<string name="settle_channel_cash_not_enough">金额不足,无法支付</string> <string name="settle_channel_cash_not_enough">金额不足,无法支付</string>
...@@ -469,6 +466,11 @@ ...@@ -469,6 +466,11 @@
<string name="menu_ticket">发券</string> <string name="menu_ticket">发券</string>
<string name="menu_statistics">统计</string> <string name="menu_statistics">统计</string>
<string name="menu_manager">管理</string> <string name="menu_manager">管理</string>
<string name="menu_announcement">公告通知</string>
<string name="menu_feed">反馈</string>
<string name="menu_update">升级</string>
<string name="menu_help">帮助</string>
<string name="menu_exit">退出</string>
<!--输入器--> <!--输入器-->
<string name="inputer_1">1</string> <string name="inputer_1">1</string>
<string name="inputer_2">2</string> <string name="inputer_2">2</string>
...@@ -493,5 +495,13 @@ ...@@ -493,5 +495,13 @@
<string name="payment_title">收款</string> <string name="payment_title">收款</string>
<string name="payment_total">总计:</string> <string name="payment_total">总计:</string>
<!--支付-->
<string name="settle_title">收款</string>
<string name="settle_amt">应收:</string>
<string name="settle_select_vip">请选择会员</string>
<string name="settle_vip_dis_rate_hint">折扣:</string>
<string name="settle_vip_dis_rate"></string>
<string name="settle_btn_expand">收款</string>
</resources> </resources>
...@@ -313,6 +313,11 @@ ...@@ -313,6 +313,11 @@
<item name="android:textSize">@dimen/et_textsize</item> <item name="android:textSize">@dimen/et_textsize</item>
<item name="android:textColorHint">@color/hint</item> <item name="android:textColorHint">@color/hint</item>
</style> </style>
<style name="Base.Widget.Design.TabLayout" parent="android:Widget">
<item name="tabBackground">@color/white_caocao</item>
<item name="tabIndicatorColor">#FFF</item>
<item name="tabIndicatorHeight">0dp</item>
</style>
<style name="button" parent="view_base"> <style name="button" parent="view_base">
<item name=" android:background">@drawable/red_border</item> <item name=" android:background">@drawable/red_border</item>
......
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