Commit 24b6de23 by 宁斌

1、新增餐檯模式餐種 2、細項/套餐組要可以 一起滑動 3、獲取支付方式接口新增上傳 payType字段

parent 5f1d9219
......@@ -51,7 +51,7 @@ android {
/**
* 版本号
*/
schemaVersion 18
schemaVersion 19
/**
* greendao输出dao的数据库操作实体类文件夹(相对路径 包名+自定义路径名称,包将创建于包名的直接路径下)
*/
......
......@@ -75,9 +75,9 @@ public class GsaCloudApplication extends BaseApplication {
*/
public static boolean openSkinMake = false;
/**
* okhttp连接超时15
* okhttp连接超时20
*/
public static int CONNECT_TIMEOUT = 15;
public static int CONNECT_TIMEOUT = 20;
/**
* okhttp读写超时20秒
*/
......
package com.gingersoft.gsa.cloud.constans;
/**
* @author : bin
* @create date: 2020-10-17
* @update date: 2020-10-17
* @description:餐種類型
*/
public interface FoodSummaryConstans {
/**
* 外賣餐種
*/
int TAKEAWAY_TYPE = 1;
/**
* skyorder餐種
*/
int SKYORDER = 2;
/**
* 自取餐種
*/
int SELF_COLLECTION = 3;
/**
* 餐牌餐種
*/
int MEAL_MENU = 4;
/**
* 冷鏈餐種
*/
int COLD_CHAIN = 5;
/**
* 餐檯模式餐種
*/
int RESTAURANT_MODE = 6;
}
......@@ -2,15 +2,12 @@ package com.gingersoft.gsa.cloud.database.bean;
import android.graphics.Color;
import android.text.TextUtils;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.Transient;
import java.util.Date;
import lombok.Data;
/**
......@@ -160,6 +157,11 @@ public class ComboItem {
@Transient
private boolean isModifier;
/**
* 餐种{@link com.gingersoft.gsa.cloud.constans.FoodSummaryConstans}
*/
@Transient
private String foodSummary;
/**
* 0=顯示, 1=隱藏, 2=暫停,3=只显示,不操作
*/
@Transient
......@@ -199,9 +201,6 @@ public class ComboItem {
@Transient
private double pointsRedeem;
@Generated(hash = 435228340)
public ComboItem() {
}
@Generated(hash = 1579207287)
......@@ -227,6 +226,11 @@ public class ComboItem {
this.printSeting = printSeting;
}
@Generated(hash = 435228340)
public ComboItem() {
}
public boolean isSold() {
if(!TextUtils.isEmpty(currentMaxNumber) && ("售罄".equals(currentMaxNumber) || "暫停".equals(currentMaxNumber))){
......@@ -572,4 +576,12 @@ public class ComboItem {
public void setPointsRedeem(double pointsRedeem) {
this.pointsRedeem = pointsRedeem;
}
public String getFoodSummary() {
return foodSummary;
}
public void setFoodSummary(String foodSummary) {
this.foodSummary = foodSummary;
}
}
package com.gingersoft.gsa.cloud.database.bean;
import android.graphics.Color;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
......@@ -9,7 +8,6 @@ import org.greenrobot.greendao.annotation.JoinEntity;
import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.ToMany;
import org.greenrobot.greendao.annotation.Transient;
import java.util.Date;
import java.util.List;
import org.greenrobot.greendao.DaoException;
......@@ -85,9 +83,9 @@ public class Food {
*/
private long limitType;
/**
* 餐种
* 餐种{@link com.gingersoft.gsa.cloud.constans.FoodSummaryConstans}
*/
private long foodSummary;
private String foodSummary;
/**
* 0=顯示, 1=隱藏, 2=暫停,3=只显示,不操作
*/
......@@ -326,12 +324,11 @@ public class Food {
@Transient
private boolean isComboFood = false;
@Generated(hash = 972927256)
@Generated(hash = 408737970)
public Food(Long id, long parentId, long restaurantId, byte isParent,
long seqNo, String foodName, String foodName1, String foodName2,
String plu, String posFid, String foodDesc, long limitAmount,
long limitType, long foodSummary, long invisible, byte autoMod,
long limitType, String foodSummary, long invisible, byte autoMod,
double price, double marketPrice, double lunchboxPrice,
String imgUrlSmall, String imageurl, long riceponInvisible, double cost,
Date startDate, Date endDate, long like, long totalSold, long isSold,
......@@ -420,6 +417,8 @@ public class Food {
}
public Long getId() {
return id;
}
......@@ -508,14 +507,10 @@ public class Food {
this.limitType = limitType;
}
public Long getFoodSummary() {
public String getFoodSummary() {
return foodSummary;
}
public void setFoodSummary(Long foodSummary) {
this.foodSummary = foodSummary;
}
public Long getInvisible() {
return invisible;
}
......@@ -1048,7 +1043,7 @@ public class Food {
this.limitType = limitType;
}
public void setFoodSummary(long foodSummary) {
public void setFoodSummary(String foodSummary) {
this.foodSummary = foodSummary;
}
......
......@@ -14,10 +14,10 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* Master of DAO (schema version 18): knows all DAOs.
* Master of DAO (schema version 19): knows all DAOs.
*/
public class DaoMaster extends AbstractDaoMaster {
public static final int SCHEMA_VERSION = 18;
public static final int SCHEMA_VERSION = 19;
/** Creates underlying database table using DAOs. */
public static void createAllTables(Database db, boolean ifNotExists) {
......
......@@ -37,7 +37,7 @@ public class FoodDao extends AbstractDao<Food, Long> {
public final static Property FoodDesc = new Property(10, String.class, "foodDesc", false, "FOOD_DESC");
public final static Property LimitAmount = new Property(11, long.class, "limitAmount", false, "LIMIT_AMOUNT");
public final static Property LimitType = new Property(12, long.class, "limitType", false, "LIMIT_TYPE");
public final static Property FoodSummary = new Property(13, long.class, "foodSummary", false, "FOOD_SUMMARY");
public final static Property FoodSummary = new Property(13, String.class, "foodSummary", false, "FOOD_SUMMARY");
public final static Property Invisible = new Property(14, long.class, "invisible", false, "INVISIBLE");
public final static Property AutoMod = new Property(15, byte.class, "autoMod", false, "AUTO_MOD");
public final static Property Price = new Property(16, double.class, "price", false, "PRICE");
......@@ -119,7 +119,7 @@ public class FoodDao extends AbstractDao<Food, Long> {
"\"FOOD_DESC\" TEXT," + // 10: foodDesc
"\"LIMIT_AMOUNT\" INTEGER NOT NULL ," + // 11: limitAmount
"\"LIMIT_TYPE\" INTEGER NOT NULL ," + // 12: limitType
"\"FOOD_SUMMARY\" INTEGER NOT NULL ," + // 13: foodSummary
"\"FOOD_SUMMARY\" TEXT," + // 13: foodSummary
"\"INVISIBLE\" INTEGER NOT NULL ," + // 14: invisible
"\"AUTO_MOD\" INTEGER NOT NULL ," + // 15: autoMod
"\"PRICE\" REAL NOT NULL ," + // 16: price
......@@ -225,7 +225,11 @@ public class FoodDao extends AbstractDao<Food, Long> {
}
stmt.bindLong(12, entity.getLimitAmount());
stmt.bindLong(13, entity.getLimitType());
stmt.bindLong(14, entity.getFoodSummary());
String foodSummary = entity.getFoodSummary();
if (foodSummary != null) {
stmt.bindString(14, foodSummary);
}
stmt.bindLong(15, entity.getInvisible());
stmt.bindLong(16, entity.getAutoMod());
stmt.bindDouble(17, entity.getPrice());
......@@ -365,7 +369,11 @@ public class FoodDao extends AbstractDao<Food, Long> {
}
stmt.bindLong(12, entity.getLimitAmount());
stmt.bindLong(13, entity.getLimitType());
stmt.bindLong(14, entity.getFoodSummary());
String foodSummary = entity.getFoodSummary();
if (foodSummary != null) {
stmt.bindString(14, foodSummary);
}
stmt.bindLong(15, entity.getInvisible());
stmt.bindLong(16, entity.getAutoMod());
stmt.bindDouble(17, entity.getPrice());
......@@ -482,7 +490,7 @@ public class FoodDao extends AbstractDao<Food, Long> {
cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // foodDesc
cursor.getLong(offset + 11), // limitAmount
cursor.getLong(offset + 12), // limitType
cursor.getLong(offset + 13), // foodSummary
cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // foodSummary
cursor.getLong(offset + 14), // invisible
(byte) cursor.getShort(offset + 15), // autoMod
cursor.getDouble(offset + 16), // price
......@@ -555,7 +563,7 @@ public class FoodDao extends AbstractDao<Food, Long> {
entity.setFoodDesc(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
entity.setLimitAmount(cursor.getLong(offset + 11));
entity.setLimitType(cursor.getLong(offset + 12));
entity.setFoodSummary(cursor.getLong(offset + 13));
entity.setFoodSummary(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13));
entity.setInvisible(cursor.getLong(offset + 14));
entity.setAutoMod((byte) cursor.getShort(offset + 15));
entity.setPrice(cursor.getDouble(offset + 16));
......
......@@ -162,7 +162,7 @@ public class ComboItemDaoUtils {
ArrayList<ComboItem> comboItems = new ArrayList<>();
// String sql = "SELECT c.*,f.FOOD_NAME,f.FOOD_NAME1,f.FOOD_NAME2,f.PRICE,f.AUTO_MOD FROM COMBO_ITEM c join FOOD f on c.FID=f.FID and f.INVISIBLE=0 join FOOD_COMBO r on r.COM_ID=c.COM_ID ";
String sql = "SELECT c.*,f.FOOD_NAME,f.FOOD_NAME1,f.FOOD_NAME2,f.PRICE,f.AUTO_MOD,f.PRINT_SETING,f.ABLE_DISCOUNT,SELECT_QTY,DEF_MODIFIER,INVISIBLE,POINTS_ADD,POINTS_RATIO,POINTS_REDEEM,SERVICE_CHARGE,c.DIFF_AMT FROM COMBO_ITEM c join FOOD f on c.FID=f.FID and f.INVISIBLE!=1 join FOOD_COMBO r on r.COM_ID=c.COM_ID and r.DELETES!=1";
String sql = "SELECT c.*,f.FOOD_NAME,f.FOOD_NAME1,f.FOOD_NAME2,f.PRICE,f.FOOD_SUMMARY,f.AUTO_MOD,f.PRINT_SETING,f.ABLE_DISCOUNT,SELECT_QTY,DEF_MODIFIER,INVISIBLE,POINTS_ADD,POINTS_RATIO,POINTS_REDEEM,SERVICE_CHARGE,c.DIFF_AMT FROM COMBO_ITEM c join FOOD f on c.FID=f.FID and f.INVISIBLE!=1 join FOOD_COMBO r on r.COM_ID=c.COM_ID and r.DELETES!=1";
if (fid > 0) {
sql = sql + " where r.FID='" + fid + "'";
......@@ -182,6 +182,7 @@ public class ComboItemDaoUtils {
order.setVisible(c.getLong(c.getColumnIndex("VISIBLE")));
order.setAutoMode(c.getInt(c.getColumnIndex("AUTO_MOD")));
order.setSelectQty(c.getInt(c.getColumnIndex("SELECT_QTY")));
order.setFoodSummary(c.getString(c.getColumnIndex("FOOD_SUMMARY")));
order.setInvisible(c.getLong(c.getColumnIndex("INVISIBLE")));
order.setPrintSeting(c.getString(c.getColumnIndex("PRINT_SETING")));
order.setAblediscount(c.getLong(c.getColumnIndex("ABLE_DISCOUNT")));
......
......@@ -173,6 +173,21 @@ public class FoodDaoUtils {
}
/**
* 使用queryBuilder进行查询食品組
*
* @return
*/
public List<Food> queryFoodGroupByQueryBuilder(int foodSummary) {
QueryBuilder<Food> queryBuilder = mManager.getDaoSession().queryBuilder(Food.class);
long currentTime = System.currentTimeMillis();
return queryBuilder.where(queryBuilder.and(
FoodDao.Properties.ParentId.eq(0),
FoodDao.Properties.FoodSummary.like("%"+foodSummary+"%"),
FoodDao.Properties.StartDate.le(currentTime),
FoodDao.Properties.EndDate.ge(currentTime))).orderAsc(FoodDao.Properties.SeqNo).list();
}
/**
* 使用queryBuilder进行查询食品
*
* @return
......@@ -187,6 +202,22 @@ public class FoodDaoUtils {
FoodDao.Properties.EndDate.ge(currentTime))).orderAsc(FoodDao.Properties.SeqNo).list();
}
/**
* 使用queryBuilder进行查询食品
*
* @return
*/
public List<Food> queryFoodByQueryBuilder(long parentId,int foodSummary) {
QueryBuilder<Food> queryBuilder = mManager.getDaoSession().queryBuilder(Food.class);
long currentTime = System.currentTimeMillis();
return queryBuilder.where(queryBuilder.and(
FoodDao.Properties.ParentId.eq(parentId),
FoodDao.Properties.FoodSummary.like("%"+foodSummary+"%"),
FoodDao.Properties.Invisible.notEq(1),
FoodDao.Properties.StartDate.le(currentTime),
FoodDao.Properties.EndDate.ge(currentTime))).orderAsc(FoodDao.Properties.SeqNo).list();
}
public List<Food> queryAllFoodByQueryBuilder() {
QueryBuilder<Food> queryBuilder = mManager.getDaoSession().queryBuilder(Food.class);
long currentTime = System.currentTimeMillis();
......
......@@ -50,16 +50,6 @@ public class ComponentDownload implements IComponent {
case "showDownloadActivity":
openActivity(cc);
break;
case "getFunctionlist":
//demo for provide fragment object to other component
getFunctionlist(cc);
break;
case "getFoodGroupList":
getFoodGroupList(cc);
break;
case "getFoodListByParentId":
getFoodListByParentId(cc);
break;
case "getInfo":
getInfo(cc);
break;
......@@ -83,36 +73,6 @@ public class ComponentDownload implements IComponent {
}
}
private void getFoodGroupList(CC cc) {
List<Food> foodGroupList = queryDB_FoodGroupList(cc.getContext());
if (foodGroupList != null) {
CCResult ccResult = CCResult.success("foodGroupList", GsonUtils.GsonString(foodGroupList));
CC.sendCCResult(cc.getCallId(), ccResult);
} else {
CC.sendCCResult(cc.getCallId(), CCResult.error("foodGroupList is null"));
}
}
private void getFoodListByParentId(CC cc) {
int parentId = cc.getParamItem("parentId");
List<Food> foodList = queryDB_FoodList(cc.getContext(), parentId);
if (foodList != null) {
CC.sendCCResult(cc.getCallId(), CCResult.success("foodList", GsonUtils.GsonString(foodList)));
} else {
CC.sendCCResult(cc.getCallId(), CCResult.error("foodList is null"));
}
}
public List<Food> queryDB_FoodGroupList(Context context) {
FoodDaoUtils foodDaoUtils = new FoodDaoUtils(context);
return foodDaoUtils.queryFoodGroupByQueryBuilder();
}
public List<Food> queryDB_FoodList(Context context, int parentId) {
FoodDaoUtils foodDaoUtils = new FoodDaoUtils(context);
return foodDaoUtils.queryFoodByQueryBuilder(parentId);
}
private void getInfo(CC cc) {
String userName = "billy";
CC.sendCCResult(cc.getCallId(), CCResult.success("userName", userName));
......
......@@ -45,9 +45,6 @@ public interface DownloadContract {
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
List<Food> queryDB_FoodGroupList(Context context);
List<Food> queryDB_FoodList(Context context, int parentId);
Observable<FunctionRespone> downFunctionList(long userId);
......
......@@ -60,18 +60,6 @@ public class DownloadModel extends BaseModel implements DownloadContract.Model {
}
@Override
public List<Food> queryDB_FoodGroupList(Context context) {
FoodDaoUtils foodDaoUtils = new FoodDaoUtils(context);
return foodDaoUtils.queryFoodGroupByQueryBuilder();
}
@Override
public List<Food> queryDB_FoodList(Context context, int parentId) {
FoodDaoUtils foodDaoUtils = new FoodDaoUtils(context);
return foodDaoUtils.queryFoodByQueryBuilder(parentId);
}
@Override
public Observable<FunctionRespone> downFunctionList(long userId) {
return mRepositoryManager.obtainRetrofitService(DownloadService.class)
.downFunctionList(userId);
......
......@@ -89,11 +89,23 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
.doOnSubscribe(disposable -> mRootView.showLoading(null))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
// .doAfterTerminate(() -> mRootView.hideLoading())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<BaseResult>(mErrorHandler) {
@Override
public void onComplete() {
super.onComplete();
mRootView.hideLoading();
}
@Override
public void onError(Throwable t) {
super.onError(t);
mRootView.hideLoading();
}
@Override
public void onNext(@NonNull BaseResult info) {
if (info != null && info.isSuccess()) {
if (info.getData() != null) {
......@@ -120,11 +132,23 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
.doOnSubscribe(disposable -> mRootView.showLoading(null))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
// .doAfterTerminate(() -> {mRootView.hideLoading()})
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<BaseResult>(mErrorHandler) {
@Override
public void onComplete() {
super.onComplete();
mRootView.hideLoading();
}
@Override
public void onError(Throwable t) {
super.onError(t);
mRootView.hideLoading();
}
@Override
public void onNext(@NonNull BaseResult info) {
if (info != null && info.isSuccess()) {
if (info.getData() != null) {
......@@ -150,11 +174,23 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
.doOnSubscribe(disposable -> mRootView.showLoading(null))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
// .doAfterTerminate(() -> mRootView.hideLoading())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<BaseResult>(mErrorHandler) {
@Override
public void onComplete() {
super.onComplete();
mRootView.hideLoading();
}
@Override
public void onError(Throwable t) {
super.onError(t);
mRootView.hideLoading();
}
@Override
public void onNext(@NonNull BaseResult info) {
if (info != null && info.isSuccess()) {
if (info.getData() != null) {
......@@ -236,11 +272,23 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
.doOnSubscribe(disposable -> mRootView.showLoading(null))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
// .doAfterTerminate(() -> mRootView.hideLoading())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<BaseResult>(mErrorHandler) {
@Override
public void onComplete() {
super.onComplete();
mRootView.hideLoading();
}
@Override
public void onError(Throwable t) {
super.onError(t);
mRootView.hideLoading();
}
@Override
public void onNext(@NonNull BaseResult info) {
if (info != null && info.isSuccess()) {
if (info.getData() != null) {
......@@ -267,11 +315,23 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
.doOnSubscribe(disposable -> mRootView.showLoading(null))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
// .doAfterTerminate(() -> mRootView.hideLoading())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<BaseResult>(mErrorHandler) {
@Override
public void onComplete() {
super.onComplete();
mRootView.hideLoading();
}
@Override
public void onError(Throwable t) {
super.onError(t);
mRootView.hideLoading();
}
@Override
public void onNext(@NonNull BaseResult info) {
if (info != null && info.isSuccess()) {
if (info.getData() != null) {
......@@ -297,11 +357,23 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
.doOnSubscribe(disposable -> mRootView.showLoading(null))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
// .doAfterTerminate(() -> mRootView.hideLoading())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<BaseResult>(mErrorHandler) {
@Override
public void onComplete() {
super.onComplete();
mRootView.hideLoading();
}
@Override
public void onError(Throwable t) {
super.onError(t);
mRootView.hideLoading();
}
@Override
public void onNext(@NonNull BaseResult info) {
if (info != null && info.isSuccess()) {
if (info.getData() != null) {
......@@ -395,11 +467,23 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
.doOnSubscribe(disposable -> mRootView.showLoading(null))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
// .doAfterTerminate(() -> mRootView.hideLoading())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<BaseResult>(mErrorHandler) {
@Override
public void onComplete() {
super.onComplete();
mRootView.hideLoading();
}
@Override
public void onError(Throwable t) {
super.onError(t);
mRootView.hideLoading();
}
@Override
public void onNext(@NonNull BaseResult info) {
if (info != null && info.isSuccess()) {
if (info.getData() != null) {
......@@ -431,7 +515,7 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
LogUtil.d(TAG, "changeTableSort " + " ids:" + ids);
mModel.changeTableSort(requestBody)
.subscribeOn(Schedulers.io())
// .doOnSubscribe(disposable -> mRootView.showLoading(null))
.doOnSubscribe(disposable -> mRootView.showLoading(null))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
// .doAfterTerminate(() -> mRootView.hideLoading())
......@@ -439,6 +523,18 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
.subscribe(new ErrorHandleSubscriber<BaseResult>(mErrorHandler) {
@Override
public void onComplete() {
super.onComplete();
mRootView.hideLoading();
}
@Override
public void onError(Throwable t) {
super.onError(t);
mRootView.hideLoading();
}
@Override
public void onNext(@NonNull BaseResult info) {
if (info != null && info.isSuccess()) {
if (info.getData() != null) {
......
......@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.manager.mvp.ui.activity;
import android.content.Intent;
import android.os.Bundle;
import com.gingersoft.gsa.cloud.base.table.bean.TableArea;
import com.gingersoft.gsa.cloud.base.table.bean.TableItem;
import com.gingersoft.gsa.cloud.manager.R;
......@@ -24,6 +25,7 @@ import java.util.List;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import me.yokeyword.fragmentation.ISupportFragment;
import me.yokeyword.fragmentation.anim.DefaultHorizontalAnimator;
import me.yokeyword.fragmentation.anim.FragmentAnimator;
......@@ -212,12 +214,15 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
if (mTableAreaList.size() > 0) {
mTableAreaList.clear();
}
this.mTableAreaList.addAll(areas);
mTableAreaList.addAll(areas);
ISupportFragment fragment = getTopFragment();
if (fragment != null) {
if (fragment instanceof AreaListFragment) {
AreaListFragment areaListFragment = (AreaListFragment) fragment;
if (type == DELETE_AREA_SUCCESS) {
areaListFragment.deleteSuccess();
}
if (!areaListFragment.isRadioEdit()) {
areaListFragment.updateAreaData(areas);
}
......@@ -227,23 +232,18 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
}
switch (type) {
case ADD_AREA_SUCCESS:
case UPDATE_AREA_SUCCESS:
AreaListFragment areaListFragment = (AreaListFragment) fragment;
if (areaListFragment != null) {
if (type == ADD_AREA_SUCCESS) {
areaListFragment.addSuccess();
}
if (fragment instanceof AreaListFragment) {
AreaListFragment areaListFragment = (AreaListFragment) fragment;
areaListFragment.addSuccess();
}
break;
case UPDATE_AREA_SUCCESS:
TableListFragment tableListFragment = findFragment(TableListFragment.class);
if (tableListFragment != null) {
tableListFragment.updateTableData(mTableAreaList, mTableList);
}
break;
case DELETE_AREA_SUCCESS:
areaListFragment = (AreaListFragment) fragment;
if (areaListFragment != null) {
areaListFragment.deleteSuccess();
}
break;
case QUERY_AREA_SUCCESS:
......
......@@ -182,11 +182,11 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements
rightButton = mTopBar.addRightTextButton("編輯", R.id.qmui_dialog_edit_right_icon);
rightButton.setTextColor(ContextCompat.getColor(mContext, R.color.theme_white_color));
rightButton.setOnClickListener(v -> {
clickEdit(rightButton);
clickEdit();
});
}
private void clickEdit(Button rightButton) {
public void clickEdit() {
isRadioEdit = !isRadioEdit;
if (isRadioEdit) {
fl_add_area.setVisibility(View.INVISIBLE);
......@@ -302,7 +302,7 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements
}
public void deleteSuccess() {
clickEdit(rightButton);
clickEdit();
}
@Override
......@@ -332,11 +332,6 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements
}
}
// @OnClick(R2.id.btn_save)
// void onClickSaveModify() {
// mActivity.updateArea(createUpateAreaRequest(datasBean.getId(), name));
// }
@OnClick(R2.id.btn_sure)
void onClickSure() {
String ids = getDeleteIds();
......
......@@ -47,28 +47,35 @@
android:orientation="horizontal"
android:visibility="gone">
<EditText
<com.rengwuxian.materialedittext.MaterialEditText
android:id="@+id/ed_area_name"
android:layout_width="0dp"
android:layout_height="@dimen/dp_48"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:hint="請輸入區域名稱"
android:maxLength="15"
android:layout_margin="@dimen/dp_2"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10"
android:singleLine="true"
android:textColor="@color/normal_color"
android:textColorHint="@color/hint_color"
android:textSize="@dimen/sp_16"
android:visibility="visible" />
app:met_autoValidate="true"
app:met_clearButton="true"
app:met_floatingLabel="highlight"
app:met_iconPadding="2dp"
app:met_baseColor="@color/theme_black"
app:met_primaryColor="@color/theme_color"
app:met_singleLineEllipsis="false"/>
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/btn_save_area"
android:layout_width="@dimen/dp_60"
android:layout_height="@dimen/dp_38"
android:layout_gravity="right|center_vertical"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginLeft="@dimen/dp_8"
android:layout_marginRight="@dimen/dp_10"
android:background="@color/theme_red_color"
android:text="保存"
......
......@@ -9,6 +9,7 @@ import com.gingersoft.gsa.cloud.base.order.bean.BillOrderMoney;
import com.gingersoft.gsa.cloud.base.order.bean.DeleteOrderRequest;
import com.gingersoft.gsa.cloud.base.order.bean.OrderBean;
import com.gingersoft.gsa.cloud.base.order.bean.OrderDetail;
import com.gingersoft.gsa.cloud.constans.FoodSummaryConstans;
import com.gingersoft.gsa.cloud.print.bean.OrderDetails;
import com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog;
......@@ -110,12 +111,10 @@ public class MyOrderManage {
private boolean modifyOrder = false;
/**
* 訂單類型(0=堂食,1=外賣)
* 訂單類型
*/
private int orderType;
private int orderType = FoodSummaryConstans.RESTAURANT_MODE;
public static final int order_type_0 = 0;
public static final int order_type_1 = 1;
public long getOrderId() {
if (orderBean != null) {
......@@ -341,7 +340,7 @@ public class MyOrderManage {
orderBean = null;
modifyOrder = false;
memberUpdateStatus = "";
orderType = order_type_0;
orderType = FoodSummaryConstans.RESTAURANT_MODE;
}
public int getSelpostion() {
......
......@@ -137,9 +137,9 @@ public interface MealStandContract {
List<Food> queryDB_AllFoodList();
List<Food> queryDB_FoodGroupList();
List<Food> queryDB_FoodGroupList(int foodSummary);
List<Food> queryDB_FoodList(long parentId);
List<Food> queryDB_FoodList(long parentId,int foodSummary);
List<Modifier> queryDB_ModifierList(long fid, int mode);
......
......@@ -56,7 +56,7 @@ public interface OrderPayContract {
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends BaseOrderContract.Model {
Observable<BaseResult> getPayMethods(int brandId,int restaurantId);
Observable<BaseResult> getPayMethods(int brandId,int restaurantId,int payType);
Observable<BaseResult> updateOrderPay(RequestBody requestBody);
......
package com.gingersoft.gsa.cloud.table.mvp.model;
import android.app.Application;
import android.text.TextUtils;
import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.base.order.bean.mealManger.MyOrderManage;
......@@ -66,6 +67,17 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
this.mApplication = null;
}
private List<Food> foodConditionFilter(List<Food> foodList) {
for (int i = foodList.size() - 1; i >= 0; i--) {
Food food = foodList.get(i);
String foodSummary = food.getFoodSummary();
if (!TextUtils.isEmpty(foodSummary)) {
foodSummary.split(",");
}
}
return foodList;
}
@Override
public List<Food> queryDB_AllFoodList() {
FoodDaoUtils foodDaoUtils = new FoodDaoUtils(mApplication);
......@@ -74,16 +86,16 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
}
@Override
public List<Food> queryDB_FoodGroupList() {
public List<Food> queryDB_FoodGroupList(int foodSummary) {
FoodDaoUtils foodDaoUtils = new FoodDaoUtils(mApplication);
List<Food> foods = foodDaoUtils.queryFoodGroupByQueryBuilder();
List<Food> foods = foodDaoUtils.queryFoodGroupByQueryBuilder(foodSummary);
return foods;
}
@Override
public List<Food> queryDB_FoodList(long parentId) {
public List<Food> queryDB_FoodList(long parentId, int foodSummary) {
FoodDaoUtils foodDaoUtils = new FoodDaoUtils(mApplication);
List<Food> foods = foodDaoUtils.queryFoodByQueryBuilder(parentId);
List<Food> foods = foodDaoUtils.queryFoodByQueryBuilder(parentId, foodSummary);
return foods;
}
......
......@@ -50,9 +50,9 @@ public class OrderPayModel extends BaseModel implements OrderPayContract.Model {
}
@Override
public Observable<BaseResult> getPayMethods(int brandId,int restaurantId) {
public Observable<BaseResult> getPayMethods(int brandId,int restaurantId,int payType) {
return mRepositoryManager.obtainRetrofitService(OrderPayService.class)
.getPayMethods(brandId,restaurantId);
.getPayMethods(brandId,restaurantId,payType);
}
@Override
......
......@@ -25,5 +25,5 @@ public interface OrderPayService {
Observable<BaseResult> toOrderPay(@Body RequestBody requestBody);
@GET("restaurant/pay/get" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> getPayMethods(@Query("brandId") int brandId,@Query("restaurantId") int restaurantId);
Observable<BaseResult> getPayMethods(@Query("brandId") int brandId,@Query("restaurantId") int restaurantId,@Query("payType") int payType);
}
......@@ -96,6 +96,10 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
protected List<BillOrderMoney> mOrderMoneyList;
protected OrderDetail mCurrentOrderDetailBean;
/**
* 訂單類型
*/
protected int orderType;
//選中操作的食品下標
protected int orderSelectPosition = -1;
......@@ -128,6 +132,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
this.myOrderManage = MyOrderManage.getInstance();
this.mOrderFoodList = myOrderManage.getOrderFoodList();
this.mOrderMoneyList = myOrderManage.getOrderMoneyList();
this.orderType = myOrderManage.getOrderType();
if (IActivity instanceof OrderContentActivity) {
mOrderContentActivity = (OrderContentActivity) IActivity;
......
......@@ -162,7 +162,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
public void initMealData() {
List<Food> foodGroupList = mModel.queryDB_FoodGroupList();
List<Food> foodGroupList = mModel.queryDB_FoodGroupList(orderType);
if (foodGroupList != null && foodGroupList.size() > 0) {
......@@ -245,7 +245,6 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
mCurrentOrderDetailBean = datasBean;
mSelectMealAdapter.setMyOrderManageSelectPosition();
loadComboData(datasBean, true);
// updateOrderFoodNumber();
}
@Override
......@@ -273,9 +272,13 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
return;
}
RvMealClicked = false;
mCurrentOrderDetailBean = OrderDetail.foodTransOrderDetails(datasBean, 1);
//加載套餐食品
loadComboData(mCurrentOrderDetailBean, false);
if (datasBean.getIsParent() == 0) {
changedMealByParentId(datasBean.getId());
} else {
mCurrentOrderDetailBean = OrderDetail.foodTransOrderDetails(datasBean, 1);
//加載套餐食品
loadComboData(mCurrentOrderDetailBean, false);
}
}
});
mComboAdapter.setOnItemClickListener(new ComboAdapter.OnItemClickListener() {
......@@ -525,7 +528,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
}
}
if (IActivity.getCurrentViewMode() != MealConstant.fine_ViewMode && isSelectedMeal || autoMod) {
mRootView.showViewModeVisibility(MealConstant.combo_ViewMode, MealConstant.modifier_ViewMode);
mRootView.showViewModeVisibility(MealConstant.combo_ViewMode);
}
if (!RvMealClicked) {
//新增食品
......@@ -1167,7 +1170,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
}
public void changedMealByParentId(long parentId) {
List<Food> foodList = mModel.queryDB_FoodList(parentId);
List<Food> foodList = mModel.queryDB_FoodList(parentId,orderType);
mFoodAdapter.resetSelect(-1, null);
if (foodList != null) {
updateFoodData(foodList, parentId);
......@@ -1644,15 +1647,15 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
private void setFoodGroupBtnNumber(FoodGroupAdapter adapter, List<Food> foodGroupList) {
List<OrderDetail> orderDetailList = getOrderFoodLists();
for (int i = 0; i < foodGroupList.size(); i++) {
Food foodBean = foodGroupList.get(i);
foodBean.setNumber(0);
Food foodGroupBean = foodGroupList.get(i);
foodGroupBean.setNumber(0);
int iNumber = 0;
if (orderDetailList != null) {
for (int j = 0; j < orderDetailList.size(); j++) {
OrderDetail food = orderDetailList.get(j);
if (food.isNew() && food.getTopId() == foodBean.getId()) {
if (food.isNew() && food.getTopId() == foodGroupBean.getId()) {
iNumber = iNumber + food.getNumber();
foodBean.setNumber(iNumber);
foodGroupBean.setNumber(iNumber);
}
}
}
......
......@@ -25,6 +25,7 @@ import com.gingersoft.gsa.cloud.base.utils.JsonUtils;
import com.gingersoft.gsa.cloud.base.utils.RestaurantExpandInfoUtils;
import com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.constans.ExpandConstant;
import com.gingersoft.gsa.cloud.constans.FoodSummaryConstans;
import com.gingersoft.gsa.cloud.constans.GoldConstants;
import com.gingersoft.gsa.cloud.constans.PrintConstans;
import com.gingersoft.gsa.cloud.database.bean.Discount;
......@@ -283,7 +284,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
// if (functions.size() > 0) {
// mFunctionList.addAll(functions);
// } else {
if (MyOrderManage.getInstance().getOrderType() == MyOrderManage.order_type_1) {
if (MyOrderManage.getInstance().getOrderType() == FoodSummaryConstans.TAKEAWAY_TYPE) {
mFunctionList.add(new Function("折扣", Color.parseColor("#FFFFFF"), Color.parseColor("#008577"), 24));
mFunctionList.add(new Function("印單", Color.parseColor("#FFFFFF"), Color.parseColor("#FF8E04"), 24));
mFunctionList.add(new Function("送單信息", Color.parseColor("#FFFFFF"), Color.parseColor("#008131"), 24));
......
......@@ -14,6 +14,7 @@ import com.gingersoft.gsa.cloud.base.order.bean.mealManger.OpenTableManage;
import com.gingersoft.gsa.cloud.base.utils.JsonUtils;
import com.gingersoft.gsa.cloud.base.utils.MoneyUtil;
import com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.constans.FoodSummaryConstans;
import com.gingersoft.gsa.cloud.table.BuildConfig;
import com.gingersoft.gsa.cloud.table.mvp.contract.OrderPayContract;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.OrderPayRespose;
......@@ -182,7 +183,7 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
public void getPayMethods() {
int brandId = GsaCloudApplication.getBrandId();
int restaurantId = GsaCloudApplication.getRestaurantId();
mModel.getPayMethods(brandId, restaurantId)
mModel.getPayMethods(brandId, restaurantId, FoodSummaryConstans.RESTAURANT_MODE)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(null))
.subscribeOn(AndroidSchedulers.mainThread())
......@@ -307,7 +308,7 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
orderPay.setTipsPrice(orderPayView.getTipsPrice());
}
if (orderPay.getPayType() == PayMethod.PAY_TYPE_INTEGRAL) {
double consumptionPoints = orderPayView.getPayForConsumptionPoints(null,memberInfo.getPointRedeemCash());
double consumptionPoints = orderPayView.getPayForConsumptionPoints(null, memberInfo.getPointRedeemCash());
orderPay.setConsumptionPoints(consumptionPoints);
// //減去積分支付所用的積分
// payRequest.setPointsUse(MoneyUtil.sum(payRequest.getPointsUse(), consumptionPoints));
......@@ -495,7 +496,8 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
}
return false;
}
//
//
public List<PayMethod> getBillMoneyList() {
return mBillMoneyList;
}
......
......@@ -21,6 +21,7 @@ import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import com.billy.cc.core.component.CC;
......@@ -35,6 +36,7 @@ import com.gingersoft.gsa.cloud.base.order.bean.mealManger.OpenTableManage;
import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
import com.gingersoft.gsa.cloud.base.utils.VibratorUtils;
import com.gingersoft.gsa.cloud.base.utils.other.SPUtils;
import com.gingersoft.gsa.cloud.constans.FoodSummaryConstans;
import com.gingersoft.gsa.cloud.table.BuildConfig;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.R2;
......@@ -131,6 +133,9 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@BindView(R2.id.rv_discount)
RecyclerView rv_discount;
@BindView(R2.id.scroll_combo)
ScrollView scroll_combo;
@BindView(R2.id.rl_fine_tabs)
RelativeLayout rl_fine_tabs;
@BindView(R2.id.tabs_fine)
......@@ -325,7 +330,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
}
private void initTableDetail() {
if (MyOrderManage.getInstance().getOrderType() == MyOrderManage.order_type_1) {
if (MyOrderManage.getInstance().getOrderType() == FoodSummaryConstans.TAKEAWAY_TYPE) {
TableBean.DataBean tableBean = new TableBean.DataBean();
tableBean.setPerson(1);
tableBean.setTableName("外賣");
......@@ -370,12 +375,6 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
//总的页数向上取整
totalPage = (int) Math.ceil(foodGroupList.size() * 1.0 / GoldConstants.foodGriupPageSize);
// int Rows = GoldConstants.foodGriupRows;
// if (foodGroupList.size() <= GoldConstants.foodGriupColumns) {
// Rows = 1;
// }
// mLayoutManager = new PagerGridLayoutManager(Rows, GoldConstants.foodGriupColumns, PagerGridLayoutManager.HORIZONTAL);
int Rows = foodGroupRow;
if (foodGroupList.size() <= foodGroupColumn) {
Rows = 1;
......@@ -591,7 +590,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@OnClick(R2.id.btn_table)
void onClickTable() {
if (MyOrderManage.getInstance().getOrderType() == MyOrderManage.order_type_1) {
if (MyOrderManage.getInstance().getOrderType() == FoodSummaryConstans.TAKEAWAY_TYPE) {
return;
}
//type取值:1:qrCdoetype,2:手機號,3:memberId
......@@ -702,7 +701,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
int id = v.getId();
if (id == R.id.btn_numberman) {
if (MyOrderManage.getInstance().getOrderType() == MyOrderManage.order_type_1) {
if (MyOrderManage.getInstance().getOrderType() == FoodSummaryConstans.TAKEAWAY_TYPE) {
return;
}
showChoosePeopleNumDialog(true);
......@@ -728,7 +727,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
mPresenter.restoreDeleteFood();
showBtnMealModifyRestoreVisibility(false);
} else if (id == R.id.btn_send_order) {
if (MyOrderManage.getInstance().getOrderType() == MyOrderManage.order_type_1) {
if (MyOrderManage.getInstance().getOrderType() == FoodSummaryConstans.TAKEAWAY_TYPE) {
CC.obtainBuilder("ComponentDeliveryPick")
.setActionName("SendOrder")
.build()
......@@ -810,7 +809,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
break;
}
} else if (id == R.id.iv_fine_back) {
showViewModeVisibility(MealConstant.combo_ViewMode, MealConstant.modifier_ViewMode);
showViewModeVisibility(MealConstant.combo_ViewMode);
}
}
......@@ -1108,7 +1107,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
showModifyLayoutVisibility(false);
break;
case MealConstant.combo_ViewMode:
case MealConstant.modifier_ViewMode:
// case MealConstant.modifier_ViewMode:
case MealConstant.discount_ViewMode:
case MealConstant.fine_ViewMode:
showModifyLayoutVisibility(true);
......@@ -1267,8 +1266,8 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
private void initViewMap() {
map.put(MealConstant.food_group_ViewMode, ll_food_group);
map.put(MealConstant.food_ViewMode, rv_food);
map.put(MealConstant.combo_ViewMode, rv_combo);
map.put(MealConstant.modifier_ViewMode, rv_modifier);
map.put(MealConstant.combo_ViewMode, scroll_combo);
// map.put(MealConstant.modifier_ViewMode, rv_modifier);
map.put(MealConstant.discount_ViewMode, rv_discount);
map.put(MealConstant.fine_ViewMode, pager_fine);
map.put(MealConstant.fine_tabs_ViewMode, rl_fine_tabs);
......@@ -1327,11 +1326,11 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@Override
public void setModifierTop(int margins) {
RelativeLayout.LayoutParams layoutParam = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
layoutParam.setMargins(0, margins, 0, 0);
layoutParam.addRule(RelativeLayout.ABOVE, R.id.ll_stand_oper);
layoutParam.addRule(RelativeLayout.BELOW, R.id.rv_combo);
rv_modifier.setLayoutParams(layoutParam);
// RelativeLayout.LayoutParams layoutParam = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
// layoutParam.setMargins(0, margins, 0, 0);
// layoutParam.addRule(RelativeLayout.ABOVE, R.id.ll_stand_oper);
// layoutParam.addRule(RelativeLayout.BELOW, R.id.rv_combo);
// rv_modifier.setLayoutParams(layoutParam);
}
@Override
......@@ -1344,37 +1343,5 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
btn_select_all.setVisibility(visibility);
}
private void setViewDrawableColor() {
Drawable tasteDrawable = ArmsUtils.getDrawablebyResource(this, R.mipmap.meal_fine_taste);
QMUIDrawableHelper.setDrawableTintColor(tasteDrawable, ArmsUtils.getColor(mContext, R.color.theme_white_color));
tasteDrawable.invalidateSelf();
Drawable msgDrawable = ArmsUtils.getDrawablebyResource(this, R.mipmap.meal_fine_info);
QMUIDrawableHelper.setDrawableTintColor(msgDrawable, ArmsUtils.getColor(mContext, R.color.theme_white_color));
msgDrawable.invalidateSelf();
Drawable commDrawable = ArmsUtils.getDrawablebyResource(this, R.mipmap.meal_fine_info);
QMUIDrawableHelper.setDrawableTintColor(commDrawable, ArmsUtils.getColor(mContext, R.color.theme_white_color));
commDrawable.invalidateSelf();
Drawable deleteDrawable = ArmsUtils.getDrawablebyResource(this, R.mipmap.meal_fine_delete);
QMUIDrawableHelper.setDrawableTintColor(deleteDrawable, ArmsUtils.getColor(mContext, R.color.theme_white_color));
deleteDrawable.invalidateSelf();
Drawable endDrawable = ArmsUtils.getDrawablebyResource(this, R.mipmap.meal_fine_end);
QMUIDrawableHelper.setDrawableTintColor(endDrawable, ArmsUtils.getColor(mContext, R.color.theme_white_color));
endDrawable.invalidateSelf();
tasteDrawable.setBounds(tasteDrawable.getMinimumWidth(), 0, 0, tasteDrawable.getMinimumHeight());
msgDrawable.setBounds(msgDrawable.getMinimumWidth(), 0, 0, msgDrawable.getMinimumHeight());
commDrawable.setBounds(commDrawable.getMinimumWidth(), 0, 0, commDrawable.getMinimumHeight());
deleteDrawable.setBounds(deleteDrawable.getMinimumWidth(), 0, 0, deleteDrawable.getMinimumHeight());
endDrawable.setBounds(endDrawable.getMinimumWidth(), 0, 0, endDrawable.getMinimumHeight());
btn_taste.setCompoundDrawables(tasteDrawable, null, null, null);
btn_msg.setCompoundDrawables(msgDrawable, null, null, null);
btn_delete.setCompoundDrawables(deleteDrawable, null, null, null);
btn_end.setCompoundDrawables(endDrawable, null, null, null);
}
}
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