Commit 84221077 by Wyh

1、供应链新的食材列表优化完成 2、切换环境按钮文字修改为确认 3、修改打包包名 4、心跳定时切换成RxJavaUtils

parent 68fb2115
......@@ -66,11 +66,9 @@ android {
def date = new Date()
def formattedDate = date.format('yyyy-MM-dd')
if (variant.buildType.name == 'release') {
fileName = "${formattedDate}_GSA-Cloud_${variant.mergedFlavor.versionName}_正式版_.apk"
} else if (variant.buildType.name == 'Test') {
fileName = "${formattedDate}_GSA-Cloud_${variant.mergedFlavor.versionName}_測試版_.apk"
fileName = "正式版_GSA-Cloud_${variant.mergedFlavor.versionName}_${formattedDate}.apk"
} else if (variant.buildType.name == 'debug') {
fileName = "${formattedDate}_GSA-Cloud_${variant.mergedFlavor.versionName}_debug_.apk"
fileName = "测试版_GSA-Cloud_${variant.mergedFlavor.versionName}_${formattedDate}.apk"
}
outputFileName = fileName
}
......
......@@ -121,12 +121,10 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
boolean isLogin = (boolean) SPUtils.get(UserConstans.AUTO_LOGIN, false);
if (isLogin) {
if (!TextUtils.isEmpty(UserContext.newInstance().getLoginToken()) && RestaurantInfoManager.newInstance().getRestaurantId() != 0) {
//自動登陸
UserContext.newInstance().setState(new LoginedState());
int restaurantId = RestaurantInfoManager.newInstance().getRestaurantId();
if (restaurantId != 0) {
if (restaurantId > 0) {
//已经选择过餐厅 直接进入
// jumpDownloadActivity();
//需要驗證登陸人數
......@@ -135,7 +133,7 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
}
//调整选择餐厅页面
Intent intent = new Intent(mContext, ChooseRestaurantActivity.class);
Class clazz = getClass();
Class clazz = WelcomeActivity.this.getClass();
intent.putExtra("form", clazz.getName());
launchActivity(intent);
} else {
......
......@@ -80,7 +80,7 @@
android:layout_height="@dimen/head_height"
android:layout_margin="@dimen/dp_20"
android:background="@color/theme_color"
android:text="清除用戶信息"
android:text="@string/str_determine"
android:textColor="@color/white"
android:textSize="@dimen/sp_16" />
</LinearLayout>
\ No newline at end of file
......@@ -21,6 +21,13 @@ public class Constant {
public static final int PAGE_SIZE = 10;
public static final int PURCHASE_FOOD_MAX = 9999;
/**
* 长按时,初始间隔
*/
public static final int LONG_CLICK_INIT_TIME = 500;
public static final int LONG_CLICK_DECREASE_TIME = 100;
/**
* 庫存消耗——盤點消耗的id
*/
public static final int INVENTORY_CONSUME_ID = 5;
......
......@@ -48,7 +48,7 @@ public interface BuyIngredientsContract {
/**
* 結束加載並且沒有更多數據了
*/
void finishLoadNoMoreData();
void finishLoad(boolean noData);
/**
* 加載食品
......
......@@ -582,7 +582,7 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
public void loadNextCategoryFood(boolean isSupplier, int position, List<OrderCategoryBean.FoodCategoryTrees> foodCategoryTrees) {
List<BuyIngredientsBean> buyIngredientsBeans = null;
if (isSupplier) {
if(supplierFoods.get(position) != null){
if (supplierFoods.get(position) != null) {
buyIngredientsBeans = new ArrayList<>();
buyIngredientsBeans.add(supplierFoods.get(position));
}
......@@ -605,12 +605,12 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
Log.e("eee", "下一個");
loadNextCategoryFood(isSupplier, position, foodCategoryTrees);
} else {
mRootView.finishLoadNoMoreData();
mRootView.finishLoad(true);
}
} else {
Log.e("eee", "loadNextCategoryFood未加載");
//加載
mRootView.selectFirstCategoryByIndex(position);
// mRootView.selectFirstCategoryByIndex(position);
if (isHasLocationInfo(isSupplier, position)) {
loadCacheFood(isSupplier, position, false, false);
} else {
......@@ -639,6 +639,9 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
* @param index 分類下標
*/
public BuyIngredientsBean getFirstCategoryByIndex(int index) {
if (index >= showFoods.size()) {
return null;
}
BuyIngredientsBean buyIngredientsBean = showFoods.get(index);
boolean isParent = buyIngredientsBean.parentId == 0;
for (int i = index; i > -1; i--) {
......@@ -669,18 +672,36 @@ public class BuyIngredientsPresenter extends BasePresenter<BuyIngredientsContrac
BuyIngredientsBean buyIngredientsBean = supplierFoods.get(position);
if (buyIngredientsBean != null) {
showFoods.add(addToHead ? 0 : showFoods.size(), buyIngredientsBean);
List<BuyIngredientsBean> buyIngredientsBeans = new ArrayList<>();
buyIngredientsBeans.add(buyIngredientsBean);
mRootView.loadFood(buyIngredientsBeans, addToHead, isReset);
}
} else {
List<BuyIngredientsBean> buyIngredientsBeans = categoryFoods.get(position);
if (CollectionUtils.isNotNullOrEmpty(buyIngredientsBeans) && !showFoods.contains(buyIngredientsBeans.get(0))) {
if (addToHead) {
showFoods.addAll(0, categoryFoods.get(position));
if (CollectionUtils.isNotNullOrEmpty(buyIngredientsBeans)) {
if (showFoods.contains(buyIngredientsBeans.get(0))) {
//如果列表中已经有这个分类的数据,则加载上一个分类
position -= 1;
if (position >= 0 && position < categoryFoods.size()) {
loadCacheFood(isSupplier, position, addToHead, isReset);
} else {
mRootView.finishLoad(false);
}
} else {
showFoods.addAll(categoryFoods.get(position));
Log.e("eee", "加载分类缓存");
if (addToHead) {
showFoods.addAll(0, categoryFoods.get(position));
} else {
showFoods.addAll(categoryFoods.get(position));
}
mRootView.loadFood(categoryFoods.get(position), addToHead, isReset);
}
} else {
Log.e("eee", "没有分类缓存" + position);
//需要通过接口
getFoodByCategory(position, foodCategoryTrees.get(position), addToHead, isReset);
}
}
mRootView.loadFood(showFoods, addToHead, isReset);
}
......
......@@ -482,7 +482,7 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient
//食材所屬供應商
purchaseFoodBean.setSupplierName(infoMultiBeans.get(supplierIndex).getShowValue());
//食材名稱
purchaseFoodBean.setName(infoMultiBeans.get(foodNameIndex).getShowValue().trim());
purchaseFoodBean.setName(TextUtil.getNotNullStrAndTrim(infoMultiBeans.get(foodNameIndex).getShowValue()));
//食材類別名稱
purchaseFoodBean.setFoodCategoryName(getCategoryName());
//食材基本單位
......
......@@ -139,7 +139,7 @@ public class NewFoodUnitPresenter extends BasePresenter<NewFoodUnitContract.Mode
}
}
foodUnit.setUnitContent(infoMultiBeans.get(1).getShowValue());
foodUnit.setRemarks(infoMultiBeans.get(2).getShowValue().trim());
foodUnit.setRemarks(TextUtil.getNotNullStrAndTrim(infoMultiBeans.get(2).getShowValue()));
return foodUnit;
}
}
......@@ -510,16 +510,16 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode
supplierInfoBean = new SupplierInfoBean();
}
//供應商編號
supplierInfoBean.setSupplierNo(infoMultiBeans.get(supplierNoIndex).getShowValue().trim());
supplierInfoBean.setSupplierNo(TextUtil.getNotNullStrAndTrim(infoMultiBeans.get(supplierNoIndex).getShowValue()));
//供應商名稱
supplierInfoBean.setSupplierName(infoMultiBeans.get(supplierNameIndex).getShowValue().trim());
supplierInfoBean.setSupplierName(TextUtil.getNotNullStrAndTrim(infoMultiBeans.get(supplierNameIndex).getShowValue()));
//聯繫人
supplierInfoBean.setContacts(infoMultiBeans.get(contactsIndex).getShowValue().trim());
supplierInfoBean.setContacts(TextUtil.getNotNullStrAndTrim(infoMultiBeans.get(contactsIndex).getShowValue()));
//手機號碼
String telephone = infoMultiBeans.get(telephoneIndex).getShowValue().trim();
String telephone = TextUtil.getNotNullStrAndTrim(infoMultiBeans.get(telephoneIndex).getShowValue());
supplierInfoBean.setContactInformation(telephone);
//地址
supplierInfoBean.setAddress(infoMultiBeans.get(addressIndex).getShowValue().trim());
supplierInfoBean.setAddress(TextUtil.getNotNullStrAndTrim(infoMultiBeans.get(addressIndex).getShowValue()));
//餐廳信息
supplierInfoBean.setRestaurantId(Constant.getRestaurantId());
supplierInfoBean.setBrandId(Constant.getBrandId());
......@@ -566,7 +566,7 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode
}
deleteNullContact(contacts);
supplierInfoBean.setSupplierContacts(contacts);
supplierInfoBean.setRemarks(infoMultiBeans.get(remarkIndex).getShowValue().trim());
supplierInfoBean.setRemarks(TextUtil.getNotNullStrAndTrim(infoMultiBeans.get(remarkIndex).getShowValue()));
return supplierInfoBean;
}
......
......@@ -38,17 +38,6 @@ public class BuyIngredientsAdapter extends GroupedRecyclerViewAdapter<BuyIngredi
isSinger = showType;
}
// public BuyIngredientsBean getHeaderDataByPosition(int position) {
// if (position < buyIngredientsBeans.size()) {
// return buyIngredientsBeans.get(position);
// }
// return null;
// }
//
// public List<BuyIngredientsBean> getData() {
// return buyIngredientsBeans;
// }
@Override
public int getGroupCount() {
return getData() == null ? 0 : getData().size();
......@@ -113,7 +102,7 @@ public class BuyIngredientsAdapter extends GroupedRecyclerViewAdapter<BuyIngredi
itemViewHolder.setText(R.id.tv_food_item_unit, purchaseFoodBean.getBasicUnitName());
}
itemViewHolder.setText(R.id.tv_food_item_price, String.format(mContext.getString(R.string.amount_string), purchaseFoodBean.getUnitPrice()));
EditText edNumberInput = (EditText) itemViewHolder.get(R.id.ed_food_ingredient_number);
EditText edNumberInput = itemViewHolder.get(R.id.ed_food_ingredient_number);
edNumberInput.setText(String.valueOf(purchaseFoodBean.getFoodQuantity()), TextView.BufferType.EDITABLE);
//如果數量小於等於0,就不顯示減號和數量
setSubAndNumShow(itemViewHolder, purchaseFoodBean.getFoodQuantity() <= 0);
......@@ -189,7 +178,7 @@ public class BuyIngredientsAdapter extends GroupedRecyclerViewAdapter<BuyIngredi
*/
public void setLongClick(BaseViewHolder itemViewHolder, int groupPosition, int childPosition, PurchaseFoodBean purchaseFoodBean, boolean addOrSub) {
//開啟線程
EditText edNumberInput = (EditText) itemViewHolder.get(R.id.ed_food_ingredient_number);
EditText edNumberInput = itemViewHolder.get(R.id.ed_food_ingredient_number);
ThreadPoolManager.getInstence().putExecutableTasks(() -> {
int number = 0;
if (TextUtil.isNotEmptyOrNullOrUndefined(edNumberInput)) {
......
......@@ -26,7 +26,7 @@ public class ImageAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
@Override
protected void convert(@NotNull BaseViewHolder viewHolder, String s) {
GlideUtils.display(getContext(), viewHolder.getView(R.id.iv_img), s, R.drawable.img_small_default);
GlideUtils.display(getContext(), viewHolder.getView(R.id.iv_img), s);
viewHolder.setGone(R.id.iv_img_delete, notShowDelete);
}
}
......@@ -112,13 +112,27 @@ public class OrderDetailsFoodAdapter extends BaseQuickAdapter<PurchaseOrderDetai
viewHolder.setText(R.id.tv_order_details_item_warehouse_total_amount, String.format(formatAmount, item.getTotalAmount()));
//食品數量
EditText edFoodNum = viewHolder.getView(R.id.ed_food_num);
//食品單價
EditText edUnitPrice = viewHolder.getView(R.id.ed_food_unit_price);
//SN食材不可編輯數量
if(item.getFoodMarkSn() == PurchaseFoodBean.HAS_SN){
if (item.getFoodMarkSn() == PurchaseFoodBean.HAS_SN) {
edFoodNum.setEnabled(false);
edFoodNum.setTextColor(ContextCompat.getColor(getContext(), R.color.color_aaa));
edUnitPrice.setTextColor(ContextCompat.getColor(getContext(), R.color.color_3c));
edUnitPrice.setEnabled(true);
} else {
edFoodNum.setTextColor(ContextCompat.getColor(getContext(), R.color.color_3c));
edFoodNum.setEnabled(true);
if (item.getStatus() == PurchaseOrderDetailsBean.COMPLETE_RECEIVED) {
//全部收貨的不可編輯數量和金額
edFoodNum.setEnabled(false);
edUnitPrice.setEnabled(false);
edFoodNum.setTextColor(ContextCompat.getColor(getContext(), R.color.color_aaa));
edUnitPrice.setTextColor(ContextCompat.getColor(getContext(), R.color.color_aaa));
} else {
edFoodNum.setEnabled(true);
edUnitPrice.setEnabled(true);
edFoodNum.setTextColor(ContextCompat.getColor(getContext(), R.color.color_3c));
edUnitPrice.setTextColor(ContextCompat.getColor(getContext(), R.color.color_3c));
}
}
edFoodNum.setFilters(inputFilters);
//已入庫數量
......@@ -178,8 +192,6 @@ public class OrderDetailsFoodAdapter extends BaseQuickAdapter<PurchaseOrderDetai
edFoodNum.removeTextChangedListener(watcher);
}
});
//食品單價
EditText edUnitPrice = viewHolder.getView(R.id.ed_food_unit_price);
edUnitPrice.setFilters(inputFilters);
edUnitPrice.setText(String.valueOf(item.getShowUnit().getUnitPrice()));
TextWatcher unitPriceWatcher = new TextWatcher() {
......
......@@ -51,6 +51,7 @@ public class ShoppingCartAdapter extends BaseQuickAdapter<ShoppingCartBean, Shop
private String amountUnitStr;
private String estimateDeliveryTimeStr;
public ShoppingCartAdapter(Context context, @Nullable List<ShoppingCartBean> data) {
super(R.layout.item_shopping_cart, data);
this.context = context;
......@@ -86,7 +87,11 @@ public class ShoppingCartAdapter extends BaseQuickAdapter<ShoppingCartBean, Shop
if (!hasFocus) {
//失去焦點時修改備註
ShoppingCartBean currentShoppingBean = getData().get(viewHolder.getAdapterPosition());
currentShoppingBean.setRemarks(mEdRemarks.getText().toString().trim());
if (TextUtil.isNotEmptyOrNullOrUndefined(mEdRemarks)) {
currentShoppingBean.setRemarks("");
} else {
currentShoppingBean.setRemarks(TextUtil.getNotNullStrAndTrim(mEdRemarks.getText().toString()));
}
}
});
if (shoppingCartBean.isFlashing()) {
......
......@@ -32,7 +32,9 @@ import com.gingersoft.supply_chain.mvp.ui.fragment.food.MeasurementUnitFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.supplier.SupplierListFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.food.FoodIngredientsFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.warehouse.WareHouseListFragment;
import com.gingersoft.supply_chain.mvp.ui.widget.GoodsDetailsPopup;
import com.jess.arms.di.component.AppComponent;
import com.lxj.xpopup.XPopup;
import com.qmuiteam.qmui.widget.QMUITopBar;
import java.util.ArrayList;
......
......@@ -163,7 +163,7 @@ public class CategoryFragment extends BaseSupplyChainFragment<CategoryPresenter>
showMessage("請輸入分類名稱");
return;
}
mPresenter.updateFoodCategory(mPresenter.toFoodCategoryBean(foodCategoryTrees.getParentId(), categoryPopup.getEditText().getText().toString().trim(), foodCategoryTrees.getId()), currentLevel, position);
mPresenter.updateFoodCategory(mPresenter.toFoodCategoryBean(foodCategoryTrees.getParentId(), TextUtil.getNotNullStrAndTrim(categoryPopup.getEditText().getText().toString()), foodCategoryTrees.getId()), currentLevel, position);
}, () -> {
}))
.show();
......@@ -236,7 +236,7 @@ public class CategoryFragment extends BaseSupplyChainFragment<CategoryPresenter>
return;
}
//創建分類
mPresenter.addCategory(parentId, categoryPopup.getEditText().getText().toString().trim(), level);
mPresenter.addCategory(parentId, TextUtil.getNotNullStrAndTrim(categoryPopup.getEditText().getText().toString()), level);
}, () -> {
}))
.show();
......
......@@ -304,7 +304,6 @@ public class NewFoodIngredientsFragment extends BaseSupplyChainFragment<NewFoodI
dialog.dismiss();
saveGoodsInfo();
}, (view, dialog) -> {
dialog.dismiss();
isLeave = true;
killMyself();
});
......
......@@ -231,7 +231,7 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
* @param state 狀態,全部收貨還是部分收貨
*/
private void addWarehouse(int state) {
AppDialog.getInstance().showWaringDialog(requireContext(), "是否確認收貨?", (view, dialog) -> {
AppDialog.getInstance().showTipDialog(requireContext(), "是否確認收貨?", (view, dialog) -> {
mPresenter.addWarehouse(state, edRemark.getText() + "", totalAmount, orderDetailsFoodAdapter.getData());
setFragmentResult(RESULT_OK, null);
});
......@@ -267,10 +267,15 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
//判斷有沒有SN食材,如果沒有,就顯示全選按妞
if (orderDetailsBean.getStatus() == PurchaseOrderDetailsBean.COMPLETE_RECEIVED) {
//全部收貨,顯示備註,備註不可編輯
layoutRemarks.setVisibility(View.GONE);
edRemark.setEnabled(false);
edRemark.setFocusable(false);
edRemark.setBackground(null);
cbOrderDetailsAllSelected.setVisibility(View.VISIBLE);
if (TextUtil.isNotEmptyOrNullOrUndefined(orderDetailsBean.getWarehousingRemarks())) {
layoutInputRemark.setVisibility(View.VISIBLE);
layoutInputRemark.setCounterEnabled(false);
}
} else {
cbOrderDetailsAllSelected.setVisibility(mPresenter.hasSnFood(orderDetailsBean.getPurchaseOrderDetailsInfoVOS()) ? View.GONE : View.VISIBLE);
supplyTopBar.addRightImageButton(R.drawable.ic_take_pictures, R.id.id_take_pictures).setOnClickListener(this);
......@@ -397,6 +402,8 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
if (TextUtil.isNotEmptyOrNullOrUndefined(pic)) {
new XPopup.Builder(requireContext())
.isDestroyOnDismiss(true)
.isDarkTheme(true)
.enableDrag(false)
.asImageViewer((ImageView) view, pic, true, Color.parseColor("#f1f1f1"), -1, -1, false, -1, new ImageLoader())
.show();
}
......@@ -636,14 +643,25 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
if (data != null) {
Uri uri = data.getData();
if (uri != null) {
File file = SelectPicture.getInstance().uriToFileApiQ(requireContext(), uri);
SelectPicture.getInstance().crop(Uri.fromFile(file), this);
// File file = SelectPicture.getInstance().uriToFileApiQ(requireContext(), uri);
// SelectPicture.getInstance().crop(Uri.fromFile(file), this);
String filePath = FileUtils.getFilePathByUri(mContext, uri);
if (!TextUtils.isEmpty(filePath)) {
mPresenter.uploadPic(filePath);
}
}
}
} else if (requestCode == SelectPicture.TAKE_PHOTO && resultCode == RESULT_OK) {
//拍照
Uri cameraUri = SelectPicture.getInstance().getmCameraUri();
if (cameraUri != null) {
String filePath = FileUtils.getFilePathByUri(mContext, cameraUri);
if (!TextUtils.isEmpty(filePath)) {
mPresenter.uploadPic(filePath);
}
}
//拍照完成後需要裁剪
SelectPicture.getInstance().crop(SelectPicture.getInstance().getmCameraUri(), this);
// SelectPicture.getInstance().crop(SelectPicture.getInstance().getmCameraUri(), this);
} else if (requestCode == REQUEST_CROP && resultCode == RESULT_OK && data != null) {
final Uri resultUri = UCrop.getOutput(data);
if (resultUri != null) {
......
package com.gingersoft.supply_chain.mvp.ui.fragment.order;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -129,7 +130,6 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
});
initTopBar();
initTabAndData();
getOrderList();
}
private void getOrderList() {
......@@ -142,9 +142,7 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
@Override
public void onSupportVisible() {
super.onSupportVisible();
if (tvCartGoodsNum != null) {
tvCartGoodsNum.setText(String.valueOf(SupplyShoppingCart.getInstance().getCartFoods().size()));
}
setGoodsSize();
}
private TextView tvCartGoodsNum;
......@@ -154,8 +152,7 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
mTopBar.setTitle("採購列表");
View view = View.inflate(mContext, R.layout.layout_shopping_cart, null);
tvCartGoodsNum = view.findViewById(R.id.tv_purchase_cart_size);
tvCartGoodsNum.setText(String.valueOf(SupplyShoppingCart.getInstance().getCartFoods().size()));
setGoodsSize();
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT);
mTopBar.addRightView(view, R.id.qmui_shopping_cart, layoutParams);
view.setOnClickListener(v -> {
......@@ -169,6 +166,21 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
});
}
/**
* 修改商品數量
*/
private void setGoodsSize() {
if (tvCartGoodsNum != null) {
int shoppingGoodsSize = SupplyShoppingCart.getInstance().getCartFoods().size();
if (shoppingGoodsSize > 0) {
tvCartGoodsNum.setVisibility(View.VISIBLE);
tvCartGoodsNum.setText(String.valueOf(shoppingGoodsSize));
} else {
tvCartGoodsNum.setVisibility(View.GONE);
}
}
}
private void initTabAndData() {
QMUITabBuilder builder = mTabSegment.tabBuilder()
.setNormalColor(ContextCompat.getColor(mContext, R.color.color_86))
......@@ -221,6 +233,7 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
mTabSegment.addOnTabSelectedListener(new QMUIBasicTabSegment.OnTabSelectedListener() {
@Override
public void onTabSelected(int index) {
Log.e("eee", "onTabSelected" + index);
orderStateIndex = index;
pageIndex = 0;
getOrderList();
......@@ -233,6 +246,7 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
@Override
public void onTabReselected(int index) {
Log.e("eee", "onTabReselected" + index);
}
......
......@@ -20,6 +20,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import com.gingersoft.gsa.cloud.common.loadsir.EmptyCallback;
import com.gingersoft.gsa.cloud.common.loadsir.ErrorCallback;
import com.gingersoft.gsa.cloud.common.utils.inputFilter.InputFilterUtils;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.ui.animator.CustomAnimation1;
import com.gingersoft.supply_chain.R;
import com.gingersoft.supply_chain.R2;
......@@ -131,7 +132,7 @@ public class WareHouseListFragment extends BaseSupplyChainFragment<WareHouseList
if (pageIndex == 0 && warehousingQueryAdapter != null) {
warehousingQueryAdapter.setList(null);
}
mPresenter.getWarehousing(pageIndex, edWarehouseListSearch.getText().toString().trim());
mPresenter.getWarehousing(pageIndex, TextUtil.getNotNullStrAndTrim(edWarehouseListSearch.getText().toString()));
}
//R2.id.tv_warehouse_item_unit_price, R2.id.tv_warehouse_item_inventory_quantity, R2.id.tv_warehouse_item_total_amount
......
......@@ -3,6 +3,7 @@ package com.gingersoft.supply_chain.mvp.ui.fragment.warehouse;
import android.animation.LayoutTransition;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -49,6 +50,8 @@ import com.kingja.loadsir.core.LoadSir;
import com.qmuiteam.qmui.widget.QMUITopBar;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
......@@ -298,6 +301,7 @@ public class WarehouseDetailsFragment extends BaseSupplyChainFragment<WarehouseD
.setOnCancelListener(() -> showList(View.VISIBLE));
return;
}
inventoryConsumptionView.setEdit(false).setHint(getString(R.string.str_sn_not_edit));
//初始化掃碼view
scanSnView = new ScanSnView(this).setOnScanResultListener((popup, scanResult) -> {
if (scanResult.isEmpty()) {
......@@ -319,8 +323,12 @@ public class WarehouseDetailsFragment extends BaseSupplyChainFragment<WarehouseD
}).init();
scanSnView.setOnSingerResultListener((isAdd, snCode, currentSnCodeNumber) -> {
//inventoryConsumptionView.setConsumptionNumber(currentSnCodeNumber)
//添加或移除某個sn碼
//添加sn碼
scanSnView.setConfirmBtnState();
inventoryConsumptionView.setConsumptionNumber(currentSnCodeNumber);
}).setOnDeleteSnCodeListener((snCode, position) -> {
//刪除SN碼
inventoryConsumptionView.setConsumptionNumber(inventoryConsumptionView.getConsumptionNum() - 1);
});
inventoryConsumptionView.setOnNumberChangeListener(num -> {
//輸入數量發生變化時
......@@ -407,30 +415,66 @@ public class WarehouseDetailsFragment extends BaseSupplyChainFragment<WarehouseD
RecyclerView rvInfo = view.findViewById(R.id.rv_print_consume_info);
TextView tvUserName = view.findViewById(R.id.tv_print_consume_user_name);
TextView tvSnCodes = view.findViewById(R.id.tv_print_sn);
LinearLayout layoutSn = view.findViewById(R.id.layout_sn_list);
restaurantName.setText(String.format(getString(R.string.str_restaurant_outbound_order), RestaurantInfoManager.newInstance().getRestaurantName()));
tvDate.setText(TimeUtils.getCurrentDate(TimeUtils.DEFAULT_DATE_FORMAT_YMDHM));
tvFoodNo.setText(String.format(getString(R.string.str_no), purchaseWarehousingOrderDetailsVO.getFoodNo()));
tvUserName.setText(String.format(getString(R.string.str_prepared), UserContext.newInstance().getMemberName()));
List<OutboundOrderBean> outboundOrderBeans = new ArrayList<>();
outboundOrderBeans.add(new OutboundOrderBean("品名", purchaseWarehousingOrderDetailsVO.getName()));
outboundOrderBeans.add(new OutboundOrderBean("單位", purchaseWarehousingOrderDetailsVO.getUnitName()));
outboundOrderBeans.add(new OutboundOrderBean("數量", String.valueOf(foodNum)));
outboundOrderBeans.add(new OutboundOrderBean("單價", String.valueOf(purchaseWarehousingOrderDetailsVO.getFoodPrice())));
outboundOrderBeans.add(new OutboundOrderBean("金額", String.valueOf(MoneyUtil.priceCalculation(purchaseWarehousingOrderDetailsVO.getFoodPrice(), foodNum))));
outboundOrderBeans.add(new OutboundOrderBean("消耗原因", consumptionReason));
outboundOrderBeans.add(new OutboundOrderBean("備註", remarks));
outboundOrderBeans.add(new OutboundOrderBean(getString(R.string.str_product_name), purchaseWarehousingOrderDetailsVO.getName()));
outboundOrderBeans.add(new OutboundOrderBean(getString(R.string.str_unit), purchaseWarehousingOrderDetailsVO.getUnitName()));
outboundOrderBeans.add(new OutboundOrderBean(getString(R.string.str_number), String.valueOf(foodNum)));
outboundOrderBeans.add(new OutboundOrderBean(getString(R.string.str_unit_prices), String.valueOf(purchaseWarehousingOrderDetailsVO.getFoodPrice())));
outboundOrderBeans.add(new OutboundOrderBean(getString(R.string.str_amount), String.valueOf(MoneyUtil.priceCalculation(purchaseWarehousingOrderDetailsVO.getFoodPrice(), foodNum))));
outboundOrderBeans.add(new OutboundOrderBean(getString(R.string.str_inventory_reason), consumptionReason));
outboundOrderBeans.add(new OutboundOrderBean(getString(R.string.str_remark), remarks));
if (CollectionUtils.isNotNullOrEmpty(snCodes)) {
layoutSn.addView(getSnView(getString(R.string.str_serial_number), getString(R.string.str_sn_code)));
int size = snCodes.size();
for (int i = 0; i < size; i++) {
LinearLayout layout = getSnView(i + 1 + "", snCodes.get(i));
layoutSn.addView(layout);
}
//sn碼不為空
tvSnCodes.setText(String.format(getString(R.string.str_sn_codes), CollectionUtils.listToCommaString(snCodes)));
layoutSn.setVisibility(View.VISIBLE);
} else {
tvSnCodes.setVisibility(View.GONE);
layoutSn.setVisibility(View.GONE);
}
OutboundOrderAdapter outboundOrderAdapter = new OutboundOrderAdapter(outboundOrderBeans);
rvInfo.setAdapter(outboundOrderAdapter);
return LayoutToBitmapUtils.getBitmapByView(requireContext(), view);
}
@NotNull
private LinearLayout getSnView(String no, String snCode) {
LinearLayout layout = new LinearLayout(requireContext());
layout.setOrientation(LinearLayout.HORIZONTAL);
//序號
TextView tvNo = new TextView(requireContext());
tvNo.setTextSize(14);
tvNo.setTextColor(ContextCompat.getColor(requireContext(), R.color.black));
tvNo.setText(no);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT);
layoutParams.weight = 1;
layoutParams.setMargins(0, 5, 0, 0);
layout.addView(tvNo, layoutParams);
TextView tvSnCode = new TextView(requireContext());
tvSnCode.setTextColor(ContextCompat.getColor(requireContext(), R.color.black));
tvSnCode.setTextSize(14);
tvSnCode.setText(snCode);
LinearLayout.LayoutParams snCodeParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT);
snCodeParams.weight = 2;
snCodeParams.setMargins(0, 5, 0, 0);
layout.addView(tvSnCode, snCodeParams);
return layout;
}
/**
* 顯示消耗列表
*
......
......@@ -298,6 +298,7 @@ public class WarehousingInventoryFragment extends BaseSupplyChainFragment<Wareho
snCodeSize -= 1;
edWarehouseLoss.setText(String.valueOf(snCodeSize));
}
}).setOnCancelListener(this::showList).init();
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
layoutParams.topMargin = QMUIDisplayHelper.dp2px(requireContext(), 10);
......
package com.gingersoft.supply_chain.mvp.ui.widget;
import android.content.Context;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatEditText;
import androidx.core.content.ContextCompat;
import com.gingersoft.gsa.cloud.common.utils.MoneyUtil;
import com.gingersoft.gsa.cloud.common.utils.glide.GlideUtils;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.common.utils.threadPool.ThreadPoolManager;
import com.gingersoft.gsa.cloud.ui.view.imageview.mask.PorterShapeImageView;
import com.gingersoft.supply_chain.R;
import com.gingersoft.supply_chain.R2;
import com.gingersoft.supply_chain.mvp.bean.PurchaseFoodBean;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.gingersoft.supply_chain.mvp.ui.adapter.BuyIngredientsAdapter;
import com.google.android.material.textfield.TextInputEditText;
import com.lxj.xpopup.core.BasePopupView;
import com.lxj.xpopup.core.CenterPopupView;
import com.lxj.xpopup.util.KeyboardUtils;
import com.qmuiteam.qmui.layout.QMUIButton;
import com.qmuiteam.qmui.widget.textview.QMUISpanTouchFixTextView;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* @author 宇航.
* User: admin
......@@ -7,5 +39,182 @@ package com.gingersoft.supply_chain.mvp.ui.widget;
* Time: 10:07
* Use:
*/
public class GoodsDetailsPopup {
public class GoodsDetailsPopup extends CenterPopupView {
@BindView(R2.id.iv_goods_details)
PorterShapeImageView ivGoodsDetails;
@BindView(R2.id.tv_goods_name)
TextView tvGoodsName;
@BindView(R2.id.tv_supplier_name)
TextView tvSupplierName;
@BindView(R2.id.tv_goods_no)
TextView tvGoodsNo;
@BindView(R2.id.tv_goods_price)
QMUISpanTouchFixTextView tvGoodsPrice;
@BindView(R2.id.tv_goods_specification)
TextView tvGoodsSpecification;
@BindView(R2.id.tv_goods_stock)
TextView tvGoodsStock;
@BindView(R2.id.btn_food_operation_sub)
QMUIButton btnFoodOperationSub;
@BindView(R2.id.ed_food_ingredient_number)
AppCompatEditText edFoodIngredientNumber;
@BindView(R2.id.btn_food_operation_add)
QMUIButton btnFoodOperationAdd;
@BindView(R2.id.layout_operation_food_num)
LinearLayout layoutOperationFoodNum;
@BindView(R2.id.iv_popup_close)
ImageView ivPopupClose;
private PurchaseFoodBean purchaseFoodBean;
private BuyIngredientsAdapter.OnFoodNumberChangeListener onFoodNumberChangeListener;
public GoodsDetailsPopup(@NonNull Context context, PurchaseFoodBean purchaseFoodBean) {
super(context);
this.purchaseFoodBean = purchaseFoodBean;
}
@Override
protected int getImplLayoutId() {
return R.layout.layout_goods_details_popup;
}
@Override
protected void onCreate() {
super.onCreate();
ButterKnife.bind(this);
popupInfo.autoOpenSoftInput = false;
if (purchaseFoodBean.getImages() == null) {
ivGoodsDetails.setImageResource(R.drawable.img_small_default);
} else {
GlideUtils.display(getContext(), ivGoodsDetails, purchaseFoodBean.getImages(), R.drawable.img_small_default);
}
tvGoodsName.setText(purchaseFoodBean.getName());
tvSupplierName.setText(purchaseFoodBean.getSupplierName());
tvGoodsNo.setText(purchaseFoodBean.getFoodNo());
String price = String.format(getContext().getString(R.string.str_unit_price_colon_s), MoneyUtil.formatDouble(purchaseFoodBean.getUnitPrice()));
tvGoodsPrice.setText(TextUtil.getBoldSpannableString(price, ContextCompat.getColor(getContext(), R.color.required_color), 3, price.length()));
if (TextUtil.isNotEmptyOrNullOrUndefined(purchaseFoodBean.getPackingDescription())) {
tvGoodsSpecification.setText(purchaseFoodBean.getPackingDescription());
} else {
tvGoodsSpecification.setText(purchaseFoodBean.getBasicUnitName());
}
edFoodIngredientNumber.setText(purchaseFoodBean.getFoodQuantity() + "");
KeyboardUtils.hideSoftInput(this);
btnFoodOperationSub.setOnClickListener(v -> {
//减
if (purchaseFoodBean.getFoodQuantity() > 0) {
foodNumberChange(-1);
}
});
btnFoodOperationSub.setOnTouchListener(onBtnTouchListener);
btnFoodOperationSub.setOnLongClickListener(v -> {
//長按減號
setLongClick(false);
return true;
});
btnFoodOperationAdd.setOnTouchListener(onBtnTouchListener);
btnFoodOperationAdd.setOnLongClickListener(v -> {
//長按加號
setLongClick(true);
return true;
});
btnFoodOperationAdd.setOnClickListener(v -> {
//加
if (purchaseFoodBean.getFoodQuantity() < Constant.PURCHASE_FOOD_MAX) {
foodNumberChange(1);
}
});
ivPopupClose.setOnClickListener(this::onClick);
KeyboardUtils.hideSoftInput(this);
}
/**
* + - 按鈕觸摸事件
*/
private View.OnTouchListener onBtnTouchListener = (v, event) -> {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
longClick = true;
} else if (event.getAction() == MotionEvent.ACTION_UP) {
longClick = false;
}
return false;
};
private int delayTime = Constant.LONG_CLICK_INIT_TIME;
private boolean longClick = false;
/**
* 按鈕長按事件
*
* @param addOrSub 是+ or -
*/
public void setLongClick(boolean addOrSub) {
//開啟線程
ThreadPoolManager.getInstence().putExecutableTasks(() -> {
int number = purchaseFoodBean.getFoodQuantity();
delayTime = Constant.LONG_CLICK_INIT_TIME;
if (addOrSub) {
//+
while (longClick) {
if (number < Constant.PURCHASE_FOOD_MAX) {
try {
Thread.sleep(delayTime);
number++;
if (delayTime > Constant.LONG_CLICK_DECREASE_TIME) {
delayTime -= Constant.LONG_CLICK_DECREASE_TIME;
}
edFoodIngredientNumber.post(() -> foodNumberChange(1));
} catch (InterruptedException e) {
e.printStackTrace();
}
} else {
longClick = false;
}
}
} else {
//-
while (longClick) {
if (number > 0) {
try {
Thread.sleep(delayTime);
number--;
if (delayTime > Constant.LONG_CLICK_DECREASE_TIME) {
delayTime -= Constant.LONG_CLICK_DECREASE_TIME;
}
edFoodIngredientNumber.post(() -> foodNumberChange(-1));
} catch (InterruptedException e) {
e.printStackTrace();
}
} else {
longClick = false;
}
}
}
});
}
private void foodNumberChange(int changeNum) {
purchaseFoodBean.setFoodQuantity(purchaseFoodBean.getFoodQuantity() + changeNum);
edFoodIngredientNumber.setText(String.valueOf(purchaseFoodBean.getFoodQuantity()));
if (onFoodNumberChangeListener != null) {
onFoodNumberChangeListener.onChange(purchaseFoodBean, 0, 0, purchaseFoodBean.getFoodQuantity() - changeNum, purchaseFoodBean.getFoodQuantity());
}
}
public GoodsDetailsPopup setOnFoodNumberChangeListener(BuyIngredientsAdapter.OnFoodNumberChangeListener onFoodNumberChangeListener) {
this.onFoodNumberChangeListener = onFoodNumberChangeListener;
return this;
}
private void onClick(View v) {
dismiss();
}
}
......@@ -9,7 +9,6 @@ import android.view.View;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.SwitchCompat;
......@@ -17,6 +16,7 @@ import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.gingersoft.gsa.cloud.common.utils.inputFilter.InputFilterUtils;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.ui.adapter.multi.RemarkProvider;
import com.gingersoft.supply_chain.R;
......@@ -59,6 +59,7 @@ public class InventoryConsumptionView extends FrameLayout {
private ConsumptionReasonAdapter consumptionReasonAdapter;
private OnNumberChangeListener onNumberChangeListener;
public InventoryConsumptionView(@NonNull Context context, List<ConsumeReasonBean> consumeReasonBeans, int maxConsumption) {
super(context);
View rootView = LayoutInflater.from(context).inflate(R.layout.layout_inventory_consumption, null, false);
......@@ -80,7 +81,7 @@ public class InventoryConsumptionView extends FrameLayout {
if (i > maxConsumption) {
edInput.setError("不能超過當前庫存數量:" + maxConsumption);
} else {
onConfirmClickListener.onConfirm(i, consumptionReasonAdapter.getSelectIndex(), edRemarks.getText().toString().trim());
onConfirmClickListener.onConfirm(i, consumptionReasonAdapter.getSelectIndex(), TextUtil.getNotNullStrAndTrim(edRemarks.getText().toString()));
}
} else {
ToastUtils.show(getContext(), "請輸入消耗庫存數");
......@@ -121,6 +122,14 @@ public class InventoryConsumptionView extends FrameLayout {
});
}
public InventoryConsumptionView setEdit(boolean enabled) {
edInput.setEnabled(enabled);
return this;
}
public InventoryConsumptionView setHint(String hint) {
edInput.setHint(hint);
return this;
}
public InventoryConsumptionView setOnConfirmClickListener(OnConfirmClickListener onConfirmClickListener) {
this.onConfirmClickListener = onConfirmClickListener;
return this;
......
......@@ -38,13 +38,17 @@ public class ViewUtils {
return;
}
//取得中間位置的item
Log.e("eee", "需要選中:" + sectionPosition + "顯示的:" + layoutManager.findFirstVisibleItemPosition() + "子數量:" + recyclerView.getChildCount());
View childAt = recyclerView.getChildAt(sectionPosition - layoutManager.findFirstVisibleItemPosition());
//拿到列表一半的寬度
int halfLeftRvWidth = recyclerView.getWidth() / 2;
Log.e("eee", childAt + "一半寬度:" + halfLeftRvWidth + "第一個:" + recyclerView.getChildAt(0));
if (childAt != null) {
//中間位置那個item減去一半的高度等於中間item一半顯示在列表中間
int x = childAt.getLeft() - halfLeftRvWidth;
recyclerView.smoothScrollBy(x, 0);
} else {
layoutManager.scrollToPositionWithOffset(sectionPosition, 0);
}
}
}
......@@ -131,7 +131,7 @@
android:id="@+id/iv_order_state"
android:layout_width="@dimen/dp_52"
android:layout_height="@dimen/dp_46"
android:layout_gravity="bottom"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/dp_25" />
</LinearLayout>
......
......@@ -62,7 +62,6 @@
android:textColor="@color/white"
android:textSize="@dimen/dp_14" />
</LinearLayout>
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/srl_supplier"
android:layout_width="match_parent"
......
......@@ -150,26 +150,17 @@
app:srlEnablePreviewInEditMode="true"
app:srlPrimaryColor="@color/trans">
<androidx.core.widget.NestedScrollView
<LinearLayout
android:id="@+id/layout_warehousing_root"
android:layout_width="match_parent"
android:clipChildren="true"
android:fillViewport="true"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/layout_warehousing_root"
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/vp_warehouse_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/vp_warehouse_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_10"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
android:layout_marginTop="@dimen/dp_10" />
</LinearLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
......@@ -7,9 +7,10 @@
android:id="@+id/iv_img"
android:layout_width="@dimen/dp_58"
android:layout_height="@dimen/dp_58"
android:src="@drawable/img_search_keyboard_bg"
android:layout_marginTop="@dimen/dp_8"
android:layout_marginRight="@dimen/dp_8"/>
android:layout_marginRight="@dimen/dp_8"
android:scaleType="fitXY"
android:src="@drawable/awe" />
<ImageView
android:id="@+id/iv_img_delete"
......
......@@ -21,6 +21,7 @@
android:paddingTop="@dimen/dp_5"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_5"
android:textSize="@dimen/dp_14"
tools:text="品名" />
<View
......@@ -38,6 +39,7 @@
android:paddingTop="@dimen/dp_5"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_5"
android:textSize="@dimen/dp_14"
tools:text="巴西肥牛" />
</LinearLayout>
......
......@@ -77,7 +77,8 @@
style="@style/Supplier_Info_text_Style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="地\u3000\u3000址:" />
android:text="地\u3000\u3000址:"
android:visibility="gone" />
<TextView
android:id="@+id/tv_supplier_address"
......@@ -100,7 +101,9 @@
style="@style/Supplier_Info_text_Style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="聯繫方式:" />
android:text="聯繫方式:"
android:visibility="gone" />
<TextView
android:id="@+id/tv_supplier_phone"
......@@ -109,38 +112,50 @@
android:layout_height="wrap_content"
android:layout_weight="3"
tools:text="12893798276" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_7"
android:layout_marginTop="@dimen/dp_2"
android:layout_marginRight="@dimen/dp_7"
android:orientation="horizontal">
<TextView
style="@style/Supplier_Info_text_Style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="聯&#160;&#160;繫&#160;&#160;人:" />
<TextView
android:id="@+id/tv_supplier_contact"
style="@style/Supplier_Info_text_Style"
android:layout_width="0dp"
android:layout_marginLeft="@dimen/dp_5"
android:gravity="right"
android:layout_height="wrap_content"
android:layout_weight="3"
tools:text="雷鋒" />
</LinearLayout>
<!-- <LinearLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginLeft="@dimen/dp_7"-->
<!-- android:layout_marginTop="@dimen/dp_2"-->
<!-- android:layout_marginRight="@dimen/dp_7"-->
<!-- android:orientation="horizontal">-->
<!-- <TextView-->
<!-- style="@style/Supplier_Info_text_Style"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:visibility="gone"-->
<!-- android:text="聯&#160;&#160;繫&#160;&#160;人:" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_supplier_contact"-->
<!-- style="@style/Supplier_Info_text_Style"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_weight="3"-->
<!-- tools:text="雷鋒" />-->
<!-- </LinearLayout>-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_7"
android:layout_marginTop="@dimen/dp_2"
android:layout_marginRight="@dimen/dp_7"
android:orientation="horizontal">
android:orientation="horizontal"
android:visibility="gone">
<TextView
style="@style/Supplier_Info_text_Style"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_white_eight_corners_bg"
android:orientation="vertical">
<FrameLayout
android:layout_width="@dimen/dp_269"
android:layout_height="@dimen/dp_269">
<com.gingersoft.gsa.cloud.ui.view.imageview.mask.PorterShapeImageView
android:id="@+id/iv_goods_details"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:siShape="@drawable/shape_top_radius" />
<TextView
android:id="@+id/tv_goods_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@color/alpha_60_black"
android:padding="@dimen/dp_5"
android:textColor="@color/white"
android:textSize="@dimen/dp_15"
tools:text="巴西费缪" />
</FrameLayout>
<LinearLayout
android:layout_width="@dimen/dp_269"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/dp_9">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_supplier_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/color_3c"
android:textSize="@dimen/dp_17"
android:textStyle="bold"
tools:text="海鮮天地" />
<TextView
android:id="@+id/tv_goods_no"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:layout_weight="1"
android:gravity="right"
android:text="SP001"
android:textColor="@color/color_3c"
android:textSize="@dimen/dp_17" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_9"
android:orientation="horizontal">
<com.qmuiteam.qmui.widget.textview.QMUISpanTouchFixTextView
android:id="@+id/tv_goods_price"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:includeFontPadding="false"
android:text="單價:$100.0"
android:textColor="@color/color_3c"
android:textSize="@dimen/dp_15" />
<TextView
android:id="@+id/tv_goods_specification"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:layout_weight="0.5"
android:gravity="right"
android:includeFontPadding="false"
android:text="1KG/盒"
android:textColor="@color/color_3c"
android:textSize="@dimen/dp_15" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<requestFocus />
<TextView
android:id="@+id/tv_goods_stock"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="庫存:15/60"
android:textColor="@color/color_3c"
android:textSize="@dimen/dp_15" />
<LinearLayout
android:id="@+id/layout_operation_food_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:descendantFocusability="beforeDescendants"
android:divider="@color/color_3c"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="center_vertical"
android:orientation="horizontal">
<com.qmuiteam.qmui.layout.QMUIButton
android:id="@+id/btn_food_operation_sub"
android:layout_width="@dimen/dp_24"
android:layout_height="@dimen/dp_24"
android:background="@drawable/ic_circle_gray_sub" />
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/ed_food_ingredient_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_4"
android:layout_marginRight="@dimen/dp_4"
android:background="@null"
android:gravity="center"
android:inputType="number"
android:maxLength="4"
android:maxLines="1"
android:minWidth="@dimen/dp_30"
android:textColor="@color/black"
android:textCursorDrawable="@drawable/cursor_theme"
android:textSize="@dimen/dp_22"
tools:text="10" />
<com.qmuiteam.qmui.layout.QMUIButton
android:id="@+id/btn_food_operation_add"
android:layout_width="@dimen/dp_24"
android:layout_height="@dimen/dp_24"
android:background="@drawable/ic_circle_theme_add" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/iv_popup_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_19"
android:layout_marginBottom="@dimen/dp_10"
android:src="@drawable/dialog_close" />
</LinearLayout>
\ No newline at end of file
......@@ -44,7 +44,7 @@
android:text=""
android:textColor="@color/color_3c"
android:textCursorDrawable="@drawable/cursor_theme"
android:textSize="@dimen/sp_16" />
android:textSize="@dimen/sp_14" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
......
......@@ -47,8 +47,8 @@
<View
android:layout_width="match_parent"
android:layout_marginTop="@dimen/dp_5"
android:layout_height="@dimen/dp_1"
android:layout_marginTop="@dimen/dp_5"
android:background="@color/theme_333_color" />
<androidx.recyclerview.widget.RecyclerView
......@@ -57,12 +57,21 @@
android:layout_height="wrap_content"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<LinearLayout
android:id="@+id/layout_sn_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10" />
<TextView
android:id="@+id/tv_print_consume_user_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_10"
android:text="製單人:"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14" />
......@@ -71,10 +80,11 @@
android:id="@+id/tv_print_sn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_10"
android:text="@string/str_sn_codes"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14" />
android:textSize="@dimen/dp_14"
android:visibility="gone" />
</LinearLayout>
\ No newline at end of file
......@@ -27,6 +27,7 @@
android:text="0"
android:textColor="@color/white"
android:textSize="@dimen/dp_6"
android:visibility="gone"
app:layout_constraintRight_toRightOf="@id/iv_shopping_cart"
app:layout_constraintTop_toTopOf="@id/iv_shopping_cart" />
</com.qmuiteam.qmui.alpha.QMUIAlphaConstraintLayout>
\ No newline at end of file
......@@ -23,6 +23,8 @@
<string name="str_format_positive_int">+%1$d</string>
<string name="str_format_less">-%1$s</string>
<string name="str_unit_price_colon">單價:$%1$.2f</string>
<string name="str_unit_price_colon_s">單價:$%1$s</string>
<string name="str_latest_unit_price_colon">最新單價:$%1$.2f</string>
<string name="str_total_amount_colon">總價:$%1$.2f</string>
<string name="str_delete_category_tip">是否確認刪除該類別【%1$s】,子類和食材將一同刪除?</string>
......@@ -41,4 +43,13 @@
<string name="str_sn_codes">SN碼:%1$s</string>
<string name="str_en_num_digits">ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789</string>
<string name="str_purchase_loading">飛速加載中</string>
<string name="str_sn_not_edit">SN食材不可手動輸入</string>
<string name="str_serial_number">序號</string>
<string name="str_unit">單位</string>
<string name="str_unit_prices">單價</string>
<string name="str_product_name">品名</string>
<string name="str_number">數量</string>
<string name="str_amount">金額</string>
<string name="str_inventory_reason">消耗原因</string>
</resources>
\ No newline at end of file
......@@ -47,9 +47,11 @@ public class GlideUtils {
.imageView(imageView)
.build());
}
public static void display(Context context, ImageView imageView, String url, int placeholder) {
public static void display(Context context, ImageView imageView, String url, int placeholder) {
if (url == null) {
return;
}
if (imageView == null) {
throw new IllegalArgumentException("argument error");
}
......@@ -153,7 +155,7 @@ public class GlideUtils {
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
if (callBack != null && resource != null) {
callBack.onObtainBitmapSuccess(resource);
}else {
} else {
callBack.onObtainBitmapFailed();
}
}
......
package com.gingersoft.gsa.cloud.common.utils.other;
import android.graphics.Typeface;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import android.text.style.StyleSpan;
import android.widget.EditText;
import androidx.annotation.ColorInt;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -52,6 +59,20 @@ public class TextUtil {
}
}
public static String getNotNullStr(String str) {
if (isEmptyOrNullOrUndefined(str)) {
return "";
}
return str;
}
public static String getNotNullStrAndTrim(String str) {
if (isEmptyOrNullOrUndefined(str)) {
return "";
}
return str.trim();
}
public static String isEmptyReturnString(String str) {
if (str == null || str.length() == 0 ||
str.equals("null") || str.equals("undefined")) {
......@@ -140,4 +161,44 @@ public class TextUtil {
}
return length;
}
public static SpannableString getSpannableString(CharSequence source, @ColorInt int color, int startIndex, int endIndex) {
if (source != null) {
if (endIndex > source.length()) {
endIndex = source.length();
}
SpannableString spannableString = new SpannableString(source);
ForegroundColorSpan colorSpan = new ForegroundColorSpan(color);
spannableString.setSpan(colorSpan, startIndex, endIndex, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
return spannableString;
}
return null;
}
public static SpannableString getBoldSpannableString(CharSequence source, @ColorInt int color, int startIndex, int endIndex) {
if (source != null) {
if (endIndex > source.length()) {
endIndex = source.length();
}
//AbsoluteSizeSpan(int size) ---- 设置字体大小,参数是绝对数值,相当于Word中的字体大小
//RelativeSizeSpan(float proportion) ---- 设置字体大小,参数是相对于默认字体大小的倍数,比如默认字体大小是x, 那么设置后的字体大小就是x*proportion,这个用起来比较灵活,proportion>1就是放大(zoom in), proportion<1就是缩小(zoom out)
//ScaleXSpan(float proportion) ---- 缩放字体,与上面的类似,默认为1,设置后就是原来的乘以proportion,大于1时放大(zoon in),小于时缩小(zoom out)
//BackgroundColorSpan(int color) ----背景着色,参数是颜色数值,可以直接使用android.graphics.Color里面定义的常量,或是用Color.rgb(int, int, int)
//ForegroundColorSpan(int color) ----前景着色,也就是字的着色,参数与背景着色一致
//TypefaceSpan(String family) ----字体,参数是字体的名字比如“sans", "sans-serif"等
//StyleSpan(Typeface style) -----字体风格,比如粗体,斜体,参数是android.graphics.Typeface里面定义的常量,如Typeface.BOLD,Typeface.ITALIC等等。
//StrikethroughSpan----如果设置了此风格,会有一条线从中间穿过所有的字,就像被划掉一样
SpannableString spannableString = new SpannableString(source);
ForegroundColorSpan colorSpan = new ForegroundColorSpan(color);
StyleSpan styleSpan = new StyleSpan(Typeface.BOLD);
//Spanned.SPAN_EXCLUSIVE_EXCLUSIVE --- 不包含两端start和end所在的端点
//Spanned.SPAN_EXCLUSIVE_INCLUSIVE --- 不包含端start,但包含end所在的端点
//Spanned.SPAN_INCLUSIVE_EXCLUSIVE --- 包含两端start,但不包含end所在的端点
//Spanned.SPAN_INCLUSIVE_INCLUSIVE--- 包含两端start和end所在的端点
spannableString.setSpan(styleSpan, startIndex, endIndex, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
spannableString.setSpan(colorSpan, startIndex, endIndex, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
return spannableString;
}
return null;
}
}
......@@ -4,6 +4,8 @@
<stroke
android:width="@dimen/dp_1"
android:color="@color/black" />
<solid android:color="@color/white" />
<corners android:radius="@dimen/dp_4" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:topLeftRadius="@dimen/dp_8"
android:topRightRadius="@dimen/dp_8" />
<solid android:color="@color/black" />
</shape>
\ No newline at end of file
......@@ -14,8 +14,8 @@ public class CustomAnimation1 implements BaseAnimation {
@NotNull
@Override
public Animator[] animators(@NotNull View view) {
Animator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 1.3f, 1);
Animator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 1.3f, 1);
Animator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 1.1f, 1);
Animator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 1.1f, 1);
Animator alpha = ObjectAnimator.ofFloat(view, "alpha", 0, 1f);
scaleY.setDuration(350);
......
......@@ -124,6 +124,7 @@ public class AppDialog {
}
});
hepler.getView(R.id.tv_dialog_cancel).setOnClickListener(v -> {
dismiss();
if (onCancelListener != null) {
onCancelListener.onclick(v, dialog);
}
......
package com.gingersoft.gsa.cloud.ui.view.imageview.mask;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import androidx.appcompat.widget.AppCompatImageView;
import com.gingersoft.gsa.cloud.ui.R;
@SuppressWarnings("WeakerAccess")
public abstract class PorterImageView extends AppCompatImageView {
private static final String TAG = PorterImageView.class.getSimpleName();
private static final PorterDuffXfermode PORTER_DUFF_XFERMODE = new PorterDuffXfermode(PorterDuff.Mode.DST_IN);
private Canvas maskCanvas;
private Bitmap maskBitmap;
private Paint maskPaint;
private Canvas drawableCanvas;
private Bitmap drawableBitmap;
private Paint drawablePaint;
private boolean invalidated = true;
private boolean square = false;
public PorterImageView(Context context) {
super(context);
setup(context, null, 0);
}
public PorterImageView(Context context, AttributeSet attrs) {
super(context, attrs);
setup(context, attrs, 0);
}
public PorterImageView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
setup(context, attrs, defStyle);
}
@SuppressWarnings("SameParameterValue")
public void setSquare(boolean square) {
this.square = square;
}
private void setup(Context context, AttributeSet attrs, int defStyle) {
if (attrs != null) {
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.ShaderImageView, defStyle, 0);
square = typedArray.getBoolean(R.styleable.ShaderImageView_siSquare, false);
typedArray.recycle();
}
if (getScaleType() == ScaleType.FIT_CENTER) {
setScaleType(ScaleType.CENTER_CROP);
}
maskPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
maskPaint.setColor(Color.BLACK);
}
@Override
public void invalidate() {
invalidated = true;
super.invalidate();
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
createMaskCanvas(w, h, oldw, oldh);
}
private void createMaskCanvas(int width, int height, int oldw, int oldh) {
boolean sizeChanged = width != oldw || height != oldh;
boolean isValid = width > 0 && height > 0;
if (isValid && (maskCanvas == null || sizeChanged)) {
maskCanvas = new Canvas();
maskBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
maskCanvas.setBitmap(maskBitmap);
maskPaint.reset();
paintMaskCanvas(maskCanvas, maskPaint, width, height);
drawableCanvas = new Canvas();
drawableBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
drawableCanvas.setBitmap(drawableBitmap);
drawablePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
invalidated = true;
}
}
protected abstract void paintMaskCanvas(Canvas maskCanvas, Paint maskPaint, int width, int height);
@Override
protected void onDraw(Canvas canvas) {
if (!isInEditMode()) {
int saveCount = canvas.saveLayer(0.0f, 0.0f, getWidth(), getHeight(), null, Canvas.ALL_SAVE_FLAG);
try {
if (invalidated) {
Drawable drawable = getDrawable();
if (drawable != null) {
invalidated = false;
Matrix imageMatrix = getImageMatrix();
if (imageMatrix == null) {// && mPaddingTop == 0 && mPaddingLeft == 0) {
drawable.draw(drawableCanvas);
} else {
int drawableSaveCount = drawableCanvas.getSaveCount();
drawableCanvas.save();
drawableCanvas.concat(imageMatrix);
drawable.draw(drawableCanvas);
drawableCanvas.restoreToCount(drawableSaveCount);
}
drawablePaint.reset();
drawablePaint.setFilterBitmap(false);
drawablePaint.setXfermode(PORTER_DUFF_XFERMODE);
drawableCanvas.drawBitmap(maskBitmap, 0.0f, 0.0f, drawablePaint);
}
}
if (!invalidated) {
drawablePaint.setXfermode(null);
canvas.drawBitmap(drawableBitmap, 0.0f, 0.0f, drawablePaint);
}
} catch (Exception e) {
String log = "Exception occured while drawing " + getId();
Log.e(TAG, log, e);
} finally {
canvas.restoreToCount(saveCount);
}
} else {
super.onDraw(canvas);
}
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
if (square) {
int width = getMeasuredWidth();
int height = getMeasuredHeight();
int dimen = Math.min(width, height);
setMeasuredDimension(dimen, dimen);
}
}
}
\ No newline at end of file
package com.gingersoft.gsa.cloud.ui.view.imageview.mask;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import com.gingersoft.gsa.cloud.ui.R;
public class PorterShapeImageView extends PorterImageView {
private Drawable shape;
private Matrix matrix;
private Matrix drawMatrix;
public PorterShapeImageView(Context context) {
super(context);
setup(context, null, 0);
}
public PorterShapeImageView(Context context, AttributeSet attrs) {
super(context, attrs);
setup(context, attrs, 0);
}
public PorterShapeImageView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
setup(context, attrs, defStyle);
}
private void setup(Context context, AttributeSet attrs, int defStyle) {
if(attrs != null){
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.ShaderImageView, defStyle, 0);
shape = typedArray.getDrawable(R.styleable.ShaderImageView_siShape);
typedArray.recycle();
}
matrix = new Matrix();
}
@Override
protected void paintMaskCanvas(Canvas maskCanvas, Paint maskPaint, int width, int height) {
if(shape != null) {
if (shape instanceof BitmapDrawable) {
configureBitmapBounds(width, height);
if(drawMatrix != null) {
int drawableSaveCount = maskCanvas.getSaveCount();
maskCanvas.save();
maskCanvas.concat(matrix);
shape.draw(maskCanvas);
maskCanvas.restoreToCount(drawableSaveCount);
return;
}
}
shape.setBounds(0, 0, width, height);
shape.draw(maskCanvas);
}
}
private void configureBitmapBounds(int viewWidth, int viewHeight) {
drawMatrix = null;
int drawableWidth = shape.getIntrinsicWidth();
int drawableHeight = shape.getIntrinsicHeight();
boolean fits = viewWidth == drawableWidth && viewHeight == drawableHeight;
if (drawableWidth > 0 && drawableHeight > 0 && !fits) {
shape.setBounds(0, 0, drawableWidth, drawableHeight);
float widthRatio = (float) viewWidth / (float) drawableWidth;
float heightRatio = (float) viewHeight / (float) drawableHeight;
float scale = Math.min(widthRatio, heightRatio);
float dx = (int) ((viewWidth - drawableWidth * scale) * 0.5f + 0.5f);
float dy = (int) ((viewHeight - drawableHeight * scale) * 0.5f + 0.5f);
matrix.setScale(scale, scale);
matrix.postTranslate(dx, dy);
}
}
}
\ No newline at end of file
......@@ -12,5 +12,5 @@
android:paddingTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10"
android:text="現金結賬"
android:textColor="@color/color_3c"
android:textColor="@color/white"
android:textSize="@dimen/dp_12" />
......@@ -11,28 +11,28 @@
<!--斜角标签-->
<declare-styleable name="BeveLabelView">
<!--背景颜色-->
<attr name="label_bg_color" format="color|reference"/>
<attr name="label_bg_color" format="color|reference" />
<!--文字-->
<attr name="label_text" format="string"/>
<attr name="label_text" format="string" />
<!-- 文字颜色-->
<attr name="label_text_color" format="color|reference"/>
<attr name="label_text_color" format="color|reference" />
<!--文字大小-->
<attr name="label_text_size" format="dimension"/>
<attr name="label_text_size" format="dimension" />
<attr name="label_length" format="dimension"/>
<attr name="label_length" format="dimension" />
<!-- 圆角-->
<attr name="label_corner" format="dimension"/>
<attr name="label_corner" format="dimension" />
<attr name="label_mode">
<!-- fill是沾满整个,-->
<enum name="left_top" value="0"/>
<enum name="right_top" value="1"/>
<enum name="left_bottom" value="2"/>
<enum name="right_bottom" value="3"/>
<enum name="left_top_fill" value="4"/>
<enum name="right_top_fill" value="5"/>
<enum name="left_bottom_fill" value="6"/>
<enum name="right_bottom_fill" value="7"/>
<enum name="left_top" value="0" />
<enum name="right_top" value="1" />
<enum name="left_bottom" value="2" />
<enum name="right_bottom" value="3" />
<enum name="left_top_fill" value="4" />
<enum name="right_top_fill" value="5" />
<enum name="left_bottom_fill" value="6" />
<enum name="right_bottom_fill" value="7" />
</attr>
</declare-styleable>
......@@ -493,26 +493,26 @@
</declare-styleable>
<declare-styleable name="SwitchButton">
<attr name="kswThumbDrawable" format="reference"/>
<attr name="kswThumbColor" format="color|reference"/>
<attr name="kswThumbMargin" format="dimension|reference"/>
<attr name="kswThumbMarginTop" format="dimension|reference"/>
<attr name="kswThumbMarginBottom" format="dimension|reference"/>
<attr name="kswThumbMarginLeft" format="dimension|reference"/>
<attr name="kswThumbMarginRight" format="dimension|reference"/>
<attr name="kswThumbWidth" format="dimension|reference"/>
<attr name="kswThumbHeight" format="dimension|reference"/>
<attr name="kswThumbRadius" format="dimension|reference"/>
<attr name="kswBackRadius" format="dimension|reference"/>
<attr name="kswBackDrawable" format="reference"/>
<attr name="kswBackColor" format="color|reference"/>
<attr name="kswFadeBack" format="boolean"/>
<attr name="kswBackMeasureRatio" format="float"/>
<attr name="kswAnimationDuration" format="integer"/>
<attr name="kswTintColor" format="color|reference"/>
<attr name="kswTextOn" format="string"/>
<attr name="kswTextOff" format="string"/>
<attr name="kswTextMarginH" format="dimension"/>
<attr name="kswThumbDrawable" format="reference" />
<attr name="kswThumbColor" format="color|reference" />
<attr name="kswThumbMargin" format="dimension|reference" />
<attr name="kswThumbMarginTop" format="dimension|reference" />
<attr name="kswThumbMarginBottom" format="dimension|reference" />
<attr name="kswThumbMarginLeft" format="dimension|reference" />
<attr name="kswThumbMarginRight" format="dimension|reference" />
<attr name="kswThumbWidth" format="dimension|reference" />
<attr name="kswThumbHeight" format="dimension|reference" />
<attr name="kswThumbRadius" format="dimension|reference" />
<attr name="kswBackRadius" format="dimension|reference" />
<attr name="kswBackDrawable" format="reference" />
<attr name="kswBackColor" format="color|reference" />
<attr name="kswFadeBack" format="boolean" />
<attr name="kswBackMeasureRatio" format="float" />
<attr name="kswAnimationDuration" format="integer" />
<attr name="kswTintColor" format="color|reference" />
<attr name="kswTextOn" format="string" />
<attr name="kswTextOff" format="string" />
<attr name="kswTextMarginH" format="dimension" />
</declare-styleable>
<declare-styleable name="WaveView">
......@@ -528,4 +528,47 @@
</attr>
<attr name="showWave" format="boolean" />
</declare-styleable>
<declare-styleable name="CircleImageView">
<attr name="civ_border_width" format="dimension" />
<attr name="civ_border_color" format="color" />
<attr name="civ_border_overlay" format="boolean" />
<attr name="civ_circle_background_color" format="color" />
</declare-styleable>
<attr name="siArrowPosition">
<enum name="left" value="0" />
<enum name="right" value="1" />
</attr>
<attr name="siBorderType">
<enum name="stroke" value="0" />
<enum name="fill" value="1" />
</attr>
<attr name="siStrokeCap">
<enum name="butt" value="0" />
<enum name="round" value="1" />
<enum name="square" value="2" />
</attr>
<attr name="siStrokeJoin">
<enum name="bevel" value="0" />
<enum name="miter" value="1" />
<enum name="round" value="2" />
</attr>
<declare-styleable name="ShaderImageView">
<attr name="siSquare" format="boolean" />
<attr name="siBorderColor" format="color" />
<attr name="siBorderWidth" format="dimension" />
<attr name="siBorderAlpha" format="float" />
<attr name="siForeground" format="integer|reference" />
<!-- Rounded Image View -->
<attr name="siRadius" format="dimension" />
<!--BubbleImageView-->
<attr name="siArrowPosition" />
<attr name="siTriangleHeight" format="dimension" />
<!--PorterImageView-->
<attr name="siShape" format="integer|reference" />
<!--ShaderImageView-->
<attr name="siBorderType" />
<attr name="siStrokeCap" />
<attr name="siStrokeJoin" />
<attr name="siStrokeMiter" format="dimension" />
</declare-styleable>
</resources>
\ 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