print button hide in hostConfigScreen
This commit is contained in:
parent
74e9e21ee0
commit
3b08569a48
@ -36,6 +36,7 @@ public class HostConfigFragment extends DataBindingFragment {
|
|||||||
@Override
|
@Override
|
||||||
protected DataBindingConfig getDataBindingConfig() {
|
protected DataBindingConfig getDataBindingConfig() {
|
||||||
return new DataBindingConfig(R.layout.fragment_host_config, BR.viewModel, viewModel)
|
return new DataBindingConfig(R.layout.fragment_host_config, BR.viewModel, viewModel)
|
||||||
|
.addBindingParam(BR.sharedViewModel, sharedViewModel)
|
||||||
.addBindingParam(BR.click, new ClickHandler());
|
.addBindingParam(BR.click, new ClickHandler());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,6 +53,7 @@ public class HostConfigFragment extends DataBindingFragment {
|
|||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
setToolBarTitleWithBackIcon("Host Configs");
|
setToolBarTitleWithBackIcon("Host Configs");
|
||||||
|
sharedViewModel.printerDisabled.setValue(!SystemParamsOperation.getInstance().getPrinterEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -75,6 +77,10 @@ public class HostConfigFragment extends DataBindingFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onPrint(){
|
public void onPrint(){
|
||||||
|
if (!SystemParamsOperation.getInstance().getPrinterEnabled()) {
|
||||||
|
showDeclineDialog("Printer is disabled!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
sharedViewModel.printTerminalHostConfigs();
|
sharedViewModel.printTerminalHostConfigs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -257,6 +257,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
android:visibility="@{sharedViewModel.printerDisabled ? View.GONE : View.VISIBLE}"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent">
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user