Commit 9ae76d77 by 宁斌

1、餐檯頁面UI調整

2、輸入餐檯頁面UI調整
parent d9d4e87b
......@@ -69,6 +69,7 @@ public class TableBean {
* serviceCharge : 0
* memberId : 0
* status : 0
* person : 2
* useStatus: 0
*/
......@@ -92,9 +93,42 @@ public class TableBean {
* 连台 6
*/
private int status;
/**使用狀態*/
/**
* 用餐人數
*/
private int person;
/**
* 使用狀態
*/
private int useStatus;
public DataBean() {
}
public DataBean(DataBean dataBean) {
this.id = dataBean.id;
this.tableName = dataBean.tableName;
this.restaurantId = dataBean.restaurantId;
this.qrCode = dataBean.qrCode;
this.seatCount = dataBean.seatCount;
this.createTime = dataBean.createTime;
this.createBy = dataBean.createBy;
this.qrCodeImg = dataBean.qrCodeImg;
this.posTableId = dataBean.posTableId;
this.serviceCharge = dataBean.serviceCharge;
this.memberId = dataBean.memberId;
this.status = dataBean.status;
this.person = dataBean.person;
this.useStatus = dataBean.useStatus;
}
public int getPerson() {
return person;
}
public void setPerson(int person) {
this.person = person;
}
public int getUseStatus() {
return useStatus;
......@@ -104,6 +138,7 @@ public class TableBean {
this.useStatus = useStatus;
}
public int getId() {
return id;
}
......
......@@ -533,6 +533,79 @@ public class TimeUtil {
}
/**
* 两个时间相差距离多少天多少小时多少分多少秒
*
* @param str1 时间参数 1 格式:1990-01-01 12:00:00
* @param str2 时间参数 2 格式:2009-01-01 12:00:00
* @return long[] 返回值为:{天, 时, 分, 秒}
*/
public static long[] getDistanceTimes(String str1, String str2) {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date one;
Date two;
long day = 0;
long hour = 0;
long min = 0;
long sec = 0;
try {
one = df.parse(str1);
two = df.parse(str2);
long time1 = one.getTime();
long time2 = two.getTime();
long diff;
if (time1 < time2) {
diff = time2 - time1;
} else {
diff = time1 - time2;
}
day = diff / (24 * 60 * 60 * 1000);
hour = (diff / (60 * 60 * 1000) - day * 24);
min = ((diff / (60 * 1000)) - day * 24 * 60 - hour * 60);
sec = (diff / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - min * 60);
} catch (ParseException e) {
e.printStackTrace();
}
long[] times = {day, hour, min, sec};
return times;
}
public static long[] getDistanceTimes2(String str1, String str2) {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date one;
Date two;
long day = 0;
long hour = 0;
long min = 0;
long sec = 0;
try {
one = df.parse(str1);
two = df.parse(str2);
long time1 = one.getTime();
long time2 = two.getTime();
long diff;
if (time1 < time2) {
diff = time2 - time1;
} else {
diff = time1 - time2;
}
day = diff / (24 * 60 * 60 * 1000);
hour = (diff / (60 * 60 * 1000) - day * 24);
min = ((diff / (60 * 1000)) - day * 24 * 60 - hour * 60);
sec = (diff / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - min * 60);
} catch (ParseException e) {
e.printStackTrace();
}
// if (day != 0) {
// hour += day * 24;
// }
// if (hour != 0) {
// min += hour * 60;
// }
long[] times = {hour, min, sec};
return times;
}
/**
* 描述:获取本周一.
*
* @param format the format
......
......@@ -54,7 +54,8 @@ public class Function {
private int backgroundColorRes;
@Transient
private int textSizeRes;
@Transient
private int iconRes;
@Generated(hash = 816556116)
public Function(Long dbid, @NotNull Long id, int parentId, int groupId, int status,
......@@ -75,14 +76,12 @@ public class Function {
public Function() {
}
public Function(@NotNull Long id, int status, long effectiveTime,
String resName, String resUrl, String imageURL) {
public Function(Long id, String resName, int textColorRes, int textSizeRes, int iconRes) {
this.id = id;
this.status = status;
this.effectiveTime = effectiveTime;
this.resName = resName;
this.resUrl = resUrl;
this.imageURL = imageURL;
this.textColorRes = textColorRes;
this.textSizeRes = textSizeRes;
this.iconRes = iconRes;
}
public Function(String resName, int textColor, int backgroundColor, int textSize) {
......@@ -211,22 +210,12 @@ public class Function {
this.textSizeRes = textSizeRes;
}
@Override
public String toString() {
return "Function{" +
"id=" + id +
", status=" + status +
", effectiveTime=" + effectiveTime +
", resName='" + resName + '\'' +
", resUrl='" + resUrl + '\'' +
", imageURL='" + imageURL + '\'' +
", textColor=" + textColor +
", backgroundColor=" + backgroundColor +
", textSize=" + textSize +
", textColorRes=" + textColorRes +
", backgroundColorRes=" + backgroundColorRes +
", textSizeRes=" + textSizeRes +
'}';
public int getIconRes() {
return iconRes;
}
public void setIconRes(int iconRes) {
this.iconRes = iconRes;
}
public Long getDbid() {
......@@ -260,4 +249,28 @@ public class Function {
public void setIcRes(int icRes) {
this.icRes = icRes;
}
@Override
public String toString() {
return "Function{" +
"dbid=" + dbid +
", id=" + id +
", parentId=" + parentId +
", groupId=" + groupId +
", status=" + status +
", effectiveTime=" + effectiveTime +
", resName='" + resName + '\'' +
", resUrl='" + resUrl + '\'' +
", imageURL='" + imageURL + '\'' +
", icRes=" + icRes +
", textColor=" + textColor +
", backgroundColor=" + backgroundColor +
", textSize=" + textSize +
", nameRes=" + nameRes +
", textColorRes=" + textColorRes +
", backgroundColorRes=" + backgroundColorRes +
", textSizeRes=" + textSizeRes +
", iconRes=" + iconRes +
'}';
}
}
......@@ -16,7 +16,6 @@ import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
/**
* Created by Wyh on 2019/9/20.
*/
......
......@@ -41,6 +41,11 @@
<color name="keyboard_fast_paybill_normal">#FFA317</color>
<color name="keyboard_fast_paybill_press">#99FFA317</color>
<color name="table_normal">#FFFFFFFF</color>
<color name="table_send">#FF249B65</color>
<color name="table_print">#FFE5AC00</color>
<color name="table_use">#FFD14141</color>
<color name="pay_load_success">#03a44e</color>
<color name="pay_load_failure">#de0e26</color>
......
package com.gingersoft.gsa.cloud.table.mvp.model.bean;
import com.gingersoft.gsa.cloud.base.common.bean.OrderBean;
import com.gingersoft.gsa.cloud.base.common.bean.OrderDetail;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import static com.gingersoft.gsa.cloud.base.common.bean.OrderDetail.FOOD_TYPE;
import static com.gingersoft.gsa.cloud.base.common.bean.OrderDetail.getItemType;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
......@@ -166,4 +171,30 @@ public class OrderDetailItem implements Serializable {
this.orderDetails = orderDetails;
}
public static List<OrderDetail> orderTransOrderDetails(List<OrderBean.OrderDetailsBean> orderDetails) {
List<OrderDetail> orderDetailList = new ArrayList<>();
OrderDetail parentOrderDetail = null;
for (OrderBean.OrderDetailsBean orderDetailsBean : orderDetails) {
OrderDetail orderDetail = new OrderDetail();
orderDetail.setId(orderDetailsBean.getId());
orderDetail.setProductId(orderDetailsBean.getProductId());
orderDetail.setOrderId(orderDetailsBean.getOrderId());
orderDetail.setParentId(orderDetailsBean.getParentId());
orderDetail.setProductName(orderDetailsBean.getProductName());
orderDetail.setNumber(orderDetailsBean.getNumber());
orderDetail.setPrice(orderDetailsBean.getPrice());
orderDetail.setVisible(orderDetailsBean.getStatus() == 0);
// orderDetail.setAutomod(foods.getAutomod());
orderDetail.setIsfood(orderDetailsBean.getType() == FOOD_TYPE);
orderDetail.setNew(false);
orderDetail.setType(orderDetailsBean.getType());
orderDetail.setItemType(getItemType(orderDetailsBean, parentOrderDetail));
orderDetailList.add(orderDetail);
if (orderDetail.isIsfood()) {
parentOrderDetail = orderDetail;
}
}
return orderDetailList;
}
}
......@@ -20,6 +20,7 @@ import retrofit2.http.POST;
* 描述:
*/
public interface MealService {
@POST("order/send" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> createOrder(@Body RequestBody requestBody);
......
......@@ -12,6 +12,7 @@ import com.gingersoft.gsa.cloud.base.common.bean.PayMethod;
import com.gingersoft.gsa.cloud.base.common.bean.TableBean;
import com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage;
import com.gingersoft.gsa.cloud.base.common.bean.mealManage.OpenTableManage;
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtil;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.mvp.contract.AllOrderContract;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.OrderDetailItem;
......@@ -29,6 +30,7 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.inject.Inject;
......@@ -114,7 +116,7 @@ public class AllOrderPresenter extends BasePresenter<AllOrderContract.Model, All
MyOrderManage.getInstance().setOrderBean(orderBean);
TableBean.DataBean openTableBean = new TableBean.DataBean();
openTableBean.setCreateTime(datasBean.getCreateTime());
openTableBean.setCreateTime(TimeUtil.getStringByFormat(new Date(datasBean.getCreateTime()), TimeUtil.dateFormatYMDHM));
openTableBean.setTableName(datasBean.getTableName());
openTableBean.setId(datasBean.getTableId());
OpenTableManage.getDefault().setTableBean(openTableBean);
......@@ -153,7 +155,7 @@ public class AllOrderPresenter extends BasePresenter<AllOrderContract.Model, All
OpenTableManage.getDefault().setPeopleNumber(orderDetailItem.getPerson());
TableBean.DataBean dataBean = new TableBean.DataBean();
dataBean.setTableName(orderDetailItem.getTableName());
dataBean.setCreateTime(orderDetailItem.getCreateTime());
dataBean.setCreateTime(TimeUtil.getStringByFormat(new Date(orderDetailItem.getCreateTime()), TimeUtil.dateFormatYMDHM));
OpenTableManage.getDefault().setTableBean(dataBean);
List<PayMethod> payMethodList = getPayMethodList(orderDetailItem);
//設置打印所需支付方式
......
......@@ -316,11 +316,11 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
mRootView.setModifierTop(0);
}
// if (food.getAutoMod() == 1) {
if (isSelectedMeal || comboItemList.size() > 0 || modifierList.size() > 0) {
isSelectedMeal = isSelectedMeal && (comboItemList.size() > 0 || modifierList.size() > 0);
boolean autoMod = food.getAutoMod() == 1 && (comboItemList.size() > 0 || modifierList.size() > 0);
if (isSelectedMeal || autoMod) {
mRootView.showViewModeVisibility(MealConstant.combo_ViewMode, MealConstant.modifier_ViewMode);
}
// }
}
private void loadModifierData(long fid) {
......@@ -402,6 +402,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
/**
* 打印上菜紙
*
* @param initTable 是否是開台
*/
private void printSendOrder(boolean initTable) {
......
......@@ -27,6 +27,7 @@ import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.http.imageloader.ImageLoader;
import com.jess.arms.integration.AppManager;
import com.jess.arms.mvp.BasePresenter;
import com.jess.arms.utils.ArmsUtils;
import com.jess.arms.utils.RxLifecycleUtils;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
......@@ -161,10 +162,11 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
}
public void initBottomFunctionItem() {
mBottomFunctionList.add(new Function((long) 1, 1, 2025, "重置檯號", "", String.valueOf(R.mipmap.table_init)));
mBottomFunctionList.add(new Function((long) 2, 1, 2025, "轉檯", "", String.valueOf(R.mipmap.table_move)));
// mBottomFunctionList.add(new Function((long) 3, 1, 2025, "分檯", "", ""));
// mBottomFunctionList.add(new Function((long) 4, 1, 2025, "↑", "", ""));
mBottomFunctionList.add(new Function((long) 1, "重置檯號", ArmsUtils.getColor(IActivity, R.color.theme_black), ArmsUtils.getDimens(IActivity, R.dimen.sp_14), R.mipmap.table_init));
mBottomFunctionList.add(new Function((long) 2, "轉檯", ArmsUtils.getColor(IActivity, R.color.theme_black), ArmsUtils.getDimens(IActivity, R.dimen.sp_14), R.mipmap.table_move));
mBottomFunctionList.add(new Function((long) 3, "分檯", ArmsUtils.getColor(IActivity, R.color.theme_black), ArmsUtils.getDimens(IActivity, R.dimen.sp_14), R.mipmap.table_splite));
mBottomFunctionList.add(new Function((long) 4, "skyorder", ArmsUtils.getColor(IActivity, R.color.theme_black), ArmsUtils.getDimens(IActivity, R.dimen.sp_14), R.mipmap.table_skyorder));
// mBottomFunctionList.add(new Function((long) 5, "上菜紙", ArmsUtils.getColor(IActivity,R.color.theme_black), ArmsUtils.getDimens(IActivity,R.dimen.sp_14), R.mipmap.table_paper));
}
public void getTables(boolean show) {
......@@ -225,13 +227,13 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
@Override
public void onNext(@NonNull BaseRespose respose) {
if (respose.isSuccess()) {
//設置當前開台數據
TableBean.DataBean openTableBean = getTableById(tableId);
//先將開台時間設置為當前時間
if(openTableBean != null) {
openTableBean.setCreateTime(TimeUtils.getTime(System.currentTimeMillis(), TimeUtils.DEFAULT_DATE_FORMAT));
//設置當前開台數據1584427984728 1584428017196 1584428086282
TableBean.DataBean dataBean = getTableById(tableId);
TableBean.DataBean openTableBean = null;
if (dataBean != null) {
openTableBean = new TableBean.DataBean(dataBean);
}
OpenTableManage.getDefault().setPeopleNumber(0);
OrderBean orderBean = respose.getData();
if (orderBean != null && respose.getData().getOrderDetails() != null) {
if (respose.getData().getCreateTime() != null && openTableBean != null) {
......@@ -251,7 +253,9 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
MyOrderManage.getInstance().setOrderBean(null);
MyOrderManage.getInstance().setOrderFoodList(new ArrayList<>());
}
if (openTableBean != null) {
OpenTableManage.getDefault().setTableBean(openTableBean);
}
mRootView.startMealStandActivity();
} else {
mRootView.showMessage(respose.getErrMsg());
......
......@@ -38,6 +38,8 @@ import com.qmuiteam.qmui.alpha.QMUIAlphaImageButton;
import com.qmuiteam.qmui.layout.QMUIButton;
import com.qmuiteam.qmui.util.QMUIDisplayHelper;
import com.qmuiteam.qmui.widget.QMUITopBar;
import com.qmuiteam.qmui.widget.tab.QMUITab;
import com.qmuiteam.qmui.widget.tab.QMUITabBuilder;
import com.qmuiteam.qmui.widget.tab.QMUITabIndicator;
import com.qmuiteam.qmui.widget.tab.QMUITabSegment;
......@@ -348,11 +350,9 @@ public class TableActivity extends BaseActivity<TablePresenter> implements Table
rv_bottom_function.setAdapter(adapter);
}
private GridLayoutManager bottomFunctionRecycleLayoutManager;
@Override
public void setBottomFunctionRecycleLayoutManager(int orientation) {
bottomFunctionRecycleLayoutManager = new GridLayoutManager(this, GoldConstants.bottomFunctionColCount, orientation, false);
GridLayoutManager bottomFunctionRecycleLayoutManager = new GridLayoutManager(this, GoldConstants.bottomFunctionColCount, orientation, false);
rv_bottom_function.setLayoutManager(bottomFunctionRecycleLayoutManager);
rv_bottom_function.setItemAnimator(new DefaultItemAnimator());
}
......@@ -382,19 +382,19 @@ public class TableActivity extends BaseActivity<TablePresenter> implements Table
if (allTableFragment != null) {
return allTableFragment;
}
allTableFragment = new AllTableFragment();
allTableFragment = AllTableFragment.newInstance();
return allTableFragment;
case 2:
if (stateTableFragment != null) {
return stateTableFragment;
}
stateTableFragment = new StateTableFragment();
stateTableFragment = StateTableFragment.newInstance();
return stateTableFragment;
default:
if (inputTableFragment != null) {
return inputTableFragment;
}
inputTableFragment = new InputTableFragment();
inputTableFragment = InputTableFragment.newInstance();
return inputTableFragment;
}
}
......@@ -406,35 +406,47 @@ public class TableActivity extends BaseActivity<TablePresenter> implements Table
@Override
public CharSequence getPageTitle(int position) {
switch (position) {
case 1:
return tabTitles[1];
case 2:
return tabTitles[2];
default:
return tabTitles[0];
}
return "";
}
};
QMUITabBuilder builder = mTabSegment.tabBuilder();
QMUITab tab1 = builder
.setText(tabTitles[0])
.build(mContext);
QMUITab tab2 = builder
.setText(tabTitles[1])
.build(mContext);
QMUITab tab3 = builder
.setNormalDrawable(ContextCompat.getDrawable(mContext, R.drawable.arrow_down_black))
.setSelectedDrawable(ContextCompat.getDrawable(mContext, R.drawable.arrow_down_black))
.setIconPosition(QMUITab.ICON_POSITION_RIGHT)
.setText(tabTitles[2])
.build(mContext);
mTabSegment.addTab(tab1).addTab(tab2).addTab(tab3);
mContentViewPager.setAdapter(pagerAdapter);
mContentViewPager.setCurrentItem(mCurrentPageIndex);
int space = QMUIDisplayHelper.dp2px(this, 16);
mTabSegment.setIndicator(new QMUITabIndicator(QMUIDisplayHelper.dp2px(this, 2), false, true));
mTabSegment.setDefaultTextSize(QMUIDisplayHelper.dp2px(this, 16), QMUIDisplayHelper.dp2px(this, 16));
mTabSegment.setPadding(space, 0, space, 0);
mTabSegment.setupWithViewPager(mContentViewPager);
mTabSegment.setupWithViewPager(mContentViewPager, false);
mTabSegment.addOnTabSelectedListener(new QMUITabSegment.OnTabSelectedListener() {
@Override
public void onTabSelected(int index) {
if (index == 0) {
setBottomFunctionVisibility(false);
switch (index){
case 0:
// setBottomFunctionVisibility(false);
//标号输入页面 暂停刷新餐台数据
onPauseRefreshTableData();
} else {
setBottomFunctionVisibility(true);
break;
case 1:
case 2:
// setBottomFunctionVisibility(true);
//页面切换完成区域,状态页面恢复获取餐台数据
onStartRefreshTableData();
break;
}
mCurrentPageIndex = index;
}
......
......@@ -215,7 +215,7 @@ public class OrderCenterActivity extends BaseActivity<OrderCenterPresenter> impl
killMyself();
}
});
mTopBar.setTitle("單管理");
mTopBar.setTitle("單管理");
}
@Override
......
......@@ -156,7 +156,7 @@ public class OrderDetailActivity extends BaseActivity<OrderDetailPresenter> impl
private void initOrderDetail(OrderDetailItem orderDetailItem) {
if (orderDetailItem != null) {
String payBill = LanguageUtils.get_language_system(this, "opentable.paybill", "結賬") + ":";
String tableName = LanguageUtils.get_language_system(this, "table.number", "檯號̖") + ":";
String tableName = LanguageUtils.get_language_system(this, "table.number", "檯號") + ":";
String pax = LanguageUtils.get_language_system(this, "Meal.Mannumber", "人數") + ":";
String orderNumber = LanguageUtils.get_language_system(this, "order.number", "訂單號") + ":";
String openTable = LanguageUtils.get_language_system(this, "open.table", "開台") + ":";
......@@ -175,7 +175,7 @@ public class OrderDetailActivity extends BaseActivity<OrderDetailPresenter> impl
setOrderStatus(orderDetailItem);
mOrderDetailList = OrderAssemblyUtil.assemblyOrder(OrderDetail.orderTransOrderDetails(orderDetailItem.getOrderDetails()));
mOrderDetailList = OrderAssemblyUtil.assemblyOrder(OrderDetailItem.orderTransOrderDetails(orderDetailItem.getOrderDetails()));
setOrderDetailFoodAdapter(mOrderDetailList);
setOrderPayMethodAdapter(orderDetailItem);
}
......@@ -276,14 +276,14 @@ public class OrderDetailActivity extends BaseActivity<OrderDetailPresenter> impl
MyOrderManage.getInstance().setOrderBean(orderBean);
TableBean.DataBean openTableBean = new TableBean.DataBean();
openTableBean.setCreateTime(datasBean.getCreateTime());
openTableBean.setCreateTime(TimeUtil.getStringByFormat(new Date(datasBean.getCreateTime()), TimeUtil.dateFormatYMDHM));
openTableBean.setTableName(datasBean.getTableName());
openTableBean.setId(datasBean.getTableId());
OpenTableManage.getDefault().setTableBean(openTableBean);
OpenTableManage.getDefault().setPeopleNumber(datasBean.getPerson());
List<OrderBean.OrderDetailsBean> orderDetailsBeans = datasBean.getOrderDetails();
List<OrderDetail> orderDetailList = OrderAssemblyUtil.assemblyOrder(OrderDetail.orderTransOrderDetails(orderDetailsBeans));
List<OrderDetail> orderDetailList = OrderAssemblyUtil.assemblyOrder(OrderDetailItem.orderTransOrderDetails(orderDetailsBeans));
MyOrderManage.getInstance().setOrderFoodList(orderDetailList);
Intent intent = new Intent(this, MealStandActivity.class);
......@@ -302,7 +302,7 @@ public class OrderDetailActivity extends BaseActivity<OrderDetailPresenter> impl
OpenTableManage.getDefault().setPeopleNumber(orderDetailItem.getPerson());
TableBean.DataBean dataBean = new TableBean.DataBean();
dataBean.setTableName(orderDetailItem.getTableName());
dataBean.setCreateTime(orderDetailItem.getCreateTime());
dataBean.setCreateTime(TimeUtil.getStringByFormat(new Date(orderDetailItem.getCreateTime()), TimeUtil.dateFormatYMDHM));
OpenTableManage.getDefault().setTableBean(dataBean);
CC.obtainBuilder("Component.Print")
.setActionName("printActivity")
......
......@@ -69,14 +69,8 @@ public class BottomFunctionAdapter extends DefaultAdapter<Function> {
private void initItemData(Function item) {
tv_name.setText(item.getResName());
iv_icon.setImageResource(Integer.parseInt(item.getImageURL()));
iv_icon.setImageResource(item.getIconRes());
}
private void initItemTableClick(TableBean.DataBean item, int position) {
}
}
......
......@@ -3,22 +3,31 @@ package com.gingersoft.gsa.cloud.table.mvp.ui.adapter;
import android.content.Context;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.StateListDrawable;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.gingersoft.gsa.cloud.aspectj.SingleClick;
import com.gingersoft.gsa.cloud.aspectj.XClickUtil;
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtil;
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.R2;
import com.gingersoft.gsa.cloud.base.common.bean.TableBean;
import com.jess.arms.base.BaseHolder;
import com.jess.arms.base.DefaultAdapter;
import com.jess.arms.utils.ArmsUtils;
import com.qmuiteam.qmui.alpha.QMUIAlphaRelativeLayout;
import com.qmuiteam.qmui.alpha.QMUIAlphaTextView;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import butterknife.BindView;
......@@ -55,7 +64,7 @@ public class TableAdapter extends DefaultAdapter<TableBean.DataBean> {
this.mContext = context;
this.mFunction = function;
this.mDiaplayScreenHeight = diaplayScreenHeight;
this.mTableTextSize = 38;
this.mTableTextSize = 20;
initItemDispalyHeight();
}
......@@ -81,18 +90,26 @@ public class TableAdapter extends DefaultAdapter<TableBean.DataBean> {
return R.layout.table_recycler_table;
}
private Date date;
class TableItemHolder extends BaseHolder<TableBean.DataBean> {
@BindView(R2.id.fl_container)
RelativeLayout fl_container;
@BindView(R2.id.ll_container)
LinearLayout ll_container;
@BindView(R2.id.rl_table)
QMUIAlphaRelativeLayout rl_table;
@BindView(R2.id.btn_table)
Button btn_table;
@BindView(R2.id.btn_showMain)
Button btn_showMain;
@BindView(R2.id.iv_vip)
ImageView iv_vip;
@BindView(R2.id.tv_scan_flag)
TextView tv_scan_flag;
TextView btn_table;
@BindView(R2.id.tv_people)
TextView tv_people;
@BindView(R2.id.tv_open_duration)
TextView tv_open_duration;
// @BindView(R2.id.btn_showMain)
// Button btn_showMain;
// @BindView(R2.id.iv_vip)
// ImageView iv_vip;
// @BindView(R2.id.tv_scan_flag)
// TextView tv_scan_flag;
public TableItemHolder(View itemView) {
super(itemView);
......@@ -111,50 +128,23 @@ public class TableAdapter extends DefaultAdapter<TableBean.DataBean> {
btn_table.setText(item.getTableName());
// if (item.getMainshowtable().equals("")) {
// if (btn_showMain.getVisibility() != View.GONE) {
// btn_showMain.setVisibility(View.GONE);
// }
if (btn_table.getGravity() != Gravity.CENTER) {
btn_table.setGravity(Gravity.CENTER);
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) btn_table.getLayoutParams();
lp.height = ItemColHeight;
btn_table.setLayoutParams(lp);
if (item.getStatus() != 0) {
tv_people.setVisibility(View.VISIBLE);
tv_people.setText(item.getPerson() + "人");
String createDate = item.getCreateTime();
String createTime = TimeUtil.getStringByFormat(new Date(createDate), TimeUtil.dateFormatYMDHMS);
String currentTime = TimeUtil.getStringByFormat(System.currentTimeMillis(), TimeUtil.dateFormatYMDHMS);
long[] difference = TimeUtil.getDistanceTimes2(createTime, currentTime);
if (difference[0] != 0) {
tv_open_duration.setText(difference[0] + ":" + difference[1] + ":" + difference[2]);
} else {
tv_open_duration.setText(difference[1] + ":" + difference[2]);
}
tv_open_duration.setVisibility(View.VISIBLE);
} else {
tv_people.setVisibility(View.GONE);
tv_open_duration.setVisibility(View.GONE);
}
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) btn_table.getLayoutParams();
btn_table.setLayoutParams(lp);
// } else {
// if (btn_showMain.getVisibility() == View.VISIBLE) {
// return;
// }
// btn_showMain.setVisibility(View.VISIBLE);
// btn_showMain.setText("(" + item.getMainshowtable() + ")");
// RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) btn_table.getLayoutParams();
// int heee = (int) Math.ceil(ItemColHeight * 70 / 100);
// lp.height = heee;
// btn_table.setLayoutParams(lp);
//
// lp = (RelativeLayout.LayoutParams) btn_showMain.getLayoutParams();
// lp.height = ItemColHeight - heee;//(int)Math.ceil(this.height*30/100)+1;
// btn_showMain.setLayoutParams(lp);
//
// if (style != 0) {
// btn_table.setTextSize(20);
// }
// }
// if (!TextUtils.isEmpty(item.getQrCode())) {
// setTableFlagDispalyLayout(item);
// tv_scan_flag.setVisibility(View.VISIBLE);
// } else {
// //不是skyorder台才显示vip标识
// if (item.getMemberId() != 0) {
// iv_vip.setVisibility(View.VISIBLE);
// } else {
// iv_vip.setVisibility(View.GONE);
// }
// tv_scan_flag.setVisibility(View.GONE);
// }
}
private void initTableBackground(TableBean.DataBean item) {
......@@ -168,23 +158,23 @@ public class TableAdapter extends DefaultAdapter<TableBean.DataBean> {
// setBackGroundWork(item, "888", R.drawable.tablebutton_splite, R.drawable.tablebutton_splite_new, R.color.black);
// } else {
if (item.getUseStatus() == 1) {
setBackGroundWork(item, "999", R.drawable.tablebutton_red, R.drawable.tablebutton_red_new, R.color.black);
setBackGroundWork(item, "999", R.drawable.table_shape_table_use, R.drawable.tablebutton_red_new, R.color.theme_white_color);
} else {
switch (item.getStatus()) {
case 0:
setBackGroundWork(item, "0", R.drawable.tablebutton_skyblue, R.drawable.tablebutton_skyblue_new, R.color.theme_white_color);
setBackGroundWork(item, "0", R.drawable.table_shape_table_nomal, R.drawable.tablebutton_skyblue_new, R.color.black);
break;
case 1:
setBackGroundWork(item, "1", R.drawable.tablebutton_default, R.drawable.tablebutton_default_new, R.color.theme_white_color);
break;
case 2:
setBackGroundWork(item, "2", R.drawable.tablebutton_glassgreen, R.drawable.tablebutton_glassgreen_new, R.color.theme_black);
setBackGroundWork(item, "2", R.drawable.table_shape_table_send, R.drawable.tablebutton_glassgreen_new, R.color.theme_white_color);
break;
case 3:
setBackGroundWork(item, "3", R.drawable.tablebutton_yellow, R.drawable.tablebutton_yellow_new, R.color.theme_black);
setBackGroundWork(item, "3", R.drawable.table_shape_table_print, R.drawable.tablebutton_yellow_new, R.color.theme_white_color);
break;
case 4:
setBackGroundWork(item, "4", R.drawable.tablebutton_violet, R.drawable.tablebutton_violet_new, R.color.theme_black);
setBackGroundWork(item, "4", R.drawable.tablebutton_violet, R.drawable.tablebutton_violet_new, R.color.theme_white_color);
break;
case 5:
setBackGroundWork(item, "5", R.drawable.tablebutton_default, R.drawable.tablebutton_default_new, R.color.theme_white_color);
......@@ -197,11 +187,11 @@ public class TableAdapter extends DefaultAdapter<TableBean.DataBean> {
}
private void initItemTableClick(TableBean.DataBean item, int position) {
btn_table.setOnClickListener(new View.OnClickListener() {
rl_table.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(XClickUtil.isFastDoubleClick(v,1000)){
if (XClickUtil.isFastDoubleClick(v, 1000)) {
return;
}
if (mOnItemClickListener != null) {
......@@ -212,69 +202,33 @@ public class TableAdapter extends DefaultAdapter<TableBean.DataBean> {
}
private void initItemDispalyMetrics() {
if (btn_table.getGravity() != Gravity.CENTER) {
rl_table.setGravity(Gravity.CENTER);
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) rl_table.getLayoutParams();
lp.height = ItemColHeight;
rl_table.setLayoutParams(lp);
}
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) rl_table.getLayoutParams();
rl_table.setLayoutParams(lp);
btn_table.setMinimumHeight(ItemColHeight);
btn_table.setHeight(ItemColHeight);
btn_table.setTextSize(mTableTextSize);
rl_table.setMinimumHeight(ItemColHeight);
RelativeLayout.LayoutParams relativeLayout = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
LinearLayout.LayoutParams relativeLayout = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
relativeLayout.height = ItemColHeight;
btn_table.setLayoutParams(relativeLayout);
}
private void setTableFlagDispalyLayout(TableBean.DataBean item) {
// GradientDrawable drawable = new GradientDrawable();
// drawable.setColor(Color.parseColor(GSAApplication.androidSetting.getQRTable_FlagTextBackGroup()));
// tv_scan_flag.setBackground(drawable);
//
// RelativeLayout.LayoutParams relativeLayout = (RelativeLayout.LayoutParams) tv_scan_flag.getLayoutParams();
// relativeLayout.height = ArmsUtils.dip2px(mContext, GSAApplication.androidSetting.getQRTable_FlagHeight());
// relativeLayout.width = ArmsUtils.dip2px(mContext, GSAApplication.androidSetting.getQRTable_FlagWith());
// tv_scan_flag.setLayoutParams(relativeLayout);
//
// tv_scan_flag.setText(GSAApplication.androidSetting.getQRTable_FlagText());
// tv_scan_flag.setTextSize(GSAApplication.androidSetting.getQRTable_FlagTextSize());
//
// if (!TextUtils.isEmpty(item.getQrCode())) {
// if (item.getMemberId() != 0) {
// //未登入会员
// if (item.getOrderid() > 0 && item.getRiceponorderid() > 0) {
// //已送单(橙色底黑色“S”)
// //橙色底黑色字“S”=SKY ORDER未登錄會員
// tv_scan_flag.setTextColor(Color.parseColor("#000000"));
// tv_scan_flag.setBackgroundColor(Color.parseColor("#FF7F04"));
// }else {
// //未送单(蓝色底黑色“S”)
// //藍色底黑色字“S”=SKY ORDER未登錄會員
// tv_scan_flag.setTextColor(Color.parseColor("#000000"));
// tv_scan_flag.setBackgroundColor(Color.parseColor("#0404FF"));
// }
// } else {
// //已登入会员
// if (item.getOrderid() > 0 && item.getRiceponorderid() > 0) {
// //已送单(橙色底白色“S”)
// tv_scan_flag.setTextColor(Color.parseColor("#FFFFFF"));
// tv_scan_flag.setBackgroundColor(Color.parseColor("#FF7F04"));
// } else {
// //未送单(蓝色底白色“S”)
// tv_scan_flag.setTextColor(Color.parseColor("#FFFFFF"));
// tv_scan_flag.setBackgroundColor(Color.parseColor("#0404FF"));
// }
// }
// }
rl_table.setLayoutParams(relativeLayout);
}
private void setBackGroundWork(TableBean.DataBean item, String workstatu, int defaultMainback, int defaultChildBack, int defaultFontColor) {
String tableName = item.getTableName();
if (defaultMainback != -1) {
fl_container.setBackgroundDrawable(mContext.getResources().getDrawable(defaultMainback));
}
if (defaultChildBack != -1) {
btn_table.setBackgroundDrawable(mContext.getResources().getDrawable(defaultChildBack));
btn_showMain.setBackgroundDrawable(mContext.getResources().getDrawable(defaultChildBack));
ll_container.setBackground(mContext.getResources().getDrawable(defaultMainback));
}
// if (defaultChildBack != -1) {
// btn_table.setBackground(mContext.getResources().getDrawable(defaultMainback));
// btn_showMain.setBackground(mContext.getResources().getDrawable(defaultMainback));
// }
btn_table.setTextColor(mContext.getResources().getColor(defaultFontColor));
btn_showMain.setTextColor(mContext.getResources().getColor(defaultFontColor));
// btn_showMain.setTextColor(mContext.getResources().getColor(defaultFontColor));
/**
* 可使用 0
......@@ -284,33 +238,33 @@ public class TableAdapter extends DefaultAdapter<TableBean.DataBean> {
* 已结账 4
* 连台 6
*/
StateListDrawable bgShape = (StateListDrawable) btn_table.getBackground();
GradientDrawable d = (GradientDrawable) bgShape.getCurrent();
switch (workstatu) {
case "0":
d.setColor(ArmsUtils.getColor(mContext, R.color.app_color_blue));
break;
case "1":
case "2":
d.setColor(ArmsUtils.getColor(mContext, R.color.green_500));
break;
case "3":
d.setColor(ArmsUtils.getColor(mContext, R.color.yellow_500));
break;
case "4":
d.setColor(ArmsUtils.getColor(mContext, R.color.app_color_blue));
break;
case "5":
d.setColor(ArmsUtils.getColor(mContext, R.color.app_color_blue));
break;
case "6":
d.setColor(ArmsUtils.getColor(mContext, R.color.Violet));
break;
case "999":
d.setColor(ArmsUtils.getColor(mContext, R.color.red));
break;
}
// StateListDrawable bgShape = (StateListDrawable) btn_table.getBackground();
// GradientDrawable d = (GradientDrawable) bgShape.getCurrent();
// switch (workstatu) {
// case "0":
// d.setColor(ArmsUtils.getColor(mContext, R.color.table_normal));
// break;
// case "1":
// case "2":
// d.setColor(ArmsUtils.getColor(mContext, R.color.table_send));
// break;
// case "3":
// d.setColor(ArmsUtils.getColor(mContext, R.color.table_print));
// break;
// case "4":
// d.setColor(ArmsUtils.getColor(mContext, R.color.table_normal));
// break;
// case "5":
// d.setColor(ArmsUtils.getColor(mContext, R.color.table_normal));
// break;
// case "6":
// d.setColor(ArmsUtils.getColor(mContext, R.color.Violet));
// break;
// case "999":
// d.setColor(ArmsUtils.getColor(mContext, R.color.table_use));
// break;
//
// }
// com.elegant.bin.gsa.mvp.main.model.bean.Color.DatasBean cs;
//
// for (TableWorkStatusColor tws : GSAApplication.androidSetting.getTableWorkStatusColors()) {
......@@ -422,7 +376,6 @@ public class TableAdapter extends DefaultAdapter<TableBean.DataBean> {
this.style = style;
}
private OnItemClickListener mOnItemClickListener;
public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
......
......@@ -207,9 +207,9 @@ public class AllTableFragment extends BaseFragment<AllTablePresenter> implements
// } else {
mAllTableRecycleLayoutManager = new GridLayoutManager(getActivity(), 4, LinearLayoutManager.VERTICAL, false);
recycle_all_table.setLayoutManager(mAllTableRecycleLayoutManager);
// recycle_all_table.addItemDecoration(new GridDividerItemDecoration(ArmsUtils.dip2px(getActivity(),1), ArmsUtils.getColor(getActivity(), R.color.red)));
recycle_all_table.addItemDecoration(new DividerItemDecoration(getActivity(), LinearLayoutManager.HORIZONTAL));
recycle_all_table.addItemDecoration(new DividerItemDecoration(getActivity(), LinearLayoutManager.VERTICAL));
// recycle_all_table.addItemDecoration(new GridDividerItemDecoration(ArmsUtils.dip2px(getActivity(),1), ArmsUtils.getColor(getActivity(), R.color.theme_grey_color)));
// recycle_all_table.addItemDecoration(new DividerItemDecoration(getActivity(), LinearLayoutManager.HORIZONTAL));
// recycle_all_table.addItemDecoration(new DividerItemDecoration(getActivity(), LinearLayoutManager.VERTICAL));
// }
}
}
......@@ -3,11 +3,14 @@ package com.gingersoft.gsa.cloud.table.mvp.ui.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.os.Message;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import com.gingersoft.gsa.cloud.base.common.bean.TableBean;
import com.gingersoft.gsa.cloud.base.utils.VibratorUtils;
......@@ -21,6 +24,7 @@ import com.gingersoft.gsa.cloud.table.mvp.ui.activity.TableActivity;
import com.jess.arms.base.BaseFragment;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils;
import com.qmuiteam.qmui.alpha.QMUIAlphaButton;
import java.util.ArrayList;
import java.util.List;
......@@ -50,39 +54,41 @@ public class InputTableFragment extends BaseFragment<InputTablePresenter> implem
@BindView(R2.id.ed_value)
EditText ed_value;
@BindView(R2.id.iv_clear_account)
ImageView iv_clear_account;
@BindView(R2.id.btn_0)
Button btn_0;
QMUIAlphaButton btn_0;
@BindView(R2.id.btn_1)
Button btn_1;
QMUIAlphaButton btn_1;
@BindView(R2.id.btn_2)
Button btn_2;
QMUIAlphaButton btn_2;
@BindView(R2.id.btn_3)
Button btn_3;
QMUIAlphaButton btn_3;
@BindView(R2.id.btn_4)
Button btn_4;
QMUIAlphaButton btn_4;
@BindView(R2.id.btn_5)
Button btn_5;
QMUIAlphaButton btn_5;
@BindView(R2.id.btn_6)
Button btn_6;
QMUIAlphaButton btn_6;
@BindView(R2.id.btn_7)
Button btn_7;
QMUIAlphaButton btn_7;
@BindView(R2.id.btn_8)
Button btn_8;
QMUIAlphaButton btn_8;
@BindView(R2.id.btn_9)
Button btn_9;
QMUIAlphaButton btn_9;
@BindView(R2.id.btn_clear)
Button btn_clear;
QMUIAlphaButton btn_clear;
@BindView(R2.id.btn_A)
Button btn_A;
QMUIAlphaButton btn_A;
@BindView(R2.id.btn_B)
Button btn_B;
QMUIAlphaButton btn_B;
@BindView(R2.id.btn_C)
Button btn_C;
QMUIAlphaButton btn_C;
@BindView(R2.id.btn_more)
Button btn_more;
QMUIAlphaButton btn_more;
@BindView(R2.id.btn_right)
Button btn_right;
QMUIAlphaButton btn_right;
private TableActivity mActivity;
private List<TableBean.DataBean> mTableList = new ArrayList<>();
......@@ -124,8 +130,44 @@ public class InputTableFragment extends BaseFragment<InputTablePresenter> implem
mActivity = (TableActivity) getActivity();
ed_value.setOnFocusChangeListener(mOnFocusChangeListener);
ed_value.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (ed_value.getText().toString().equals("")) {
iv_clear_account.setVisibility(View.GONE);
} else {
iv_clear_account.setVisibility(View.VISIBLE);
}
}
@Override
public void afterTextChanged(Editable s) {
}
});
}
private View.OnFocusChangeListener mOnFocusChangeListener = new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (v.getId() == R.id.ed_value && hasFocus) {
//賬號框獲得焦點
if (ed_value.getText() != null && ed_value.getText().toString().length() > 0) {
iv_clear_account.setVisibility(View.VISIBLE);
} else {
iv_clear_account.setVisibility(View.GONE);
}
} else {
iv_clear_account.setVisibility(View.GONE);
}
}
};
private void initDefalutText() {
if (letter.length() > 1)
......@@ -169,17 +211,43 @@ public class InputTableFragment extends BaseFragment<InputTablePresenter> implem
}
@OnClick({R2.id.btn_0, R2.id.btn_1, R2.id.btn_2, R2.id.btn_3, R2.id.btn_4, R2.id.btn_5, R2.id.btn_6, R2.id.btn_7, R2.id.btn_8
, R2.id.btn_9, R2.id.btn_A, R2.id.btn_B, R2.id.btn_C, R2.id.btn_more, R2.id.btn_right, R2.id.btn_clear})
, R2.id.btn_9, R2.id.btn_A, R2.id.btn_B, R2.id.btn_C, R2.id.btn_more, R2.id.btn_right, R2.id.btn_clear, R2.id.iv_clear_account})
public void onClick(View v) {
int i = Integer.parseInt(v.getTag().toString());
Button btn = (Button) v;
String s = btn.getText().toString();
VibratorUtils.pressButtonSound(getActivity());
// GSAApplication.tableContract.setIsSplite(false);
// GSAApplication.tableContract.setTableno_split("");
if (v.getId() == R.id.iv_clear_account) {
if (inputstr.length() > 0) {
String sr = inputstr.substring(inputstr.length() - 1, inputstr.length());
//将获取到的sr进行对比
String ss = "";
if (sr.equals("-")) {
Splitemodal = false;
}
if (Splitemodal) {
ss = t_name.substring(t_name.length() - 1, t_name.length());
if (t_splite.length() > 0) {
String ss1 = t_splite.substring(t_splite.length() - 1, t_splite.length());
if (ss1.equals(sr)) {
t_splite = t_splite.substring(0, t_splite.length() - 1);
}
}
} else {
if (ss.equals(sr)) {
t_name = t_name.substring(0, t_name.length() - 1);
}
}
inputstr = inputstr.substring(0, inputstr.length() - 1);
ed_value.setText(inputstr);
}
} else {
int i = Integer.parseInt(v.getTag().toString());
Button btn = (Button) v;
String s = btn.getText().toString();
switch (i) {
case 0:
case 1:
......@@ -245,38 +313,14 @@ public class InputTableFragment extends BaseFragment<InputTablePresenter> implem
ed_value.setText("");
break;
case 99: //clear button
if (inputstr.length() > 0) {
String sr = inputstr.substring(inputstr.length() - 1, inputstr.length());
//将获取到的sr进行对比
String ss = "";
if (sr.equals("-")) {
Splitemodal = false;
}
if (Splitemodal) {
ss = t_name.substring(t_name.length() - 1, t_name.length());
if (t_splite.length() > 0) {
String ss1 = t_splite.substring(t_splite.length() - 1, t_splite.length());
if (ss1.equals(sr)) {
t_splite = t_splite.substring(0, t_splite.length() - 1);
}
}
} else {
if (ss.equals(sr)) {
t_name = t_name.substring(0, t_name.length() - 1);
}
}
inputstr = inputstr.substring(0, inputstr.length() - 1);
ed_value.setText(inputstr);
// if (inputstr.length() > 0) {
// GSAApplication.tableContract.setTableno(inputstr);
// } else {
// GSAApplication.tableContract.setTableno("");
// }
}
inputstr = "";
ed_value.setText("");
break;
}
}
}
private void goToMealStandBefore() {
if (Splitemodal) {
Splitemodal = false;
......@@ -286,9 +330,9 @@ public class InputTableFragment extends BaseFragment<InputTablePresenter> implem
TableBean.DataBean table = getTableByName(t_name);
if(table != null){
if (table != null) {
mActivity.clickTableItem(table);
}else {
} else {
showMessage("未找到該檯號!");
}
}
......
......@@ -136,7 +136,7 @@ public class StateTableFragment extends BaseFragment<StateTablePresenter> implem
status = ((Message) data).arg1;
if (mPresenter != null) {
//recycleView正在滑动
if (recycle_state_table.getScrollState() != 0) {
if (recycle_state_table != null && recycle_state_table.getScrollState() != 0) {
} else {
mPresenter.updateAllTableData(mActivity, datasBeans, status);
}
......@@ -146,7 +146,7 @@ public class StateTableFragment extends BaseFragment<StateTablePresenter> implem
datasBeans = (List<TableBean.DataBean>) ((Message) data).obj;
if (mPresenter != null) {
//recycleView正在滑动
if (recycle_state_table.getScrollState() != 0) {
if (recycle_state_table != null && recycle_state_table.getScrollState() != 0) {
} else {
mPresenter.updataTableItem(datasBeans);
}
......@@ -207,8 +207,8 @@ public class StateTableFragment extends BaseFragment<StateTablePresenter> implem
mStateTableRecycleLayoutManager = new GridLayoutManager(getActivity(), 4, LinearLayoutManager.VERTICAL, false);
recycle_state_table.setLayoutManager(mStateTableRecycleLayoutManager);
// recycle_state_table.addItemDecoration(new GridDividerItemDecoration(ArmsUtils.dip2px(getActivity(),1), ArmsUtils.getColor(getActivity(), R.color.theme_grey_color)));
recycle_state_table.addItemDecoration(new DividerItemDecoration(getActivity(), LinearLayoutManager.HORIZONTAL));
recycle_state_table.addItemDecoration(new DividerItemDecoration(getActivity(), LinearLayoutManager.VERTICAL));
// recycle_state_table.addItemDecoration(new DividerItemDecoration(getActivity(), LinearLayoutManager.HORIZONTAL));
// recycle_state_table.addItemDecoration(new DividerItemDecoration(getActivity(), LinearLayoutManager.VERTICAL));
// }
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke android:width="1px" android:color="@color/theme_hint_color" />
<corners android:radius="@dimen/dp_5"/>
</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 android:shape="rectangle">
<padding
android:top="1px" />
<solid android:color="#0DCCCCCC" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<padding
android:top="1px" />
<solid android:color="#10CCCCCC" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<padding
android:top="1px" />
<solid android:color="#15CCCCCC" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<padding
android:top="1px" />
<solid android:color="#20CCCCCC" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<padding
android:top="1px" />
<solid android:color="#30CCCCCC" />
</shape>
</item>
<item>
<shape>
<solid android:color="#FFFFFF" />
</shape>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:radius="@dimen/dp_5" />
<solid android:color="#FFFFFFFF" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:radius="@dimen/dp_5" />
<solid android:color="#FFE5AC00" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:radius="@dimen/dp_5" />
<solid android:color="#FF249B65" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:radius="@dimen/dp_5" />
<solid android:color="#FFD14141" />
</shape>
\ No newline at end of file
......@@ -488,7 +488,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_meals"
android:layout_above="@+id/ll_stand_oper"
android:divider="@null"
android:fadeScrollbars="false"
android:orientation="vertical"
......
......@@ -15,7 +15,7 @@
android:layout_height="wrap_content"
android:layout_above="@+id/rv_bottom_function"
android:layout_marginTop="?attr/qmui_topbar_height"
android:background="@color/theme_white_color">
android:background="#FFE8E8E8">
<com.qmuiteam.qmui.widget.tab.QMUITabSegment
android:id="@+id/tabSegment"
......@@ -66,9 +66,8 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_alignParentBottom="true"
android:background="@color/theme_white_color"
android:orientation="horizontal"
android:padding="1dp" />
android:background="@drawable/table_shape_table_bottom_function_layout"
android:orientation="horizontal" />
<com.qmuiteam.qmui.layout.QMUIButton
android:id="@+id/btn_cancel_operat"
......
......@@ -4,7 +4,337 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- <include layout="@layout/table_include_number_input"/>-->
<include layout="@layout/table_include_number_input"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_80"
android:background="@color/theme_white_color">
<EditText
android:id="@+id/ed_value"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_60"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_15"
android:background="@drawable/table_shape_input_table_number_frame"
android:ems="10"
android:enabled="false"
android:hint="@string/please_input_table_number"
android:textSize="@dimen/sp_28"
android:paddingLeft="@dimen/dp_8"
android:paddingRight="@dimen/dp_40"
android:layout_centerInParent="true"
android:gravity="right|center_vertical"
android:inputType="numberDecimal"
android:singleLine="true"
android:textColor="@color/table_input_table_keypad"
android:textColorHint="@color/theme_hint_color"
android:textStyle="bold" />
<ImageView
android:id="@+id/iv_clear_account"
android:layout_width="@dimen/dp_30"
android:layout_height="@dimen/dp_30"
android:padding="@dimen/dp_2"
android:layout_marginRight="@dimen/dp_25"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@mipmap/ic_clear_text"
android:visibility="gone" />
</RelativeLayout>
<TableLayout
android:id="@+id/LL_keys"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_80"
android:background="#FFF6F5F8"
android:stretchColumns="*">
<TableRow
android:id="@+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_A"
style="@style/ButtonBorderless"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:focusable="true"
android:gravity="center"
android:layerType="software"
android:tag="55"
android:text="A"
android:textColor="@color/table_input_table_keypad"
android:textSize="40dp"
android:textStyle="bold" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_7"
style="@style/ButtonBorderless"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:focusable="true"
android:layerType="software"
android:tag="7"
android:text="@string/Key_7"
android:textColor="@color/table_input_table_keypad"
android:textSize="40dp"
android:textStyle="bold" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_8"
style="@style/ButtonBorderless"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:focusable="true"
android:layerType="software"
android:tag="8"
android:text="@string/Key_8"
android:textColor="@color/table_input_table_keypad"
android:textSize="40dp"
android:textStyle="bold" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_9"
style="@style/ButtonBorderless"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:focusable="true"
android:layerType="software"
android:tag="9"
android:text="@string/Key_9"
android:textColor="@color/table_input_table_keypad"
android:textSize="40dp"
android:textStyle="bold" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_B"
style="@style/ButtonBorderless"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_marginRight="2dp"
android:layout_marginTop="1dp"
android:layout_weight="1"
android:focusable="true"
android:layerType="software"
android:tag="56"
android:text="@string/Key_7"
android:textColor="@color/table_input_table_keypad"
android:textSize="40dp"
android:textStyle="bold" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_4"
style="@style/ButtonBorderless"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_marginRight="2dp"
android:layout_marginTop="1dp"
android:layout_weight="1"
android:focusable="true"
android:layerType="software"
android:tag="4"
android:text="@string/Key_4"
android:textColor="@color/table_input_table_keypad"
android:textSize="40dp"
android:textStyle="bold" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_5"
style="@style/ButtonBorderless"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_marginRight="2dp"
android:layout_marginTop="1dp"
android:layout_weight="1"
android:focusable="true"
android:layerType="software"
android:tag="5"
android:text="@string/Key_5"
android:textColor="@color/table_input_table_keypad"
android:textSize="40dp"
android:textStyle="bold" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_6"
style="@style/ButtonBorderless"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_marginTop="1dp"
android:layout_weight="1"
android:focusable="true"
android:layerType="software"
android:tag="6"
android:text="@string/Key_6"
android:textColor="@color/table_input_table_keypad"
android:textSize="40dp"
android:textStyle="bold" />
</TableRow>
<TableRow
android:id="@+id/tableRow3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_C"
style="@style/ButtonBorderless"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_marginRight="2dp"
android:layout_marginTop="1dp"
android:layout_weight="1"
android:focusable="true"
android:layerType="software"
android:tag="57"
android:text="@string/Key_7"
android:textColor="@color/table_input_table_keypad"
android:textSize="40dp"
android:textStyle="bold" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_1"
style="@style/ButtonBorderless"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_marginRight="2dp"
android:layout_marginTop="1dp"
android:layout_weight="1"
android:focusable="true"
android:layerType="software"
android:tag="1"
android:text="@string/Key_1"
android:textColor="@color/table_input_table_keypad"
android:textSize="40dp"
android:textStyle="bold" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_2"
style="@style/ButtonBorderless"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_marginRight="2dp"
android:layout_marginTop="1dp"
android:layout_weight="1"
android:focusable="true"
android:layerType="software"
android:tag="2"
android:text="@string/Key_2"
android:textColor="@color/table_input_table_keypad"
android:textSize="40dp"
android:textStyle="bold" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_3"
style="@style/ButtonBorderless"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_marginTop="1dp"
android:layout_weight="1"
android:focusable="true"
android:layerType="software"
android:tag="3"
android:text="@string/Key_3"
android:textColor="@color/table_input_table_keypad"
android:textSize="40dp"
android:textStyle="bold" />
</TableRow>
<TableRow
android:id="@+id/tableRow4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:background="#FFDDEDFE">
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_more"
style="@style/ButtonBorderless"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_marginRight="2dp"
android:layout_marginTop="1dp"
android:layout_weight="1"
android:focusable="true"
android:gravity="center"
android:layerType="software"
android:tag="58"
android:text="..."
android:textColor="@color/table_input_table_keypad"
android:textSize="40dp"
android:textStyle="bold" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_clear"
style="@style/ButtonBorderless"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_marginRight="2dp"
android:layout_marginTop="1dp"
android:layout_weight="1"
android:focusable="true"
android:gravity="center"
android:layerType="software"
android:longClickable="true"
android:tag="99"
android:text="@string/Key_clear"
android:textColor="@color/table_input_table_keypad"
android:textSize="30sp"
android:textStyle="bold" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_0"
style="@style/ButtonBorderless"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_marginRight="2dp"
android:layout_marginTop="1dp"
android:layout_weight="1"
android:focusable="true"
android:gravity="center"
android:layerType="software"
android:tag="0"
android:text="@string/Key_0"
android:textColor="@color/table_input_table_keypad"
android:textSize="40dp"
android:textStyle="bold" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_right"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_marginTop="1dp"
android:layout_weight="1"
android:background="@color/table_input_table_keypad"
android:focusable="true"
android:gravity="center"
android:layerType="software"
android:tag="98"
android:text="@string/Key_right"
android:textColor="@color/theme_white_color"
android:textSize="40dp"
android:textStyle="bold" />
</TableRow>
</TableLayout>
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>
\ No newline at end of file
......@@ -15,6 +15,7 @@
android:gravity="right"
android:inputType="numberDecimal"
android:singleLine="true"
android:text=""
android:textColorHint="#FF0000"
android:textSize="30dip"
android:textStyle="bold">
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fl_container"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:layout_margin="@dimen/dp_2">
<RelativeLayout
android:id="@+id/rl_container"
<com.qmuiteam.qmui.alpha.QMUIAlphaRelativeLayout
android:id="@+id/rl_table"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
<TextView
android:id="@+id/btn_table"
style="@style/ButtonBorderless"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="Button"
android:textColor="@color/theme_white_color"
android:textSize="@dimen/dp_38" />
<Button
android:id="@+id/btn_showMain"
style="@style/ButtonBorderless"
android:layout_width="match_parent"
android:layout_height="96dp"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginLeft="0dp"
android:layout_marginTop="0dp"
android:text="Button"
android:textSize="@dimen/dp_16"
android:visibility="gone" />
</RelativeLayout>
android:maxLines="1"
android:ellipsize="end"
android:layout_centerHorizontal="true"
android:textColor="#FF000000"
android:textSize="@dimen/dp_22" />
<ImageView
android:id="@+id/iv_vip"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:scaleType="fitXY"
android:src="@drawable/qmui_icon_tip_new"
android:visibility="gone" />
<TextView
android:id="@+id/tv_people"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2人"
android:layout_below="@+id/btn_table"
android:layout_centerHorizontal="true"
android:textSize="@dimen/sp_13"
android:layout_marginTop="@dimen/dp_3"
android:textColor="@color/theme_white_color"
android:visibility="gone"/>
<TextView
android:id="@+id/tv_scan_flag"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:text="S"
android:background="@color/orange_700"
android:id="@+id/tv_open_duration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="30:00"
android:layout_below="@+id/tv_people"
android:textSize="@dimen/sp_12"
android:layout_centerHorizontal="true"
android:drawableLeft="@mipmap/ic_table_open_time"
android:layout_marginTop="@dimen/dp_2"
android:drawablePadding="@dimen/dp_3"
android:textColor="@color/theme_white_color"
android:gravity="center"
android:visibility="gone"
android:textSize="@dimen/font_normal2" />
</RelativeLayout>
android:visibility="gone"/>
<!-- <com.qmuiteam.qmui.alpha.QMUIAlphaButton-->
<!-- android:id="@+id/btn_showMain"-->
<!-- style="@style/ButtonBorderless"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="96dp"-->
<!-- android:layout_alignParentLeft="true"-->
<!-- android:layout_alignParentRight="true"-->
<!-- android:layout_alignParentBottom="true"-->
<!-- android:layout_marginLeft="0dp"-->
<!-- android:layout_marginTop="0dp"-->
<!-- android:text="Button"-->
<!-- android:textSize="@dimen/dp_16"-->
<!-- android:visibility="gone" />-->
</com.qmuiteam.qmui.alpha.QMUIAlphaRelativeLayout>
<!-- <ImageView-->
<!-- android:id="@+id/iv_vip"-->
<!-- android:layout_width="50dp"-->
<!-- android:layout_height="50dp"-->
<!-- android:layout_alignParentLeft="true"-->
<!-- android:layout_alignParentTop="true"-->
<!-- android:scaleType="fitXY"-->
<!-- android:src="@drawable/qmui_icon_tip_new"-->
<!-- android:visibility="gone" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_scan_flag"-->
<!-- android:layout_width="25dp"-->
<!-- android:layout_height="25dp"-->
<!-- android:layout_alignParentTop="true"-->
<!-- android:layout_alignParentRight="true"-->
<!-- android:text="S"-->
<!-- android:background="@color/orange_700"-->
<!-- android:textColor="@color/theme_white_color"-->
<!-- android:gravity="center"-->
<!-- android:visibility="gone"-->
<!-- android:textSize="@dimen/font_normal2" />-->
</LinearLayout>
......@@ -3,4 +3,6 @@
<color name="table_colorPrimary">#008577</color>
<color name="table_colorPrimaryDark">#00574B</color>
<color name="table_colorAccent">#D81B60</color>
<color name="table_input_table_keypad">#FF4B9DFA</color>
</resources>
......@@ -85,6 +85,7 @@
<string name="detailmode">细微模式</string>
<string name="malnumber">請選擇按鍵錄入數量</string>
<string name="input_pay_money">請輸入支付金額</string>
<string name="please_input_table_number">請輸入檯號</string>
<string name="waring">警告</string>
<string name="presssound">按鍵音量</string>
<string name="Vibration">震動強度</string>
......
......@@ -60,7 +60,7 @@
android:layout_width="@dimen/dp_30"
android:layout_height="@dimen/dp_30"
android:padding="@dimen/dp_5"
android:src="@mipmap/ic_clear_text"
android:src="@drawable/ic_clear_text"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/ed_login_user_account"
app:layout_constraintLeft_toRightOf="@id/ed_login_user_account"
......
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