print button hide in hostConfigScreen

This commit is contained in:
MooN 2026-02-05 21:04:08 +06:30
parent 74e9e21ee0
commit 3b08569a48
2 changed files with 8 additions and 1 deletions

View File

@ -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,6 +77,10 @@ public class HostConfigFragment extends DataBindingFragment {
}
public void onPrint(){
if (!SystemParamsOperation.getInstance().getPrinterEnabled()) {
showDeclineDialog("Printer is disabled!");
return;
}
sharedViewModel.printTerminalHostConfigs();
}
}

View File

@ -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">