re-unbind visible on hostConfig
This commit is contained in:
parent
0ddd5f269c
commit
fc8349ad2d
@ -23,7 +23,6 @@ public class HostConfigFragment extends DataBindingFragment {
|
|||||||
private HostConfigViewModel viewModel;
|
private HostConfigViewModel viewModel;
|
||||||
|
|
||||||
private SharedViewModel sharedViewModel;
|
private SharedViewModel sharedViewModel;
|
||||||
private boolean printerDisabled = SystemParamsOperation.getInstance().getPrinterDisabled();
|
|
||||||
protected Printer printer;
|
protected Printer printer;
|
||||||
int FONT_NORMAL = 20;
|
int FONT_NORMAL = 20;
|
||||||
int FONT_HEADER = 24;
|
int FONT_HEADER = 24;
|
||||||
@ -46,7 +45,6 @@ public class HostConfigFragment extends DataBindingFragment {
|
|||||||
|
|
||||||
FragmentHostConfigBinding binding = (FragmentHostConfigBinding) this.binding;
|
FragmentHostConfigBinding binding = (FragmentHostConfigBinding) this.binding;
|
||||||
viewModel.loadConfig();
|
viewModel.loadConfig();
|
||||||
sharedViewModel.printerDisabled.setValue(printerDisabled);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -54,7 +52,6 @@ public class HostConfigFragment extends DataBindingFragment {
|
|||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
setToolBarTitleWithBackIcon("Host Configs");
|
setToolBarTitleWithBackIcon("Host Configs");
|
||||||
sharedViewModel.printerDisabled.setValue(printerDisabled);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -365,7 +365,6 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:text="Print"
|
android:text="Print"
|
||||||
android:visibility="@{sharedViewModel.printerDisabled ? View.VISIBLE : View.GONE}"
|
|
||||||
android:onClick="@{()-> click.onPrint()}"
|
android:onClick="@{()-> click.onPrint()}"
|
||||||
android:background="@drawable/bg_rounded_btn_cv"
|
android:background="@drawable/bg_rounded_btn_cv"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user