修改 添加bug

master
wanghao 2 months ago
parent 4274ff4825
commit 2d3020ccfb

@ -10,8 +10,8 @@ android {
applicationId "com.example.as_trak" applicationId "com.example.as_trak"
minSdk 26 minSdk 26
targetSdk 33 targetSdk 33
versionCode 1 versionCode 3
versionName "1.0" versionName "1.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<litepal> <litepal>
<dbname value="AS_TRAK" /> <dbname value="AS_TRAK" />
<version value="8" /> <version value="10" />
<list> <list>
<mapping class="com.example.as_trak.entity.LoadOperation"/> <mapping class="com.example.as_trak.entity.LoadOperation"/>
<mapping class="com.example.as_trak.entity.CargoInfo"/> <mapping class="com.example.as_trak.entity.CargoInfo"/>

@ -9,7 +9,6 @@ import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.ListPopupWindow; import android.widget.ListPopupWindow;
import android.widget.Spinner;
import android.widget.Toast; import android.widget.Toast;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
@ -69,7 +68,7 @@ public class LoadMainActivity extends BaseActivity implements AddFlightDialog.Ad
binding.setQty1(cargoQty); binding.setQty1(cargoQty);
binding.setQty2(loadQty); binding.setQty2(loadQty);
initAlertDialog(); initAlertDialog();
initScan();
} }
private void initAlertDialog() { private void initAlertDialog() {
@ -102,6 +101,13 @@ public class LoadMainActivity extends BaseActivity implements AddFlightDialog.Ad
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
initInputCargo(); initInputCargo();
initScan();
}
@Override
protected void onStop() {
super.onStop();
unregisterReceiver(myReceiver);
} }
// 初始化添加货箱 // 初始化添加货箱
@ -145,12 +151,18 @@ public class LoadMainActivity extends BaseActivity implements AddFlightDialog.Ad
public void loadAddCargo1(View view) { public void loadAddCargo1(View view) {
if (flightInfoTag == null) return; if (flightInfoTag == null) return;
String code0 = binding.loadMainCargoSanCode.getText().toString(); String code0 = binding.loadMainCargoSanCode.getText().toString();
if (code0.isEmpty()) return;
addCargo(code0, binding.loadMainSanTypeSpinner.getSelectedItem().toString()); addCargo(code0, binding.loadMainSanTypeSpinner.getSelectedItem().toString());
} }
public void loadAddCargo(View view) { public void loadAddCargo(View view) {
if (flightInfoTag == null) return; if (flightInfoTag == null) return;
String cargoCode = binding.loadMainCargoCode.getText().toString(); String cargoCode = binding.loadMainCargoCode.getText().toString();
if (cargoCode.isEmpty()) return; if (cargoCode.length() != 7) {
Toast.makeText(this, "填写格式不规范", Toast.LENGTH_SHORT).show();
return;
}
String cargoCode0 = binding.loadMainCargoCode0.getSelectedItem().toString(); String cargoCode0 = binding.loadMainCargoCode0.getSelectedItem().toString();
cargoCode = cargoCode0 + cargoCode; cargoCode = cargoCode0 + cargoCode;
addCargo(cargoCode, binding.loadMainCargoCode2.getSelectedItem().toString()); addCargo(cargoCode, binding.loadMainCargoCode2.getSelectedItem().toString());
@ -213,6 +225,7 @@ public class LoadMainActivity extends BaseActivity implements AddFlightDialog.Ad
flightList.add(flightInfo); flightList.add(flightInfo);
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();
} }
// 删除装载单元 // 删除装载单元
@SuppressLint("NotifyDataSetChanged") @SuppressLint("NotifyDataSetChanged")
@Override @Override
@ -261,6 +274,7 @@ public class LoadMainActivity extends BaseActivity implements AddFlightDialog.Ad
Toast.makeText(this, "查询成功", Toast.LENGTH_SHORT).show(); Toast.makeText(this, "查询成功", Toast.LENGTH_SHORT).show();
lpw.dismiss(); lpw.dismiss();
} }
// 返回时调 // 返回时调
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
@ -268,11 +282,11 @@ public class LoadMainActivity extends BaseActivity implements AddFlightDialog.Ad
Log.e("TAG", "onActivityResult:重加载"); Log.e("TAG", "onActivityResult:重加载");
selectCargo(); selectCargo();
} }
// 查询装载单元 内 数量 // 查询装载单元 内 数量
@SuppressLint("NotifyDataSetChanged") @SuppressLint("NotifyDataSetChanged")
private void selectCargo() { private void selectCargo() {
cargoInfoList = LitePal.where("flightId = ? ", cargoInfoList = LitePal.where("flightId = ? ", String.valueOf(flightInfoTag.getId())).find(CargoInfo.class);
String.valueOf(flightInfoTag.getId())).find(CargoInfo.class);
AtomicInteger tag = new AtomicInteger(); AtomicInteger tag = new AtomicInteger();
if (!cargoInfoList.isEmpty()) { if (!cargoInfoList.isEmpty()) {
cargoInfoList.forEach(cargoInfo -> { cargoInfoList.forEach(cargoInfo -> {
@ -287,6 +301,7 @@ public class LoadMainActivity extends BaseActivity implements AddFlightDialog.Ad
cargoInfoAdapter.notifyDataSetChanged(); cargoInfoAdapter.notifyDataSetChanged();
} }
// 跳转装载页面
public void clickCargoInfo(View view) { public void clickCargoInfo(View view) {
if (flightInfoTag == null) { if (flightInfoTag == null) {
Toast.makeText(this, "没有选择航班", Toast.LENGTH_SHORT).show(); Toast.makeText(this, "没有选择航班", Toast.LENGTH_SHORT).show();
@ -296,9 +311,19 @@ public class LoadMainActivity extends BaseActivity implements AddFlightDialog.Ad
Toast.makeText(this, "没有添加装载单元", Toast.LENGTH_SHORT).show(); Toast.makeText(this, "没有添加装载单元", Toast.LENGTH_SHORT).show();
return; return;
} }
ContainerType containerType = LitePal.where("typeName = ? and type =3 ",
flightInfoTag.getFlightCode().substring(0, 2)).findFirst(ContainerType.class);
boolean b = containerType != null;
intent.putExtra("checkState",b);
if (b){
intent.putExtra("checkCode",containerType.getCheckCode());
}
intent.putExtra("id", flightInfoTag.getId()); intent.putExtra("id", flightInfoTag.getId());
startActivityForResult(intent, 0); startActivityForResult(intent, 0);
} }
// 扫描装载单元 // 扫描装载单元
@Override @Override
public void sanCodeResult(String code) { public void sanCodeResult(String code) {
@ -307,8 +332,10 @@ public class LoadMainActivity extends BaseActivity implements AddFlightDialog.Ad
Toast.makeText(this, "扫描数据:" + code + " 异常", Toast.LENGTH_SHORT).show(); Toast.makeText(this, "扫描数据:" + code + " 异常", Toast.LENGTH_SHORT).show();
return; return;
} }
String substring = code.substring(0, 8); binding.loadMainCargoSanCode.setText(code);
binding.loadMainCargoSanCode.setText(substring);
} }
} }

@ -2,6 +2,7 @@ package com.example.as_trak;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
@ -48,13 +49,18 @@ public class LoadScanActivity extends BaseActivity implements CargoListAdapter.C
private TipDialog tipDialog; private TipDialog tipDialog;
private AlertDialog.Builder alertDialog; private AlertDialog.Builder alertDialog;
private Handler handler = new Handler(Looper.getMainLooper()); private Handler handler = new Handler(Looper.getMainLooper());
private String checkCode;
private boolean checkState;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
binding = DataBindingUtil.setContentView(this, R.layout.activity_load_scan); binding = DataBindingUtil.setContentView(this, R.layout.activity_load_scan);
initScan(); initScan();
int id = getIntent().getIntExtra("id", 0); Intent intent = getIntent();
int id = intent.getIntExtra("id", 0);
checkCode = intent.getStringExtra("checkCode");
checkState = intent.getBooleanExtra("checkState", false);
// 航班显示 // 航班显示
flightInfo = LitePal.where("id= ?", String.valueOf(id)).findFirst(FlightInfo.class); flightInfo = LitePal.where("id= ?", String.valueOf(id)).findFirst(FlightInfo.class);
binding.setData(flightInfo); binding.setData(flightInfo);
@ -63,7 +69,7 @@ public class LoadScanActivity extends BaseActivity implements CargoListAdapter.C
adapter = new CargoListAdapter(this, this); adapter = new CargoListAdapter(this, this);
adapter.setList(cargoInfoList); adapter.setList(cargoInfoList);
binding.setAdapter1(adapter); binding.setAdapter1(adapter);
formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
// loadToast = new LoadToast(this); // loadToast = new LoadToast(this);
loadInfoAdapter = new LoadInfoAdapter(this, this); loadInfoAdapter = new LoadInfoAdapter(this, this);
loadInfoAdapter.setRecyclerView(binding.loadInfoRecyclerview); loadInfoAdapter.setRecyclerView(binding.loadInfoRecyclerview);
@ -86,6 +92,7 @@ public class LoadScanActivity extends BaseActivity implements CargoListAdapter.C
updataDialog.dismiss(); updataDialog.dismiss();
}); });
tipDialog = new TipDialog(this); tipDialog = new TipDialog(this);
tipDialog.setTipCall(this::loadLastFun);
alertDialog = new AlertDialog.Builder(this); alertDialog = new AlertDialog.Builder(this);
alertDialog.setTitle("装载完成提示").setMessage("确认装载完成").setNegativeButton("取消", null).setPositiveButton("确认", new DialogInterface.OnClickListener() { alertDialog.setTitle("装载完成提示").setMessage("确认装载完成").setNegativeButton("取消", null).setPositiveButton("确认", new DialogInterface.OnClickListener() {
@Override @Override
@ -119,7 +126,7 @@ public class LoadScanActivity extends BaseActivity implements CargoListAdapter.C
super.sanCodeResult(code); super.sanCodeResult(code);
binding.loadSanInfoCode.setText(code); binding.loadSanInfoCode.setText(code);
// 先验证扫描情况 // 先验证扫描情况
String regex = "^[A-Za-z]{3}\\d{5}"; String regex = "^[A-Za-z]{3}\\d{5}\\w{2}";
Pattern pattern = Pattern.compile(regex); Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(code); Matcher matcher = pattern.matcher(code);
@ -158,16 +165,30 @@ public class LoadScanActivity extends BaseActivity implements CargoListAdapter.C
Toast.makeText(this, "没有选择装载单元", Toast.LENGTH_SHORT).show(); Toast.makeText(this, "没有选择装载单元", Toast.LENGTH_SHORT).show();
return; return;
} }
if (checkState) {
String pattern = "^" + checkCode + "\\d+";
boolean isMatch = Pattern.matches(pattern, code);
if (!isMatch) {
tipDialog.showError("校验失败:" + code + ",不允许装机", code, true);
return;
}
}
loadLastFun(code);
// if (cargoInfoTag.getState().equals("装载完成")) { // if (cargoInfoTag.getState().equals("装载完成")) {
// Toast.makeText(this, "装载单元已经装载完成", Toast.LENGTH_SHORT).show(); // Toast.makeText(this, "装载单元已经装载完成", Toast.LENGTH_SHORT).show();
// return; // return;
// } // }
}
private void loadLastFun(String code) {
int count = LitePal.where("flightId= ? and luggageCode=? and type ='装载' and (state IS NULL or state = '修改') ", String.valueOf(flightInfo.getId()), code).count(LoadOperation.class); int count = LitePal.where("flightId= ? and luggageCode=? and type ='装载' and (state IS NULL or state = '修改') ", String.valueOf(flightInfo.getId()), code).count(LoadOperation.class);
if (count > 0) { if (count > 0) {
tipDialog.showError("行李条码:" + code + "重复"); tipDialog.showError("行李条码:" + code + "重复", code, false);
return; return;
} }
tipDialog.showSuccess(code + "\t装载成功"); tipDialog.showSuccess(code + "\n装载成功");
// 添加行李 // 添加行李
LoadOperation loadOperation = new LoadOperation(); LoadOperation loadOperation = new LoadOperation();
loadOperation.setFlightCode(flightInfo.getFlightCode()); loadOperation.setFlightCode(flightInfo.getFlightCode());
@ -241,4 +262,11 @@ public class LoadScanActivity extends BaseActivity implements CargoListAdapter.C
alertDialog.show(); alertDialog.show();
return true; return true;
} }
@Override
protected void onDestroy() {
super.onDestroy();
if (myReceiver != null) unregisterReceiver(myReceiver);
}
} }

@ -38,8 +38,15 @@ public class SettingActivity extends BaseActivity implements EditDialog.EditDial
@SuppressLint("NotifyDataSetChanged") @SuppressLint("NotifyDataSetChanged")
@Override @Override
public void onTabSelected(TabLayout.Tab tab) { public void onTabSelected(TabLayout.Tab tab) {
String string = tab.getText().toString(); String string = tab.getText().toString();
type = string.equals("种类维护") ? "1" : "2"; if (string.equals("种类维护")) {
type = "1";
}else if (string.equals("类型代码")){
type = "2";
}else {
type = "3";
}
adapterSetList(type); adapterSetList(type);
} }
@ -70,9 +77,10 @@ public class SettingActivity extends BaseActivity implements EditDialog.EditDial
@SuppressLint("NotifyDataSetChanged") @SuppressLint("NotifyDataSetChanged")
@Override @Override
public void saveInfo(String info) { public void saveInfo(String info,String checkCode) {
ContainerType containerType = new ContainerType(); ContainerType containerType = new ContainerType();
containerType.setTypeName(info); containerType.setTypeName(info);
containerType.setCheckCode(checkCode);
containerType.setType(type); containerType.setType(type);
containerType.save(); containerType.save();
list.add(containerType); list.add(containerType);
@ -89,6 +97,7 @@ public class SettingActivity extends BaseActivity implements EditDialog.EditDial
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();
} }
public void settingAdd(View view){ public void settingAdd(View view){
editDialog.setType(type);
editDialog.show(); editDialog.show();
} }
} }

@ -34,6 +34,11 @@ public class UnLoadActivity extends BaseActivity {
Log.e("TAG", "传值:" + code); Log.e("TAG", "传值:" + code);
luggageFragment.sanCode(code); luggageFragment.sanCode(code);
} }
@Override
protected void onDestroy() {
super.onDestroy();
if (myReceiver!=null) unregisterReceiver(myReceiver);
}
} }

@ -12,7 +12,7 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
public class BaseActivity extends AppCompatActivity { public class BaseActivity extends AppCompatActivity {
private MyScanCodeBroad myReceiver; public MyScanCodeBroad myReceiver;
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
@ -29,11 +29,6 @@ public class BaseActivity extends AppCompatActivity {
registerReceiver(myReceiver, intentFilter); registerReceiver(myReceiver, intentFilter);
} }
@Override
protected void onDestroy() {
super.onDestroy();
if (myReceiver!=null) unregisterReceiver(myReceiver);
}
private class MyScanCodeBroad extends BroadcastReceiver { private class MyScanCodeBroad extends BroadcastReceiver {
@Override @Override

@ -20,20 +20,27 @@ public class EditDialog extends Dialog {
this.call = call; this.call = call;
} }
private String type;
public void setType(String type) {
this.type = type;
}
public EditDialog(@NonNull Context context) { public EditDialog(@NonNull Context context) {
super(context, R.style.dialog_style); super(context, R.style.dialog_style);
binding = DataBindingUtil.inflate(LayoutInflater.from(context), R.layout.dialog_edit, null, false); binding = DataBindingUtil.inflate(LayoutInflater.from(context), R.layout.dialog_edit, null, false);
setContentView(binding.getRoot()); setContentView(binding.getRoot());
binding.editFalse.setOnClickListener(v -> dismiss()); binding.editFalse.setOnClickListener(v -> dismiss());
binding.editTrue.setOnClickListener(v -> call.saveInfo(binding.editInfo.getText().toString())); binding.editTrue.setOnClickListener(v -> call.saveInfo(binding.editInfo.getText().toString(),binding.editInfo2.getText().toString()));
} }
public interface EditDialogCall{ public interface EditDialogCall{
void saveInfo(String info); void saveInfo(String info,String checkCode);
} }
@Override @Override
public void show() { public void show() {
super.show(); super.show();
binding.setType(type);
binding.editInfo.setText(null); binding.editInfo.setText(null);
} }
} }

@ -24,6 +24,7 @@ public class TipDialog extends Dialog {
private MediaPlayer musicSuccess; private MediaPlayer musicSuccess;
private Vibrator vibrator; private Vibrator vibrator;
private ObservableBoolean state; private ObservableBoolean state;
private ObservableBoolean buttonVisState;
private DialogTipBinding binding; private DialogTipBinding binding;
public TipDialog(@NonNull Context context) { public TipDialog(@NonNull Context context) {
@ -37,23 +38,38 @@ public class TipDialog extends Dialog {
state = new ObservableBoolean(); state = new ObservableBoolean();
setCanceledOnTouchOutside(false); setCanceledOnTouchOutside(false);
binding.setState(state); binding.setState(state);
buttonVisState=new ObservableBoolean();
binding.setButtonVisState(buttonVisState);
binding.tipDialogOver.setOnClickListener(v -> dismiss()); binding.tipDialogOver.setOnClickListener(v -> dismiss());
binding.tipDialogAllwey.setOnClickListener(v -> tipCall.noAutoSub(code));
} }
private String code;
public void showError(String msg) { public void showError(String msg,String code,boolean buttonState) {
super.show(); super.show();
music.start(); music.start();
vibrator.vibrate(500); // 震动1/2秒 vibrator.vibrate(500); // 震动1/2秒
state.set(false); state.set(false);
buttonVisState.set(buttonState);
binding.toastMsg.setText(msg); binding.toastMsg.setText(msg);
this.code=code;
} }
public void showSuccess(String msg) { public void showSuccess(String msg) {
super.show(); super.show();
musicSuccess.start(); musicSuccess.start();
state.set(true); state.set(true);
buttonVisState.set(false);
binding.toastMsg.setText(msg); binding.toastMsg.setText(msg);
} }
public interface TipCall{
void noAutoSub(String code);
}
private TipCall tipCall;
public void setTipCall(TipCall tipCall) {
this.tipCall = tipCall;
}
} }

@ -6,8 +6,16 @@ public class ContainerType extends LitePalSupport {
private int id; private int id;
private int tag; private int tag;
private String typeName; private String typeName;
private String checkCode;
private String type; private String type;
public String getCheckCode() {
return checkCode;
}
public void setCheckCode(String checkCode) {
this.checkCode = checkCode;
}
public String getType() { public String getType() {
return type; return type;

@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<data> <data>
<variable <variable
name="title" name="title"
type="String" /> type="String" />
@ -27,10 +28,10 @@
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginEnd="20dp" android:layout_marginEnd="20dp"
android:background="@drawable/tablayout_bg" android:background="@drawable/tablayout_bg"
app:tabBackground="@drawable/tab_background_selector"
app:tabGravity="fill" app:tabGravity="fill"
app:tabTextColor="@color/blue"
app:tabSelectedTextColor="@color/white" app:tabSelectedTextColor="@color/white"
app:tabBackground="@drawable/tab_background_selector"> app:tabTextColor="@color/blue">
<com.google.android.material.tabs.TabItem <com.google.android.material.tabs.TabItem
android:layout_width="match_parent" android:layout_width="match_parent"
@ -46,6 +47,7 @@
</com.google.android.material.tabs.TabLayout> </com.google.android.material.tabs.TabLayout>
<androidx.viewpager2.widget.ViewPager2 <androidx.viewpager2.widget.ViewPager2

@ -174,7 +174,7 @@
style="@style/text_title"/> style="@style/text_title"/>
<TextView <EditText
android:id="@+id/load_main_cargo_san_code" android:id="@+id/load_main_cargo_san_code"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="45dp" android:layout_height="45dp"
@ -386,11 +386,12 @@
<Button <Button
android:layout_width="match_parent" android:layout_width="350dp"
android:layout_height="48dp" android:layout_height="50dp"
android:layout_margin="12dp" android:layout_margin="8dp"
android:letterSpacing="0.5" android:letterSpacing="0.5"
android:onClick="clickCargoInfo" android:onClick="clickCargoInfo"
android:layout_gravity="center"
android:text="装载行李" android:text="装载行李"
android:textSize="18sp" android:textSize="18sp"
android:textStyle="bold" /> android:textStyle="bold" />

@ -4,9 +4,11 @@
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<data> <data>
<variable <variable
name="title" name="title"
type="String" /> type="String" />
<variable <variable
name="adapter" name="adapter"
type="com.example.as_trak.adapter.ContainerTypesAdapter" /> type="com.example.as_trak.adapter.ContainerTypesAdapter" />
@ -47,6 +49,11 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="类型代码" /> android:text="类型代码" />
<com.google.android.material.tabs.TabItem
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="校验维护" />
</com.google.android.material.tabs.TabLayout> </com.google.android.material.tabs.TabLayout>
@ -54,21 +61,21 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginStart="20dp" android:layout_marginStart="20dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:layout_marginEnd="20dp" android:layout_marginEnd="20dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" android:layout_weight="1"
android:adapter="@{adapter}" android:adapter="@{adapter}"
android:background="@color/white" /> android:background="@color/white"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<ImageView <ImageView
android:layout_width="62dp" android:layout_width="62dp"
android:layout_height="62dp" android:layout_height="62dp"
android:src="@mipmap/info_add" android:layout_gravity="center"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:onClick="settingAdd" android:onClick="settingAdd"
android:layout_gravity="center" /> android:src="@mipmap/info_add" />
</LinearLayout> </LinearLayout>
</layout> </layout>

@ -3,6 +3,11 @@
<data> <data>
<variable
name="type"
type="String" />
<import type="android.view.View"/>
</data> </data>
<LinearLayout <LinearLayout
@ -17,19 +22,55 @@
android:layout_gravity="center" android:layout_gravity="center"
android:drawableStart="@mipmap/icon_tip" android:drawableStart="@mipmap/icon_tip"
android:gravity="center" android:gravity="center"
android:textSize="22dp" android:text="填写信息"
android:text="填写信息" /> android:textSize="22dp" />
<LinearLayout
android:layout_width="350dp"
android:layout_height="55dp"
android:layout_gravity="center"
android:layout_margin="10dp">
<TextView
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="航司代码:"
android:visibility='@{type.equals("3")?View.VISIBLE:View.GONE}'
style="@style/text_title"/>
<EditText <EditText
android:id="@+id/edit_info" android:id="@+id/edit_info"
android:layout_width="match_parent"
android:layout_height="55dp"
android:gravity="center"
android:inputType="textCapWords"
android:lines="1"
android:maxLines="1" />
</LinearLayout>
<LinearLayout
android:layout_width="350dp" android:layout_width="350dp"
android:layout_height="55dp" android:layout_height="55dp"
android:layout_margin="10dp"
android:gravity="center"
android:layout_gravity="center" android:layout_gravity="center"
android:lines="1" android:visibility='@{type.equals("3")?View.VISIBLE:View.GONE}'
android:layout_margin="5dp">
<TextView
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="前缀代码:"
style="@style/text_title"/>
<EditText
android:id="@+id/edit_info2"
android:layout_width="match_parent"
android:layout_height="55dp"
android:gravity="center"
android:inputType="textCapWords" android:inputType="textCapWords"
android:lines="1"
android:maxLines="1" /> android:maxLines="1" />
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

@ -6,6 +6,9 @@
<variable <variable
name="state" name="state"
type="androidx.databinding.ObservableBoolean" /> type="androidx.databinding.ObservableBoolean" />
<variable
name="buttonVisState"
type="androidx.databinding.ObservableBoolean" />
<import type="android.view.View" /> <import type="android.view.View" />
</data> </data>
@ -36,12 +39,26 @@
<TextView <TextView
android:id="@+id/toast_msg" android:id="@+id/toast_msg"
android:layout_width="400dp" android:layout_width="420dp"
android:layout_height="215dp" android:layout_height="215dp"
android:gravity="center" android:gravity="center"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="28sp" /> android:textSize="28sp" />
<Button
android:id="@+id/tip_dialog_allwey"
android:layout_width="250dp"
android:layout_height="55dp"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:backgroundTint="@color/green"
android:text="转机人工通过校验"
android:visibility="@{buttonVisState?View.VISIBLE:View.GONE}"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold" />
<Button <Button
android:id="@+id/tip_dialog_over" android:id="@+id/tip_dialog_over"
android:layout_width="250dp" android:layout_width="250dp"
@ -49,10 +66,12 @@
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:backgroundTint="@color/white" android:backgroundTint="@color/white"
android:letterSpacing="0.5"
android:text="关闭" android:text="关闭"
android:textColor="@color/black" android:textColor="@color/black"
android:textStyle="bold"
android:textSize="20sp" android:textSize="20sp"
android:letterSpacing="0.5"/> android:textStyle="bold" />
</LinearLayout> </LinearLayout>
</layout> </layout>

@ -2,9 +2,11 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android"> <layout xmlns:android="http://schemas.android.com/apk/res/android">
<data> <data>
<variable <variable
name="data" name="data"
type="com.example.as_trak.entity.ContainerType" /> type="com.example.as_trak.entity.ContainerType" />
<import type="android.view.View"/>
</data> </data>
<LinearLayout <LinearLayout
@ -31,8 +33,6 @@
android:background="#e1e1e1" /> android:background="#e1e1e1" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -41,6 +41,16 @@
android:text="@{data.typeName}" android:text="@{data.typeName}"
android:textSize="15sp" /> android:textSize="15sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="@{data.checkCode}"
android:visibility='@{data.type.equals("3")?View.VISIBLE:View.GONE}'
android:textSize="15sp" />
<TextView <TextView
android:id="@+id/item_cargo_d" android:id="@+id/item_cargo_d"
android:layout_width="50dp" android:layout_width="50dp"

Loading…
Cancel
Save