print button hide in hostConfigScreen
This commit is contained in:
parent
74e9e21ee0
commit
3b08569a48
@ -36,6 +36,7 @@ public class HostConfigFragment extends DataBindingFragment {
|
||||
@Override
|
||||
protected DataBindingConfig getDataBindingConfig() {
|
||||
return new DataBindingConfig(R.layout.fragment_host_config, BR.viewModel, viewModel)
|
||||
.addBindingParam(BR.sharedViewModel, sharedViewModel)
|
||||
.addBindingParam(BR.click, new ClickHandler());
|
||||
}
|
||||
|
||||
@ -52,6 +53,7 @@ public class HostConfigFragment extends DataBindingFragment {
|
||||
super.onResume();
|
||||
|
||||
setToolBarTitleWithBackIcon("Host Configs");
|
||||
sharedViewModel.printerDisabled.setValue(!SystemParamsOperation.getInstance().getPrinterEnabled());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -75,7 +77,11 @@ public class HostConfigFragment extends DataBindingFragment {
|
||||
}
|
||||
|
||||
public void onPrint(){
|
||||
if (!SystemParamsOperation.getInstance().getPrinterEnabled()) {
|
||||
showDeclineDialog("Printer is disabled!");
|
||||
return;
|
||||
}
|
||||
sharedViewModel.printTerminalHostConfigs();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -257,6 +257,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
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