Commit fa4a065d by 宁斌

增加skyorder打印頁

parent a1867471
......@@ -112,15 +112,21 @@ dependencies {
api 'com.github.xuexiangjys:RxUtil2:1.1.5'
//时间选择器
api rootProject.ext.dependencies["pickerview"]
//底部功能導航view
api 'com.github.ittianyu:BottomNavigationViewEx:2.0.4'
api rootProject.ext.dependencies["permissionx"]
api rootProject.ext.dependencies["design"]
api rootProject.ext.dependencies["appcompat-v7"]
implementation 'cn.bingoogolapple:bga-photopicker:1.2.8@aar'
implementation 'cn.bingoogolapple:bga-baseadapter:1.2.9@aar'
implementation 'cn.bingoogolapple:bga-flowlayout:1.0.0@aar'
implementation 'cn.onestravel.one:one_bottom_navigationbar:1.1.1'
api 'androidx.core:core-ktx:+'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api 'com.github.huangyanbin:SmartTable:2.2.0'
......
......@@ -19,3 +19,9 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-keep public class com.google.android.material.bottomnavigation.BottomNavigationView { *; }
-keep public class com.google.android.material.bottomnavigation.BottomNavigationMenuView { *; }
-keep public class com.google.android.material.bottomnavigation.BottomNavigationPresenter { *; }
-keep public class com.google.android.material.bottomnavigation.BottomNavigationItemView { *; }
package com.gingersoft.gsa.cloud.base.utils;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
/**
* <pre>
* author: Blankj
* blog : http://blankj.com
* time : 2016/09/25
* desc : 剪贴板相关工具类
* </pre>
*/
public final class ClipboardUtils {
private ClipboardUtils() {
throw new UnsupportedOperationException("u can't instantiate me...");
}
/**
* 复制文本到剪贴板
*
* @param text 文本
*/
public static void copyText(final CharSequence text) {
ClipboardManager cm = (ClipboardManager) GsaCloudApplication.getAppContext().getSystemService(Context.CLIPBOARD_SERVICE);
//noinspection ConstantConditions
cm.setPrimaryClip(ClipData.newPlainText("text", text));
}
/**
* 获取剪贴板的文本
*
* @return 剪贴板的文本
*/
public static CharSequence getText() {
ClipboardManager cm = (ClipboardManager) GsaCloudApplication.getAppContext().getSystemService(Context.CLIPBOARD_SERVICE);
//noinspection ConstantConditions
ClipData clip = cm.getPrimaryClip();
if (clip != null && clip.getItemCount() > 0) {
return clip.getItemAt(0).coerceToText(GsaCloudApplication.getAppContext());
}
return null;
}
/**
* 复制uri到剪贴板
*
* @param uri uri
*/
public static void copyUri(final Uri uri) {
ClipboardManager cm = (ClipboardManager) GsaCloudApplication.getAppContext().getSystemService(Context.CLIPBOARD_SERVICE);
//noinspection ConstantConditions
cm.setPrimaryClip(ClipData.newUri(GsaCloudApplication.getAppContext().getContentResolver(), "uri", uri));
}
/**
* 获取剪贴板的uri
*
* @return 剪贴板的uri
*/
public static Uri getUri() {
ClipboardManager cm = (ClipboardManager) GsaCloudApplication.getAppContext().getSystemService(Context.CLIPBOARD_SERVICE);
//noinspection ConstantConditions
ClipData clip = cm.getPrimaryClip();
if (clip != null && clip.getItemCount() > 0) {
return clip.getItemAt(0).getUri();
}
return null;
}
/**
* 复制意图到剪贴板
*
* @param intent 意图
*/
public static void copyIntent(final Intent intent) {
ClipboardManager cm = (ClipboardManager) GsaCloudApplication.getAppContext().getSystemService(Context.CLIPBOARD_SERVICE);
//noinspection ConstantConditions
cm.setPrimaryClip(ClipData.newIntent("intent", intent));
}
/**
* 获取剪贴板的意图
*
* @return 剪贴板的意图
*/
public static Intent getIntent() {
ClipboardManager cm = (ClipboardManager) GsaCloudApplication.getAppContext().getSystemService(Context.CLIPBOARD_SERVICE);
//noinspection ConstantConditions
ClipData clip = cm.getPrimaryClip();
if (clip != null && clip.getItemCount() > 0) {
return clip.getItemAt(0).getIntent();
}
return null;
}
}
package com.gingersoft.gsa.cloud.base.utils;
import android.graphics.Color;
import androidx.annotation.ColorInt;
/**
* @author : bin
* @create date: 2020-11-03
* @update date: 2020-11-03
* @description:
*/
public class ColorUtil {
private ColorUtil() {
}
public static String parseColorInt(@ColorInt int color) {
return String.format("#%06X", 0xFFFFFF & color);
}
public static boolean isColdColor(@ColorInt int color) {
float[] hsv = new float[3];
Color.colorToHSV(color, hsv);
return hsv[2] <= 0.8f;
}
}
......@@ -9,7 +9,7 @@ package com.gingersoft.gsa.cloud.constans;
*/
public interface GoldConstants {
int bottomFunctionColCount = 4;
int bottomFunctionColCount = 5;
int restaurantId = 26;
int refreshTime = 3;
......
package com.gingersoft.gsa.cloud.menu;
/**
* @author : bin
* @create date: 2020-11-03
* @update date: 2020-11-03
* @description:
*/
public interface Menu {
}
......@@ -487,7 +487,7 @@ public class WebActivity extends BaseActivity<BasePresenter> implements IView {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// getMenuInflater().inflate(R.menu.menu_mTopBar_web_activity, menu);
// getMenuInflater().inflate(R.Menu.menu_mTopBar_web_activity, Menu);
return true;
}
......
......@@ -46,8 +46,8 @@ public abstract class BaseRetryDialog extends Dialog {
private static final String TAG = "BaseRetryDialog";
private Context mContext;
public BaseRetryDialog(@NonNull Context context) {
super(context, R.style.MyDialogTheme2);
public BaseRetryDialog(@NonNull Context context,int style) {
super(context, style);
mContext = context;
}
......
......@@ -3,7 +3,7 @@
android:shape="rectangle">
<solid android:color="#2B2B2B" />
<corners android:topLeftRadius="@dimen/normal_space5" />
<corners android:topRightRadius="@dimen/normal_space5" />
<corners android:topLeftRadius="@dimen/normal_space5"
android:topRightRadius="@dimen/normal_space5" />
</shape>
\ No newline at end of file
......@@ -3,7 +3,7 @@
android:shape="rectangle">
<solid android:color="@color/theme_white_color" />
<corners android:topLeftRadius="@dimen/normal_space5" />
<corners android:topRightRadius="@dimen/normal_space5" />
<corners
android:topLeftRadius="@dimen/normal_space5"
android:topRightRadius="@dimen/normal_space5" />
</shape>
\ No newline at end of file
......@@ -21,43 +21,6 @@ import lombok.Data;
@Entity
public class ComboItem {
/**
* ID
*/
// @Property(nameInDb = "_id")
// @Id(autoincrement = true)
// private Long id;
//
// private Long comId;
//
// private Long fid;
//
// private Long qty;
//
// private Double diffAmt;
//
// private Long seqNo;
//
// private Long visible;
//
// private Date createTime;
//
// private String createBy;
//
// private Date updateTime;
//
// private Long conditions;
//
// private Long isRT;
//
// private Byte deletes;
//
// private Long posId;
//
// private Long restaurant_id;
//
// private Byte isMainAccount;
@Property(nameInDb = "_id")
@Id(autoincrement = true)
private Long id;
......
......@@ -8,6 +8,9 @@ import org.greenrobot.greendao.annotation.NotNull;
import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.Transient;
import lombok.Getter;
import lombok.Setter;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
......@@ -15,7 +18,8 @@ import org.greenrobot.greendao.annotation.Transient;
* 修订历史:2020-01-02
* 描述:
*/
@Getter
@Setter
@Entity
public class Function {
......@@ -24,7 +28,7 @@ public class Function {
private Long dbid;
@NotNull
private Long id;
private int id;
private int parentId;
private int groupId;
......@@ -32,14 +36,17 @@ public class Function {
private String resName;
private String resUrl;
private String imageURL;
/**暫時沒有imageURL,用本地資源代替*/
/**
* 暫時沒有imageURL,用本地資源代替
*/
private int icRes;
/**狀態
/**
* 狀態
* 0 未开通
* 1 正常
* 2 有時間限制
* 3 關閉
* */
*/
private int status;
@Transient
......@@ -74,26 +81,18 @@ public class Function {
@Transient
private String lable;
@Generated(hash = 756881616)
public Function(Long dbid, @NotNull Long id, int parentId, int groupId, long effectiveTime,
String resName, String resUrl, String imageURL, int icRes, int status) {
this.dbid = dbid;
this.id = id;
this.parentId = parentId;
this.groupId = groupId;
this.effectiveTime = effectiveTime;
this.resName = resName;
this.resUrl = resUrl;
this.imageURL = imageURL;
this.icRes = icRes;
this.status = status;
}
/**
* 底部功能按鈕是否凸起
*/
@Transient
private boolean raisedBottom = false;
@Generated(hash = 133141990)
public Function() {
}
public Function(Long id, String resName, int textColorRes, int textSizeRes, int iconRes) {
public Function(int id, String resName, int textColorRes, int textSizeRes, int iconRes) {
this.id = id;
this.resName = resName;
this.textColorRes = textColorRes;
......@@ -108,7 +107,7 @@ public class Function {
this.textSize = textSize;
}
public Function(Long id, int parentId, int groupId, String resName, int icRes, int status) {
public Function(int id, int parentId, int groupId, String resName, int icRes, int status) {
this.id = id;
this.parentId = parentId;
this.groupId = groupId;
......@@ -129,140 +128,108 @@ public class Function {
this.iconRes = iconRes;
}
public Long getId() {
return id;
}
public void setId(Long id) {
@Generated(hash = 607723885)
public Function(Long dbid, int id, int parentId, int groupId, long effectiveTime, String resName,
String resUrl, String imageURL, int icRes, int status) {
this.dbid = dbid;
this.id = id;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public long getEffectiveTime() {
return effectiveTime;
}
public void setEffectiveTime(long effectiveTime) {
this.parentId = parentId;
this.groupId = groupId;
this.effectiveTime = effectiveTime;
}
public String getResName() {
return resName;
}
public void setResName(String resName) {
this.resName = resName;
}
public String getResUrl() {
return resUrl;
}
public void setResUrl(String resUrl) {
this.resUrl = resUrl;
}
public String getImageURL() {
return imageURL;
}
public void setImageURL(String imageURL) {
this.imageURL = imageURL;
this.icRes = icRes;
this.status = status;
}
public int getNameRes() {
return nameRes;
}
public void setNameRes(int nameRes) {
this.nameRes = nameRes;
}
public int getTextColor() {
return textColor;
}
public void setTextColor(int textColor) {
this.textColor = textColor;
}
public int getBackgroundColor() {
return backgroundColor;
}
public void setBackgroundColor(int backgroundColor) {
this.backgroundColor = backgroundColor;
@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 +
", lable='" + lable + '\'' +
'}';
}
public int getTextSize() {
return textSize;
public Long getDbid() {
return this.dbid;
}
public void setTextSize(int textSize) {
this.textSize = textSize;
public void setDbid(Long dbid) {
this.dbid = dbid;
}
public int getTextColorRes() {
return textColorRes;
public int getId() {
return this.id;
}
public void setTextColorRes(int textColorRes) {
this.textColorRes = textColorRes;
public void setId(int id) {
this.id = id;
}
public int getBackgroundColorRes() {
return backgroundColorRes;
public int getParentId() {
return this.parentId;
}
public void setBackgroundColorRes(int backgroundColorRes) {
this.backgroundColorRes = backgroundColorRes;
public void setParentId(int parentId) {
this.parentId = parentId;
}
public int getTextSizeRes() {
return textSizeRes;
public int getGroupId() {
return this.groupId;
}
public void setTextSizeRes(int textSizeRes) {
this.textSizeRes = textSizeRes;
public void setGroupId(int groupId) {
this.groupId = groupId;
}
public int getIconRes() {
return iconRes;
public long getEffectiveTime() {
return this.effectiveTime;
}
public void setIconRes(int iconRes) {
this.iconRes = iconRes;
public void setEffectiveTime(long effectiveTime) {
this.effectiveTime = effectiveTime;
}
public Long getDbid() {
return this.dbid;
public String getResName() {
return this.resName;
}
public void setDbid(Long dbid) {
this.dbid = dbid;
public void setResName(String resName) {
this.resName = resName;
}
public int getParentId() {
return this.parentId;
public String getResUrl() {
return this.resUrl;
}
public void setParentId(int parentId) {
this.parentId = parentId;
public void setResUrl(String resUrl) {
this.resUrl = resUrl;
}
public int getGroupId() {
return this.groupId;
public String getImageURL() {
return this.imageURL;
}
public void setGroupId(int groupId) {
this.groupId = groupId;
public void setImageURL(String imageURL) {
this.imageURL = imageURL;
}
public int getIcRes() {
......@@ -273,36 +240,11 @@ public class Function {
this.icRes = icRes;
}
public String getLable() {
return lable;
}
public void setLable(String lable) {
this.lable = lable;
public int getStatus() {
return this.status;
}
@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 +
", lable='" + lable + '\'' +
'}';
public void setStatus(int status) {
this.status = status;
}
}
......@@ -25,7 +25,7 @@ public class FunctionDao extends AbstractDao<Function, Long> {
*/
public static class Properties {
public final static Property Dbid = new Property(0, Long.class, "dbid", true, "_id");
public final static Property Id = new Property(1, Long.class, "id", false, "ID");
public final static Property Id = new Property(1, int.class, "id", false, "ID");
public final static Property ParentId = new Property(2, int.class, "parentId", false, "PARENT_ID");
public final static Property GroupId = new Property(3, int.class, "groupId", false, "GROUP_ID");
public final static Property EffectiveTime = new Property(4, long.class, "effectiveTime", false, "EFFECTIVE_TIME");
......@@ -138,7 +138,7 @@ public class FunctionDao extends AbstractDao<Function, Long> {
public Function readEntity(Cursor cursor, int offset) {
Function entity = new Function( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // dbid
cursor.getLong(offset + 1), // id
cursor.getInt(offset + 1), // id
cursor.getInt(offset + 2), // parentId
cursor.getInt(offset + 3), // groupId
cursor.getLong(offset + 4), // effectiveTime
......@@ -154,7 +154,7 @@ public class FunctionDao extends AbstractDao<Function, Long> {
@Override
public void readEntity(Cursor cursor, Function entity, int offset) {
entity.setDbid(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setId(cursor.getLong(offset + 1));
entity.setId(cursor.getInt(offset + 1));
entity.setParentId(cursor.getInt(offset + 2));
entity.setGroupId(cursor.getInt(offset + 3));
entity.setEffectiveTime(cursor.getLong(offset + 4));
......
......@@ -156,31 +156,6 @@ public class FoodComboDaoUtils {
return mManager.getDaoSession().queryRaw(FoodCombo.class, sql, conditions);
}
/**
* 使用queryBuilder进行查询食品
*
* @return
*/
public List<FoodCombo> queryComboFoodsByQueryBuilder(long fid) {
FoodCombo foodCombo = queryComboByQueryBuilder(fid);
List<FoodCombo> foodCombos = null;
if (foodCombo != null) {
foodCombos = queryCombosByComIdQueryBuilder(foodCombo.getComId());
}
List<FoodCombo> list = new ArrayList<>();
FoodDaoUtils foodDao = new FoodDaoUtils(mContext);
if (foodCombos != null) {
for (int i = 0; i < foodCombos.size(); i++) {
Food food = foodDao.queryFoodByFidQueryBuilder(foodCombos.get(i).getFid());
if (food != null) {
list.add(foodCombos.get(i));
}
}
}
return list;
}
public List<FoodCombo> queryCombosFoodsByQueryBuilder(long fid) {
List<FoodCombo> foodCombo = queryCombosByQueryBuilder(fid);
List<FoodCombo> foodCombos = null;
......
......@@ -12,6 +12,7 @@ import com.gingersoft.gsa.cloud.main.mvp.contract.MainContract;
import com.gingersoft.gsa.cloud.main.mvp.presenter.MainPresenter;
import com.gingersoft.gsa.cloud.main.mvp.ui.fragment.HomeFragment;
import com.gingersoft.gsa.cloud.main.mvp.ui.fragment.MyFragment;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.jess.arms.base.BaseFragmentActivity;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils;
......@@ -131,6 +132,7 @@ public class MainActivity extends BaseFragmentActivity<MainPresenter> implements
mTabSegment.addTab(home)
.addTab(report)
.addTab(my);
}
@Override
......
......@@ -269,10 +269,10 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
List<Function> managerFuncations = FunctionManager.getDefault().getFunctionByResModule(this, ComponentMain.main.class, ComponentMain.main.manager, "manager");
managerFuncations.add(new Function((long) 171, 163, 5, "二維碼", R.drawable.ic_authority_management, 0));
managerFuncations.add(new Function((long) 171, 163, 5, "配置列表", R.drawable.ic_authority_management, 0));
managerFuncations.add(new Function((long) 171, 163, 5, "廚房打印查詢", R.drawable.ic_authority_management, 0));
managerFuncations.add(new Function((long) 171, 163, 5, "餐牌管理", R.drawable.ic_authority_management, 0));
managerFuncations.add(new Function(171, 163, 5, "二維碼", R.drawable.ic_authority_management, 0));
managerFuncations.add(new Function(171, 163, 5, "配置列表", R.drawable.ic_authority_management, 0));
managerFuncations.add(new Function(171, 163, 5, "廚房打印查詢", R.drawable.ic_authority_management, 0));
managerFuncations.add(new Function(171, 163, 5, "餐牌管理", R.drawable.ic_authority_management, 0));
if (managerFuncations.size() > 0) {
functions.addAll(managerFuncations);
......@@ -296,7 +296,7 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
for (Function function : functions) {
if (function.getParentId() == 0) {
//父模塊
parents.put(function.getId().intValue(), function.getResName());
parents.put(function.getId(), function.getResName());
} else {
if (funMap.get(function.getParentId()) == null) {
List<Function> functionList = new ArrayList<>();
......
......@@ -22,7 +22,4 @@ public class DiscountItem extends BillItem {
super(name, money, status,type);
}
public void updateBillItem(int type) {
}
}
......@@ -11,15 +11,5 @@ import lombok.Data;
*/
public interface Commodity {
// protected Long id;
// protected String name;
// protected String name2;
// protected String name3;
// protected double price;
// protected int number;
// /**
// * 类型#1:优惠卷;2:商品;3:菜品;4:细项;5:折扣;
// */
// protected byte type;
}
......@@ -9,7 +9,7 @@ import androidx.appcompat.app.AppCompatActivity;
import com.epson.epos2.printer.Printer;
import com.epson.epos2.printer.PrinterStatusInfo;
import com.epson.epos2.printer.ReceiveListener;
import com.gingersoft.gsa.cloud.base.order.bean.OrderDetail;
import com.gingersoft.gsa.cloud.base.order.commodity.OrderDetail;
import com.gingersoft.gsa.cloud.base.utils.time.TimePickerUtils;
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
......
......@@ -214,7 +214,7 @@ public class IpPrintListActivityFragment extends BaseFragment<IpPrintListActivit
//item點擊事件 打開打印機詳情
startToEditPrint(adapterPosition);
});
//menu 右侧菜單點擊事件
//Menu 右侧菜單點擊事件
// mRvPrintList.setOnItemMenuClickListener((menuBridge, position) -> {
// //刪除按鈕點擊事件
// menuBridge.closeMenu();
......
......@@ -18,6 +18,7 @@ public class ComponentTable implements IComponent {
public static final FModule[] bottom = {
new FModule("table/bottom/init", R.mipmap.table_init,0) ,
new FModule("table/bottom/move", R.mipmap.table_move,0) ,
new FModule("table/bottom/null", 0,0) ,
new FModule("table/bottom/splite", R.mipmap.table_splite,0) ,
new FModule("table/bottom/parper", R.mipmap.table_paper,0) ,
new FModule("table/bottom/skyorder", R.mipmap.table_skyorder,0)
......
package com.gingersoft.gsa.cloud.table.mvp.model.bean;
import lombok.Getter;
import lombok.Setter;
/**
* @author : bin
* @create date: 2020-11-03
* @update date: 2020-11-03
* @description:
*/
@Getter
@Setter
public class MealSummary {
private String name;
}
......@@ -145,7 +145,9 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
mTableActions.add(new SplitTableAction(context));
} else if (function.getResUrl().endsWith("parper")) {
mTableActions.add(new PrintServingPaperAction(context));
} else if (function.getResUrl().endsWith("skyorder")) {
}
if (mTableActions.size() == 2 && function.getResUrl().endsWith("skyorder")) {
//將skyorder功能添加到中間
mTableActions.add(new PrintSkyOrderAction(context));
}
}
......@@ -205,6 +207,16 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
}
boolean addFuctions = false;
List<Function> functions = FunctionManager.getDefault().getFunctionByResModule(GsaCloudApplication.getAppContext(), ComponentTable.table.class, ComponentTable.table.bottom, "bottom");
Function newFunction = new Function();
newFunction.setParentId(175);
newFunction.setGroupId(5);
newFunction.setId(366);
newFunction.setResName("");
newFunction.setIcRes(0);
newFunction.setStatus(0);
newFunction.setResUrl("");
functions.add(newFunction);
for (int i = 0; i < functions.size(); i++) {
Function function = functions.get(i);
if (function.getParentId() == 0) {
......@@ -213,6 +225,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
addFuctions = true;
}
}
Collections.swap(functions,2,4);
if (addFuctions) {
mBottomFunctionList.addAll(functions);
mRootView.setBottomFunctionVisibility(true);
......@@ -221,11 +234,6 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
mRootView.setBottomFunctionVisibility(false);
}
initTableActions(IActivity, functions);
// 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));
}
......
......@@ -4,6 +4,7 @@ import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.os.Message;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ImageView;
......@@ -27,6 +28,8 @@ import com.gingersoft.gsa.cloud.table.mvp.ui.fragment.AllTableFragment;
import com.gingersoft.gsa.cloud.table.mvp.ui.fragment.InputTableFragment;
import com.gingersoft.gsa.cloud.constans.GoldConstants;
import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx;
import com.jess.arms.base.BaseFragmentActivity;
import com.jess.arms.base.DefaultAdapter;
import com.jess.arms.di.component.AppComponent;
......@@ -106,8 +109,6 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
@BindView(R2.id.tv_table_action_content)
TextView tv_table_action_content;
@BindView(R2.id.iv_tab_icon)
ImageView iv_tab_icon;
private LoadService loadService;
/**
......@@ -158,11 +159,11 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
// loadService = LoadSir.getDefault().register(this, new Callback.OnReloadListener() {
// @Override
// public void onReload(View v) {
// // 重新加载逻辑
// //重新加载逻辑
// getTables(true, null);
// }
// });
// bn_table_function.getMenu().
initTabAndPager();
getTables(true, null);
}
......
......@@ -157,7 +157,7 @@ public class OrderDetailActivity extends BaseActivity<OrderDetailPresenter> impl
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
mDoshokuOrder = mDoshokuOrder;
mDoshokuOrder = DoshokuOrder.getInstance();
mShoppingCart = mDoshokuOrder.getShoppingCart();
super.onCreate(savedInstanceState);
}
......
......@@ -27,12 +27,14 @@ public class BottomFunctionAdapter extends DefaultAdapter<Function> {
private Context mContext;
public static final int VIEW_TYPE_NOMAL = 1;
public static final int VIEW_TYPE_SKYORDER = 2;
public BottomFunctionAdapter(Context context, List<Function> infos) {
super(infos);
this.mContext = context;
}
@Override
public int getItemCount() {
return mInfos.size();
......@@ -40,12 +42,29 @@ public class BottomFunctionAdapter extends DefaultAdapter<Function> {
@Override
public BaseHolder<Function> getHolder(View v, int viewType) {
if (viewType == VIEW_TYPE_SKYORDER) {
return new SkyorderFunctionItemHolder(v);
} else {
return new BottomFunctionItemHolder(v);
}
}
@Override
public int getLayoutId(int viewType) {
return R.layout.table_item_bottom_function;
if (viewType == VIEW_TYPE_SKYORDER) {
return R.layout.table_item_skyorder;
} else {
return R.layout.table_item_table_bottom;
}
}
@Override
public int getItemViewType(int position) {
Function function = getItem(position);
if (function.isRaisedBottom()) {
return VIEW_TYPE_SKYORDER;
}
return VIEW_TYPE_NOMAL;
}
class BottomFunctionItemHolder extends BaseHolder<Function> {
......@@ -72,16 +91,22 @@ public class BottomFunctionAdapter extends DefaultAdapter<Function> {
}
}
class SkyorderFunctionItemHolder extends BaseHolder<Function> {
@BindView(R2.id.tv_name)
TextView tv_name;
@BindView(R2.id.iv_lock)
ImageView iv_lock;
// private OnItemClickListener mOnItemClickListener;
//
// public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
// mOnItemClickListener = onItemClickListener;
// }
//
// public interface OnItemClickListener {
//
// void onItemClick(TableBean.DataBean datasBean, int position);
//
// }
public SkyorderFunctionItemHolder(View itemView) {
super(itemView);
}
@Override
public void setData(Function item, int position) {
tv_name.setText(item.getResName());
}
}
}
......@@ -8,7 +8,6 @@ import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.R2;
import com.gingersoft.gsa.cloud.table.di.component.DaggerAllOrderComponent;
......@@ -27,7 +26,6 @@ import com.qmuiteam.qmui.widget.QMUIEmptyView;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener;
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
import org.json.JSONException;
import java.net.SocketTimeoutException;
......
......@@ -90,8 +90,9 @@ public class DiscountDialog extends Dialog {
}
public void addItems(List<Discount> items) {
if (mItems.size() > 0)
if (mItems.size() > 0) {
mItems.clear();
}
mItems.addAll(items);
}
......
......@@ -12,8 +12,12 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.AnimationUtils;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.TranslateAnimation;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.GridView;
......@@ -50,8 +54,6 @@ public class KeyboardDialog extends Dialog {
private GridView mGridView;
private MaterialEditText ed_text;
private Animation enterAnim, exitAnim;
private ArrayList<Map<String, String>> keyboardValueList;
// 动画时长
private final static int mAnimationDuration = 300;
......@@ -62,8 +64,6 @@ public class KeyboardDialog extends Dialog {
public KeyboardDialog(Activity context) {
super(context, R.style.QMUI_BottomSheet);
this.mContext = context;
initAnim();
}
@Override
......@@ -114,7 +114,18 @@ public class KeyboardDialog extends Dialog {
if (mContentView == null) {
return;
}
mContentView.startAnimation(enterAnim);
TranslateAnimation translate = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0f,
Animation.RELATIVE_TO_SELF, 1f, Animation.RELATIVE_TO_SELF, 0f
);
AlphaAnimation alpha = new AlphaAnimation(0, 1);
AnimationSet set = new AnimationSet(true);
set.addAnimation(translate);
set.addAnimation(alpha);
set.setInterpolator(new DecelerateInterpolator());
set.setDuration(mAnimationDuration);
set.setFillAfter(true);
mContentView.startAnimation(set);
}
/**
......@@ -124,7 +135,18 @@ public class KeyboardDialog extends Dialog {
if (mContentView == null) {
return;
}
exitAnim.setAnimationListener(new Animation.AnimationListener() {
TranslateAnimation translate = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0f,
Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 1f
);
AlphaAnimation alpha = new AlphaAnimation(1, 0);
AnimationSet set = new AnimationSet(true);
set.addAnimation(translate);
set.addAnimation(alpha);
set.setInterpolator(new DecelerateInterpolator());
set.setDuration(mAnimationDuration);
set.setFillAfter(true);
set.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
mIsAnimating = true;
......@@ -155,7 +177,7 @@ public class KeyboardDialog extends Dialog {
}
});
mContentView.startAnimation(exitAnim);
mContentView.startAnimation(set);
}
@Override
......@@ -166,7 +188,6 @@ public class KeyboardDialog extends Dialog {
@Override
public void dismiss() {
super.dismiss();
if (mIsAnimating) {
return;
}
......@@ -204,7 +225,7 @@ public class KeyboardDialog extends Dialog {
virtualKeyboardView.setFocusable(true);
virtualKeyboardView.setFocusableInTouchMode(true);
virtualKeyboardView.startAnimation(enterAnim);
// virtualKeyboardView.startAnimation(enterAnim);
virtualKeyboardView.setVisibility(View.VISIBLE);
keyboardValueList = virtualKeyboardView.getValueList();
......@@ -286,14 +307,6 @@ public class KeyboardDialog extends Dialog {
}
};
/**
* 数字键盘显示动画
*/
private void initAnim() {
enterAnim = AnimationUtils.loadAnimation(mContext, com.gingersoft.gsa.cloud.table.R.anim.push_bottom_in);
exitAnim = AnimationUtils.loadAnimation(mContext, com.gingersoft.gsa.cloud.table.R.anim.push_bottom_out);
}
protected int getContentViewLayoutId() {
return R.layout.table_dialog_keyboard;
}
......
......@@ -59,7 +59,7 @@ public class SplitTableDialog extends BaseRetryDialog {
private ImageView btn_close;
public SplitTableDialog(@NonNull Context context) {
super(context);
super(context, R.style.MyDialogTheme2);
mContext = context;
mItems = new ArrayList<>();
mRadius = QMUIDisplayHelper.dp2px(mContext, 8);
......
......@@ -33,5 +33,8 @@
android:fitsSystemWindows="true"/>
</LinearLayout>
<com.qmuiteam.qmui.widget.grouplist.QMUICommonListItemView
android:layout_width="match_parent"
android:layout_height="match_parent"></com.qmuiteam.qmui.widget.grouplist.QMUICommonListItemView>
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>
\ No newline at end of file
......@@ -14,7 +14,7 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/rv_bottom_function"
android:layout_above="@+id/bn_table_function"
android:layout_marginTop="?attr/qmui_topbar_height"
android:background="#FFE8E8E8">
......@@ -68,20 +68,17 @@
</LinearLayout>
</RelativeLayout>
<ImageView
android:id="@+id/iv_tab_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_bottom_function"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_height="@dimen/dp_60"
android:layout_gravity="bottom"
android:layout_alignParentBottom="true"
android:background="@drawable/table_shape_table_bottom_function_layout"
android:orientation="horizontal" />
<include layout="@layout/table_item_skyorder" />
<com.qmuiteam.qmui.layout.QMUIButton
android:id="@+id/btn_cancel_operat"
android:layout_width="match_parent"
......
......@@ -3,15 +3,19 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/shape_rect_top_radius_white_5">
android:background="@drawable/shape_rect_top_radius_white_5"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
<LinearLayout
android:id="@+id/cl_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_20"
android:orientation="vertical">
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10"
android:gravity="center_vertical"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatCheckBox
android:id="@+id/cb_title"
......@@ -26,15 +30,16 @@
android:id="@+id/tv_start_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:drawableRight="@drawable/qmui_popup_arrow_down"
android:drawablePadding="@dimen/dp_20"
android:drawablePadding="@dimen/dp_10"
android:drawableTint="@color/theme_hint_color"
android:gravity="center"
android:paddingStart="@dimen/dp_20"
android:text="22"
android:paddingStart="@dimen/dp_10"
android:text="22:00"
android:textColor="@color/theme_text_color"
android:textSize="@dimen/sp_16"
app:layout_constraintLeft_toRightOf="@+id/cb_title"/>
app:layout_constraintLeft_toRightOf="@+id/cb_title" />
<TextView
android:id="@+id/tv_split"
......@@ -50,26 +55,43 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableRight="@drawable/qmui_popup_arrow_down"
android:drawablePadding="@dimen/dp_20"
android:drawablePadding="@dimen/dp_10"
android:drawableTint="@color/theme_hint_color"
android:gravity="center"
android:paddingStart="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
android:text="30"
android:paddingStart="@dimen/dp_10"
android:paddingEnd="@dimen/dp_10"
android:text="23:30"
android:textColor="@color/theme_text_color"
android:textSize="@dimen/sp_16"
app:layout_constraintLeft_toRightOf="@+id/tv_split" />
<!-- </LinearLayout>-->
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_summary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
app:layout_constraintTop_toBottomOf="@+id/cb_title"/>
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
app:layout_constraintTop_toBottomOf="@+id/cb_title" />
<com.qmuiteam.qmui.widget.QMUIEmptyView
android:id="@+id/emptyView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true" />
<ProgressBar
android:id="@+id/progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="invisible"/>
</FrameLayout>
<include
layout="@layout/table_input_skyorder_people_number" />
<include layout="@layout/table_input_skyorder_people_number" />
</LinearLayout>
\ No newline at end of file
......@@ -21,7 +21,7 @@
<com.rengwuxian.materialedittext.MaterialEditText
android:id="@+id/ed_value"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_60"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_15"
......@@ -35,7 +35,7 @@
android:singleLine="true"
android:textColor="@color/table_input_table_keypad"
android:textColorHint="@color/theme_hint_color"
android:textSize="@dimen/sp_28"
android:textSize="@dimen/dp_25"
android:textStyle="bold"
app:met_baseColor="@color/theme_black"
app:met_clearButton="true"
......@@ -46,7 +46,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_80"
android:orientation="horizontal">
<TableLayout
......@@ -75,7 +74,7 @@
android:tag="7"
android:text="@string/Key_7"
android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_25" />
android:textSize="@dimen/dp_30" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/btn_8"
......@@ -89,7 +88,7 @@
android:tag="8"
android:text="@string/Key_8"
android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_25" />
android:textSize="@dimen/dp_30" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/btn_9"
......@@ -102,7 +101,7 @@
android:tag="9"
android:text="@string/Key_9"
android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_25" />
android:textSize="@dimen/dp_30" />
</TableRow>
<TableRow
......@@ -124,7 +123,7 @@
android:tag="4"
android:text="@string/Key_4"
android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_25" />
android:textSize="@dimen/dp_30" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/btn_5"
......@@ -139,7 +138,7 @@
android:tag="5"
android:text="@string/Key_5"
android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_25" />
android:textSize="@dimen/dp_30" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/btn_6"
......@@ -153,7 +152,7 @@
android:tag="6"
android:text="@string/Key_6"
android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_25" />
android:textSize="@dimen/dp_30" />
</TableRow>
<TableRow
......@@ -175,7 +174,7 @@
android:tag="1"
android:text="@string/Key_1"
android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_25" />
android:textSize="@dimen/dp_30" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/btn_2"
......@@ -190,7 +189,7 @@
android:tag="2"
android:text="@string/Key_2"
android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_25" />
android:textSize="@dimen/dp_30" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/btn_3"
......@@ -204,7 +203,7 @@
android:tag="3"
android:text="@string/Key_3"
android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_25" />
android:textSize="@dimen/dp_30" />
</TableRow>
<TableRow
......@@ -215,7 +214,7 @@
android:background="#FFDDEDFE">
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/btn_more"
android:id="@+id/btn_clear"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_marginTop="1dp"
......@@ -242,10 +241,10 @@
android:tag="0"
android:text="@string/Key_0"
android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_25" />
android:textSize="@dimen/dp_30" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/btn_clear"
android:id="@+id/btn_add10"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_marginTop="1dp"
......@@ -258,7 +257,7 @@
android:tag="99"
android:text="+10"
android:textColor="@color/table_input_table_keypad"
android:textSize="@dimen/dp_25" />
android:textSize="@dimen/dp_28" />
</TableRow>
</TableLayout>
......@@ -268,7 +267,7 @@
android:orientation="vertical">
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/btn_cha"
android:id="@+id/btn_delete"
android:layout_width="@dimen/dp_120"
android:layout_height="0dp"
android:layout_weight="1"
......@@ -277,7 +276,7 @@
android:gravity="center"
android:layerType="software"
android:tag="98"
android:text="@string/Key_clear"
android:text="×"
android:textColor="#1196DB"
android:textSize="@dimen/dp_25"
android:textStyle="bold" />
......
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundRelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_above="@+id/rv_bottom_function"
android:gravity="center"
android:orientation="vertical"
app:qmui_backgroundColor="@color/theme_color"
app:qmui_borderColor="@color/theme_hint_color">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTint="@color/theme_white_color"
android:drawableTop="@mipmap/table_skyorder_qrcode"
android:text="skyorder"
android:layout_marginTop="@dimen/dp_5"
android:textColor="@color/theme_white_color"
android:textSize="@dimen/font_normal" />
<ImageView
android:id="@+id/iv_lock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:tint="@color/theme_white_color"
android:layout_below="@+id/tv_name"
android:src="@drawable/qrcode_time_lock"/>
</com.qmuiteam.qmui.widget.roundwidget.QMUIRoundRelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/init_table"
android:title="重置餐檯"
android:icon="@mipmap/table_init"/>
<item
android:id="@+id/move_table"
android:title="轉移"
android:icon="@mipmap/table_move"/>
<item
android:id="@+id/skyorder"
android:title="skyorder"
android:icon="@mipmap/table_skyorder"/>
<item
android:id="@+id/splite_table"
android:title="分檯"
android:icon="@mipmap/table_splite"/>
<item
android:id="@+id/print_serving_paper"
android:title="上菜紙"
android:icon="@mipmap/table_paper"/>
<item
android:id="@+id/print_serving_paper2"
android:title="上菜紙2"
android:icon="@mipmap/table_paper"/>
<item
android:id="@+id/print_serving_paper3"
android:title="上菜紙3"
android:icon="@mipmap/table_paper"/>
</menu>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/send_order"
android:title="送單" />
<item
android:id="@+id/print_order"
android:title="印單" />
<item
android:id="@+id/order_pay"
android:title="結賬" />
<item
android:id="@+id/transfer_food"
android:title="轉移" />
<item
android:id="@+id/order_discount"
android:title="折扣" />
</menu>
\ No newline at end of file
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