print button hide in Report Summary
This commit is contained in:
parent
dcaf00e542
commit
fc4e3558f7
@ -62,6 +62,7 @@ public class TransactionSummaryFragment extends DataBindingFragment {
|
||||
protected DataBindingConfig getDataBindingConfig() {
|
||||
return new DataBindingConfig(R.layout.fragment_transaction_summary_screen, BR.manageViewModel,managementViewModel)
|
||||
.addBindingParam(BR.summaryViewModel,summaryViewModel)
|
||||
.addBindingParam(BR.sharedViewModel, sharedViewModel)
|
||||
.addBindingParam(BR.click,new ClickEvent());
|
||||
}
|
||||
|
||||
@ -86,6 +87,8 @@ public class TransactionSummaryFragment extends DataBindingFragment {
|
||||
|
||||
setToolBarTitleWithBackIcon(getString(R.string.title_trans_summary));
|
||||
|
||||
sharedViewModel.printerDisabled.setValue(!SystemParamsOperation.getInstance().getPrinterEnabled());
|
||||
|
||||
summaryViewModel.resetField();
|
||||
|
||||
}
|
||||
@ -561,6 +564,10 @@ public class TransactionSummaryFragment extends DataBindingFragment {
|
||||
|
||||
public void onPrint() {
|
||||
try {
|
||||
if (!SystemParamsOperation.getInstance().getPrinterEnabled()) {
|
||||
showDeclineDialog("Printer is disabled!");
|
||||
return;
|
||||
}
|
||||
if (summaryViewModel.validateField()) {
|
||||
LogUtil.d(TAG, "Print button clicked - validation passed");
|
||||
startSearchProcess();
|
||||
|
||||
@ -4,12 +4,16 @@
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
<variable
|
||||
name="summaryViewModel"
|
||||
type="com.utsmm.kbz.ui.management.SummaryViewModel" />
|
||||
<variable
|
||||
name="manageViewModel"
|
||||
type="com.utsmm.kbz.ui.management.ManagementViewModel" />
|
||||
<variable
|
||||
name="sharedViewModel"
|
||||
type="com.utsmm.kbz.ui.core_viewmodel.SharedViewModel" />
|
||||
<variable
|
||||
name="click"
|
||||
type="com.utsmm.kbz.ui.management.TransactionSummaryFragment.ClickEvent" />
|
||||
@ -536,6 +540,7 @@
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp"
|
||||
android:paddingBottom="24dp"
|
||||
android:visibility="@{sharedViewModel.printerDisabled ? View.GONE : View.VISIBLE}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user