完成 开发
@ -0,0 +1,15 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="17" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="LOCAL" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleHome" value="$PROJECT_DIR$/../../../android gradle version/gradle-8.0.2" />
|
||||
<option name="gradleJvm" value="jbr-17" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="AndroidUnknownAttribute" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
@ -0,0 +1,8 @@
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1 @@
|
||||
/build
|
@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
@ -0,0 +1,26 @@
|
||||
package com.example.as_trak;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.example.as_trak", appContext.getPackageName());
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<application
|
||||
android:name="org.litepal.LitePalApplication"
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Astrak"
|
||||
tools:ignore="MissingClass"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".UnLoadActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".InfoActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".LoadScanActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".LoadMainActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<litepal>
|
||||
<dbname value="AS_TRAK" />
|
||||
<version value="2" />
|
||||
<list>
|
||||
<mapping class="com.example.as_trak.entity.LoadOperation"/>
|
||||
<mapping class="com.example.as_trak.entity.CargoInfo"/>
|
||||
<mapping class="com.example.as_trak.entity.FlightInfo" />
|
||||
</list>
|
||||
</litepal>
|
@ -0,0 +1,33 @@
|
||||
package com.example.as_trak;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.example.as_trak.adapter.MyFragmentStateAdapter;
|
||||
import com.example.as_trak.base.BaseActivity;
|
||||
import com.example.as_trak.databinding.ActivityInfoBinding;
|
||||
import com.google.android.material.tabs.TabLayoutMediator;
|
||||
|
||||
public class InfoActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ActivityInfoBinding binding=DataBindingUtil. setContentView(this,R.layout.activity_info);
|
||||
binding.viewPager2.setAdapter(new MyFragmentStateAdapter(this));
|
||||
//
|
||||
new TabLayoutMediator(binding.infoTabLayout, binding.viewPager2, (tab, position) -> {
|
||||
switch (position) {
|
||||
case 0:
|
||||
tab.setText("行李信息");
|
||||
break;
|
||||
case 1:
|
||||
tab.setText("航班信息");
|
||||
break;
|
||||
|
||||
}
|
||||
}).attach();
|
||||
}
|
||||
}
|
@ -0,0 +1,215 @@
|
||||
package com.example.as_trak;
|
||||
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableBoolean;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ListPopupWindow;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.as_trak.adapter.CargoInfoAdapter;
|
||||
import com.example.as_trak.adapter.FlightInfoAdapter;
|
||||
import com.example.as_trak.base.BaseActivity;
|
||||
import com.example.as_trak.databinding.ActivityLoadMainBinding;
|
||||
import com.example.as_trak.dialog.AddFlightDialog;
|
||||
import com.example.as_trak.entity.CargoInfo;
|
||||
import com.example.as_trak.entity.FlightInfo;
|
||||
import com.example.as_trak.entity.LoadOperation;
|
||||
import com.example.as_trak.toast.LoadToast;
|
||||
|
||||
import org.litepal.LitePal;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class LoadMainActivity extends BaseActivity implements AddFlightDialog.AddFlightDialogCall, CargoInfoAdapter.CargoInfoCall, AdapterView.OnItemClickListener {
|
||||
private ObservableBoolean visibState;
|
||||
private AddFlightDialog addFlightDialog;
|
||||
private List<FlightInfo> flightList;
|
||||
private ListPopupWindow lpw;
|
||||
private FlightInfo flightInfoTag;
|
||||
private CargoInfoAdapter cargoInfoAdapter;
|
||||
private List<CargoInfo> cargoInfoList;
|
||||
private FlightInfoAdapter adapter;
|
||||
|
||||
private ActivityLoadMainBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = DataBindingUtil.setContentView(this, R.layout.activity_load_main);
|
||||
visibState = new ObservableBoolean();
|
||||
visibState.set(true);
|
||||
binding.setVisibState(visibState);
|
||||
// 装载器适配
|
||||
cargoInfoAdapter = new CargoInfoAdapter(this, this);
|
||||
binding.setAdapter(cargoInfoAdapter);
|
||||
// 航班添加框
|
||||
addFlightDialog = new AddFlightDialog(this);
|
||||
addFlightDialog.setCall(this);
|
||||
// 航班选择框
|
||||
lpw = new ListPopupWindow(this);
|
||||
lpw.setAnchorView(binding.loadMainFlightCode);
|
||||
// 航班查询
|
||||
flightList = LitePal.order("createTime desc").find(FlightInfo.class);
|
||||
if (flightList == null) flightList = new ArrayList<>();
|
||||
adapter = new FlightInfoAdapter(this, flightList);
|
||||
lpw.setAdapter(adapter);
|
||||
lpw.setOnItemClickListener(this);
|
||||
binding.loadMainFlightCode.setOnClickListener(v -> {
|
||||
lpw.show();
|
||||
});
|
||||
intent = new Intent(this, LoadScanActivity.class);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 显示航班添加框
|
||||
public void loadAddFlight(View view) {
|
||||
addFlightDialog.show();
|
||||
}
|
||||
|
||||
// 显示添加货箱按钮
|
||||
public void loadAddEdit(View view) {
|
||||
visibState.set(false);
|
||||
}
|
||||
|
||||
// 添加货箱
|
||||
public void loadAddCargo(View view) {
|
||||
if (flightInfoTag == null) {
|
||||
return;
|
||||
}
|
||||
String cargoCode = binding.loadMainCargoCode.getText().toString();
|
||||
if (cargoCode.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
int id = flightInfoTag.getId();
|
||||
int countTag = LitePal.where("cargoCode= ? and flightId=?", cargoCode, String.valueOf(id)).count(CargoInfo.class);
|
||||
if (countTag > 0) {
|
||||
Toast.makeText(this, "装载单元已经绑定", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
CargoInfo cargoInfo = new CargoInfo();
|
||||
cargoInfo.setCount(0);
|
||||
cargoInfo.setCargoCode(cargoCode);
|
||||
cargoInfo.setFlightId(id);
|
||||
cargoInfo.setState("待装载");
|
||||
cargoInfo.save();
|
||||
cargoInfoList.add(cargoInfo);
|
||||
cargoInfoAdapter.notifyDataSetChanged();
|
||||
binding.loadMainCargoCode.setText(null);
|
||||
Toast.makeText(this, "绑定成功", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
// 关闭货箱添加
|
||||
public void loadCloseEdit(View view) {
|
||||
visibState.set(true);
|
||||
binding.loadMainCargoCode.setText(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回新增的航班信息
|
||||
*
|
||||
* @param flightCode 航班编号
|
||||
* @param destination 三字代码
|
||||
* @param date 日期
|
||||
* @param time 时间
|
||||
*/
|
||||
@Override
|
||||
public void flightInfo(String flightCode, String destination, String date, String time) {
|
||||
FlightInfo flightInfo = new FlightInfo();
|
||||
flightInfo.setFlightCode(flightCode);
|
||||
flightInfo.setDestination(destination);
|
||||
flightInfo.setTakeoffDate(date);
|
||||
flightInfo.setTakeoffTime(time);
|
||||
flightInfo.setCreateTime(new Date());
|
||||
flightInfo.save();
|
||||
addFlightDialog.dismiss();
|
||||
flightList.add(flightInfo);
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public void sanCodeResult(String code) {
|
||||
super.sanCodeResult(code);
|
||||
Log.e("TAG", "sanCodeResult:" + code);
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public void updateCargoInfo(int index) {
|
||||
// CargoInfo cargoInfo = cargoInfoList.get(index);
|
||||
// cargoInfoAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteCargoInfo(int index) {
|
||||
CargoInfo cargoInfo = cargoInfoList.get(index);
|
||||
if (!cargoInfo.getState().equals("待装载")) {
|
||||
Toast.makeText(this, "已经装载行李,不能删除", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
cargoInfo.delete();
|
||||
cargoInfoList.remove(index);
|
||||
cargoInfoAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private Intent intent;
|
||||
|
||||
public void clickCargoInfo(View view) {
|
||||
if (flightInfoTag == null) {
|
||||
Toast.makeText(this, "没有选择航班", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (cargoInfoList == null || cargoInfoList.isEmpty()) {
|
||||
Toast.makeText(this, "没有添加装载单元", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
intent.putExtra("id", flightInfoTag.getId());
|
||||
startActivityForResult(intent, 0);
|
||||
}
|
||||
|
||||
// 选中航班
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
flightInfoTag = flightList.get(position);
|
||||
// 添加输入框
|
||||
binding.loadMainFlightCode.setText(flightInfoTag.getFlightCode());
|
||||
// 查询货框
|
||||
selectCargo();
|
||||
Toast.makeText(this, "查询成功", Toast.LENGTH_SHORT).show();
|
||||
lpw.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
Log.e("TAG", "onActivityResult:重加载");
|
||||
selectCargo();
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private void selectCargo() {
|
||||
cargoInfoList = LitePal.where("flightId = ? ",
|
||||
String.valueOf(flightInfoTag.getId())).find(CargoInfo.class);
|
||||
if (!cargoInfoList.isEmpty()) {
|
||||
cargoInfoList.forEach(cargoInfo -> {
|
||||
int countNum = LitePal.where("cargoId = ? and type ='正常' and (state IS NULL or state = '修改')",String.valueOf(cargoInfo.getId())).count(LoadOperation.class);
|
||||
cargoInfo.setCount(countNum);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
cargoInfoAdapter.setList(cargoInfoList);
|
||||
cargoInfoAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
@ -0,0 +1,163 @@
|
||||
package com.example.as_trak;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.as_trak.adapter.CargoListAdapter;
|
||||
import com.example.as_trak.adapter.LoadInfoAdapter;
|
||||
import com.example.as_trak.base.BaseActivity;
|
||||
import com.example.as_trak.databinding.ActivityLoadScanBinding;
|
||||
import com.example.as_trak.dialog.UpdataDialog;
|
||||
import com.example.as_trak.entity.CargoInfo;
|
||||
import com.example.as_trak.entity.FlightInfo;
|
||||
import com.example.as_trak.entity.LoadOperation;
|
||||
import com.example.as_trak.toast.LoadToast;
|
||||
|
||||
import org.litepal.LitePal;
|
||||
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
|
||||
public class LoadScanActivity extends BaseActivity implements CargoListAdapter.CargoInfoCall, LoadInfoAdapter.LoadInfoCall {
|
||||
private List<CargoInfo> cargoInfoList;
|
||||
private CargoListAdapter adapter;
|
||||
private List<LoadOperation> loadOperations;
|
||||
private CargoInfo cargoInfoTag;
|
||||
private FlightInfo flightInfo;
|
||||
private LoadToast loadToast;
|
||||
|
||||
private LoadInfoAdapter loadInfoAdapter;
|
||||
// 定义时间格式
|
||||
private DateTimeFormatter formatter;
|
||||
|
||||
|
||||
private UpdataDialog updataDialog;
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
com.example.as_trak.databinding.ActivityLoadScanBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_load_scan);
|
||||
initScan();
|
||||
int id = getIntent().getIntExtra("id", 0);
|
||||
flightInfo = LitePal.where("id= ?", String.valueOf(id)).findFirst(FlightInfo.class);
|
||||
|
||||
binding.setData(flightInfo);
|
||||
cargoInfoList = LitePal.where("flightId = ?", String.valueOf(id)).find(CargoInfo.class);
|
||||
adapter = new CargoListAdapter(this, this);
|
||||
adapter.setList(cargoInfoList);
|
||||
binding.setAdapter1(adapter);
|
||||
formatter = DateTimeFormatter.ofPattern("HH:mm");
|
||||
loadToast = new LoadToast(this);
|
||||
loadInfoAdapter = new LoadInfoAdapter(this, this);
|
||||
binding.setAdapter2(loadInfoAdapter);
|
||||
updataDialog = new UpdataDialog(this);
|
||||
updataDialog.setUpdataDialogCall((code, index) -> {
|
||||
LoadOperation loadOperation = loadOperations.get(index);
|
||||
loadOperation.setOldLuggageCode(loadOperation.getLuggageCode());
|
||||
loadOperation.setLuggageCode(code);
|
||||
loadOperation.setState("修改");
|
||||
loadOperation.update(loadOperation.getId());
|
||||
loadInfoAdapter.notifyDataSetChanged();
|
||||
});
|
||||
}
|
||||
|
||||
// 扫码结果
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||
@Override
|
||||
public void sanCodeResult(String code) {
|
||||
super.sanCodeResult(code);
|
||||
if (cargoInfoTag == null) {
|
||||
Toast.makeText(this, "没有选择装载单元", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
int count = LitePal.where("flightId= ? and luggageCode=? and (state IS NULL or state = '修改') ",
|
||||
String.valueOf(flightInfo.getId()), code).count(LoadOperation.class);
|
||||
if (count > 0) {
|
||||
loadToast.show("行李条码重复");
|
||||
return;
|
||||
}
|
||||
LoadOperation loadOperation = new LoadOperation();
|
||||
loadOperation.setFlightCode(flightInfo.getFlightCode());
|
||||
loadOperation.setFlightId(flightInfo.getId());
|
||||
loadOperation.setDestination(flightInfo.getDestination());
|
||||
loadOperation.setTakeoffTime(flightInfo.getTakeoffTime());
|
||||
loadOperation.setCargoCode(cargoInfoTag.getCargoCode());
|
||||
loadOperation.setCargoId(cargoInfoTag.getId());
|
||||
loadOperation.setLuggageCode(code);
|
||||
// loadOperation.setUser();
|
||||
String formattedTime = LocalTime.now().format(formatter); // 格式化当前时间
|
||||
loadOperation.setLoadTime(formattedTime);
|
||||
loadOperation.setType("正常");
|
||||
loadOperation.save();
|
||||
loadOperations.add(loadOperation);
|
||||
loadInfoAdapter.notifyDataSetChanged();
|
||||
|
||||
int size = loadOperations.size();
|
||||
Log.e("TAG", "更新的id:" + cargoInfoTag.getId() + "数量:" + size);
|
||||
cargoInfoTag.setCount(size);
|
||||
cargoInfoTag.setState("装载中");
|
||||
cargoInfoTag.update(cargoInfoTag.getId());
|
||||
|
||||
}
|
||||
|
||||
// 点击箱子
|
||||
@Override
|
||||
public void clickCargoInfo(int index) {
|
||||
|
||||
cargoInfoTag = cargoInfoList.get(index);
|
||||
Log.e("TAG", "clickCargoInfo:" + cargoInfoTag.toString());
|
||||
loadOperations = LitePal.where("cargoId =? and type = ? and (state IS NULL or state = '修改') ",
|
||||
String.valueOf(cargoInfoTag.getId()), "正常")
|
||||
.find(LoadOperation.class);
|
||||
loadInfoAdapter.setList(loadOperations);
|
||||
loadInfoAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
// 修改行李号
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
@Override
|
||||
public void updateCargoInfo(int index) {
|
||||
LoadOperation loadOperation = loadOperations.get(index);
|
||||
updataDialog.setIndex(index);
|
||||
updataDialog.setCode(loadOperation.getLuggageCode());
|
||||
updataDialog.show();
|
||||
}
|
||||
|
||||
// 删除行李
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
@Override
|
||||
public void deleteCargoInfo(int index) {
|
||||
LoadOperation loadOperation = loadOperations.get(index);
|
||||
loadOperation.setState("删除");
|
||||
loadOperation.update(loadOperation.getId());
|
||||
loadOperations.remove(index);
|
||||
|
||||
cargoInfoTag.setCount(loadOperations.size());
|
||||
cargoInfoTag.update(cargoInfoTag.getId());
|
||||
loadInfoAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
// 装载完毕
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
public void loadOver(View view) {
|
||||
if (cargoInfoTag == null) {
|
||||
return;
|
||||
}
|
||||
cargoInfoTag.setState("装载完成");
|
||||
cargoInfoTag.update(cargoInfoTag.getId());
|
||||
adapter.notifyDataSetChanged();
|
||||
cargoInfoTag = null;
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.example.as_trak;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import com.example.as_trak.toast.LoadToast;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
private Intent intent1;
|
||||
private Intent intent2;
|
||||
private Intent intent3;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
intent1 = new Intent(this, LoadMainActivity.class);
|
||||
intent2 = new Intent(this, UnLoadActivity.class);
|
||||
intent3 = new Intent(this, InfoActivity.class);
|
||||
}
|
||||
|
||||
public void homeLoad(View view) {
|
||||
startActivity(intent1);
|
||||
}
|
||||
public void homeinfo(View view) {
|
||||
startActivity(intent3);
|
||||
}
|
||||
|
||||
public void homeUnLoad(View view) {
|
||||
startActivity(intent2);
|
||||
}
|
||||
|
||||
public void homeClose(View view) {
|
||||
finish();
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.example.as_trak;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.example.as_trak.base.BaseActivity;
|
||||
import com.example.as_trak.databinding.ActivityUnLoadBinding;
|
||||
import com.example.as_trak.fragment.LuggageFragment;
|
||||
|
||||
public class UnLoadActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ActivityUnLoadBinding binding=DataBindingUtil.setContentView(this,R.layout.activity_un_load);
|
||||
|
||||
LuggageFragment luggageFragment = new LuggageFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("data", "true");
|
||||
luggageFragment.setArguments(bundle);
|
||||
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
||||
transaction.replace(R.id.un_load_frame, luggageFragment);
|
||||
transaction.commit();
|
||||
}
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.example.as_trak.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.as_trak.R;
|
||||
import com.example.as_trak.databinding.ItemCargoBinding;
|
||||
import com.example.as_trak.entity.CargoInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CargoInfoAdapter extends RecyclerView.Adapter<CargoInfoAdapter.MyViewHolder> {
|
||||
private Context context;
|
||||
private LayoutInflater inflater;
|
||||
private List<CargoInfo> list;
|
||||
private CargoInfoCall call;
|
||||
public CargoInfoAdapter(Context context,CargoInfoCall call) {
|
||||
this.context = context;
|
||||
inflater=LayoutInflater.from(context);
|
||||
this.call=call;
|
||||
}
|
||||
|
||||
public void setList(List<CargoInfo> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
ItemCargoBinding binding = DataBindingUtil.inflate(inflater, R.layout.item_cargo, parent, false, null);
|
||||
return new MyViewHolder(binding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
|
||||
ItemCargoBinding binding = holder.binding;
|
||||
binding.setData(list.get(position));
|
||||
binding.itemCargoD.setOnClickListener(v -> call.deleteCargoInfo(position));
|
||||
binding.itemCargoU.setOnClickListener(v -> call.updateCargoInfo(position));
|
||||
// binding.itemCargoC.setOnClickListener(v -> call.clickCargoInfo(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list == null ? 0 : list.size();
|
||||
}
|
||||
|
||||
|
||||
static class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
private ItemCargoBinding binding;
|
||||
|
||||
public MyViewHolder(ItemCargoBinding binding) {
|
||||
super(binding.getRoot());
|
||||
this.binding = binding;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public interface CargoInfoCall {
|
||||
void updateCargoInfo(int index);
|
||||
void deleteCargoInfo(int index);
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package com.example.as_trak.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.as_trak.R;
|
||||
import com.example.as_trak.databinding.ItemCargoBinding;
|
||||
import com.example.as_trak.databinding.ItemCargoListBinding;
|
||||
import com.example.as_trak.entity.CargoInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
public class CargoListAdapter extends RecyclerView.Adapter<CargoListAdapter.MyViewHolder> {
|
||||
private Context context;
|
||||
private LayoutInflater inflater;
|
||||
private List<CargoInfo> list;
|
||||
private CargoInfoCall call;
|
||||
private List<Boolean> bgList;
|
||||
private int tag=-1;
|
||||
public CargoListAdapter(Context context, CargoInfoCall call) {
|
||||
this.context = context;
|
||||
inflater=LayoutInflater.from(context);
|
||||
this.call=call;
|
||||
}
|
||||
|
||||
public void setList(List<CargoInfo> list) {
|
||||
this.list = list;
|
||||
initBgLsit(list.size());
|
||||
}
|
||||
|
||||
private void initBgLsit(int size) {
|
||||
bgList=new ArrayList<>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
bgList.add(false);
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
ItemCargoListBinding binding = DataBindingUtil.inflate(inflater, R.layout.item_cargo_list, parent, false, null);
|
||||
return new MyViewHolder(binding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull MyViewHolder holder, @SuppressLint("RecyclerView") int position) {
|
||||
ItemCargoListBinding binding = holder.binding;
|
||||
TextView itemCargoCode = binding.itemCargoCode;
|
||||
CargoInfo cargoInfo = list.get(position);
|
||||
itemCargoCode.setText(cargoInfo.getCargoCode());
|
||||
|
||||
if (cargoInfo.getState().equals("装载完成")){
|
||||
itemCargoCode.setBackgroundResource(R.drawable.item_over);
|
||||
return;
|
||||
}
|
||||
|
||||
if (bgList.get(position)){
|
||||
itemCargoCode.setBackgroundResource(R.drawable.item_click_bg);
|
||||
}else {
|
||||
itemCargoCode.setBackgroundResource(R.drawable.select_bg);
|
||||
}
|
||||
|
||||
|
||||
itemCargoCode.setOnClickListener(v -> {
|
||||
if (tag!=-1){
|
||||
bgList.set(tag,false);
|
||||
notifyItemChanged(tag);
|
||||
}
|
||||
bgList.set(position,true);
|
||||
call.clickCargoInfo(position);
|
||||
tag=position;
|
||||
notifyItemChanged(position);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list == null ? 0 : list.size();
|
||||
}
|
||||
|
||||
|
||||
static class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
private ItemCargoListBinding binding;
|
||||
|
||||
public MyViewHolder(ItemCargoListBinding binding) {
|
||||
super(binding.getRoot());
|
||||
this.binding = binding;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public interface CargoInfoCall {
|
||||
void clickCargoInfo(int index);
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.example.as_trak.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.example.as_trak.R;
|
||||
import com.example.as_trak.databinding.ItemFlightInfoBinding;
|
||||
import com.example.as_trak.entity.FlightInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class FlightInfoAdapter extends BaseAdapter {
|
||||
private Context context;
|
||||
private List<FlightInfo> flightInfoList;
|
||||
public FlightInfoAdapter(Context context, List<FlightInfo> flightInfoList) {
|
||||
this.context = context;
|
||||
this.flightInfoList = flightInfoList;
|
||||
}
|
||||
@Override
|
||||
public int getCount() {
|
||||
return flightInfoList.size();
|
||||
}
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
return flightInfoList.get(position);
|
||||
}
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
ItemFlightInfoBinding binding;
|
||||
if (convertView == null) {
|
||||
binding = DataBindingUtil.inflate(
|
||||
LayoutInflater.from(context),
|
||||
R.layout.item_flight_info,
|
||||
parent,
|
||||
false
|
||||
);
|
||||
convertView = binding.getRoot();
|
||||
convertView.setTag(binding);
|
||||
} else {
|
||||
binding = (ItemFlightInfoBinding) convertView.getTag();
|
||||
}
|
||||
FlightInfo flightInfo = flightInfoList.get(position);
|
||||
binding.setFlightInfo(flightInfo);
|
||||
return convertView;
|
||||
}
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.example.as_trak.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.as_trak.R;
|
||||
import com.example.as_trak.databinding.ItemLoadInfoBinding;
|
||||
import com.example.as_trak.entity.LoadOperation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LoadInfoAdapter extends RecyclerView.Adapter<LoadInfoAdapter.MyViewHolder> {
|
||||
private Context context;
|
||||
private LayoutInflater inflater;
|
||||
private List<LoadOperation> list;
|
||||
private LoadInfoCall call;
|
||||
|
||||
public LoadInfoAdapter(Context context, LoadInfoCall call) {
|
||||
this.context = context;
|
||||
inflater = LayoutInflater.from(context);
|
||||
this.call = call;
|
||||
}
|
||||
|
||||
public void setList(List<LoadOperation> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
ItemLoadInfoBinding binding = DataBindingUtil.inflate(inflater, R.layout.item_load_info, parent, false, null);
|
||||
return new MyViewHolder(binding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
|
||||
ItemLoadInfoBinding binding = holder.binding;
|
||||
LoadOperation data = list.get(position);
|
||||
data.setOrderNum(position+1);
|
||||
binding.setData(data);
|
||||
binding.itemLoadD.setOnClickListener(v -> call.deleteCargoInfo(position));
|
||||
binding.itemLoadU.setOnLongClickListener(v -> {
|
||||
call.updateCargoInfo(position);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list == null ? 0 : list.size();
|
||||
}
|
||||
|
||||
|
||||
static class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
private ItemLoadInfoBinding binding;
|
||||
|
||||
public MyViewHolder(ItemLoadInfoBinding binding) {
|
||||
super(binding.getRoot());
|
||||
this.binding = binding;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public interface LoadInfoCall {
|
||||
void updateCargoInfo(int index);
|
||||
|
||||
void deleteCargoInfo(int index);
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.example.as_trak.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.as_trak.R;
|
||||
import com.example.as_trak.databinding.ItemLoadInfoBinding;
|
||||
import com.example.as_trak.databinding.ItemOpinListBinding;
|
||||
import com.example.as_trak.entity.LoadOperation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LoadListAdapter extends RecyclerView.Adapter<LoadListAdapter.MyViewHolder> {
|
||||
private Context context;
|
||||
private LayoutInflater inflater;
|
||||
private List<LoadOperation> list;
|
||||
|
||||
public LoadListAdapter(Context context) {
|
||||
this.context = context;
|
||||
inflater = LayoutInflater.from(context);
|
||||
}
|
||||
|
||||
public void setList(List<LoadOperation> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
ItemOpinListBinding binding = DataBindingUtil.inflate(inflater, R.layout.item_opin_list, parent, false, null);
|
||||
return new MyViewHolder(binding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
|
||||
ItemOpinListBinding binding = holder.binding;
|
||||
LoadOperation data = list.get(position);
|
||||
if (data.getType().equals("拉下")){
|
||||
binding.itemOpinLinear.setBackgroundResource(R.drawable.button_delete);
|
||||
}else {
|
||||
binding.itemOpinLinear.setBackgroundResource(R.drawable.main_menu_bg);
|
||||
}
|
||||
|
||||
// data.setOrderNum(position+1);
|
||||
binding.setData(data);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list == null ? 0 : list.size();
|
||||
}
|
||||
|
||||
|
||||
static class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
private ItemOpinListBinding binding;
|
||||
|
||||
public MyViewHolder(ItemOpinListBinding binding) {
|
||||
super(binding.getRoot());
|
||||
this.binding = binding;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.example.as_trak.adapter;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
|
||||
import com.example.as_trak.fragment.FlightInfoFragment;
|
||||
import com.example.as_trak.fragment.LuggageFragment;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MyFragmentStateAdapter extends FragmentStateAdapter {
|
||||
private List<Fragment> fragments;
|
||||
|
||||
public MyFragmentStateAdapter(@NonNull FragmentActivity fragmentActivity) {
|
||||
super(fragmentActivity);
|
||||
fragments=new ArrayList<>();
|
||||
fragments.add(new LuggageFragment());
|
||||
|
||||
fragments.add(new FlightInfoFragment());
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
return fragments.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return fragments.size();
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.example.as_trak.base;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class BaseActivity extends AppCompatActivity {
|
||||
private MyScanCodeBroad myReceiver;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void initScan() {
|
||||
myReceiver = new MyScanCodeBroad();
|
||||
IntentFilter intentFilter = new IntentFilter();
|
||||
intentFilter.addAction("android.intent.action.SCANRESULT");
|
||||
registerReceiver(myReceiver, intentFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (myReceiver!=null) unregisterReceiver(myReceiver);
|
||||
}
|
||||
|
||||
private class MyScanCodeBroad extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String value = intent.getStringExtra("value");
|
||||
Log.e("TAG", "onReceive:" + value);
|
||||
sanCodeResult(value);
|
||||
}
|
||||
}
|
||||
public void sanCodeResult(String code){}
|
||||
|
||||
public void titleToolClick(View view){
|
||||
finish();
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.example.as_trak.dialog;
|
||||
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.TimePicker;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.example.as_trak.R;
|
||||
import com.example.as_trak.databinding.DialogAddFlightBinding;
|
||||
|
||||
public class AddFlightDialog extends Dialog {
|
||||
private AddFlightDialogCall call;
|
||||
|
||||
public void setCall(AddFlightDialogCall call) {
|
||||
this.call = call;
|
||||
}
|
||||
|
||||
public AddFlightDialog(@NonNull Context context) {
|
||||
super(context, R.style.dialog_style);
|
||||
DialogAddFlightBinding binding = DataBindingUtil.inflate(LayoutInflater.from(context), R.layout.dialog_add_flight, null, false);
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
binding.returnDialogDis.setOnClickListener(v -> dismiss());
|
||||
TimePicker dialogTimepicker = binding.dialogTimepicker;
|
||||
dialogTimepicker.setIs24HourView(true);
|
||||
DatePicker dialogDatepicker = binding.dialogDatepicker;
|
||||
dialogDatepicker.setCalendarViewShown(false); // 隐藏日历视图
|
||||
dialogDatepicker.setSpinnersShown(true); // 显示数字选择器(true);
|
||||
|
||||
binding.dialogReturnTrue.setOnClickListener(v -> {
|
||||
String date = dialogDatepicker.getYear() + "-" + (dialogDatepicker.getMonth()+1) + "-" + dialogDatepicker.getDayOfMonth();
|
||||
// Log.e("TAG", "AddFlightDialog:" + date);
|
||||
String time= dialogTimepicker.getHour()+":"+dialogTimepicker.getMinute();
|
||||
String flightCode = binding.dialogFlightCode.getText().toString();
|
||||
String destination = binding.dialogFlightNum.getText().toString();
|
||||
if (flightCode.isEmpty()||destination.isEmpty()){
|
||||
return;
|
||||
}
|
||||
call.flightInfo(flightCode, destination, date, time);
|
||||
});
|
||||
}
|
||||
public interface AddFlightDialogCall{
|
||||
void flightInfo(String flightCode,String destination,String date,String time);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.example.as_trak.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.example.as_trak.R;
|
||||
import com.example.as_trak.databinding.DialogUpdateBinding;
|
||||
|
||||
import java.nio.charset.CoderResult;
|
||||
|
||||
public class UpdataDialog extends Dialog {
|
||||
private DialogUpdateBinding binding;
|
||||
private String code;
|
||||
private int index;
|
||||
|
||||
public void setIndex(int index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
private UpdataDialogCall updataDialogCall;
|
||||
|
||||
public void setUpdataDialogCall(UpdataDialogCall updataDialogCall) {
|
||||
this.updataDialogCall = updataDialogCall;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public UpdataDialog(@NonNull Context context) {
|
||||
super(context, R.style.dialog_style);
|
||||
binding = DataBindingUtil.inflate(LayoutInflater.from(context), R.layout.dialog_update, null, false);
|
||||
setContentView(binding.getRoot());
|
||||
binding.dialogDis.setOnClickListener(v -> dismiss());
|
||||
binding.dialogTrue.setOnClickListener(v -> {
|
||||
String code = binding.updataNewCode.getText().toString();
|
||||
if (code.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
updataDialogCall.codeResult(code,index);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
super.show();
|
||||
binding.updateOldCode.setText(code);
|
||||
binding.updataNewCode.setText(null);
|
||||
}
|
||||
public interface UpdataDialogCall{
|
||||
public void codeResult(String code,int index);
|
||||
}
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package com.example.as_trak.entity;
|
||||
|
||||
import org.litepal.crud.LitePalSupport;
|
||||
|
||||
public class CargoInfo extends LitePalSupport {
|
||||
private int id;
|
||||
/**
|
||||
* 航班号
|
||||
*/
|
||||
private String flightCode;
|
||||
private int flightId;
|
||||
/**
|
||||
* 货箱号
|
||||
*/
|
||||
private String cargoCode;
|
||||
/**
|
||||
* 装载状态
|
||||
*/
|
||||
private String state;
|
||||
|
||||
private int count;
|
||||
|
||||
public int getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(int count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFlightCode() {
|
||||
return flightCode;
|
||||
}
|
||||
|
||||
public void setFlightCode(String flightCode) {
|
||||
this.flightCode = flightCode;
|
||||
}
|
||||
|
||||
public int getFlightId() {
|
||||
return flightId;
|
||||
}
|
||||
|
||||
public void setFlightId(int flightId) {
|
||||
this.flightId = flightId;
|
||||
}
|
||||
|
||||
public String getCargoCode() {
|
||||
return cargoCode;
|
||||
}
|
||||
|
||||
public void setCargoCode(String cargoCode) {
|
||||
this.cargoCode = cargoCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CargoInfo{" +
|
||||
"id=" + id +
|
||||
"flightId=" + flightId +
|
||||
", cargoCode='" + cargoCode + '\'' +
|
||||
", state='" + state + '\'' +
|
||||
", count=" + count +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package com.example.as_trak.entity;
|
||||
|
||||
import org.litepal.crud.LitePalSupport;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class FlightInfo extends LitePalSupport {
|
||||
private int id;
|
||||
/**
|
||||
* 航班号
|
||||
*/
|
||||
private String flightCode;
|
||||
/**
|
||||
* 目的地
|
||||
*/
|
||||
private String destination;
|
||||
/**
|
||||
* 航班日期
|
||||
*/
|
||||
private String takeoffDate;
|
||||
/**
|
||||
* 起飞时间
|
||||
*/
|
||||
private String takeoffTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createUser;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFlightCode() {
|
||||
return flightCode;
|
||||
}
|
||||
|
||||
public void setFlightCode(String flightCode) {
|
||||
this.flightCode = flightCode;
|
||||
}
|
||||
|
||||
public String getDestination() {
|
||||
return destination;
|
||||
}
|
||||
|
||||
public void setDestination(String destination) {
|
||||
this.destination = destination;
|
||||
}
|
||||
|
||||
public String getTakeoffDate() {
|
||||
return takeoffDate;
|
||||
}
|
||||
|
||||
public void setTakeoffDate(String takeoffDate) {
|
||||
this.takeoffDate = takeoffDate;
|
||||
}
|
||||
|
||||
public String getTakeoffTime() {
|
||||
return takeoffTime;
|
||||
}
|
||||
|
||||
public void setTakeoffTime(String takeoffTime) {
|
||||
this.takeoffTime = takeoffTime;
|
||||
}
|
||||
|
||||
public String getCreateUser() {
|
||||
return createUser;
|
||||
}
|
||||
|
||||
public void setCreateUser(String createUser) {
|
||||
this.createUser = createUser;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
}
|
@ -0,0 +1,211 @@
|
||||
package com.example.as_trak.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.provider.MediaStore;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ListPopupWindow;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.as_trak.R;
|
||||
import com.example.as_trak.adapter.FlightInfoAdapter;
|
||||
import com.example.as_trak.adapter.LoadListAdapter;
|
||||
import com.example.as_trak.databinding.FragmentFlightInfoBinding;
|
||||
import com.example.as_trak.entity.CargoInfo;
|
||||
import com.example.as_trak.entity.FlightInfo;
|
||||
import com.example.as_trak.entity.LoadOperation;
|
||||
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.litepal.LitePal;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class FlightInfoFragment extends Fragment implements AdapterView.OnItemClickListener {
|
||||
private LoadListAdapter adapter;
|
||||
private Context context;
|
||||
private ListPopupWindow lpw;
|
||||
private List<FlightInfo> flightList;
|
||||
private FragmentFlightInfoBinding binding;
|
||||
private String tagId;
|
||||
private ProgressDialog progressDialog;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
context = getContext();
|
||||
|
||||
|
||||
progressDialog = new ProgressDialog(context);
|
||||
progressDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
progressDialog.setCanceledOnTouchOutside(false);
|
||||
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
|
||||
progressDialog.setMessage("导出到excel...");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
binding = DataBindingUtil.inflate(inflater, R.layout.fragment_flight_info, container, false);
|
||||
adapter = new LoadListAdapter(getContext());
|
||||
binding.setAdapter(adapter);
|
||||
|
||||
lpw = new ListPopupWindow(context);
|
||||
lpw.setAnchorView(binding.loadMainFlightCode);
|
||||
// 航班查询
|
||||
flightList = LitePal.order("createTime desc").find(FlightInfo.class);
|
||||
if (flightList == null) flightList = new ArrayList<>();
|
||||
lpw.setAdapter(new FlightInfoAdapter(context, flightList));
|
||||
lpw.setOnItemClickListener(this);
|
||||
binding.loadMainFlightCode.setOnClickListener(v -> {
|
||||
lpw.show();
|
||||
});
|
||||
binding.importLoadInfo.setOnClickListener(v -> {
|
||||
if (tagId == null) {
|
||||
return;
|
||||
}
|
||||
exportLoadOperationsByFlightId(context, tagId);
|
||||
});
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
|
||||
FlightInfo flightInfo = flightList.get(position);
|
||||
binding.loadMainFlightCode.setText(flightInfo.getFlightCode());
|
||||
|
||||
tagId = String.valueOf(flightInfo.getId());
|
||||
int countCargo = LitePal.where("flightId= ?", tagId).count(CargoInfo.class);
|
||||
binding.loadCountCargo.setText(String.valueOf(countCargo));
|
||||
int countOperation = LitePal.where("flightId= ? and type='正常' and (state IS NULL or state = '修改') "
|
||||
, tagId).count(LoadOperation.class);
|
||||
binding.loadCountLuggage.setText(String.valueOf(countOperation));
|
||||
List<LoadOperation> list = LitePal.where("flightId= ? and (state IS NULL or state = '修改')"
|
||||
, tagId).order("cargoId,id asc").find(LoadOperation.class);
|
||||
adapter.setList(list);
|
||||
adapter.notifyDataSetChanged();
|
||||
lpw.dismiss();
|
||||
|
||||
}
|
||||
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
||||
|
||||
public void exportLoadOperationsByFlightId(Context context, String flightId) {
|
||||
progressDialog.show();
|
||||
new Thread(() -> {
|
||||
// 根据 flightId 查询 LoadOperation 数据
|
||||
List<LoadOperation> loadOperations = LitePal.where("flightId = ?", flightId).find(LoadOperation.class);
|
||||
// 创建新的工作簿
|
||||
Workbook workbook = new XSSFWorkbook();
|
||||
Sheet sheet = workbook.createSheet("Load Operations");
|
||||
|
||||
CellStyle headerCellStyle = workbook.createCellStyle();
|
||||
headerCellStyle.setAlignment(HorizontalAlignment.CENTER); // 设置水平居中
|
||||
headerCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); // 设置垂直居中
|
||||
// 创建表头
|
||||
Row headerRow = sheet.createRow(0);
|
||||
|
||||
String[] headers = {"序号", "航班号", "目的地代码", "起飞时间", "货箱号", "行李编码", "旧的行李编码", "操作人", "装载时间", "操作类型", "状态"};
|
||||
for (int i = 0; i < headers.length; i++) {
|
||||
Cell cell = headerRow.createCell(i);
|
||||
cell.setCellValue(headers[i]);
|
||||
sheet.setDefaultColumnStyle(i,headerCellStyle);
|
||||
if (i == 4 || i == 5 || i == 6) {
|
||||
sheet.setColumnWidth(i, 5000);
|
||||
} else {
|
||||
sheet.setColumnWidth(i, 3000);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 填充数据
|
||||
int rowNum = 1;
|
||||
int index = 0;
|
||||
for (LoadOperation loadOperation : loadOperations) {
|
||||
index = rowNum;
|
||||
Row row = sheet.createRow(rowNum++);
|
||||
row.createCell(0).setCellValue(index);
|
||||
row.createCell(1).setCellValue(loadOperation.getFlightCode());
|
||||
row.createCell(2).setCellValue(loadOperation.getDestination());
|
||||
row.createCell(3).setCellValue(loadOperation.getTakeoffTime());
|
||||
row.createCell(4).setCellValue(loadOperation.getCargoCode());
|
||||
// row.createCell(5).setCellValue(loadOperation.getOrderNum());
|
||||
row.createCell(5).setCellValue(loadOperation.getLuggageCode());
|
||||
row.createCell(6).setCellValue(loadOperation.getOldLuggageCode());
|
||||
row.createCell(7).setCellValue(loadOperation.getUser());
|
||||
row.createCell(8).setCellValue(loadOperation.getLoadTime());
|
||||
row.createCell(9).setCellValue(loadOperation.getType());
|
||||
row.createCell(10).setCellValue(loadOperation.getState());
|
||||
}
|
||||
|
||||
// 使用 MediaStore 存储文件
|
||||
ContentResolver contentResolver = context.getContentResolver();
|
||||
ContentValues contentValues = new ContentValues();
|
||||
contentValues.put(MediaStore.MediaColumns.DISPLAY_NAME, "行李装载操作信息" + LocalDateTime.now().format(formatter) + ".xlsx");
|
||||
contentValues.put(MediaStore.MediaColumns.MIME_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
contentValues.put(MediaStore.MediaColumns.RELATIVE_PATH, Environment.DIRECTORY_DOCUMENTS);
|
||||
}
|
||||
|
||||
Uri uri = contentResolver.insert(MediaStore.Files.getContentUri("external"), contentValues);
|
||||
if (uri != null) {
|
||||
try (OutputStream outputStream = contentResolver.openOutputStream(uri)) {
|
||||
if (outputStream != null) {
|
||||
workbook.write(outputStream);
|
||||
Log.e("TAG", "exportLoadOperationsByFlightId:" + "数据已导出到 Excel 文件:" + uri.toString());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
workbook.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
new Handler(Looper.getMainLooper()).post(() -> {
|
||||
Toast.makeText(context, "导出成功", Toast.LENGTH_SHORT).show();
|
||||
if (progressDialog.isShowing()) {
|
||||
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
});
|
||||
}).start();
|
||||
}
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
package com.example.as_trak.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.as_trak.R;
|
||||
import com.example.as_trak.databinding.FragmentLuggageBinding;
|
||||
import com.example.as_trak.entity.FlightInfo;
|
||||
import com.example.as_trak.entity.LoadOperation;
|
||||
import com.example.as_trak.fragment.been.LuggageBeen;
|
||||
|
||||
import org.litepal.LitePal;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
public class LuggageFragment extends Fragment implements View.OnClickListener {
|
||||
|
||||
private FragmentLuggageBinding binding;
|
||||
private LuggageBeen luggageBeen;
|
||||
private LoadOperation loadOperationFrist;
|
||||
private AlertDialog.Builder builder;
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
binding = DataBindingUtil.inflate(inflater, R.layout.fragment_luggage, container, false);
|
||||
Bundle bundle = this.getArguments(); // 得到从Activity传来的数据
|
||||
String mess = null;
|
||||
|
||||
luggageBeen = new LuggageBeen();
|
||||
if (bundle != null) {
|
||||
mess = bundle.getString("data");
|
||||
if (mess.equals("true")) {
|
||||
luggageBeen.setVisbleState(true);
|
||||
}
|
||||
}
|
||||
builder=new AlertDialog.Builder(getContext());
|
||||
builder.setTitle("拉下确认")
|
||||
.setMessage("是否确定拉下行李").setNegativeButton("取消", null);
|
||||
binding.setData(luggageBeen);
|
||||
|
||||
|
||||
EditText loadMainFlightCode = binding.loadMainFlightCode;
|
||||
loadMainFlightCode.setOnTouchListener((v, event) -> {
|
||||
final int DRAWABLE_RIGHT = 2;
|
||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
// 获取触摸的位置
|
||||
int x = (int) event.getX();
|
||||
// 获取图标的边界
|
||||
int drawableRightWidth = loadMainFlightCode.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().width();
|
||||
int drawableRightStart = (int) (loadMainFlightCode.getWidth() - loadMainFlightCode.getPaddingRight() - drawableRightWidth);
|
||||
// 判断是否点击了右侧图标
|
||||
if (x >= drawableRightStart && x <= (loadMainFlightCode.getWidth() - loadMainFlightCode.getPaddingRight())) {
|
||||
String code = loadMainFlightCode.getText().toString();
|
||||
if (code.isEmpty()) return false;
|
||||
selectInfo(code);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
binding.luggageUnLoad.setOnClickListener(this);
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
|
||||
private void selectInfo(String code) {
|
||||
|
||||
loadOperationFrist = LitePal.where("luggageCode=? and (state IS NULL or state = '修改')", code).findFirst(LoadOperation.class);
|
||||
if (loadOperationFrist == null) {
|
||||
Toast.makeText(getContext(), "查询失败,条码错误", Toast.LENGTH_SHORT).show();
|
||||
luggageBeen.clear();
|
||||
return;
|
||||
}
|
||||
luggageBeen.setFlightCode(loadOperationFrist.getFlightCode());
|
||||
luggageBeen.setCargoCode(loadOperationFrist.getCargoCode());
|
||||
luggageBeen.setState(loadOperationFrist.getType());
|
||||
luggageBeen.setLoadTime(loadOperationFrist.getLoadTime());
|
||||
List<LoadOperation> loadOperationList = LitePal.where("flightId = ? and cargoId = ? and (state IS NULL or state = '修改') ", String.valueOf(loadOperationFrist.getFlightId()), String.valueOf(loadOperationFrist.getCargoId())).order("id asc").find(LoadOperation.class);
|
||||
Log.e("TAG", "全部数据:" + loadOperationList.toString());
|
||||
FlightInfo flightInfo = LitePal.where("id=?", String.valueOf(loadOperationFrist.getFlightId())).findFirst(FlightInfo.class);
|
||||
luggageBeen.setTakeoffDate(flightInfo.getTakeoffDate());
|
||||
IntStream.range(0, loadOperationList.size()).filter(i -> loadOperationList.get(i).getLuggageCode().equals(code)).findFirst().ifPresent(i -> luggageBeen.setOrderNum(String.valueOf(i + 1)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (loadOperationFrist == null) {
|
||||
return;
|
||||
}
|
||||
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
loadOperationFrist.setType("拉下");
|
||||
loadOperationFrist.update(loadOperationFrist.getId());
|
||||
Toast.makeText(getContext(), "拉下成功", Toast.LENGTH_SHORT).show();
|
||||
luggageBeen.setState("拉下");
|
||||
}
|
||||
}).show();
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
package com.example.as_trak.fragment.been;
|
||||
|
||||
import androidx.databinding.BaseObservable;
|
||||
|
||||
public class LuggageBeen extends BaseObservable {
|
||||
private String flightCode;
|
||||
|
||||
/**
|
||||
* 起飞时间
|
||||
*/
|
||||
private String takeoffTime;
|
||||
/**
|
||||
* 航班日期
|
||||
*/
|
||||
private String takeoffDate;
|
||||
/**
|
||||
* 货箱号
|
||||
*/
|
||||
private String cargoCode;
|
||||
/**
|
||||
* 顺序
|
||||
*/
|
||||
private String orderNum;
|
||||
private String loadTime;
|
||||
private String State;
|
||||
private boolean visbleState = false;
|
||||
|
||||
public boolean isVisbleState() {
|
||||
return visbleState;
|
||||
}
|
||||
|
||||
public void setVisbleState(boolean visbleState) {
|
||||
this.visbleState = visbleState;
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return State;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
State = state;
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public String getFlightCode() {
|
||||
return flightCode;
|
||||
}
|
||||
|
||||
public void setFlightCode(String flightCode) {
|
||||
this.flightCode = flightCode;
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public String getTakeoffTime() {
|
||||
return takeoffTime;
|
||||
}
|
||||
|
||||
public void setTakeoffTime(String takeoffTime) {
|
||||
this.takeoffTime = takeoffTime;
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public String getTakeoffDate() {
|
||||
return takeoffDate;
|
||||
}
|
||||
|
||||
public void setTakeoffDate(String takeoffDate) {
|
||||
this.takeoffDate = takeoffDate;
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public String getCargoCode() {
|
||||
return cargoCode;
|
||||
}
|
||||
|
||||
public void setCargoCode(String cargoCode) {
|
||||
this.cargoCode = cargoCode;
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public String getOrderNum() {
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public void setOrderNum(String orderNum) {
|
||||
this.orderNum = orderNum;
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public String getLoadTime() {
|
||||
return loadTime;
|
||||
}
|
||||
|
||||
public void setLoadTime(String loadTime) {
|
||||
this.loadTime = loadTime;
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
flightCode = null;
|
||||
takeoffTime = null;
|
||||
takeoffDate = null;
|
||||
cargoCode = null;
|
||||
orderNum = null;
|
||||
loadTime = null;
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.example.as_trak.toast;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.media.MediaPlayer;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.as_trak.R;
|
||||
|
||||
public class LoadToast extends Toast {
|
||||
private MediaPlayer music;
|
||||
private TextView textView;
|
||||
@SuppressLint("MissingInflatedId")
|
||||
public LoadToast(Context context) {
|
||||
super(context);
|
||||
music = MediaPlayer.create(context, R.raw.error);
|
||||
// toast = new Toast(context);
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.toast_load, null, false);
|
||||
textView=view.findViewById(R.id.toast_msg);
|
||||
setView(view);
|
||||
// toast.setView(view);
|
||||
setDuration(Toast.LENGTH_SHORT);
|
||||
setGravity(Gravity.CENTER, 0, 200);
|
||||
}
|
||||
|
||||
|
||||
public void show(String text) {
|
||||
super.show();
|
||||
music.start();
|
||||
textView.setText(text);
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="3dp"
|
||||
/>
|
||||
<solid android:color="@color/blue"/>
|
||||
</shape>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="3dp"
|
||||
/>
|
||||
<solid android:color="#FF5722"/>
|
||||
</shape>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="3dp"
|
||||
/>
|
||||
<solid android:color="#FFC107"/>
|
||||
</shape>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="3dp"/>
|
||||
<solid android:color="@color/blue"/>
|
||||
</shape>
|
@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="3dp"/>
|
||||
<solid android:color="#8B61FF00"/>
|
||||
<stroke android:width="1dp" android:color="#999999"/>
|
||||
</shape>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#DFDEDE"/>
|
||||
<corners android:radius="3dp"/>
|
||||
</shape>
|
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- <item android:top="0dp" android:bottom="0dp">-->
|
||||
<!-- <color android:color="@color/white"/>-->
|
||||
<!-- </item>-->
|
||||
<item android:height="59dp">
|
||||
<color android:color="@color/blue" />
|
||||
</item>
|
||||
<item android:top="59dp" android:bottom="100dp">
|
||||
<shape>
|
||||
<gradient
|
||||
android:type="linear"
|
||||
|
||||
android:angle="270"
|
||||
android:endColor="#F2F3F5"
|
||||
android:startColor="@color/blue"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="3dp"/>
|
||||
<solid android:color="@color/white"/>
|
||||
</shape>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="3dp"/>
|
||||
<solid android:color="@color/white"/>
|
||||
<stroke android:width="1dp" android:color="#999999"/>
|
||||
</shape>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 选中状态的背景 -->
|
||||
<item android:drawable="@drawable/elected_tab_background_color" android:state_selected="true"/>
|
||||
<!-- 未选中状态的背景 -->
|
||||
|
||||
</selector>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/blue" />
|
||||
<corners android:radius="6dp" />
|
||||
<solid android:color="@color/white" />
|
||||
|
||||
</shape>
|
@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="title"
|
||||
type="String" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".InfoActivity">
|
||||
|
||||
<include
|
||||
layout="@layout/toolbar"
|
||||
app:title='@{title??"信息查询"}' />
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/info_tabLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="39dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:background="@drawable/tablayout_bg"
|
||||
app:tabGravity="fill"
|
||||
app:tabTextColor="@color/blue"
|
||||
app:tabSelectedTextColor="@color/white"
|
||||
app:tabBackground="@drawable/tab_background_selector">
|
||||
|
||||
<com.google.android.material.tabs.TabItem
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
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>
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/viewPager2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
</layout>
|
@ -0,0 +1,153 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="title"
|
||||
type="String" />
|
||||
<variable
|
||||
name="visibState"
|
||||
type="androidx.databinding.ObservableBoolean" />
|
||||
<import type="android.view.View"/>
|
||||
|
||||
<variable
|
||||
name="adapter"
|
||||
type="com.example.as_trak.adapter.CargoInfoAdapter" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical"
|
||||
tools:context=".LoadMainActivity">
|
||||
|
||||
<include
|
||||
layout="@layout/toolbar"
|
||||
app:title='@{title??"行李装载"}' />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="81dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/main_menu_bg">
|
||||
|
||||
<TextView
|
||||
android:layout_width="82dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="航班号"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/load_main_flight_code"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:textSize="18sp"
|
||||
android:layout_weight="1"
|
||||
android:paddingRight="10dp"
|
||||
android:drawableRight="@mipmap/ic_select"
|
||||
android:background="@drawable/select_bg" />
|
||||
|
||||
<ImageButton
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:background="@color/white"
|
||||
android:onClick="loadAddFlight"
|
||||
android:src="@mipmap/icon_add" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/main_menu_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="51dp">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/load_main_cargo_code"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="10dp"
|
||||
android:background="@drawable/select_bg"
|
||||
android:maxLines="1"
|
||||
android:inputType="text"
|
||||
android:layout_weight="1"
|
||||
android:visibility="@{visibState?View.GONE:View.VISIBLE}"
|
||||
android:gravity="center" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="5dp"
|
||||
android:background="@drawable/button_add"
|
||||
android:gravity="center"
|
||||
android:text="添加"
|
||||
android:visibility="@{visibState?View.GONE:View.VISIBLE}"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp"
|
||||
android:onClick="loadAddCargo"/>
|
||||
|
||||
<ImageButton
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@color/white"
|
||||
android:visibility="@{visibState?View.GONE:View.VISIBLE}"
|
||||
android:src="@mipmap/icon_left"
|
||||
android:onClick="loadCloseEdit"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="51dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:drawableRight="@mipmap/icon_right"
|
||||
android:gravity="center"
|
||||
android:text="装载单元信息"
|
||||
android:visibility="@{visibState?View.VISIBLE:View.GONE}"
|
||||
android:textSize="18sp"
|
||||
android:onClick="loadAddEdit"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/empty_color" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:adapter="@{adapter}"
|
||||
android:padding="10dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:text="装载行李"
|
||||
android:textStyle="bold"
|
||||
android:textSize="18sp"
|
||||
android:letterSpacing="0.5"
|
||||
android:onClick="clickCargoInfo"
|
||||
android:layout_margin="12dp"/>
|
||||
</LinearLayout>
|
||||
</layout>
|
@ -0,0 +1,192 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="title"
|
||||
type="String" />
|
||||
<variable
|
||||
name="data"
|
||||
type="com.example.as_trak.entity.FlightInfo" />
|
||||
<variable
|
||||
name="adapter1"
|
||||
type="com.example.as_trak.adapter.CargoListAdapter" />
|
||||
<variable
|
||||
name="adapter2"
|
||||
type="com.example.as_trak.adapter.LoadInfoAdapter" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:animateLayoutChanges="true"
|
||||
tools:context=".LoadScanActivity">
|
||||
|
||||
<include
|
||||
layout="@layout/toolbar"
|
||||
app:title='@{title??"行李条码扫描"}' />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="61dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/main_menu_bg">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@{data.flightCode}"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@{data.destination}"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@{data.takeoffTime}"
|
||||
android:textSize="20sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_weight="1"
|
||||
|
||||
android:background="@drawable/main_menu_bg">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/sanLin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="135dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="装载单元"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#e1e1e1" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="顺序"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="#e1e1e1" />
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="行李号"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="#e1e1e1" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
android:gravity="center"
|
||||
android:text="装载时间"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="#e1e1e1" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="操作"
|
||||
android:textSize="15sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_alignTop="@+id/scan_r1"
|
||||
android:background="#e1e1e1" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/scan_r1"
|
||||
android:layout_width="135dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_below="@+id/sanLin"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginTop="0dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
android:adapter="@{adapter1}"/>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignTop="@+id/scan_r1"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_toEndOf="@+id/scan_r1"
|
||||
android:background="#e1e1e1" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_alignTop="@+id/scan_r1"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_toEndOf="@+id/scan_r1"
|
||||
android:layout_marginStart="1dp"
|
||||
android:adapter="@{adapter2}"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<Button
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="装载完毕"
|
||||
android:textStyle="bold"
|
||||
android:onClick="loadOver"
|
||||
android:letterSpacing="0.5" />
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="title"
|
||||
type="String" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".UnLoadActivity">
|
||||
|
||||
<include
|
||||
layout="@layout/toolbar"
|
||||
app:title='@{title??"行李拉下"}' />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/un_load_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="400dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/main_menu_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/return_dialog_dis"
|
||||
style="@style/text_info"
|
||||
android:layout_width="400dp"
|
||||
android:layout_height="45dp"
|
||||
android:drawableRight="@mipmap/ic_cha"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:text="添加航班信息" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="#e1e1e1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="10dp">
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="航班号:" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/dialog_flight_code"
|
||||
style="@style/text_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="10dp">
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="目的地代码:" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/dialog_flight_num"
|
||||
style="@style/text_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="10dp">
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="航班日期:" />
|
||||
|
||||
<DatePicker
|
||||
android:id="@+id/dialog_datepicker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:datePickerMode="spinner" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="10dp">
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="起飞时间:" />
|
||||
|
||||
<TimePicker
|
||||
android:id="@+id/dialog_timepicker"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
|
||||
android:minHeight="45dp"
|
||||
android:timePickerMode="spinner" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/dialog_return_true"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="10dp"
|
||||
android:text="保存" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/main_menu_bg">
|
||||
<TextView
|
||||
android:id="@+id/dialog_dis"
|
||||
style="@style/text_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:drawableRight="@mipmap/ic_cha"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:text="修改行李号" />
|
||||
<LinearLayout
|
||||
android:layout_width="350dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="10dp">
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="行李号(旧):" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/update_old_code"
|
||||
style="@style/text_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="10dp">
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="输入行李号:" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/updata_new_code"
|
||||
style="@style/text_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/dialog_true"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="10dp"
|
||||
android:text="保存" />
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
@ -0,0 +1,186 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="adapter"
|
||||
type="com.example.as_trak.adapter.LoadListAdapter" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".fragment.FlightInfoFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="81dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@drawable/main_menu_bg">
|
||||
|
||||
<TextView
|
||||
android:layout_width="82dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="航班号"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/load_main_flight_code"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@drawable/select_bg"
|
||||
android:drawableRight="@mipmap/ic_select"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:paddingEnd="10dp"
|
||||
android:textSize="18sp" />
|
||||
<TextView
|
||||
android:id="@+id/import_load_info"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@drawable/button_update"
|
||||
android:gravity="center"
|
||||
android:text="导出"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="@drawable/main_menu_bg">
|
||||
|
||||
<TextView
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="装载单元数量"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/load_count_cargo"
|
||||
style="@style/text_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="10dp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:background="@drawable/main_menu_bg">
|
||||
|
||||
<TextView
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="装载行李数量"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/load_count_luggage"
|
||||
style="@style/text_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="10dp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/main_menu_bg">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="装载单元"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#e1e1e1" />
|
||||
|
||||
<TextView
|
||||
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="行李号"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#e1e1e1" />
|
||||
|
||||
<TextView
|
||||
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="装载时间"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#e1e1e1" />
|
||||
|
||||
<TextView
|
||||
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
android:gravity="center"
|
||||
android:text="状态"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<!-- <View-->
|
||||
<!-- android:layout_width="1dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:background="#e1e1e1" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="操作"-->
|
||||
<!-- android:textSize="18sp" />-->
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="1dp"
|
||||
android:adapter="@{adapter}"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
@ -0,0 +1,209 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="data"
|
||||
type="com.example.as_trak.fragment.been.LuggageBeen" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".fragment.LuggageFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="81dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/main_menu_bg">
|
||||
|
||||
<TextView
|
||||
android:layout_width="82dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="行李号"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/load_main_flight_code"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/select_bg"
|
||||
android:drawableEnd="@mipmap/icon_chaxun"
|
||||
android:gravity="center"
|
||||
android:paddingEnd="10dp"
|
||||
android:textSize="18sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="55dp"
|
||||
android:gravity="center"
|
||||
android:paddingStart="10dp"
|
||||
android:text="当前行李信息"
|
||||
android:textColor="@color/blue"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="61dp"
|
||||
android:background="@drawable/main_menu_bg">
|
||||
|
||||
<TextView
|
||||
android:layout_width="82dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="航班号"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="@{data.flightCode}" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="81dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:background="@drawable/main_menu_bg">
|
||||
|
||||
<TextView
|
||||
android:layout_width="82dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="航班日期"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="@{data.takeoffDate}" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="61dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:background="@drawable/main_menu_bg">
|
||||
|
||||
<TextView
|
||||
android:layout_width="82dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="装载单元"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="@{data.cargoCode}" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="61dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:background="@drawable/main_menu_bg">
|
||||
|
||||
<TextView
|
||||
android:layout_width="82dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="顺序"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text='@{data.orderNum}' />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="61dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:background="@drawable/main_menu_bg">
|
||||
|
||||
<TextView
|
||||
android:layout_width="82dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="装载时间"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text='@{data.loadTime}' />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="61dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:background="@drawable/main_menu_bg">
|
||||
|
||||
<TextView
|
||||
android:layout_width="82dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="状态"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
style="@style/text_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text='@{data.state}' />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/luggageUnLoad"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:letterSpacing="1"
|
||||
android:text="拉下"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:visibility="@{data.visbleState?View.VISIBLE:View.GONE}" />
|
||||
</LinearLayout>
|
||||
</layout>
|
@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="data"
|
||||
type="com.example.as_trak.entity.CargoInfo" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="51dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_cargo_c"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@{data.cargoCode}"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="#e1e1e1" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text='@{data.count+""}'
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="件"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="#e1e1e1" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@{data.state}"
|
||||
android:textSize="15sp" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_cargo_u"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="30dp"
|
||||
android:background="@drawable/button_update"
|
||||
android:gravity="center"
|
||||
android:text="修改"
|
||||
android:textColor="@color/white"
|
||||
android:visibility="gone"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_cargo_d"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/button_delete"
|
||||
android:gravity="center"
|
||||
android:text="删除"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="#EEEEEE" />
|
||||
</LinearLayout>
|
||||
</layout>
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:padding="1dp">
|
||||
<TextView
|
||||
android:id="@+id/item_cargo_code"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/select_bg"
|
||||
|
||||
android:gravity="center"
|
||||
android:textSize="15sp"
|
||||
android:textColor="@color/black"/>
|
||||
</LinearLayout>
|
||||
</layout>
|
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<data>
|
||||
<variable
|
||||
name="flightInfo"
|
||||
type="com.example.as_trak.entity.FlightInfo" />
|
||||
</data>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:orientation="horizontal"
|
||||
android:padding="3dp">
|
||||
<TextView
|
||||
android:id="@+id/tv_flight_code"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="18sp"
|
||||
android:text="@{flightInfo.flightCode}" />
|
||||
<View
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#e1e1e1"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_takeoff_date"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:textSize="18sp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@{flightInfo.takeoffDate}" />
|
||||
</LinearLayout>
|
||||
</layout>
|
@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="data"
|
||||
type="com.example.as_trak.entity.LoadOperation" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="51dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text='@{data.orderNum+""}'
|
||||
android:textSize="15sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="#e1e1e1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_load_u"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:text='@{data.luggageCode}'
|
||||
android:textSize="15sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="#e1e1e1" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
|
||||
android:text='@{data.loadTime}'
|
||||
android:textSize="15sp" />
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="#e1e1e1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_load_d"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/button_delete"
|
||||
android:gravity="center"
|
||||
android:text="删除"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="#EEEEEE" />
|
||||
</LinearLayout>
|
||||
</layout>
|
@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="data"
|
||||
type="com.example.as_trak.entity.LoadOperation" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/item_opin_linear"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:background="@drawable/main_menu_bg">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@{data.cargoCode}"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#e1e1e1" />
|
||||
|
||||
<TextView
|
||||
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@{data.luggageCode}"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#e1e1e1" />
|
||||
|
||||
<TextView
|
||||
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
android:gravity="center"
|
||||
android:text="@{data.loadTime}"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#e1e1e1" />
|
||||
|
||||
<TextView
|
||||
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@{data.type}"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<!-- <View-->
|
||||
<!-- android:layout_width="1dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:background="#e1e1e1" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="@{data.state}"-->
|
||||
<!-- android:textSize="18sp" />-->
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/button_delete"
|
||||
|
||||
android:orientation="vertical"
|
||||
android:theme="@android:style/Theme.DeviceDefault.Light">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:src="@mipmap/ic_no"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="30dp"/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/toast_msg"
|
||||
android:layout_width="425dp"
|
||||
android:layout_height="500dp"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center"
|
||||
android:textSize="28sp" />
|
||||
</LinearLayout>
|
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="title"
|
||||
type="String" />
|
||||
</data>
|
||||
|
||||
<FrameLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="66dp"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@mipmap/ic_back"
|
||||
android:padding="16dp"
|
||||
android:onClick="titleToolClick" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textSize="22sp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:letterSpacing="0.2"
|
||||
android:textStyle="bold"
|
||||
android:text="@{title}" />
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
</layout>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
After Width: | Height: | Size: 476 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 982 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 642 B |
After Width: | Height: | Size: 450 B |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 7.6 KiB |
@ -0,0 +1,7 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.Astrak" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Customize your dark theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
|
||||
</style>
|
||||
</resources>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="blue">#387BE7</color>
|
||||
<color name="empty_color">#F2F3F5</color>
|
||||
</resources>
|
@ -0,0 +1,5 @@
|
||||
<resources>
|
||||
<string name="app_name">AS-TRAK-2</string>
|
||||
<!-- TODO: Remove or change this placeholder text -->
|
||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||
</resources>
|
@ -0,0 +1,53 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.Astrak" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Customize your light theme here. -->
|
||||
<item name="colorPrimary">@color/blue</item>
|
||||
<item name="android:windowBackground">#F2F3F5</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Astrak" parent="Base.Theme.Astrak" />
|
||||
<style name="TabRadioButton">
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:letterSpacing">0.2</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:layout_height">match_parent</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:button">@null</item>
|
||||
<item name="android:drawablePadding">2dp</item>
|
||||
<item name="android:textColor">#000000</item>
|
||||
<item name="android:textSize">20sp</item>
|
||||
<!-- <item name="android:drawablePadding">5dp</item> -->
|
||||
</style>
|
||||
<style name="text_info">
|
||||
<item name="android:textSize">18sp</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:background">@drawable/select_bg</item>
|
||||
</style>
|
||||
<style name="text_title">
|
||||
<item name="android:textSize">18sp</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
</style>
|
||||
<style name="dialog_style" parent="@android:style/Theme.Dialog">
|
||||
<!-- 边框 -->
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<!-- 是否浮现在activity之上 -->
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<!-- 半透明 -->
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<!-- 无标题 -->
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:background">@android:color/transparent</item>
|
||||
<!-- 背景透明 -->
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<!-- 模糊 -->
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<!-- 遮罩层 -->
|
||||
<item name="android:backgroundDimAmount">0.5</item>
|
||||
|
||||
<!--对话框动画-->
|
||||
<!-- <item name="android:windowAnimationStyle">@style/dialog_anim_bottom2top</item>-->
|
||||
</style>
|
||||
</resources>
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample backup rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/guide/topics/data/autobackup
|
||||
for details.
|
||||
Note: This file is ignored for devices older that API 31
|
||||
See https://developer.android.com/about/versions/12/backup-restore
|
||||
-->
|
||||
<full-backup-content>
|
||||
<!--
|
||||
<include domain="sharedpref" path="."/>
|
||||
<exclude domain="sharedpref" path="device.xml"/>
|
||||
-->
|
||||
</full-backup-content>
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample data extraction rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
|
||||
for details.
|
||||
-->
|
||||
<data-extraction-rules>
|
||||
<cloud-backup>
|
||||
<!-- TODO: Use <include> and <exclude> to control what is backed up.
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
-->
|
||||
</cloud-backup>
|
||||
<!--
|
||||
<device-transfer>
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
</device-transfer>
|
||||
-->
|
||||
</data-extraction-rules>
|
@ -0,0 +1,17 @@
|
||||
package com.example.as_trak;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
id 'com.android.application' version '8.1.2' apply false
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
# Project-wide Gradle settings.
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||
# Android operating system, and which are packaged with your app's APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
# Enables namespacing of each library's R class so that its R class includes only the
|
||||
# resources declared in the library itself and none from the library's dependencies,
|
||||
# thereby reducing the size of the R class for that library
|
||||
android.nonTransitiveRClass=true
|
@ -0,0 +1,6 @@
|
||||
#Mon Feb 10 09:30:13 CST 2025
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
@ -0,0 +1,185 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
exec "$JAVACMD" "$@"
|
@ -0,0 +1,89 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
@ -0,0 +1,31 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven{url"https://jitpack.io"}
|
||||
maven{url'https://maven.aliyun.com/repository/releases'}
|
||||
maven{url'https://maven.aliyun.com/repository/jcenter'}
|
||||
maven{url'https://maven.aliyun.com/repository/google'}
|
||||
maven{url'https://maven.aliyun.com/repository/central'}
|
||||
maven{url'https://maven.aliyun.com/repository/gradle-plugin'}
|
||||
maven{url'https://maven.aliyun.com/repository/public'}
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
maven{url"https://jitpack.io"}
|
||||
maven{url'https://maven.aliyun.com/repository/releases'}
|
||||
maven{url'https://maven.aliyun.com/repository/jcenter'}
|
||||
maven{url'https://maven.aliyun.com/repository/google'}
|
||||
maven{url'https://maven.aliyun.com/repository/central'}
|
||||
maven{url'https://maven.aliyun.com/repository/gradle-plugin'}
|
||||
maven{url'https://maven.aliyun.com/repository/public'}
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "as-trak"
|
||||
include ':app'
|