host config break add

This commit is contained in:
moon 2026-03-20 12:20:48 +06:30
parent 49e787a56c
commit a37b035493

View File

@ -4,6 +4,8 @@
xmlns:tools="http://schemas.android.com/tools">
<data>
<import type="android.text.TextUtils"/>
<import type="android.view.View"/>
<variable
name="viewModel"
type="com.utsmm.kbz.ui.settings.HostConfigViewModel"/>
@ -96,7 +98,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="vertical"
android:visibility="@{TextUtils.isEmpty(viewModel.hostName) ? View.GONE : View.VISIBLE}">
<TextView
android:text="PRIMARY HOST"
@ -110,48 +113,56 @@
android:layout_height="wrap_content"
android:stretchColumns="1">
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.hostName) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Name"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.hostName}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.tid) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="TID"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.tid}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.mid) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="MID"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.mid}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.primaryIp) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Primary IP"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.primaryIp}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.primaryPort) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Primary Port"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.primaryPort}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.secondaryIp) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Secondary IP"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.secondaryIp}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.secondaryPort) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Secondary Port"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.secondaryPort}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.currencyCode) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Currency"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.currencyCode}'/>
@ -163,6 +174,7 @@
android:text="--------------------------------------------------------------------------"
android:gravity="left"
android:paddingVertical="8dp"
android:visibility="@{TextUtils.isEmpty(viewModel.hostName) ? View.GONE : View.VISIBLE}"
android:layout_height="wrap_content"
android:layout_width="match_parent"/>
@ -170,7 +182,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="vertical"
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostName) ? View.GONE : View.VISIBLE}">
<TextView
android:text="SECONDARY HOST"
@ -187,49 +200,57 @@
android:layout_height="wrap_content"
android:stretchColumns="1">
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostName) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Name"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.thirdHostName}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostTid) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="TID"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.thirdHostTid}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostMid) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="MID"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.thirdHostMid}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostPrimaryIp) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Primary IP"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.thirdHostPrimaryIp}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostPrimaryPort) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Primary Port"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.thirdHostPrimaryPort}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostSecondaryIp) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Secondary IP"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.thirdHostSecondaryIp}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostSecondaryPort) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Secondary Port"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.thirdHostSecondaryPort}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostCurrency) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Currency"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.thirdHostCurrency}'/>
@ -240,6 +261,7 @@
android:text="--------------------------------------------------------------------------"
android:gravity="left"
android:paddingVertical="8dp"
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostName) ? View.GONE : View.VISIBLE}"
android:layout_height="wrap_content"
android:layout_width="match_parent"/>
</LinearLayout>
@ -248,7 +270,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="vertical"
android:visibility="@{TextUtils.isEmpty(viewModel.secHostName) ? View.GONE : View.VISIBLE}">
<TextView
android:text="QR HOST"
@ -265,43 +288,50 @@
android:layout_height="wrap_content"
android:stretchColumns="1">
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.secHostName) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Name"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.secHostName}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.shortCode) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Short Code"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.shortCode}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.secHostPrimaryIp) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Primary IP"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.secHostPrimaryIp}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.secHostPrimaryPort) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Primary Port"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.secHostPrimaryPort}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.secHostSecondaryIp) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Secondary IP"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.secHostSecondaryIp}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.secHostSecondaryPort) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Secondary Port"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.secHostSecondaryPort}'/>
</TableRow>
<TableRow>
<TableRow
android:visibility="@{TextUtils.isEmpty(viewModel.secHostCurrency) ? View.GONE : View.VISIBLE}">
<TextView style="@style/HostLabelStyle" android:text="Currency"/>
<TextView style="@style/HostValueStyle"
android:text='@{": " + viewModel.secHostCurrency}'/>
@ -312,6 +342,7 @@
android:text="--------------------------------------------------------------------------"
android:gravity="left"
android:paddingVertical="8dp"
android:visibility="@{TextUtils.isEmpty(viewModel.secHostName) ? View.GONE : View.VISIBLE}"
android:layout_height="wrap_content"
android:layout_width="match_parent"/>
</LinearLayout>
@ -355,6 +386,7 @@
android:layout_height="52dp"
android:layout_weight="1"
android:layout_marginStart="8dp"
android:visibility="@{sharedViewModel.printerDisabled ? View.GONE : View.VISIBLE}"
android:text="Print"
android:onClick="@{()-> click.onPrint()}"
android:background="@drawable/bg_rounded_btn_cv"