Commit 01e6c297 authored by zhang_z's avatar zhang_z

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	app/src/main/java/com/xingdata/zzdpos/util/SystemUtil.java
parents c07e5af8 f0f0142e
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xingdata.zzdpos"> package="com.xingdata.zzdpos">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.SEND_SMS" /> <uses-permission android:name="android.permission.SEND_SMS"/>
<application <application
android:name=".App" android:name=".App"
...@@ -20,42 +20,55 @@ ...@@ -20,42 +20,55 @@
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
android:name=".ui.splash.SplashActivity" android:name=".ui.splash.SplashActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden" android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity> </activity>
<activity <activity
android:name=".ui.login.LoginActivity" android:name=".ui.login.LoginActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden" android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" /> android:windowSoftInputMode="adjustUnspecified|stateHidden"/>
<activity <activity
android:name=".ui.exception.ErrorDialogActivity" android:name=".ui.exception.ErrorDialogActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden" android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:theme="@style/Theme.AppCompat.Light.Dialog" /> android:theme="@style/Theme.AppCompat.Light.Dialog"/>
<activity <activity
android:name=".ui.exception.ServerErrActivity" android:name=".ui.exception.ServerErrActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden" android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:theme="@style/Theme.AppCompat.Light.Dialog" /> android:theme="@style/Theme.AppCompat.Light.Dialog"/>
<activity <activity
android:name=".ui.payment.PaymentActivity" android:name=".ui.payment.PaymentActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden" android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden"> android:windowSoftInputMode="adjustUnspecified|stateHidden"/>
<activity
<intent-filter> android:name=".ui.marketing.integral.IntegralActivity"
<action android:name="android.intent.action.MAIN" /> android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:theme="@style/AppTheme"
<category android:name="android.intent.category.LAUNCHER" /> android:windowSoftInputMode="adjustUnspecified|stateHidden"/>
</intent-filter> <activity
</activity> android:name=".ui.marketing.ticket.ReturnTicketActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:label="@string/title_activity_ticket"
android:theme="@style/AppTheme"/>
<activity <activity
android:name=".ui.settle.SettleActivity" android:name=".ui.settle.SettleActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden" android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden"/>
<activity
android:name=".ui.announcement.AnnouncementActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"
android:theme="@style/AppTheme"
android:windowSoftInputMode="adjustUnspecified|stateHidden" /> android:windowSoftInputMode="adjustUnspecified|stateHidden" />
</application> </application>
......
package com.xingdata.zzdpos.ui.announcement; package com.xingdata.zzdpos.ui.announcement;
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.ActivityAnnouncementBinding; import com.xingdata.zzdpos.databinding.ActivityAnnouncementBinding;
import com.xingdata.zzdpos.model.Notice;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.ui.announcement.fragment.AnnouncementFragment; import com.xingdata.zzdpos.ui.announcement.fragment.AnnouncementFragment;
...@@ -21,23 +22,16 @@ public class AnnouncementActivity extends BaseActivity<AnnouncementPresenter, Ac ...@@ -21,23 +22,16 @@ public class AnnouncementActivity extends BaseActivity<AnnouncementPresenter, Ac
@Override @Override
public void initView() { public void initView() {
// mViewBinding.imgBack.setOnClickListener(view -> { loadRootFragment(R.id.fragment_container, mAnnouncementFragment, false, false);
// finish();
// });
// loadRootFragment(R.id.f_right, mAnnouncementDetailFragment, false, false);
// loadRootFragment(R.id.f_left, mAnnouncementTitleFragment, false, false);
} }
//
//
// @Override // @Override
// public void showAnnouncementDetail(Notice s) { // public void showAnnouncementDetail(Notice s) {
// mAnnouncementDetailFragment.showAnnouncementDetail(s); // mAnnouncementDetailFragment.showAnnouncementDetail(s);
// } // }
//
// @Override @Override
// public void loadNotice(Pager<Notice> noticePager, boolean isRefresh) { public void loadNotice(Pager<Notice> noticePager, boolean isRefresh) {
// mAnnouncementTitleFragment.setData(noticePager, isRefresh); mAnnouncementFragment.setData(noticePager, isRefresh);
// } }
} }
...@@ -3,35 +3,30 @@ package com.xingdata.zzdpos.ui.announcement; ...@@ -3,35 +3,30 @@ package com.xingdata.zzdpos.ui.announcement;
import com.xingdata.zzdpos.base.BasePresenter; import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView; import com.xingdata.zzdpos.base.BaseView;
import com.xingdata.zzdpos.model.Notice;
import com.xingdata.zzdpos.model.Pager;
public interface AnnouncementContract { public interface AnnouncementContract {
interface View extends BaseView { interface View extends BaseView {
// /**
// /** * 加载列表
// * 显示公告内容 */
// */ void loadNotice(Pager<Notice> noticePager, boolean isRefresh);
// void showAnnouncementDetail(Notice s);
// /**
// * 加载列表
// */
// void loadNotice(Pager<Notice> noticePager, boolean isRefresh);
} }
abstract class Presenter extends BasePresenter<View> { abstract class Presenter extends BasePresenter<View> {
// /** /**
// * 初始化查询公告列表 * 初始化查询公告列表
// * */
// */ abstract void queryNoticeList();
// abstract void queryNoticeList();
// public abstract void refreshAnnouncement();
// /**
// * 点击公告标题 public abstract void loadMoreAnnouncement();
// */
// abstract void clickTitleItem(Notice notice);
} }
} }
package com.xingdata.zzdpos.ui.announcement; package com.xingdata.zzdpos.ui.announcement;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.api.ApiFactory;
public class AnnouncementPresenter extends AnnouncementContract.Presenter { public class AnnouncementPresenter extends AnnouncementContract.Presenter {
private int nowPageNumber = 1; private int nowPageNumber = 1;
private int nowPageSize = 10; private int nowPageSize = 10;
...@@ -8,26 +11,34 @@ public class AnnouncementPresenter extends AnnouncementContract.Presenter { ...@@ -8,26 +11,34 @@ public class AnnouncementPresenter extends AnnouncementContract.Presenter {
@Override @Override
public void onAttached() { public void onAttached() {
} }
//
// @Override @Override
// public void queryNoticeList() { public void queryNoticeList() {
// ApiFactory.Notice.queryNotice(nowPageNumber, nowPageSize).doFinally(() -> { ApiFactory.Notice.queryNotice(nowPageNumber, nowPageSize).doFinally(() -> {
//// mView.isShowLoading(false); // mView.isShowLoading(false);
// }) })
// .subscribe(noticePager -> { .subscribe(noticePager -> {
// if (noticePager.getTotalRow() == 0) { if (noticePager.getTotalRow() == 0) {
// ToastUtils.showShort("抱歉,暂无公告"); ToastUtils.showShort("抱歉,暂无公告");
// } }
// //判断是否能加载更多 //判断是否能加载更多
// mView.loadNotice(noticePager, nowPageNumber == 1); mView.loadNotice(noticePager, nowPageNumber == 1);
// }, throwable -> { }, throwable -> {
// ToastUtils.showShort(throwable.getMessage()); ToastUtils.showShort(throwable.getMessage());
// }); });
// } }
//
// @Override @Override
// public void clickTitleItem(Notice s) { public void refreshAnnouncement() {
// mView.showAnnouncementDetail(s); this.nowPageNumber = 1;
// } queryNoticeList();
//} }
@Override
public void loadMoreAnnouncement() {
this.nowPageNumber++;
queryNoticeList();
}
} }
\ No newline at end of file
//package com.xingdata.zzdpos.ui.announcement.adapter; package com.xingdata.zzdpos.ui.announcement.adapter;
//
//
//import android.support.annotation.Nullable; import android.support.annotation.Nullable;
//import android.view.View; import android.view.View;
//import android.view.ViewGroup; import android.view.ViewGroup;
//
//import com.blankj.utilcode.util.TimeUtils; import com.blankj.utilcode.util.TimeUtils;
//import com.xingdata.zzdhd.R; import com.xingdata.zzdpos.R;
//import com.xingdata.zzdhd.base.BaseAdapter;
//import com.xingdata.zzdhd.base.BaseViewHolder; import com.xingdata.zzdpos.base.BaseAdapter;
//import com.xingdata.zzdhd.databinding.ItemAnnouncementBinding; import com.xingdata.zzdpos.databinding.ItemAnnouncementDetailBinding;
//import com.xingdata.zzdhd.model.Notice; import com.xingdata.zzdpos.model.Notice;
//
//import java.util.List; import java.util.List;
//
//public class AnnouncementAdapter extends BaseAdapter<Notice, ItemAnnouncementBinding> { public class AnnouncementAdapter extends BaseAdapter<Notice, ItemAnnouncementDetailBinding> {
// public Integer isClickPos =0;
//
// public AnnouncementAdapter(@Nullable List<Notice> data) { public AnnouncementAdapter(@Nullable List<Notice> data) {
// super(R.layout.item_announcement, data); super(R.layout.item_announcement_detail, data);
//
// } }
//
// @Override
// protected void convert(BaseViewHolder helper, Notice item) { @Override
// if (helper.getAdapterPosition()==isClickPos){ protected void convert(ItemAnnouncementDetailBinding mViewBinding, Notice item) {
// helper.getConvertView().findViewById(R.id.line_is_clicked).setVisibility(View.VISIBLE); mViewBinding.date.setText(TimeUtils.millis2String(item.getCreateTime()));
// } mViewBinding.title.setText(item.getNoticeTitle());
// mViewBinding.body.setText(item.getNoticeDesc());
// super.convert(helper, item);
// } }
//
// @Override
// protected void convert(ItemAnnouncementBinding mViewBinding, Notice item) { @Override
// mViewBinding.tvTitle.setText(item.getNoticeTitle()); protected View getItemView(int layoutResId, ViewGroup parent) {
// mViewBinding.tvDate.setText(TimeUtils.millis2String(item.getCreateTime())); return super.getItemView(layoutResId, parent);
// } }
//
//
// @Override }
// protected View getItemView(int layoutResId, ViewGroup parent) {
// return super.getItemView(layoutResId, parent);
// }
//
//
//}
package com.xingdata.zzdpos.ui.announcement.fragment; package com.xingdata.zzdpos.ui.announcement.fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
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.databinding.FragmentAnnouncementBinding; import com.xingdata.zzdpos.databinding.FragmentAnnouncementBinding;
import com.xingdata.zzdpos.model.Notice;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.ui.announcement.AnnouncementPresenter; import com.xingdata.zzdpos.ui.announcement.AnnouncementPresenter;
import com.xingdata.zzdpos.ui.announcement.adapter.AnnouncementAdapter;
import java.util.ArrayList;
public class AnnouncementFragment extends BaseFragment<AnnouncementPresenter, FragmentAnnouncementBinding> { public class AnnouncementFragment extends BaseFragment<AnnouncementPresenter, FragmentAnnouncementBinding> {
// private AnnouncementAdapter announcementAdapter; private AnnouncementAdapter announcementAdapter;
@Override @Override
public int getLayoutId() { public int getLayoutId() {
...@@ -22,55 +30,48 @@ public class AnnouncementFragment extends BaseFragment<AnnouncementPresenter, Fr ...@@ -22,55 +30,48 @@ public class AnnouncementFragment extends BaseFragment<AnnouncementPresenter, Fr
@Override @Override
public void initView() { public void initView() {
//
// initRecycler(); initRecycler();
// mPresenter.queryNoticeList(); mPresenter.queryNoticeList();
}
private void initRecycler() {
mViewBinding.announcementRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
announcementAdapter = new AnnouncementAdapter(new ArrayList<>());
announcementAdapter.bindToRecyclerView(mViewBinding.announcementRecycler);
mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh);
announcementAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.announcementRecycler);
} }
private void onRefresh() {
mPresenter.refreshAnnouncement();
}
private void onLoadMore() {
mPresenter.loadMoreAnnouncement();
}
/**
* 设置数据
*
* @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();
}
// 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));
// }
// }
//
} }
...@@ -22,6 +22,7 @@ import com.xingdata.zzdpos.ui.login.fragment.SignInFragment; ...@@ -22,6 +22,7 @@ import com.xingdata.zzdpos.ui.login.fragment.SignInFragment;
import com.xingdata.zzdpos.ui.login.fragment.bean.LoginReturnBean; import com.xingdata.zzdpos.ui.login.fragment.bean.LoginReturnBean;
import com.xingdata.zzdpos.ui.login.fragment.bean.StoreAddressJsonBean; import com.xingdata.zzdpos.ui.login.fragment.bean.StoreAddressJsonBean;
import com.xingdata.zzdpos.ui.login.fragment.bean.StoreTypeJsonBean; import com.xingdata.zzdpos.ui.login.fragment.bean.StoreTypeJsonBean;
import com.xingdata.zzdpos.ui.marketing.integral.IntegralActivity;
import com.xingdata.zzdpos.ui.splash.SplashActivity; import com.xingdata.zzdpos.ui.splash.SplashActivity;
import com.xingdata.zzdpos.view.PopupWindowDownList; import com.xingdata.zzdpos.view.PopupWindowDownList;
......
package com.xingdata.zzdpos.ui.marketing.integral;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.widget.TextView;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityIntegralBinding;
import com.xingdata.zzdpos.model.Category;
import com.xingdata.zzdpos.model.Gbound;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Ubound;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.dialog.PromptDialog;
import com.xingdata.zzdpos.ui.marketing.integral.adapter.IntegralAdapter;
import com.xingdata.zzdpos.ui.marketing.integral.adapter.IntegralExchangeAdapter;
import com.xingdata.zzdpos.ui.marketing.integral.dialog.IntegralExchangeDialog;
import com.xingdata.zzdpos.ui.marketing.integral.dialog.IntegralGetDialog;
import com.xingdata.zzdpos.util.OnClickListener;
import java.util.ArrayList;
import java.util.List;
public class IntegralActivity extends BaseActivity<IntegralPresenter, ActivityIntegralBinding>
implements IntegralContract.View {
IntegralGetDialog integralGetDialog;
IntegralAdapter integralAdapter;
IntegralExchangeAdapter integralExchangeAdapter;
private Boolean isLoadMore = false;
public static final int NORMAL_TYPE = 1;
public static final int LOADMORE_TYPE = 2;
public static final int REFRESH_TYPE = 3;
LoadingDialog loadingDialog = new LoadingDialog();
private long mExitTime;//控制快速点击
@Override
public int getLayoutId() {
return R.layout.activity_integral;
}
@Override
public void initView() {
integralAdapter = new IntegralAdapter(R.layout.item_integral, new ArrayList<>());
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mViewBinding.rvMessage.setLayoutManager(linearLayoutManager);
mViewBinding.rvMessage.setAdapter(integralAdapter);
List<Ubound> list = new ArrayList<>();
Ubound ubound = new Ubound();
ubound.setBoundValAmt(1000l);
ubound.setBoundUseStatus((byte) 0);
ubound.setBoundOrderAmt(10l);
ubound.setBoundUseNum(10000l);
list.add(ubound);
integralExchangeAdapter = new IntegralExchangeAdapter(R.layout.item_integral, list);
LinearLayoutManager linearLayoutManager1 = new LinearLayoutManager(this);
linearLayoutManager1.setOrientation(LinearLayoutManager.VERTICAL);
mViewBinding.rvExchangeMessage.setLayoutManager(linearLayoutManager1);
mViewBinding.rvExchangeMessage.setAdapter(integralExchangeAdapter);
mViewBinding.icTitle.tvTitle.setText("积分规则");
mViewBinding.icTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
ActivityUtils.finishActivity(IntegralActivity.class);
}
});
mViewBinding.setOnClickListener(v -> {
switch (v.getId()) {
case R.id.btn_add: {
integralGetDialog = new IntegralGetDialog();
integralGetDialog.setNowType(1);
integralGetDialog.show(IntegralActivity.this);
}
break;
case R.id.rb_get: {
mViewBinding.rbGet.getPaint().setFakeBoldText(true);
mViewBinding.rbExchange.getPaint().setFakeBoldText(false);
showView(v.getId());
mPresenter.query(1, NORMAL_TYPE, null);
}
break;
case R.id.rb_exchange: {
mViewBinding.rbGet.getPaint().setFakeBoldText(false);
mViewBinding.rbExchange.getPaint().setFakeBoldText(true);
showView(v.getId());
LoadingDialog loadingDialog = new LoadingDialog();
loadingDialog.show(this);
mPresenter.exchangeQuery(loadingDialog);
}
break;
default: {
}
break;
}
});
//set Presenter listener
mViewBinding.srlProduct.setOnRefreshListener(this::refreshProduct);
integralAdapter.setOnLoadMoreListener(this::loadMoreProduct, mViewBinding.rvMessage);
integralAdapter.setOnItemClickListener((adapter, view, position) -> clickProduct
(integralAdapter.getData().get(position)));
integralExchangeAdapter.setOnItemClickListener((adapter, view, position) ->
exchangeClickProduct(integralExchangeAdapter.getData().get(position)));
mPresenter.query(1, NORMAL_TYPE, null);
}
@Override
public void initComplete(List<Category> list, int nowCategory) {
if (list.size() <= 0) {
return;
}
integralGetDialog.setCategoryDate(list, nowCategory);
}
@Override
public void error(String errMsg, LoadingDialog loadingDialog) {
if (loadingDialog != null) {
loadingDialog.dismiss();
}
PromptDialog PromptDialog = new PromptDialog();
PromptDialog.show((BaseActivity) mContext);
PromptDialog.setDialogType(com.xingdata.zzdpos.ui.dialog.PromptDialog.PROMPTDIALOG_ERROR,
errMsg).setCustomButton
("关闭", new View.OnClickListener() {
@Override
public void onClick(View view) {
PromptDialog.dismiss();
}
});
LogUtils.e(errMsg);
ToastUtils.showLong(errMsg);
}
@Override
public void querySucc(@Nullable Pager<Gbound> pager, Boolean isLoadMore, int queryType,
LoadingDialog loadingDialog) {
if (loadingDialog != null) {
loadingDialog.dismiss();
}
this.isLoadMore = isLoadMore;
if (pager == null || pager.getList() == null || pager.getList().size() <= 0) {
integralAdapter.setEmptyView(getEmptyView("没有规则"));
}
if (pager.getList() != null) {
switch (queryType) {
case NORMAL_TYPE: {
//正常请求
integralAdapter.setNewData(pager.getList());
}
break;
case LOADMORE_TYPE: {
//加载更多
integralAdapter.addData(pager.getList());
}
break;
case REFRESH_TYPE: {
//刷新请求
integralAdapter.setNewData(pager.getList());
}
break;
}
}
integralAdapter.setEnableLoadMore(false);
mViewBinding.srlProduct.setRefreshing(false);
}
@Override
public void addSucc(LoadingDialog loadingDialog) {
mPresenter.query(1, NORMAL_TYPE, loadingDialog);
}
@Override
public void updateSucc(LoadingDialog loadingDialog) {
mPresenter.query(1, NORMAL_TYPE, loadingDialog);
}
@Override
public void exchangeQuerySucc(Pager<Ubound> uboundPager, LoadingDialog loadingDialog) {
if (loadingDialog != null) {
loadingDialog.dismiss();
}
if (uboundPager != null && uboundPager.getList() != null) {
// if (uboundPager.getList().size() <= 0) {
// Ubound ubound = new Ubound();
// ubound.setBoundValAmt(1000l);
// ubound.setBoundUseStatus((byte) 0);
// ubound.setBoundOrderAmt(9900l);
// ubound.setBoundUseNum(10L);
// uboundPager.getList().add(ubound);
// }
integralExchangeAdapter.setNewData(uboundPager.getList());
}
}
@Override
public void exchangeUpdateSucc(Ubound ubound, LoadingDialog loadingDialog) {
mPresenter.exchangeQuery(loadingDialog);
}
/**
* 刷新商品
*/
private void refreshProduct() {
integralAdapter.setEnableLoadMore(false);
mPresenter.query(1, REFRESH_TYPE, null);
}
/**
* 加载更多商品
*/
private void loadMoreProduct() {
mViewBinding.srlProduct.setRefreshing(false);
if (isLoadMore) {
mPresenter.query(-1, LOADMORE_TYPE, null);
}
}
/**
* 积分获取页面点击item
*/
private void clickProduct(Gbound gbound) {
if ((System.currentTimeMillis() - mExitTime) > 1000) {
integralGetDialog = new IntegralGetDialog();
loadingDialog.show(this);
integralGetDialog.setData(gbound, loadingDialog);
integralGetDialog.show(this);
mExitTime = System.currentTimeMillis();
} else {
ToastUtils.showLong("您操作太快了");
}
}
/**
* 积分兑换页面点击item
*/
private void exchangeClickProduct(Ubound gbound) {
if ((System.currentTimeMillis() - mExitTime) > 1000) {
IntegralExchangeDialog integralExchangeDialog = new IntegralExchangeDialog();
integralExchangeDialog.setData(gbound);
integralExchangeDialog.show(this);
mExitTime = System.currentTimeMillis();
} else {
ToastUtils.showLong("您操作太快了");
}
}
private View getEmptyView(String str) {
View view = getLayoutInflater().inflate(R.layout.view_empty, null);
((TextView) view.findViewById(R.id.tv_empty)).setText(str);
return view;
}
private void showView(int id) {
switch (id) {
case R.id.rb_get: {
mViewBinding.llGet.setVisibility(View.VISIBLE);
mViewBinding.llExchange.setVisibility(View.GONE);
}
break;
case R.id.rb_exchange: {
mViewBinding.llGet.setVisibility(View.GONE);
mViewBinding.llExchange.setVisibility(View.VISIBLE);
}
break;
}
}
}
package com.xingdata.zzdpos.ui.marketing.integral;
import android.support.annotation.Nullable;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView;
import com.xingdata.zzdpos.model.Category;
import com.xingdata.zzdpos.model.Gbound;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Ubound;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import java.util.List;
/**
* Created by Administrator on 2017/11/23.
*/
public interface IntegralContract {
interface View extends BaseView {
void initComplete(List<Category> list, int nowCategory);
void error(String errMsg, LoadingDialog loadingDialog);
void querySucc(Pager<Gbound> pager, Boolean isLoadMore, int queryType, LoadingDialog
loadingDialog);
void addSucc(LoadingDialog loadingDialog);
void updateSucc(LoadingDialog loadingDialog);
void exchangeQuerySucc(Pager<Ubound> uboundPager, LoadingDialog loadingDialog);
void exchangeUpdateSucc(Ubound ubound, LoadingDialog loadingDialog);
}
abstract class Presenter extends BasePresenter<View> {
abstract void initData(Category category, int nowCategory);
abstract void query(int pageNumber, int queryType, LoadingDialog loadingDialog);
abstract void add(@Nullable Gbound gbound, LoadingDialog loadingDialog);
abstract void update(@Nullable Gbound gbound, LoadingDialog loadingDialog);
abstract void exchangeQuery(LoadingDialog loadingDialog);
abstract void exchangeUpdate(@Nullable Ubound ubound, LoadingDialog loadingDialog);
}
}
package com.xingdata.zzdpos.ui.marketing.integral;
import android.support.annotation.Nullable;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.model.Category;
import com.xingdata.zzdpos.model.Gbound;
import com.xingdata.zzdpos.model.Ubound;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import java.util.List;
import io.reactivex.functions.Function;
/**
* Created by Administrator on 2017/11/23.
*/
public class IntegralPresenter extends IntegralContract.Presenter {
private int number = 1;
@Override
public void onAttached() {
}
@Override
public void initData(Category category, int nowCategory) {
ApiFactory.Shop.queryAll(category)
.map(new Function<List<Category>, List<Category>>() {
@Override
public List<Category> apply(List<Category> categoryOnes) throws
Exception {
for (Category categoryOne : categoryOnes) {
categoryOne.setNowCategory(nowCategory);
}
return categoryOnes;
}
}).subscribe(s -> {
mView.initComplete(s, nowCategory);
}, throwable -> {
mView.error(throwable.getMessage(), null);
});
}
/**
* @param pageNumber 页码 >0则使用,<0则使用默认页码number
* @param queryType 请求类型,0:正常请求;1:加载更多请求;2刷新请求
*/
@Override
public void query(int pageNumber, int queryType, LoadingDialog loadingDialog) {
if (pageNumber > 0) {
this.number = pageNumber;
}
ApiFactory.Gbounds.query(C.PRODUCT.PAGE_SIZE, number).subscribe(querySucc -> {
Boolean isLoadMore = false;
if (!querySucc.isLastPage()) {
this.number++;
isLoadMore = true;
} else {
isLoadMore = false;
}
mView.querySucc(querySucc, isLoadMore, queryType, loadingDialog);
}, throwable -> {
mView.error(throwable.getMessage(), loadingDialog);
});
}
@Override
public void add(Gbound gbound, LoadingDialog loadingDialog) {
ApiFactory.Gbounds.add(gbound).subscribe(addSucc -> {
mView.addSucc(loadingDialog);
}, throwable -> {
mView.error(throwable.getMessage(), loadingDialog);
});
}
@Override
public void update(Gbound gbound, LoadingDialog loadingDialog) {
ApiFactory.Gbounds.update(gbound).subscribe(addSucc -> {
mView.updateSucc(loadingDialog);
}, throwable -> {
mView.error(throwable.getMessage(), loadingDialog);
});
}
@Override
public void exchangeQuery(LoadingDialog loadingDialog) {
ApiFactory.Ubounds.query().subscribe(query -> {
mView.exchangeQuerySucc(query, loadingDialog);
}, throwable -> {
mView.error(throwable.getMessage(), loadingDialog);
});
}
@Override
public void exchangeUpdate(@Nullable Ubound ubound, LoadingDialog loadingDialog) {
ApiFactory.Ubounds.update(ubound).subscribe(exchangeUpdateSucc -> {
mView.exchangeUpdateSucc(exchangeUpdateSucc, loadingDialog);
}, throwable -> {
mView.error(throwable.getMessage(), loadingDialog);
});
}
}
package com.xingdata.zzdpos.ui.marketing.integral.adapter;
import android.support.annotation.Nullable;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemIntegralBinding;
import com.xingdata.zzdpos.model.Gbound;
import java.util.List;
/**
* Created by Administrator on 2017/11/24.
*/
public class IntegralAdapter extends BaseAdapter<Gbound, ItemIntegralBinding> {
public IntegralAdapter(int layoutResId, @Nullable List<Gbound> data) {
super(layoutResId, data);
}
@Override
protected void convert(ItemIntegralBinding mViewBinding, Gbound item) {
mViewBinding.tvVip.setText(item.getVipLevelName());
if (item.getSpuCateId() == 0) {
mViewBinding.tvSource.setText("全品类");
} else {
//来源品类
if (item.getSpuCateName() != null) {
mViewBinding.tvSource.setText(item.getSpuCateName());
}
}
//获取规则
mViewBinding.tvGet.setText(item.getTruleName());
//开通启用状态 0:正常 1 暂停 默认 0
if (item.getBoundGetStatus() == 0) {
mViewBinding.tvStatus.setImageResource(R.mipmap.integral_open);
} else {
mViewBinding.tvStatus.setImageResource(R.mipmap.integral_close);
}
}
}
package com.xingdata.zzdpos.ui.marketing.integral.adapter;
import android.support.annotation.Nullable;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemIntegralBinding;
import com.xingdata.zzdpos.model.Ubound;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.util.List;
/**
* Created by Administrator on 2017/11/24.
*/
public class IntegralExchangeAdapter extends BaseAdapter<Ubound, ItemIntegralBinding> {
public IntegralExchangeAdapter(int layoutResId, @Nullable List<Ubound> data) {
super(layoutResId, data);
}
@Override
protected void convert(ItemIntegralBinding mViewBinding, Ubound item) {
mViewBinding.tvVip.setText(item.getBoundValAmt() + "个积分=1元");
//兑换规则
if (item.getBoundOrderAmt() != null && item.getBoundUseNum() != null) {
mViewBinding.tvSource.setText("订单实收金额满" + ConvertUtil.fenToYuan(item.getBoundOrderAmt
()) + "元\n最多使用" + item.getBoundUseNum() + "积分");
}
//备注
mViewBinding.tvGet.setText("无");
if (item.getBoundUseStatus() != null) {
//开通启用状态 0:正常 1 暂停 默认 0
if (item.getBoundUseStatus() == 0) {
mViewBinding.tvStatus.setImageResource(R.mipmap.integral_open);
} else {
mViewBinding.tvStatus.setImageResource(R.mipmap.integral_close);
}
}
}
}
package com.xingdata.zzdpos.ui.marketing.integral.dialog;
import android.annotation.SuppressLint;
import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.TextView;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseDialog;
import com.xingdata.zzdpos.databinding.DialogIntegralExchangeSettingBinding;
import com.xingdata.zzdpos.model.Ubound;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.marketing.integral.IntegralPresenter;
import com.xingdata.zzdpos.util.ConvertUtil;
/**
* 积分兑换设置界面
*/
public class IntegralExchangeDialog extends BaseDialog<IntegralPresenter,
DialogIntegralExchangeSettingBinding> {
Ubound ubound;
@Override
public int getLayoutId() {
return R.layout.dialog_integral_exchange_setting;
}
@Override
protected boolean isShowTitle() {
return true;
}
@Override
public int getTitle() {
return R.string.integral_exchange_title;
}
@SuppressLint("SetTextI18n")
@Override
public void initView() {
setCancelable(false);
mViewBinding.setOnClickListener(view -> {
hintKbTwo();
switch (view.getId()) {
case R.id.rd_suspendeds: {
//暂停
ubound.setBoundUseStatus((byte) 1);
}
break;
case R.id.rd_starts: {
//启用
ubound.setBoundUseStatus((byte) 0);
}
break;
}
});
initUiData();
}
private void initUiData() {
if (ubound != null) {
if (ubound.getBoundUseStatus() != null && ubound.getBoundUseStatus() == 0) {
mViewBinding.rdStarts.setChecked(true);
} else if (ubound.getBoundUseStatus() != null && ubound.getBoundUseStatus() == 1) {
mViewBinding.rdSuspendeds.setChecked(true);
}
if (ubound.getBoundValAmt() != null) {
mViewBinding.etIntegralExchangeRuleCountMoney.setText(ubound.getBoundValAmt() + "");
}
if (ubound.getBoundOrderAmt() != null) {
mViewBinding.etIntegralExchangeMoney.setText(ConvertUtil.fenToYuanNoPoint(ubound
.getBoundOrderAmt()));
}
if (ubound.getBoundUseNum() != null) {
mViewBinding.etIntegralExchangeCount.setText(ubound.getBoundUseNum() + "");
}
}
}
public void setData(Ubound ubound) {
this.ubound = ubound;
}
@Override
public void onConfirmClick(View view) {
super.onConfirmClick(view);
if (isNullAndSet()) {
LoadingDialog loadingDialog = new LoadingDialog();
loadingDialog.show((BaseActivity) getActivity());
ubound.setUpdateTime(null);
ubound.setCreateTime(null);
mPresenter.exchangeUpdate(ubound, loadingDialog);
this.dismiss();
} else {
ToastUtils.showLong("输入数据不能null");
}
}
/**
* 判断用户输入数据是否为null
*
* @return 输入为null返回false 反之返回true
*/
private boolean isNullAndSet() {
if (ubound == null || ubound.getBoundUseStatus() == null) {
return false;
}
if (TextUtils.isEmpty(mViewBinding.etIntegralExchangeRuleCountMoney.getText().toString())
|| TextUtils.isEmpty(mViewBinding.etIntegralExchangeMoney.getText().toString())
|| TextUtils.isEmpty(mViewBinding.etIntegralExchangeCount.getText().toString
())) {
return false;
}
ubound.setBoundValAmt(Long.parseLong(mViewBinding.etIntegralExchangeRuleCountMoney
.getText().toString()));
ubound.setBoundOrderAmt(ConvertUtil.yuanToFen(mViewBinding.etIntegralExchangeMoney
.getText().toString()));
ubound.setBoundUseNum(Long.parseLong(mViewBinding.etIntegralExchangeCount.getText()
.toString()));
return true;
}
/**
* 显示软键盘,Dialog使用
*/
public void hintKbTwo() {
View view = getDialog().getCurrentFocus();
if (view == null) {
return;
}
if (view instanceof TextView) {
InputMethodManager mInputMethodManager = (InputMethodManager) getContext()
.getSystemService(Context.INPUT_METHOD_SERVICE);
mInputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager
.RESULT_UNCHANGED_SHOWN);
}
}
@Override
public void dismiss() {
hintKbTwo();
super.dismiss();
}
}
package com.xingdata.zzdpos.ui.marketing.integral.dialog;
import android.annotation.SuppressLint;
import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.ImageView;
import android.widget.TextView;
import com.bigkoo.pickerview.OptionsPickerView;
import com.bigkoo.pickerview.listener.CustomListener;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.App;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseDialog;
import com.xingdata.zzdpos.databinding.DialogIntegralGetSettingBinding;
import com.xingdata.zzdpos.model.Category;
import com.xingdata.zzdpos.model.Gbound;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.marketing.integral.IntegralPresenter;
import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.OnClickListener;
import java.util.ArrayList;
import java.util.List;
import io.realm.Realm;
import io.realm.RealmResults;
/**
* 积分获取设置界面
*/
public class IntegralGetDialog extends BaseDialog<IntegralPresenter,
DialogIntegralGetSettingBinding> {
//区分请求类型 正常 加载更多,下拉刷新
public static final int ONE_CATEGORY = 1;
public static final int TWO_CATEGORY = 2;
public static final int THREE_CATEGORY = 3;
//请求商品类别使用的id
private long spuCateIdTwo = -1;
private long spuCateIdThree = -1;
private OptionsPickerView pvCustomOptions;
private List<Category> listCategory = new ArrayList<>();
//积分获取提交给服务器对象
private Gbound gbound = new Gbound();
//ui显示用
private Gbound ShowGbound = new Gbound();
//商品品类提交服务器对象
private Category category = new Category();
//当前为修改还是新增 0为修改1为新增
private int nowType = -1;
//进度对话框
LoadingDialog loadingDialog;
//当前点击商品类型空间id,防止直接点击商品第二三种类型
private int nowShopTypeId = 1;
@Override
public int getLayoutId() {
return R.layout.dialog_integral_get_setting;
}
@Override
protected boolean isShowTitle() {
return true;
}
@Override
public int getTitle() {
return R.string.integral_get_title;
}
@SuppressLint("SetTextI18n")
@Override
public void initView() {
setCancelable(false);
mViewBinding.setOnClickListener(
new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
hintKbTwo();
switch (v.getId()) {
case R.id.rd_suspendeds: {
//暂停
gbound.setBoundGetStatus(1);
}
break;
case R.id.rd_starts: {
//启用
gbound.setBoundGetStatus(0);
}
break;
case R.id.rd_gettype_all: {
//通用
showView(v.getId());
gbound.setVipGboundType((byte) 0);
}
break;
case R.id.rd_gettype_category: {
//品类定义
showView(v.getId());
gbound.setVipGboundType((byte) 1);
}
break;
case R.id.rd_gettype_shop: {
//商品定义
showView(v.getId());
gbound.setVipGboundType((byte) 2);
}
break;
case R.id.tv_vip_level_select: {
Realm realm = Realm.getInstance(App.instance.mRealmConfig);
RealmResults<Level> realmResult = realm.where(Level.class)
.findAll();
if (realmResult != null && realmResult.size() > 0) {
initVipLevelOptionPicker(realmResult);
}
}
break;
case R.id.tv_category_select_one: {
mPresenter.initData(getCategory(v.getId()), ONE_CATEGORY);
mViewBinding.tvCategorySelectTwo.setText("");
mViewBinding.tvCategorySelectThree.setText("");
}
break;
case R.id.tv_category_select_two: {
if (nowShopTypeId >= 1) {
mPresenter.initData(getCategory(v.getId()), TWO_CATEGORY);
mViewBinding.tvCategorySelectThree.setText("");
nowShopTypeId = 2;
} else {
ToastUtils.showLong("请先选择第一类品类");
}
}
break;
case R.id.tv_category_select_three: {
if (nowShopTypeId >= 2) {
mPresenter.initData(getCategory(v.getId()), THREE_CATEGORY);
nowShopTypeId = 3;
} else {
ToastUtils.showLong("请先选择第一二类品类");
}
}
break;
default: {
}
break;
}
}
});
if (nowType == 0) {
setShopTypeClick(false);
updateUi();
} else if (nowType == 1) {
setShopTypeClick(true);
mViewBinding.rdSuspendeds.setChecked(true);
gbound.setBoundGetStatus(1);
gbound.setVipGboundType((byte) 0);
}
if (loadingDialog != null) {
loadingDialog.dismiss();
}
}
private void setShopTypeClick(Boolean b) {
mViewBinding.rdGettypeAll.setEnabled(b);
mViewBinding.rdGettypeShop.setEnabled(b);
mViewBinding.rdGettypeCategory.setEnabled(b);
if (b) {
mViewBinding.tvCategorySelectShowNoEdit.setVisibility(View.GONE);
mViewBinding.tvVipLevelSelectShowNoEdit.setVisibility(View.GONE);
mViewBinding.tvCategorySelectOne.setVisibility(View.VISIBLE);
mViewBinding.tvCategorySelectTwo.setVisibility(View.VISIBLE);
mViewBinding.tvCategorySelectThree.setVisibility(View.VISIBLE);
mViewBinding.tvVipLevelSelect.setVisibility(View.VISIBLE);
} else {
mViewBinding.tvCategorySelectShowNoEdit.setVisibility(View.VISIBLE);
mViewBinding.tvVipLevelSelectShowNoEdit.setVisibility(View.VISIBLE);
mViewBinding.tvCategorySelectOne.setVisibility(View.GONE);
mViewBinding.tvCategorySelectTwo.setVisibility(View.GONE);
mViewBinding.tvCategorySelectThree.setVisibility(View.GONE);
mViewBinding.tvVipLevelSelect.setVisibility(View.GONE);
}
}
private void updateUi() {
if (ShowGbound != null && ShowGbound.getTruleName() != null && !(ShowGbound.getTruleName
().equals("")
)) {
mViewBinding.tvRulesName.setText(ShowGbound.getTruleName());
//开通启用状态 0:正常 1 暂停 默认 0
if (ShowGbound.getBoundGetStatus() == 0) {
mViewBinding.rdStarts
.setChecked(true);
} else if (ShowGbound.getBoundGetStatus() == 1) {
mViewBinding.rdSuspendeds.setChecked(true);
}
mViewBinding.tvVipLevelSelectShowNoEdit.setText(ShowGbound.getVipLevelName());
//积分获取类型 0:通用 1:品类定义积分 2:商品定义积分
switch (ShowGbound.getVipGboundType()) {
case 0: {
showView(R.id.rd_gettype_all);
mViewBinding.rdGettypeAll.setChecked(true);
if (ShowGbound.getTransAmt() != null) {
mViewBinding.etIntegralWeight.setText(ConvertUtil.fenToYuanNoPoint
(ShowGbound.getTransAmt()));
}
if (ShowGbound.getBoundExp() != null) {
mViewBinding.etIntegralTimeLimit.setText(ShowGbound.getBoundExp() + "");
}
}
break;
case 1: {
showView(R.id.rd_gettype_category);
mViewBinding.rdGettypeCategory.setChecked(true);
if (ShowGbound.getSpuClaName() != null) {
mViewBinding.tvCategorySelectOne.setText((ShowGbound.getSpuClaName()));
mViewBinding.tvCategorySelectShowNoEdit.setText(ShowGbound.getSpuClaName
() + "/");
}
if (ShowGbound.getSpuGrpName() != null) {
mViewBinding.tvCategorySelectTwo.setText((ShowGbound.getSpuGrpName()));
mViewBinding.tvCategorySelectShowNoEdit.setText(mViewBinding
.tvCategorySelectShowNoEdit.getText().toString() + ShowGbound
.getSpuGrpName() + "/");
}
if (ShowGbound.getSpuCateName() != null) {
mViewBinding.tvCategorySelectThree.setText((ShowGbound.getSpuCateName()));
mViewBinding.tvCategorySelectShowNoEdit.setText(mViewBinding
.tvCategorySelectShowNoEdit.getText().toString() + ShowGbound
.getSpuCateName());
}
if (ShowGbound.getTransAmt() != null) {
mViewBinding.etIntegralCategoryWeight.setText(ConvertUtil
.fenToYuanNoPoint(ShowGbound
.getTransAmt()));
}
if (ShowGbound.getBoundExp() != null) {
mViewBinding.etIntegralCategoryTimeLimit.setText(ShowGbound.getBoundExp()
+ "");
}
}
break;
case 2: {
showView(R.id.rd_gettype_shop);
mViewBinding.rdGettypeShop.setChecked(true);
if (ShowGbound.getBoundExp() != null) {
mViewBinding.etShopTimeLimit.setText(ShowGbound.getBoundExp() + "");
}
}
break;
}
}
}
/**
* 通过用户点击品类等级 构建提交给服务器Category对象
*
* @param id 按钮id
* @return 构建好的Category对象
*/
private Category getCategory(int id) {
switch (id) {
case R.id.tv_category_select_one: {
category = new Category();
}
break;
case R.id.tv_category_select_two: {
category.setSpuCateId(spuCateIdTwo);
}
break;
case R.id.tv_category_select_three: {
category.setSpuCateId(spuCateIdThree);
}
break;
}
return category;
}
/**
* 初始化会员等级选择对话框
*/
private void initVipLevelOptionPicker(RealmResults<Level> realmResult) {//条件选择器初始化,自定义布局
pvCustomOptions = new OptionsPickerView.Builder(getActivity(), new OptionsPickerView
.OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int options1, int option2, int options3, View v) {
gbound.setVipLevel(realmResult.get(options1).getVipLevel());
mViewBinding.tvVipLevelSelect.setText(realmResult.get(options1).getVipLevelName());
}
}).setLayoutRes(R.layout.pickerview_custom_options, new CustomListener() {
@Override
public void customLayout(View v) {
final TextView tvSubmit = v.findViewById(R.id.tv_finish);
ImageView ivCancel = v.findViewById(R.id.iv_cancel);
tvSubmit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pvCustomOptions.returnData();
pvCustomOptions.dismiss();
}
});
ivCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pvCustomOptions.dismiss();
}
});
}
})
.isDialog(true)
.build();
pvCustomOptions.setPicker(realmResult);//添加数据
pvCustomOptions.show();
}
/**
* 初始化商品品类选择对话框
*
* @param list 选择对话框数据
* @param nowList 当前选中的品类索引
*/
private void initCustomOptionPicker(List<Category> list, int nowList) {//条件选择器初始化,自定义布局
pvCustomOptions = new OptionsPickerView.Builder(getActivity(), new OptionsPickerView
.OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int options1, int option2, int options3, View v) {
gbound.setSpuCateId((int) Long.parseLong(list.get(options1).getSpuCateId() + ""));
//返回的分别是三个级别的选中位置
switch (nowList) {
case ONE_CATEGORY: {
mViewBinding.tvCategorySelectOne.setText(listCategory.get(options1)
.getSpuClaName());
spuCateIdTwo = listCategory.get(options1).getSpuCateId();
}
break;
case TWO_CATEGORY: {
mViewBinding.tvCategorySelectTwo.setText(listCategory.get(options1)
.getSpuGrpName());
spuCateIdThree = listCategory.get(options1).getSpuCateId();
}
break;
case THREE_CATEGORY: {
mViewBinding.tvCategorySelectThree.setText(listCategory.get(options1)
.getSpuCateName());
}
break;
}
}
}).setLayoutRes(R.layout.pickerview_custom_options, new CustomListener() {
@Override
public void customLayout(View v) {
final TextView tvSubmit = v.findViewById(R.id.tv_finish);
ImageView ivCancel = v.findViewById(R.id.iv_cancel);
tvSubmit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pvCustomOptions.returnData();
pvCustomOptions.dismiss();
}
});
ivCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pvCustomOptions.dismiss();
}
});
}
})
.isDialog(true)
.build();
pvCustomOptions.setPicker(list);//添加数据
pvCustomOptions.show();
}
/**
* 根据用户点击控制UI控件的隐藏显示
*
* @param id 用户点击的id
*/
private void showView(int id) {
switch (id) {
case R.id.rd_gettype_all: {
mViewBinding.llAll.setVisibility(View.VISIBLE);
mViewBinding.llCategory.setVisibility(View.GONE);
mViewBinding.llShop.setVisibility(View.GONE);
}
break;
case R.id.rd_gettype_category: {
//品类定义
mViewBinding.llAll.setVisibility(View.GONE);
mViewBinding.llCategory.setVisibility(View.VISIBLE);
mViewBinding.llShop.setVisibility(View.GONE);
}
break;
case R.id.rd_gettype_shop: {
//商品定义
mViewBinding.llAll.setVisibility(View.GONE);
mViewBinding.llCategory.setVisibility(View.GONE);
mViewBinding.llShop.setVisibility(View.VISIBLE);
}
break;
}
}
@Override
public void onConfirmClick(View view) {
super.onConfirmClick(view);
if (isNullAndSetDate()) {
LoadingDialog loadingDialog = new LoadingDialog();
loadingDialog.show((BaseActivity) getActivity());
if (nowType == 0) {
//修改
mPresenter.update(gbound, loadingDialog);
LogUtils.e("修改");
} else if (nowType == 1) {
//新增
mPresenter.add(gbound, loadingDialog);
LogUtils.e("新增");
}
this.dismiss();
} else {
ToastUtils.showLong("输入数据不能null");
}
}
/**
* 请求成功设置数据
*
* @param list
* @param nowList
*/
public void setCategoryDate(List<Category> list, int nowList) {
listCategory = list;
initCustomOptionPicker(list, nowList);
}
/**
* 判断用户输入数据是否为null
*
* @return 输入为null返回false 反之返回true
*/
private boolean isNullAndSetDate() {
if (gbound.getVipGboundType() == null || gbound.getVipLevel() == null) {
return false;
}
switch (gbound.getVipGboundType()) {
case 0: {
if (TextUtils.isEmpty(mViewBinding.etIntegralWeight.getText().toString())
|| TextUtils.isEmpty(mViewBinding.etIntegralTimeLimit.getText().toString
())) {
return false;
} else {
mViewBinding.tvRulesName.setText(mViewBinding.etIntegralWeight.getText()
.toString() +
"元送一个积分");
gbound.setTransAmt(ConvertUtil.yuanToFen(mViewBinding.etIntegralWeight
.getText().toString()));
gbound.setBoundExp(Byte.parseByte(mViewBinding.etIntegralTimeLimit.getText()
.toString()));
}
}
break;
case 1: {
if (TextUtils.isEmpty(mViewBinding.etIntegralCategoryWeight.getText().toString())
|| TextUtils.isEmpty(mViewBinding.etIntegralCategoryTimeLimit.getText()
.toString()) || gbound.getSpuCateId() == -1) {
return false;
} else {
mViewBinding.tvRulesName.setText(mViewBinding.etIntegralCategoryWeight
.getText().toString() +
"元送一个积分");
gbound.setTransAmt(ConvertUtil.yuanToFen(mViewBinding
.etIntegralCategoryWeight.getText().toString()));
gbound.setBoundExp(Byte.parseByte(mViewBinding.etIntegralCategoryTimeLimit
.getText().toString()));
}
}
break;
case 2: {
if (TextUtils.isEmpty(mViewBinding.etShopTimeLimit.getText().toString())) {
return false;
} else {
mViewBinding.tvRulesName.setText("商品定义规则");
gbound.setBoundExp(Byte.parseByte(mViewBinding.etShopTimeLimit.getText()
.toString()));
}
}
break;
}
gbound.setTruleName(mViewBinding.tvRulesName.getText().toString());
return true;
}
/**
* @param gbound
*/
public void setData(Gbound gbound, LoadingDialog loadingDialog) {
this.gbound = gbound.clone();
this.ShowGbound = gbound;
this.loadingDialog = loadingDialog;
//置状态为修改状态
setNowType(0);
}
public void setNowType(int nowType) {
this.nowType = nowType;
}
/**
* 显示软键盘,Dialog使用
*/
public void hintKbTwo() {
View view = getDialog().getCurrentFocus();
if (view == null) {
return;
}
if (view instanceof TextView) {
InputMethodManager mInputMethodManager = (InputMethodManager) getContext()
.getSystemService(Context.INPUT_METHOD_SERVICE);
mInputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager
.RESULT_UNCHANGED_SHOWN);
}
}
@Override
public void dismiss() {
hintKbTwo();
super.dismiss();
}
}
package com.xingdata.zzdpos.ui.marketing.ticket;
import android.support.v7.widget.GridLayoutManager;
import android.text.Html;
import android.view.View;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityReturnTicketBinding;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Trule;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.marketing.ticket.adapter.ReturnTicketAdapter;
import com.xingdata.zzdpos.ui.marketing.ticket.dialog.TicketAddDialog;
import com.xingdata.zzdpos.util.OnClickListener;
import com.xingdata.zzdpos.util.RecyclerViewUtil;
import java.util.ArrayList;
public class ReturnTicketActivity extends BaseActivity<ReturnTicketPresenter,
ActivityReturnTicketBinding>
implements ReturnTicketContract.View {
ReturnTicketAdapter returnTicketAdapter;
LoadingDialog loadingDialog = new LoadingDialog();
@Override
public int getLayoutId() {
return R.layout.activity_return_ticket;
}
@Override
public void initView() {
mViewBinding.icTitle.tvTitle.setText("优惠券规则");
mViewBinding.icTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
ActivityUtils.finishActivity(ReturnTicketActivity.class);
}
});
mViewBinding.btnGroup.setText(Html.fromHtml(
getResources().
getString(R.string
.tv_ticket_count, "<font color='#1f7bdb'><big> " + "0" + " " +
"</big></font>")));
final int SPACING = mContext.getResources().getDimensionPixelOffset(R.dimen
.vip_message_item_spacing);
returnTicketAdapter = new
ReturnTicketAdapter(new ArrayList<>(), mPresenter);
mViewBinding.rcTicket.setAdapter(returnTicketAdapter);
mViewBinding.rcTicket.setLayoutManager(new
GridLayoutManager(ReturnTicketActivity.this,
4));
mViewBinding.rcTicket.addItemDecoration(new RecyclerViewUtil.GridSpacingItemDecoration(4,
SPACING, true));
mViewBinding.setOnClickListener(view ->
{
switch (view.getId()) {
case R.id.btn_add: {
mPresenter.ticketAddDialog = new TicketAddDialog();
mPresenter.ticketAddDialog.show(this);
}
break;
default: {
}
break;
}
});
}
@Override
public void error(String errorMsg, LoadingDialog loadingDialog) {
closeLoading(loadingDialog);
LogUtils.e(errorMsg);
ToastUtils.showLong(errorMsg);
}
@Override
public void addSucc(LoadingDialog loadingDialog) {
if (mPresenter.ticketAddDialog != null && mPresenter.ticketAddDialog.isShowing) {
mPresenter.ticketAddDialog.dismiss();
}
mPresenter.truleQuery(loadingDialog);
}
@Override
public void truleQuerySucc(Pager<Trule> trulePager, LoadingDialog loadingDialog) {
closeLoading(loadingDialog);
if (trulePager == null || trulePager.getList() == null || trulePager.getList().size() <=
0) {
mViewBinding.tvEmpty.setVisibility(View.VISIBLE);
}
if (trulePager != null && trulePager.getList() != null) {
mViewBinding.tvEmpty.setVisibility(View.GONE);
returnTicketAdapter.setNewData(trulePager.getList());
mViewBinding.btnGroup.setText(Html.fromHtml(getResources().getString(R.string
.tv_ticket_count,
"<font color='#1f7bdb'><big> " + trulePager.getList().size() + " " +
"</big></font>")));
}
}
@Override
public void truleUpdateSucc(LoadingDialog loadingDialog) {
if (mPresenter.ticketAddDialog != null && mPresenter.ticketAddDialog.isShowing) {
mPresenter.ticketAddDialog.dismiss();
}
mPresenter.truleQuery(loadingDialog);
}
private void closeLoading(LoadingDialog loadingDialog) {
if (loadingDialog != null) {
loadingDialog.dismiss();
}
}
@Override
protected void onResume() {
super.onResume();
loadingDialog.show(this);
mPresenter.truleQuery(loadingDialog);
}
}
package com.xingdata.zzdpos.ui.marketing.ticket;
import android.support.annotation.Nullable;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Trule;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
/**
* Created by Administrator on 2017/11/24.
*/
public interface ReturnTicketContract {
interface View extends BaseView {
void error(String errorMsg, LoadingDialog loadingDialog);
void addSucc(LoadingDialog loadingDialog);
void truleQuerySucc(Pager<Trule> trulePager, LoadingDialog loadingDialog);
void truleUpdateSucc(LoadingDialog loadingDialog);
}
abstract class Presenter extends BasePresenter<View> {
abstract void add(@Nullable Trule trule, LoadingDialog loadingDialog);
abstract void truleQuery(LoadingDialog loadingDialog);
abstract void truleUpdate(@Nullable Trule trule, LoadingDialog loadingDialog);
}
}
package com.xingdata.zzdpos.ui.marketing.ticket;
import android.support.annotation.Nullable;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.model.Trule;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.marketing.ticket.dialog.TicketAddDialog;
/**
* Created by Administrator on 2017/11/24.
*/
public class ReturnTicketPresenter extends ReturnTicketContract.Presenter {
public TicketAddDialog ticketAddDialog;
@Override
public void onAttached() {
}
@Override
public void add(@Nullable Trule trule, LoadingDialog loadingDialog) {
ApiFactory.TRULE.truleAdd(trule).subscribe(s -> {
mView.addSucc(loadingDialog);
}, throwable -> {
mView.error(throwable.getMessage(), loadingDialog);
});
}
@Override
public void truleQuery(LoadingDialog loadingDialog) {
ApiFactory.TRULE.truleQuery().subscribe(pager -> {
mView.truleQuerySucc(pager, loadingDialog);
}, throwable -> {
mView.error(throwable.getMessage(), loadingDialog);
});
}
@Override
public void truleUpdate(@Nullable Trule trule, LoadingDialog loadingDialog) {
ApiFactory.TRULE.truleUpdate(trule).subscribe(pager -> {
mView.truleUpdateSucc(loadingDialog);
}, throwable -> {
mView.error(throwable.getMessage(), loadingDialog);
});
}
}
package com.xingdata.zzdpos.ui.marketing.ticket.adapter;
import android.support.annotation.Nullable;
import android.view.View;
import com.blankj.utilcode.util.TimeUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemReturnTicketBinding;
import com.xingdata.zzdpos.model.Trule;
import com.xingdata.zzdpos.ui.marketing.ticket.ReturnTicketPresenter;
import com.xingdata.zzdpos.ui.marketing.ticket.dialog.TicketAddDialog;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.text.SimpleDateFormat;
import java.util.List;
public class ReturnTicketAdapter extends BaseAdapter<Trule, ItemReturnTicketBinding> {
ReturnTicketPresenter mPersenter;
public ReturnTicketAdapter(@Nullable List<Trule> data, ReturnTicketPresenter mPersenter) {
super(R.layout.item_return_ticket, data);
this.mPersenter = mPersenter;
}
@Override
protected void convert(ItemReturnTicketBinding mViewBinding, Trule item) {
mViewBinding.tvTicket.setText("优\n惠\n券");
// mViewBinding.tvSend.setText("发\n券");
mViewBinding.tvSend.setText("\n");
mViewBinding.tvTicketMoney.setText(ConvertUtil.fenToYuanNoPoint(item.getTruleValAmt()));
mViewBinding.tvRule.setText(mContext.getResources().getString(R.string.tv_rule,
ConvertUtil.fenToYuanNoPoint(item.getTruleOrderAmt())));
mViewBinding.tvDate.setText(mContext.getResources().getString(R.string.tv_date,
TimeUtils.millis2String(item.getTruleExp(), new SimpleDateFormat("yyy-mm-dd"))));
mViewBinding.clSend.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ToastUtils.showLong("发券");
}
});
mViewBinding.clItem.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mPersenter.ticketAddDialog = new TicketAddDialog();
mPersenter.ticketAddDialog.setNowType(2);
mPersenter.ticketAddDialog.editTicketData(item);
mPersenter.ticketAddDialog.show((BaseActivity) mContext);
}
});
}
}
package com.xingdata.zzdpos.ui.marketing.ticket.dialog;
import android.annotation.SuppressLint;
import android.app.DatePickerDialog;
import android.content.Context;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.DatePicker;
import android.widget.TextView;
import com.blankj.utilcode.util.TimeUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseDialog;
import com.xingdata.zzdpos.databinding.DialogTicketAddSettingBinding;
import com.xingdata.zzdpos.model.Trule;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.marketing.ticket.ReturnTicketPresenter;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.text.SimpleDateFormat;
import java.util.Calendar;
/**
* 积分获取设置界面
*/
public class TicketAddDialog extends BaseDialog<ReturnTicketPresenter,
DialogTicketAddSettingBinding> {
LoadingDialog loadingDialog = new LoadingDialog();
//0:正常 1暂停
private byte nowStatus = 1;
//当前编辑的对象
private Trule trule = new Trule();
//1为新增,2为更新
private int nowType = 1;
@Override
public int getLayoutId() {
return R.layout.dialog_ticket_add_setting;
}
@Override
protected boolean isShowTitle() {
return true;
}
@Override
public int getTitle() {
return R.string.return_ticket_title;
}
@SuppressLint("SetTextI18n")
@Override
public void initView() {
hintKbTwo();
mViewBinding.etTicketMoney.addTextChangedListener(mTextWatcher);
mViewBinding.etRuleMoney.addTextChangedListener(mTextWatcher);
mViewBinding.etTicketCount.addTextChangedListener(mTextWatcher);
if (nowType == 2) {
setTitle("编辑优惠券");
mViewBinding.tvIntegralRuleName.setText(trule.getTruleName());
if (trule.getTruleStatus() == 1) {
mViewBinding.rbSuspended.setChecked(true);
} else if (trule.getTruleStatus() == 0) {
mViewBinding.rbStart.setChecked(true);
}
mViewBinding.etTicketMoney.setText(ConvertUtil.fenToYuanNoPoint(trule.getTruleValAmt
()));
mViewBinding.tvDate.setText(TimeUtils.millis2String(trule.getTruleExp(), new
SimpleDateFormat("yyyy-mm-dd")));
mViewBinding.etRuleMoney.setText(ConvertUtil.fenToYuanNoPoint(trule.getTruleOrderAmt
()));
mViewBinding.etTicketCount.setText(trule.getTruleUseNum() + "");
}
mViewBinding.setOnClickListener(view -> {
hintKbTwo();
switch (view.getId()) {
case R.id.tv_date: {
showDialogPick(mViewBinding.tvDate);
}
break;
case R.id.rb_suspended: {
//暂停
nowStatus = 1;
}
break;
case R.id.rb_start: {
//启用
nowStatus = 0;
}
break;
default: {
}
break;
}
});
}
public void editTicketData(Trule trule) {
this.trule = trule;
}
@Override
public void onConfirmClick(View view) {
if (isNull()) {
if (Integer.parseInt(mViewBinding.etRuleMoney.getText().toString()) <= Integer
.parseInt(mViewBinding.etTicketMoney.getText().toString())) {
ToastUtils.showLong("可用金额需大于优惠券面值 ");
return;
}
loadingDialog.show((BaseActivity) mContext);
if (nowType == 1) {
mPresenter.add(getUiData(), loadingDialog);
} else if (nowType == 2) {
mPresenter.truleUpdate(getUiData(), loadingDialog);
}
} else {
ToastUtils.showLong("输入数据不能null");
}
super.onConfirmClick(view);
}
private Trule getUiData() {
mViewBinding.tvIntegralRuleName.setText(mViewBinding.etTicketMoney.getText().toString() +
"元优惠券");
trule.setTruleName(mViewBinding.tvIntegralRuleName.getText().toString());
//0:正常 1暂停 默认0
trule.setTruleStatus(nowStatus);
trule.setTruleValAmt(ConvertUtil.yuanToFen(mViewBinding.etTicketMoney.getText().toString
()));
trule.setTruleExp(TimeUtils.string2Millis(mViewBinding.tvDate.getText().toString(), new
SimpleDateFormat("yyyy-mm-dd")));
trule.setTruleOrderAmt(ConvertUtil.yuanToFen(mViewBinding.etRuleMoney.getText().toString
()));
if (!mViewBinding.etTicketCount.getText().toString().equals("")) {
trule.setTruleUseNum(Byte.parseByte(mViewBinding.etTicketCount.getText().toString()));
} else {
trule.setTruleUseNum((byte) 1);
}
return trule;
}
/**
* 判断用户输入数据是否为null
*
* @return 输入为null返回false 反之返回true
*/
private boolean isNull() {
return !(TextUtils.isEmpty(mViewBinding.etTicketMoney.getText().toString())
|| TextUtils.isEmpty(mViewBinding.tvDate.getText().toString())
|| TextUtils.isEmpty(mViewBinding.etRuleMoney.getText().toString())
|| TextUtils.isEmpty(mViewBinding.etTicketCount.getText().toString()));
}
//将两个选择时间的dialog放在该函数中
private void showDialogPick(final View btn) {
//获取Calendar对象,用于获取当前时间
final Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DAY_OF_MONTH);
//实例化DatePickerDialog对象
DatePickerDialog datePickerDialog = new DatePickerDialog(mContext, new
DatePickerDialog.OnDateSetListener() {
//选择完日期后会调用该回调函数
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int
dayOfMonth) {
//因为monthOfYear会比实际月份少一月所以这边要加1
((TextView) btn).setText(year + "-" + (monthOfYear + 1) + "-" + dayOfMonth);
}
}, year, month, day);
//弹出选择日期对话框
datePickerDialog.show();
}
/**
* 显示软键盘,Dialog使用
*/
public void hintKbTwo() {
View view = getDialog().getCurrentFocus();
if (view == null) {
return;
}
if (view instanceof TextView) {
InputMethodManager mInputMethodManager = (InputMethodManager) getContext()
.getSystemService(Context.INPUT_METHOD_SERVICE);
mInputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager
.RESULT_UNCHANGED_SHOWN);
}
}
private TextWatcher mTextWatcher = new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void afterTextChanged(Editable s) {
String text = s.toString();
int len = s.toString().length();
if (len == 1 && text.equals("0")) {
s.clear();
}
}
};
public void setNowType(int type) {
trule = new Trule();
this.nowType = type;
}
@Override
public void dismiss() {
hintKbTwo();
super.dismiss();
}
}
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!--被按压时-->
<item android:color="@color/black_baozheng" android:drawable="@drawable/radio_shape_item" android:state_checked="true"/>
<!--普通状态,这里在stroke中通过dashWidth和dashGap设置边线为虚线-->
<item android:color="@color/black" android:state_checked="false">
<shape>
<!-- 边框颜色 -->
<stroke
android:width="0.5dp"
android:color="@color/transparent"/>
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:left="-2dp"
android:right="-2dp"
android:top="-2dp">
<shape>
<solid android:color="@android:color/transparent"/>
<stroke
android:width="2dp"
android:color="@color/red_guanyu"/>
</shape>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/radio_select_bg" android:state_checked="true"/>
<item android:drawable="@mipmap/radio_normal_bg" android:state_checked="false"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/shape_navy_blue_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/shape_navy_blue"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/all_transparent" android:state_enabled="false" />
<item android:drawable="@drawable/shape_gray_round_rectangle_stroke" android:state_pressed="true" />
<item android:drawable="@drawable/shape_white_round_rectangle_blue" android:state_focused="true" />
<item android:drawable="@drawable/shape_white_round_rectangle_dark" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/all_shape_radius" />
<solid android:color="@color/navy_blue" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/all_shape_radius" />
<solid android:color="@color/deep_blue" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/all_shape_radius" />
<stroke
android:width="@dimen/edit_border"
android:color="@color/blue" />
<solid android:color="@color/white" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/all_shape_radius" />
<stroke
android:width="@dimen/edit_border"
android:color="@color/edittext_border" />
<solid android:color="@color/white" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="@color/gray_huanggai"/>
</shape>
</item>
<item android:bottom="1dp">
<shape>
<solid android:color="@color/white"/>
</shape>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto"> <layout xmlns:app="http://schemas.android.com/apk/res-auto">
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<include
android:id="@+id/ic_title"
layout="@layout/title" />
</FrameLayout>
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/gray_zhouyu"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ic_title">
</FrameLayout>
</android.support.constraint.ConstraintLayout>
</layout> </layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="OnClickListener"
type="android.view.View.OnClickListener"></variable>
</data>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
tools:context="com.xingdata.zzdpos.ui.marketing.integral.IntegralActivity">
<include
android:id="@+id/ic_title"
layout="@layout/title"/>
<LinearLayout
android:id="@+id/btn_add"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/singleline_white_gray"
android:gravity="center"
android:onClick="@{OnClickListener}"
android:orientation="horizontal"
app:layout_constraintBottom_toTopOf="@id/ll_menu"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/ic_title"
app:layout_constraintVertical_weight="@integer/all_top_weight">
<ImageView
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/but_add"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_padding"
android:text="添加获取规则"
android:textColor="@color/red_guanyu"
android:textSize="@dimen/text_three_title"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_menu"
android:layout_width="0dp"
android:layout_height="49dp"
android:background="@color/white"
android:gravity="center"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@id/cl_bottom"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/btn_add"
app:layout_constraintVertical_weight="2.5">
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checkedButton="@id/rb_get"
android:gravity="center"
android:orientation="horizontal">
<RadioButton
android:id="@+id/rb_get"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:layout_marginRight="@dimen/all_margin"
android:layout_weight="1"
android:background="@drawable/radio_select"
android:button="@null"
android:gravity="center"
android:onClick="@{OnClickListener}"
android:padding="@dimen/all_padding"
android:text="获取规则"
android:textColor="@drawable/radio_select"
android:textSize="@dimen/et_textsize"/>
<RadioButton
android:id="@+id/rb_exchange"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:layout_marginRight="@dimen/all_margin"
android:layout_weight="1"
android:background="@drawable/radio_select"
android:button="@null"
android:gravity="center"
android:onClick="@{OnClickListener}"
android:padding="@dimen/all_padding"
android:text="兑换规则"
android:textColor="@drawable/radio_select"
android:textSize="@dimen/et_textsize"/>
</RadioGroup>
</LinearLayout>
<LinearLayout
android:id="@+id/cl_bottom"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
android:padding="@dimen/padding_big"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_menu"
app:layout_constraintVertical_weight="22">
<LinearLayout
android:id="@+id/ll_get"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srl_product"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_message"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_exchange"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"
android:padding="@dimen/cl_padding"
android:visibility="gone">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="积分面值"
android:textSize="@dimen/et_textsize"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:text="兑换规则"
android:textSize="@dimen/et_textsize"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="备注"
android:textSize="@dimen/et_textsize"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="状态 "
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_height"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/vip_line"
android:paddingBottom="@dimen/all_padding"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_exchange_message"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="OnClickListener"
type="android.view.View.OnClickListener"></variable>
</data>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/appBack"
tools:context="com.xingdata.zzdhd.ui.manager.ticket.ReturnTicketActivity">
<include
android:id="@+id/ic_title"
layout="@layout/title_appback"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@id/ll_menu"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_weight="@integer/all_top_weight"/>
<LinearLayout
android:id="@+id/ll_menu"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/white"
android:gravity="center"
android:orientation="horizontal"
android:paddingLeft="@dimen/all_margin"
android:paddingRight="@dimen/all_margin"
app:layout_constraintBottom_toBottomOf="@id/rc_ticket"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/ic_title"
app:layout_constraintVertical_weight="2.5">
<TextView
android:id="@+id/btn_group"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_spacing"
android:layout_weight="1.2"
android:background="@color/transparent"
android:drawablePadding="@dimen/all_spacing"
android:drawableStart="@mipmap/login_phone"
android:foreground="?android:attr/selectableItemBackground"
android:padding="@dimen/fragment_store_item_spacing"
android:text="共 2 种优惠券"
android:textColor="@color/menu_back"
android:textSize="@dimen/all_text_size"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="7.5"/>
<Button
android:id="@+id/btn_add"
android:layout_width="0dp"
android:layout_height="@dimen/fragment_store_et_height"
android:layout_weight="1"
android:background="@drawable/selector_navy_blue"
android:drawableLeft="@mipmap/bindingcounter_addcounter_befor"
android:onClick="@{OnClickListener}"
android:paddingLeft="5dp"
android:text="添加优惠券"
android:textColor="@color/white"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/rc_ticket"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/all_margin_big"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_menu"
app:layout_constraintVertical_weight="22">
</android.support.v7.widget.RecyclerView>
<TextView
android:id="@+id/tv_empty"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/appBack"
android:drawableTop="@mipmap/icon_things_null"
android:gravity="center"
android:padding="100dp"
android:text="@string/empty_other_select"
android:textColor="@color/white_half"
android:textSize="@dimen/all_text_size_big"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_menu"
app:layout_constraintVertical_weight="22"/>
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="OnClickListener"
type="android.view.View.OnClickListener"></variable>
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/store_back"
android:focusable="true"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gary1"
android:paddingLeft="@dimen/all_margin"
android:paddingRight="@dimen/all_margin"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center"
android:padding="@dimen/all_padding">
<TextView
android:id="@+id/tv_status"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingStart="@dimen/all_margin"
android:text="启用状态:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<RadioGroup
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<RadioButton
android:id="@+id/rd_suspendeds"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:layout_marginRight="@dimen/all_margin"
android:layout_weight="1"
android:background="@drawable/selector_checkbox_bg"
android:button="@null"
android:onClick="@{OnClickListener}"
android:text="暂停 "
android:textSize="@dimen/et_textsize"/>
<RadioButton
android:id="@+id/rd_starts"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:layout_marginRight="@dimen/all_margin"
android:layout_weight="1"
android:background="@drawable/selector_checkbox_bg"
android:button="@null"
android:onClick="@{OnClickListener}"
android:text="启用 "
android:textSize="@dimen/et_textsize"/>
</RadioGroup>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gary1"
android:paddingLeft="@dimen/all_margin"
android:paddingRight="@dimen/all_margin"></View>
<LinearLayout
android:id="@+id/ll_all"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/all_padding">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingStart="@dimen/all_margin"
android:text="积分面值:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<EditText
android:id="@+id/et_integral_exchange_rule_count_money"
style="@style/dialog_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_weight="2"
android:digits="1234567890"
android:ems="5"
android:gravity="center_vertical"
android:inputType="phone|number"
android:maxLength="5"
android:saveEnabled="false"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text=" 个积分等于1元"
android:textColor="@color/black"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/all_padding">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingStart="@dimen/all_margin"
android:text="兑换条件:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:gravity="right"
android:text="订单实收满 "
android:textColor="@color/black"
android:textSize="@dimen/et_textsize"/>
<EditText
android:id="@+id/et_integral_exchange_money"
style="@style/dialog_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_weight="2"
android:digits="1234567890"
android:ems="5"
android:gravity="center_vertical"
android:inputType="phone|number"
android:maxLength="5"
android:saveEnabled="false"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="元"
android:textColor="@color/black"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/all_padding"
android:paddingBottom="@dimen/all_margin"
android:paddingTop="@dimen/all_margin">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingStart="@dimen/all_margin"
android:text=""
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:gravity="right"
android:text="可以使用 "
android:textColor="@color/black"
android:textSize="@dimen/et_textsize"/>
<EditText
android:id="@+id/et_integral_exchange_count"
style="@style/dialog_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_weight="2"
android:digits="1234567890"
android:ems="5"
android:gravity="center_vertical"
android:inputType="phone|number"
android:maxLength="5"
android:saveEnabled="false"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="个积分"
android:textColor="@color/black"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="OnClickListener"
type="com.xingdata.zzdpos.util.OnClickListener"></variable>
<variable
name="vip"
type="com.xingdata.zzdpos.model.Vip"/>
<variable
name="ticketCount"
type="int"/>
<variable
name="isExpand"
type="boolean"/>
<variable
name="pointDisAmt"
type="String"/>
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/store_back"
android:focusable="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center"
android:padding="@dimen/all_padding">
<TextView
android:id="@+id/tv_rules_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingStart="@dimen/all_margin"
android:text="规则名称:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<TextView
android:id="@+id/et_integral_role_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:focusable="true"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gary1"
android:paddingLeft="@dimen/all_margin"
android:paddingRight="@dimen/all_margin"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center"
android:padding="@dimen/all_padding">
<TextView
android:id="@+id/tv_status"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingStart="@dimen/all_margin"
android:text="启用状态:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<RadioGroup
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<RadioButton
android:id="@+id/rd_suspendeds"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:layout_marginRight="@dimen/all_margin"
android:layout_weight="1"
android:background="@drawable/selector_checkbox_bg"
android:button="@null"
android:onClick="@{OnClickListener}"
android:text="暂停 "
android:textSize="@dimen/et_textsize"/>
<RadioButton
android:id="@+id/rd_starts"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:layout_marginRight="@dimen/all_margin"
android:layout_weight="1"
android:background="@drawable/selector_checkbox_bg"
android:button="@null"
android:onClick="@{OnClickListener}"
android:text="启用 "
android:textSize="@dimen/et_textsize"/>
</RadioGroup>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gary1"
android:paddingLeft="@dimen/all_margin"
android:paddingRight="@dimen/all_margin"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center"
android:padding="@dimen/all_padding"
android:paddingBottom="@dimen/all_margin"
android:paddingLeft="@dimen/all_margin"
android:paddingRight="@dimen/all_margin"
android:paddingTop="@dimen/all_margin_big">
<TextView
android:id="@+id/tv_vip_level"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingStart="@dimen/all_margin"
android:text="会员等级:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<TextView
android:id="@+id/tv_vip_level_select"
style="@style/dialog_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_weight="5"
android:drawableRight="@mipmap/createstore_drop_down"
android:ems="10"
android:gravity="center"
android:maxLength="5"
android:onClick="@{OnClickListener}"
android:textColor="@color/black"
android:textColorHint="@color/hint"
android:textSize="@dimen/et_textsize"/>
<TextView
android:id="@+id/tv_vip_level_select_show_no_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_weight="5"
android:ems="10"
android:gravity="center"
android:maxLength="5"
android:textColor="@color/black"
android:textColorHint="@color/hint"
android:textSize="@dimen/et_textsize"
android:visibility="gone"/>
<TextView
android:id="@+id/ns_vip_level"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center"
android:padding="@dimen/all_padding">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingStart="@dimen/all_margin"
android:text="获取方式:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<RadioGroup
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="7"
android:checkedButton="@id/rd_gettype_all"
android:orientation="horizontal">
<RadioButton
android:id="@+id/rd_gettype_all"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:layout_marginRight="@dimen/all_margin"
android:layout_weight="1"
android:background="@drawable/selector_checkbox_bg"
android:button="@null"
android:onClick="@{OnClickListener}"
android:text="通用 "
android:textColor="@color/black"
android:textSize="@dimen/et_textsize"/>
<RadioButton
android:id="@+id/rd_gettype_category"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:layout_marginRight="@dimen/all_margin"
android:layout_weight="1"
android:background="@drawable/selector_checkbox_bg"
android:button="@null"
android:onClick="@{OnClickListener}"
android:text="品类定义 "
android:textColor="@color/black"
android:textSize="@dimen/et_textsize"/>
<RadioButton
android:id="@+id/rd_gettype_shop"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:layout_marginRight="@dimen/all_margin"
android:layout_weight="1"
android:background="@drawable/selector_checkbox_bg"
android:button="@null"
android:onClick="@{OnClickListener}"
android:text="商品定义 "
android:textColor="@color/black"
android:textSize="@dimen/et_textsize"/>
</RadioGroup>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_all"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/all_padding">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingStart="@dimen/all_margin"
android:text="积分比例:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<EditText
android:id="@+id/et_integral_weight"
style="@style/dialog_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_weight="2"
android:digits="1234567890"
android:ems="5"
android:gravity="center_vertical"
android:inputType="phone|number"
android:maxLength="5"
android:saveEnabled="false"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:text="元一个积分"
android:textColor="@color/black"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/all_padding"
android:paddingBottom="@dimen/all_margin"
android:paddingTop="@dimen/all_margin">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingStart="@dimen/all_margin"
android:text="有效期限:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<EditText
android:id="@+id/et_integral_time_limit"
style="@style/dialog_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_weight="2"
android:digits="1234567890"
android:ems="5"
android:gravity="center_vertical"
android:inputType="phone|number"
android:maxLength="5"
android:saveEnabled="false"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:text="个月"
android:textColor="@color/black"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_category"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:padding="@dimen/all_padding"
android:paddingBottom="@dimen/all_margin"
android:paddingTop="@dimen/all_margin">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingStart="@dimen/all_margin"
android:text="商品品类:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<TextView
android:id="@+id/tv_category_select_one"
style="@style/dialog_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_weight="2"
android:drawableRight="@mipmap/createstore_drop_down"
android:ellipsize="end"
android:gravity="center"
android:maxLength="5"
android:onClick="@{OnClickListener}"
android:singleLine="true"
android:textColor="@color/black"
android:textColorHint="@color/hint"
android:textSize="@dimen/et_textsize"/>
<TextView
android:id="@+id/tv_category_select_two"
style="@style/dialog_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginLeft="@dimen/all_padding"
android:layout_weight="2"
android:drawableRight="@mipmap/createstore_drop_down"
android:ellipsize="end"
android:gravity="center"
android:maxLength="5"
android:onClick="@{OnClickListener}"
android:singleLine="true"
android:textColor="@color/black"
android:textColorHint="@color/hint"
android:textSize="@dimen/et_textsize"/>
<TextView
android:id="@+id/tv_category_select_three"
style="@style/dialog_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginLeft="@dimen/all_padding"
android:layout_weight="2"
android:drawableRight="@mipmap/createstore_drop_down"
android:ellipsize="end"
android:ems="10"
android:gravity="center"
android:maxLength="5"
android:onClick="@{OnClickListener}"
android:singleLine="true"
android:textColor="@color/black"
android:textColorHint="@color/hint"
android:textSize="@dimen/et_textsize"/>
<TextView
android:id="@+id/tv_category_select_show_no_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginLeft="@dimen/all_padding"
android:layout_weight="6"
android:ellipsize="end"
android:ems="20"
android:gravity="center"
android:maxLength="20"
android:singleLine="true"
android:textColor="@color/black"
android:textColorHint="@color/hint"
android:textSize="@dimen/et_textsize"
android:visibility="gone"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text=""
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:padding="@dimen/all_padding">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingStart="@dimen/all_margin"
android:text="积分比例:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<EditText
android:id="@+id/et_integral_category_weight"
style="@style/dialog_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_weight="2"
android:digits="1234567890"
android:gravity="center_vertical"
android:inputType="phone|number"
android:maxLength="5"
android:saveEnabled="false"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:text="元一个积分"
android:textColor="@color/black"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:padding="@dimen/all_padding"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingStart="@dimen/all_margin"
android:text="有效期限:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<EditText
android:id="@+id/et_integral_category_time_limit"
style="@style/dialog_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_weight="2"
android:digits="1234567890"
android:ems="5"
android:gravity="center_vertical"
android:inputType="phone|number"
android:maxLength="5"
android:saveEnabled="false"
android:textColor="@color/black"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:text="个月"
android:textColor="@color/black"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_shop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:padding="@dimen/all_padding"
android:paddingTop="@dimen/all_padding"
android:visibility="gone">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingStart="@dimen/all_margin"
android:text="有效期限:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<EditText
android:id="@+id/et_shop_time_limit"
style="@style/dialog_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_weight="2"
android:digits="1234567890"
android:ems="5"
android:gravity="center_vertical"
android:inputType="phone|number"
android:maxEms="5"
android:maxLength="5"
android:saveEnabled="false"
android:textColor="@color/black"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:text="个月"
android:textColor="@color/black"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="OnClickListener"
type="android.view.View.OnClickListener"></variable>
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/store_back"
android:focusable="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center"
android:padding="@dimen/all_padding">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingStart="@dimen/all_margin"
android:text="活动名称:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<TextView
android:id="@+id/tv_integral_rule_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:focusable="true"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gary1"
android:paddingLeft="@dimen/all_margin"
android:paddingRight="@dimen/all_margin"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center"
android:padding="@dimen/all_padding">
<TextView
android:id="@+id/tv_status"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingStart="@dimen/all_margin"
android:text="启用状态:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<RadioGroup
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:checkedButton="@id/rb_suspended"
android:orientation="horizontal">
<RadioButton
android:id="@+id/rb_suspended"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:layout_marginRight="@dimen/all_margin"
android:layout_weight="1"
android:background="@drawable/selector_checkbox_bg"
android:button="@null"
android:onClick="@{OnClickListener}"
android:text="暂停 "
android:textSize="@dimen/et_textsize"/>
<RadioButton
android:id="@+id/rb_start"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:layout_marginRight="@dimen/all_margin"
android:layout_weight="1"
android:background="@drawable/selector_checkbox_bg"
android:button="@null"
android:onClick="@{OnClickListener}"
android:text="启用 "
android:textSize="@dimen/et_textsize"/>
</RadioGroup>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gary1"
android:paddingLeft="@dimen/all_margin"
android:paddingRight="@dimen/all_margin"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:gravity="center"
android:orientation="horizontal"
android:padding="@dimen/all_padding"
android:paddingBottom="@dimen/all_margin"
android:paddingLeft="@dimen/all_margin"
android:paddingRight="@dimen/all_margin"
android:paddingTop="@dimen/all_margin_big">
<TextView
android:id="@+id/tv_vip_level"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingStart="@dimen/all_margin"
android:text="规则设置:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/all_padding">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingStart="@dimen/all_margin"
android:text="优惠券面值:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<EditText
android:id="@+id/et_ticket_money"
style="@style/dialog_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_weight="2"
android:digits="1234567890"
android:ems="5"
android:inputType="number"
android:maxLength="5"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingLeft="@dimen/all_padding"
android:text="元"
android:textColor="@color/black"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/all_padding">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingStart="@dimen/all_margin"
android:text="券有效期:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<TextView
android:id="@+id/tv_date"
style="@style/dialog_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_weight="2"
android:onClick="@{OnClickListener}"
android:paddingBottom="2dp"
android:paddingTop="2dp"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/all_padding">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingStart="@dimen/all_margin"
android:text="订单金额满:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<EditText
android:id="@+id/et_rule_money"
style="@style/dialog_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_weight="2"
android:digits="1234567890"
android:ems="5"
android:inputType="phone|number"
android:maxLength="5"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingLeft="@dimen/all_padding"
android:text="元可用"
android:textColor="@color/black"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/all_padding">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingStart="@dimen/all_margin"
android:text="每单使用:"
android:textColor="@color/black"
android:textSize="@dimen/text_secondary_title"/>
<EditText
android:id="@+id/et_ticket_count"
style="@style/dialog_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_weight="2"
android:digits="1234567890"
android:ems="5"
android:inputType="phone|number"
android:maxLength="2"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:paddingLeft="@dimen/all_padding"
android:text="张"
android:textColor="@color/black"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</layout>
\ No newline at end of file
...@@ -9,29 +9,21 @@ ...@@ -9,29 +9,21 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/white"> 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.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srl_product" android:id="@+id/srl_product"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginTop="@dimen/all_margin"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title"> app:layout_constraintTop_toTopOf="parent">
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/announcement_recycler" android:id="@+id/announcement_recycler"
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" />
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<include <include
android:id="@+id/ic_title" android:id="@+id/ic_title"
layout="@layout/title"/> layout="@layout/title_appback"/>
<LinearLayout <LinearLayout
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<include <include
android:id="@+id/ic_title" android:id="@+id/ic_title"
layout="@layout/title"/> layout="@layout/title_appback"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<include <include
android:id="@+id/ic_title" android:id="@+id/ic_title"
layout="@layout/title"></include> layout="@layout/title_appback"></include>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<include android:id="@+id/ic_title" layout="@layout/title"/> <include android:id="@+id/ic_title" layout="@layout/title_appback"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -68,8 +68,7 @@ ...@@ -68,8 +68,7 @@
android:ems="10" android:ems="10"
android:hint="@string/login_et_password_hint" android:hint="@string/login_et_password_hint"
android:inputType="textPassword" android:inputType="textPassword"
android:maxLength="16" android:maxLength="16"/>
/>
<Button <Button
...@@ -80,6 +79,7 @@ ...@@ -80,6 +79,7 @@
android:layout_marginRight="@dimen/all_margin_left" android:layout_marginRight="@dimen/all_margin_left"
android:layout_marginTop="@dimen/et_margin_logo" android:layout_marginTop="@dimen/et_margin_logo"
android:background="@drawable/red_border" android:background="@drawable/red_border"
android:imeOptions="actionDone"
android:onClick="@{onClickListener}" android:onClick="@{onClickListener}"
android:text="@string/login_signinfragmentfragment_btn_login" android:text="@string/login_signinfragmentfragment_btn_login"
android:textColor="@color/white" android:textColor="@color/white"
...@@ -87,9 +87,9 @@ ...@@ -87,9 +87,9 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left" android:layout_marginLeft="@dimen/all_margin_left"
android:layout_marginRight="@dimen/all_margin_left" android:layout_marginRight="@dimen/all_margin_left"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/et_margin_logo"> android:layout_marginTop="@dimen/et_margin_logo">
<TextView <TextView
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
android:background="@color/appBack" android:background="@color/appBack"
android:orientation="vertical"> android:orientation="vertical">
<include android:id="@+id/ic_title" layout="@layout/title"></include> <include android:id="@+id/ic_title" layout="@layout/title_appback"></include>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
......
<?xml version="1.0" encoding="utf-8"?>
<layout >
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/gray_zhouyu"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/all_padding"
android:text="2017-10-10" />
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="@dimen/all_shape_radius"
android:layout_marginLeft="@dimen/all_margin"
android:layout_marginRight="@dimen/all_margin"
android:layout_marginBottom="@dimen/all_padding">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/all_margin"
>
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_margin"
android:layout_marginEnd="@dimen/all_padding"
android:layout_marginStart="@dimen/all_padding"
android:layout_marginTop="@dimen/all_margin"
android:text="心灵受金华路:糖库心灵受的巅峰之路!"
android:textColor="@color/black_baozheng"
android:textStyle="bold" />
<TextView
android:id="@+id/body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="@dimen/dp_4"
android:paddingStart="@dimen/dp_4"
android:text="ask領導就阿喀琉斯大家阿厤克斯大家阿隆索死啦對啦開始覺得請問哦請假了受打擊啦看到解開了缺點青蛙禮金卡實力坑爹 啊就是了看到薔薇科額的擴大勢力的就喀什燈籠褲幾千萬大家拉薩大家李克强千萬快樂件大事多久啦空間的權威的來擴大是快樂的切阿德 啊時代科技千龍網的!" />
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</layout>
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/cv_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:paddingTop="@dimen/all_padding"
android:paddingBottom="@dimen/all_padding"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_vip"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="适用会员"
android:textSize="@dimen/et_textsize"/>
<TextView
android:id="@+id/tv_source"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:text="来源品类"
android:textSize="@dimen/et_textsize"/>
<TextView
android:id="@+id/tv_get"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="获取规则"
android:textSize="@dimen/et_textsize"/>
<ImageView
android:id="@+id/tv_status"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@mipmap/integral_open"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="ticket"
type="com.xingdata.zzdpos.model.Ticket"/>
</data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.constraint.ConstraintLayout
android:id="@+id/cl_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/return_ticket_one"/>
<LinearLayout
android:id="@+id/ll_top"
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center"
android:orientation="horizontal"
android:padding="@dimen/all_padding"
app:layout_constraintBottom_toTopOf="@id/ll_bottom"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_weight="2.5">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="¥"
android:textColor="@color/white"
android:textSize="@dimen/et_textsize"/>
<TextView
android:id="@+id/tv_ticket_money"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/all_padding"
android:gravity="center"
android:text="20"
android:textColor="@color/white"
android:textSize="45sp"
android:textStyle="bold"/>
<TextView
android:id="@+id/tv_ticket"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/all_padding"
android:text="优惠券"
android:textColor="@color/white"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_bottom"
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_top"
app:layout_constraintVertical_weight="2">
<TextView
android:id="@+id/tv_rule"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="@string/tv_rule"
android:textColor="@color/white"
android:textSize="@dimen/et_textsize"/>
<TextView
android:id="@+id/tv_date"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="@dimen/all_padding"
android:layout_weight="1"
android:text="@string/tv_date"
android:textColor="@color/white"
android:textSize="@dimen/et_text_mini"/>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
android:id="@+id/cl_send"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/return_ticket_two"/>
<TextView
android:id="@+id/tv_send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="发券"
android:textColor="@color/white"
android:textSize="@dimen/et_textsize"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</android.support.constraint.ConstraintLayout>
</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="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#EEEEEE">
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#aaa"/>
<ImageView
android:id="@+id/iv_cancel"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_centerVertical="true"
android:layout_marginLeft="17dp"
android:padding="8dp"
android:src="@mipmap/to_down"/>
<TextView
android:id="@+id/tv_finish"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="17dp"
android:padding="8dp"
android:text="完成"
android:textColor="#24AD9D"
android:textSize="18sp"/>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#aaa"/>
</RelativeLayout>
<!--此部分需要完整复制过去,删减或者更改ID会导致初始化找不到内容而报空-->
<LinearLayout
android:id="@+id/optionspicker"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:orientation="horizontal">
<com.bigkoo.pickerview.lib.WheelView
android:id="@+id/options1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<com.bigkoo.pickerview.lib.WheelView
android:id="@+id/options2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<com.bigkoo.pickerview.lib.WheelView
android:id="@+id/options3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#24ad9d"/>
</LinearLayout>
</layout>
\ No newline at end of file
...@@ -11,20 +11,20 @@ ...@@ -11,20 +11,20 @@
</data> </data>
<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="50dp" android:layout_height="?attr/actionBarSize"
android:background="@drawable/singleline" android:background="@drawable/singleline_white_gray"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:id="@+id/iv_back" android:id="@+id/iv_back"
android:layout_width="@dimen/title_height" android:layout_width="@dimen/title_height"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:onClick="@{onClickListener}" android:onClick="@{onClickListener}"
android:padding="16dp" android:padding="@dimen/all_margin"
android:src="@mipmap/back_white"/> android:src="@mipmap/back_black"/>
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"
...@@ -32,9 +32,8 @@ ...@@ -32,9 +32,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:text="标题" android:text="标题"
android:textColor="@color/white" android:textColor="@color/black_baozheng"
android:textSize="@dimen/text_secondary_title" android:textSize="@dimen/text_secondary_title" />
android:textStyle="bold"/>
</RelativeLayout> </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="@dimen/title_height"
android:background="@drawable/singleline"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_back"
android:layout_width="@dimen/title_height"
android:layout_height="match_parent"
android:gravity="center"
android:onClick="@{onClickListener}"
android:padding="16dp"
android:src="@mipmap/back_white"/>
<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/white"
android:textSize="@dimen/text_secondary_title"
android:textStyle="bold"/>
</RelativeLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tv_empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/all_margin"
android:drawableTop="@mipmap/icon_things_null"
android:gravity="center"
android:lineSpacingExtra="@dimen/all_padding"
android:text="@string/empty_other_select"
android:textColor="@color/white_half"
android:textSize="@dimen/all_text_size_big" />
</LinearLayout>
\ No newline at end of file
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<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">50dp</dimen> <dimen name="title_height">50dp</dimen>
<dimen name="small_text_size">14sp</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>
......
...@@ -246,13 +246,16 @@ ...@@ -246,13 +246,16 @@
<item name="android:focusable">false</item> <item name="android:focusable">false</item>
<item name="android:focusableInTouchMode">false</item> <item name="android:focusableInTouchMode">false</item>
</style> </style>
<style name="button_positive_noradius" parent="android:ButtonBar"> <style name="button_positive_noradius" parent="android:ButtonBar">
<item name="android:background">@drawable/selector_gradient_red_button_background_noradius</item> <item name="android:background">@drawable/selector_gradient_red_button_background_noradius
</item>
<item name="android:textColor">@color/white</item> <item name="android:textColor">@color/white</item>
<item name="android:gravity">center</item> <item name="android:gravity">center</item>
<item name="android:focusable">false</item> <item name="android:focusable">false</item>
<item name="android:focusableInTouchMode">false</item> <item name="android:focusableInTouchMode">false</item>
</style> </style>
<style name="button_positive_allradius" parent="android:ButtonBar"> <style name="button_positive_allradius" parent="android:ButtonBar">
<item name="android:background">@drawable/red_border_allradius</item> <item name="android:background">@drawable/red_border_allradius</item>
<item name="android:textColor">@color/white</item> <item name="android:textColor">@color/white</item>
...@@ -260,6 +263,7 @@ ...@@ -260,6 +263,7 @@
<item name="android:focusable">false</item> <item name="android:focusable">false</item>
<item name="android:focusableInTouchMode">false</item> <item name="android:focusableInTouchMode">false</item>
</style> </style>
<style name="button_positive_bg_gray" parent="android:ButtonBar"> <style name="button_positive_bg_gray" parent="android:ButtonBar">
<item name="android:background">@drawable/selector_gradient_gray_button_background</item> <item name="android:background">@drawable/selector_gradient_gray_button_background</item>
<item name="android:textColor">@color/blue</item> <item name="android:textColor">@color/blue</item>
...@@ -267,13 +271,17 @@ ...@@ -267,13 +271,17 @@
<item name="android:focusable">false</item> <item name="android:focusable">false</item>
<item name="android:focusableInTouchMode">false</item> <item name="android:focusableInTouchMode">false</item>
</style> </style>
<style name="button_positive_bg_gray_noradius" parent="android:ButtonBar"> <style name="button_positive_bg_gray_noradius" parent="android:ButtonBar">
<item name="android:background">@drawable/selector_gradient_gray_button_background_noradius</item> <item name="android:background">
@drawable/selector_gradient_gray_button_background_noradius
</item>
<item name="android:textColor">@color/blue</item> <item name="android:textColor">@color/blue</item>
<item name="android:gravity">center</item> <item name="android:gravity">center</item>
<item name="android:focusable">false</item> <item name="android:focusable">false</item>
<item name="android:focusableInTouchMode">false</item> <item name="android:focusableInTouchMode">false</item>
</style> </style>
<style name="xuline_margin"> <style name="xuline_margin">
<item name="android:layout_width">match_parent</item> <item name="android:layout_width">match_parent</item>
<item name="android:layout_height">1dp</item> <item name="android:layout_height">1dp</item>
...@@ -328,4 +336,12 @@ ...@@ -328,4 +336,12 @@
<item name=" android:textColor">@color/gary</item> <item name=" android:textColor">@color/gary</item>
<item name="android:gravity">center|left</item> <item name="android:gravity">center|left</item>
</style> </style>
<style name="dialog_edit">
<item name="android:padding">@dimen/dialog_padding</item>
<item name="android:saveEnabled">false</item>
<item name="android:background">@drawable/selector_white_background_stroke</item>
<item name="android:layout_width">0dp</item>
<item name="android:textSize">@dimen/small_text_size</item>
</style>
</resources> </resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment