Commit 12c81300 authored by zhang_z's avatar zhang_z

收款bug修改;

parent 340a980f
......@@ -26,11 +26,6 @@
android:name=".ui.splash.SplashActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
......@@ -49,7 +44,14 @@
<activity
android:name=".ui.payment.PaymentActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
android:windowSoftInputMode="adjustUnspecified|stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
......@@ -10,5 +10,11 @@ interface PaymentContract {
}
abstract class Presenter extends BasePresenter<PaymentContract.View> {
/**
* 收款界面 - 点击收款
*
* @param amt 金额
*/
public abstract void clickSettle(Long amt);
}
}
\ No newline at end of file
......@@ -5,4 +5,9 @@ public class PaymentPresenter extends PaymentContract.Presenter {
@Override
public void onAttached() {
}
@Override
public void clickSettle(Long amt) {
}
}
package com.xingdata.zzdpos.ui.payment.fragment;
import com.blankj.utilcode.util.LogUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentPaymentBinding;
......@@ -28,7 +27,7 @@ public class PaymentFragment extends BaseFragment<PaymentPresenter, FragmentPaym
mViewBinding.tvAmt.setText(strResult);
});
mCalculatorView.setOnSettleClickListener(result -> {
LogUtils.e(ConvertUtil.fenToYuan(result));
if (result > 0) mPresenter.clickSettle(result);
});
}
}
......@@ -68,11 +68,15 @@ public class CalculatorView extends BaseFragment<PaymentPresenter, ViewCalculato
else if (mExps.length > 1) mValue = mExps[mExps.length - 1];
else mValue = mExp.replaceAll("[+\\-×÷]", "");
//限制位数
if (str.matches("[0-9]+") && mValue.split("[.]").length > 1 && mValue.split("[.]")[1].length() == 2)
return;
//限制小数点
if ((mExp.length() == 0 || mValue.contains(".")) && str.matches("[.]"))
return;
//限制符号
if (mLast.matches("[+\\-×÷.]") && str.matches("[+\\-×÷.]"))
return;
mLast = str;
......@@ -195,6 +199,7 @@ public class CalculatorView extends BaseFragment<PaymentPresenter, ViewCalculato
public void setOnResultChangeListener(OnResultChangeListener onResultChangeListener) {
this.mOnResultChangeListener = onResultChangeListener;
mOnResultChangeListener.onResultChange(mExp, ConvertUtil.yuanToFen(parseExp(mExp)));
}
public void setOnSettleClickListener(onSettleClickListener onSettleClickListener) {
......
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