init: init proj
1
module_hangban/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
76
module_hangban/build.gradle
Normal file
@@ -0,0 +1,76 @@
|
||||
if (isBuildModule.toBoolean()) {
|
||||
apply plugin: 'com.android.application'
|
||||
} else {
|
||||
apply plugin: 'com.android.library'
|
||||
}
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk 31
|
||||
|
||||
sourceSets {
|
||||
main{
|
||||
// 应用
|
||||
if(isBuildModule.toBoolean()){
|
||||
manifest.srcFile 'src/main/debug/AndroidManifest.xml'
|
||||
}else{// 插件
|
||||
manifest.srcFile 'src/main/release/AndroidManifest.xml'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
if (isBuildModule.toBoolean()) {
|
||||
applicationId "com.lukouguoji.hangban"
|
||||
}
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 30
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
buildToolsVersion '30.0.3'
|
||||
|
||||
buildFeatures {
|
||||
dataBinding = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
api project(':module_base')
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
implementation 'androidx.core:core-ktx:1.2.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.2.1'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
|
||||
kapt 'com.alibaba:arouter-compiler:1.5.2'
|
||||
}
|
||||
21
module_hangban/proguard-rules.pro
vendored
Normal file
@@ -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,24 @@
|
||||
package com.lukouguoji.hangban
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("com.lukouguoji.hangban", appContext.packageName)
|
||||
}
|
||||
}
|
||||
25
module_hangban/src/main/debug/AndroidManifest.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.lukouguoji.hangban">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Aerologic">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape"
|
||||
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,11 @@
|
||||
package com.lukouguoji.hangban
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,491 @@
|
||||
package com.lukouguoji.hangban.activity
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.View
|
||||
import android.widget.EditText
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.fastjson.JSONArray
|
||||
import com.alibaba.fastjson.JSONObject
|
||||
import com.lukouguoji.hangban.R
|
||||
import com.lukouguoji.hangban.adapt.HangBanListAdapter
|
||||
import com.lukouguoji.hangban.model.HangBanListModel
|
||||
import com.lukouguoji.hangban.viewModel.HangBanListViewModel
|
||||
import com.lukouguoji.module_base.BaseActivity
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
import com.scwang.smart.refresh.footer.ClassicsFooter
|
||||
import com.scwang.smart.refresh.header.ClassicsHeader
|
||||
import com.scwang.smart.refresh.layout.api.RefreshLayout
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
|
||||
@Route(path = ARouterConstants.ACTIVITY_URL_HANG_BAN_QUERY)
|
||||
class HangBanQueryActivity : BaseActivity(), View.OnClickListener {
|
||||
private val currentTitleName = "航班查询"
|
||||
|
||||
private lateinit var viewModel: HangBanListViewModel
|
||||
private lateinit var adapter: HangBanListAdapter
|
||||
private val collectList = ArrayList<HangBanListModel>()
|
||||
private lateinit var refreshLayout: RefreshLayout
|
||||
private var currentPage = 1
|
||||
private var pageSize = 10
|
||||
private var totalPage = 0
|
||||
private var totalCount = 0 //总条数
|
||||
private val calendar = Calendar.getInstance()
|
||||
private val ymdSdf = SimpleDateFormat("yyyy-MM-dd")//年月日
|
||||
private val ymdHmsSdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")//年月日 时分秒
|
||||
|
||||
//标题
|
||||
private lateinit var toolBack: LinearLayout
|
||||
private lateinit var titleName: TextView
|
||||
|
||||
//搜索
|
||||
private lateinit var searchListFragment: LinearLayout
|
||||
private lateinit var startDate: TextView
|
||||
private lateinit var endDate: TextView
|
||||
private lateinit var fno: EditText
|
||||
private lateinit var flightType: TextView
|
||||
private var flightTypeValue = ""
|
||||
private lateinit var filtrateLayout: LinearLayout
|
||||
private lateinit var searchLayout: LinearLayout
|
||||
|
||||
//筛选
|
||||
private lateinit var filtrateFragment: LinearLayout
|
||||
|
||||
// private lateinit var flight: EditText
|
||||
private lateinit var inOrOut: TextView
|
||||
private var inOrOutValue = ""
|
||||
private lateinit var countryType: TextView
|
||||
private var countryTypeValue = ""
|
||||
private lateinit var range1: EditText
|
||||
private lateinit var range2: EditText
|
||||
private lateinit var submit: TextView
|
||||
private lateinit var reset: TextView
|
||||
|
||||
//列表
|
||||
private lateinit var listLayout: LinearLayout
|
||||
|
||||
private fun initView() {
|
||||
viewModel = ViewModelProvider(this).get(HangBanListViewModel::class.java)
|
||||
val layoutManager = LinearLayoutManager(this)
|
||||
adapter = HangBanListAdapter(this, viewModel, collectList)
|
||||
var recyclerView: RecyclerView = findViewById(R.id.collectList)
|
||||
recyclerView.layoutManager = layoutManager
|
||||
recyclerView.adapter = adapter
|
||||
refreshLayout = findViewById(R.id.refreshLayout)
|
||||
|
||||
//标题
|
||||
toolBack = findViewById(R.id.tool_back)
|
||||
titleName = findViewById(R.id.title_name)
|
||||
|
||||
//搜索
|
||||
searchListFragment = findViewById(R.id.searchListFragment)
|
||||
startDate = findViewById(R.id.startDate)
|
||||
startDate = findViewById(R.id.startDate)
|
||||
endDate = findViewById(R.id.startDate)
|
||||
fno = findViewById(R.id.fno)
|
||||
flightType = findViewById(R.id.flightType)
|
||||
filtrateLayout = findViewById(R.id.filtrateLayout)
|
||||
searchLayout = findViewById(R.id.searchLayout)
|
||||
|
||||
//筛选
|
||||
filtrateFragment = findViewById(R.id.filtrateFragment)
|
||||
// flight = findViewById(R.id.flight)
|
||||
inOrOut = findViewById(R.id.inOrOut)
|
||||
countryType = findViewById(R.id.countryType)
|
||||
range1 = findViewById(R.id.range1)
|
||||
range2 = findViewById(R.id.range2)
|
||||
submit = findViewById(R.id.submit)
|
||||
reset = findViewById(R.id.reset)
|
||||
//列表
|
||||
listLayout = findViewById(R.id.listLayout)
|
||||
|
||||
toolBack.setOnClickListener(this)
|
||||
startDate.setOnClickListener(this)
|
||||
endDate.setOnClickListener(this)
|
||||
flightType.setOnClickListener(this)
|
||||
|
||||
filtrateLayout.setOnClickListener(this)
|
||||
searchLayout.setOnClickListener(this)
|
||||
|
||||
inOrOut.setOnClickListener(this)
|
||||
countryType.setOnClickListener(this)
|
||||
submit.setOnClickListener(this)
|
||||
reset.setOnClickListener(this)
|
||||
|
||||
startDate.text = ymdSdf.format(Date())
|
||||
endDate.text = ymdSdf.format(calendar.time)
|
||||
|
||||
fno.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun afterTextChanged(editable: Editable?) {
|
||||
val originText = editable.toString()
|
||||
if (originText != null && originText != "") {
|
||||
val regularExpression = "(^([A-Z0-9]+)$)"
|
||||
val matches = originText.matches(regularExpression.toRegex())
|
||||
if(!matches){
|
||||
val regularExpression2 = "([^A-Za-z0-9]+)"
|
||||
val replaceStr = originText.replace(regularExpression2.toRegex(),"")
|
||||
val replaceStrToUpper = replaceStr.uppercase(Locale.ROOT)//小写转大写
|
||||
fno.setText(replaceStrToUpper)
|
||||
fno.setSelection(replaceStrToUpper.length)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
range1.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun afterTextChanged(editable: Editable?) {
|
||||
val originText = editable.toString()
|
||||
if (originText != null && originText != "") {
|
||||
val regularExpression = "(^([A-Z]+)$)"
|
||||
val matches = originText.matches(regularExpression.toRegex())
|
||||
if(!matches){
|
||||
val regularExpression2 = "([^A-Za-z]+)"
|
||||
val replaceStr = originText.replace(regularExpression2.toRegex(),"")
|
||||
val replaceStrToUpper = replaceStr.uppercase(Locale.ROOT)//小写转大写
|
||||
range1.setText(replaceStrToUpper)
|
||||
range1.setSelection(replaceStrToUpper.length)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
range2.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun afterTextChanged(editable: Editable?) {
|
||||
val originText = editable.toString()
|
||||
if (originText != null && originText != "") {
|
||||
val regularExpression = "(^([A-Z]+)$)"
|
||||
val matches = originText.matches(regularExpression.toRegex())
|
||||
if(!matches){
|
||||
val regularExpression2 = "([^A-Za-z]+)"
|
||||
val replaceStr = originText.replace(regularExpression2.toRegex(),"")
|
||||
val replaceStrToUpper = replaceStr.uppercase(Locale.ROOT)//小写转大写
|
||||
range2.setText(replaceStrToUpper)
|
||||
range2.setSelection(replaceStrToUpper.length)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_hangban_query)
|
||||
initView()
|
||||
//查询返回结果
|
||||
viewModel.searchParamLive.observe(this) {
|
||||
loadingCancel()
|
||||
//1.获取数据
|
||||
var listArr: JSONArray = it["list"] as JSONArray
|
||||
totalCount = it.getIntValue("total")
|
||||
totalPage = it["pages"] as Int
|
||||
// var listArr :JSONArray =it["list"] as JSONArray
|
||||
if (listArr.size > 0) {
|
||||
listLayout.visibility = View.VISIBLE
|
||||
//2.循环遍历塞入collectList
|
||||
listArr.forEach {
|
||||
val itemObj = it as JSONObject
|
||||
|
||||
val id = itemObj.getIntValue("fid")
|
||||
val fdate = itemObj.getString("fdate") ?: ""
|
||||
val fno = itemObj.getString("fno") ?: ""
|
||||
val range = itemObj.getString("range") ?: ""
|
||||
val jtz = itemObj.getString("jtz") ?: ""
|
||||
val scheduledArrival = itemObj.getString("scheduledArrival") ?: ""
|
||||
val estimatedArrival = itemObj.getString("estimatedArrival") ?: ""
|
||||
val actualArrival = itemObj.getString("actualArrival") ?: ""
|
||||
val scheduledTackOff = itemObj.getString("scheduledTackOff") ?: ""
|
||||
val estimatedTakeOff = itemObj.getString("estimatedTakeOff") ?: ""
|
||||
val actualTakeOff = itemObj.getString("actualTakeOff") ?: ""
|
||||
val countryType = itemObj.getString("countryType") ?: ""
|
||||
val serviceType = itemObj.getString("serviceType") ?: ""
|
||||
val flightStatus = itemObj.getString("flightStatus") ?: ""
|
||||
val delayFreeText = itemObj.getString("delayFreeText") ?: ""
|
||||
val aircraftCode = itemObj.getString("aircraftCode") ?: ""
|
||||
val standId = itemObj.getString("standId") ?: ""
|
||||
val registration = itemObj.getString("registration") ?: "" //机号
|
||||
val status = itemObj.getString("status") ?: "0"
|
||||
|
||||
//列表赋值
|
||||
collectList.add(
|
||||
HangBanListModel(
|
||||
id,
|
||||
fdate,
|
||||
fno,
|
||||
range,
|
||||
jtz,
|
||||
scheduledArrival,
|
||||
estimatedArrival,
|
||||
actualArrival,
|
||||
scheduledTackOff, estimatedTakeOff,
|
||||
actualTakeOff,
|
||||
countryType,
|
||||
serviceType,
|
||||
flightStatus,
|
||||
delayFreeText,
|
||||
aircraftCode,
|
||||
registration,
|
||||
status
|
||||
)
|
||||
)
|
||||
}
|
||||
//3.调adpter展示
|
||||
if (currentPage == 1) {
|
||||
adapter.notifyDataSetChanged()
|
||||
} else {
|
||||
adapter.notifyItemRangeInserted((currentPage - 1) * 10, collectList.size)
|
||||
}
|
||||
refreshLayout.finishRefresh()
|
||||
refreshLayout.finishLoadMore()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/////////////// 下拉框 start
|
||||
viewModel.flightType(System.currentTimeMillis().toString())
|
||||
viewModel.flightTypeObserver.observe(this) { vd ->
|
||||
val noneObj = JSONObject()
|
||||
noneObj["name"] = "请选择航班类型"
|
||||
noneObj["code"] = ""
|
||||
viewModel.flightTypeList.add(noneObj)
|
||||
viewModel.flightTypeList.addAll(vd.getJSONArray("data"))
|
||||
}
|
||||
viewModel.initInOrOutList()
|
||||
viewModel.countryType(System.currentTimeMillis().toString())
|
||||
viewModel.countryTypeObserver.observe(this) { vd ->
|
||||
val noneObj = JSONObject()
|
||||
noneObj["name"] = "请选择地区类型"
|
||||
noneObj["code"] = ""
|
||||
viewModel.countryTypeList.add(noneObj)
|
||||
viewModel.countryTypeList.addAll(vd.getJSONArray("data"))
|
||||
}
|
||||
/////////////// 下拉框 end
|
||||
|
||||
|
||||
//搜索
|
||||
resetSearch()
|
||||
|
||||
/////////////////////////////// 加载刷新的布局
|
||||
refreshLayout.setRefreshHeader(ClassicsHeader(this))
|
||||
refreshLayout.setRefreshFooter(ClassicsFooter(this))
|
||||
/////////////////////////////// 下拉刷新
|
||||
refreshLayout.setOnRefreshListener {
|
||||
resetSearch()
|
||||
}
|
||||
/////////////////////////////// 上拉加载
|
||||
refreshLayout.setOnLoadMoreListener {
|
||||
if (currentPage < totalPage) {
|
||||
currentPage++
|
||||
//初始化查询
|
||||
searchFun()
|
||||
} else {
|
||||
refreshLayout.finishLoadMoreWithNoMoreData()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
v?.let {
|
||||
when (it.id) {
|
||||
R.id.tool_back -> {
|
||||
if (searchListFragment.visibility == View.GONE && filtrateFragment.visibility == View.VISIBLE) {
|
||||
searchListFragment.visibility = View.VISIBLE
|
||||
filtrateFragment.visibility = View.GONE
|
||||
titleName.text = currentTitleName
|
||||
} else {
|
||||
setResult(RESULT_OK)
|
||||
finish()
|
||||
}
|
||||
}
|
||||
R.id.startDate -> {
|
||||
Common.onYearMonthDay(this, startDate.text.toString()) { year, month, day ->
|
||||
calendar.set(year, month - 1, day)
|
||||
startDate.text = ymdSdf.format(calendar.time)
|
||||
}
|
||||
}
|
||||
R.id.startDate -> {
|
||||
Common.onYearMonthDay(this, endDate.text.toString()) { year, month, day ->
|
||||
calendar.set(year, month - 1, day)
|
||||
endDate.text = ymdSdf.format(calendar.time)
|
||||
}
|
||||
}
|
||||
R.id.flightType -> {
|
||||
Common.singleSelect(this, "航班类型", viewModel.flightTypeList, flightTypeValue) { _, item ->
|
||||
val jsonObject = item as JSONObject
|
||||
val name = jsonObject.getString("name")
|
||||
val code = jsonObject.getString("code")
|
||||
flightType.text = name
|
||||
flightTypeValue = code
|
||||
}
|
||||
}
|
||||
R.id.searchLayout -> {
|
||||
// viewModel.queryPickByIdGnjChuKu("M000995643")
|
||||
resetSearch()
|
||||
}
|
||||
R.id.filtrateLayout -> {
|
||||
if (searchListFragment.visibility == View.VISIBLE && filtrateFragment.visibility == View.GONE) {
|
||||
searchListFragment.visibility = View.GONE
|
||||
filtrateFragment.visibility = View.VISIBLE
|
||||
titleName.text = "搜索"
|
||||
} else {
|
||||
searchListFragment.visibility = View.VISIBLE
|
||||
filtrateFragment.visibility = View.GONE
|
||||
titleName.text = currentTitleName
|
||||
}
|
||||
// Common.showToast(this,"筛选")
|
||||
}
|
||||
R.id.inOrOut -> {
|
||||
Common.singleSelect(this, "进出港", viewModel.inOrOutList, inOrOutValue) { _, item ->
|
||||
val jsonObject = item as JSONObject
|
||||
val name = jsonObject.getString("name")
|
||||
val code = jsonObject.getString("code")
|
||||
inOrOut.text = name
|
||||
inOrOutValue = code
|
||||
}
|
||||
}
|
||||
R.id.countryType -> {
|
||||
Common.singleSelect(this, "地区类型", viewModel.countryTypeList, countryTypeValue) { _, item ->
|
||||
val jsonObject = item as JSONObject
|
||||
val name = jsonObject.getString("name")
|
||||
val code = jsonObject.getString("code")
|
||||
countryType.text = name
|
||||
countryTypeValue = code
|
||||
}
|
||||
}
|
||||
R.id.submit -> {
|
||||
//筛选页隐藏
|
||||
searchListFragment.visibility = View.VISIBLE
|
||||
filtrateFragment.visibility = View.GONE
|
||||
titleName.text = currentTitleName
|
||||
//搜索
|
||||
resetSearch()
|
||||
}
|
||||
R.id.reset -> {
|
||||
resetFun()
|
||||
}
|
||||
else -> {
|
||||
Toast.makeText(this, "未找到对应操作", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫码返回的结果
|
||||
*/
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
// 扫描二维码/条码回传
|
||||
if (resultCode == RESULT_OK && data != null) {
|
||||
val content = data.getStringExtra(com.yzq.zxinglibrary.common.Constant.CODED_CONTENT)
|
||||
if (content == null) {
|
||||
Common.showToast(this, "条码错误!")
|
||||
return
|
||||
}
|
||||
when (requestCode) {
|
||||
Constant.RequestCode.gnj_chu_ku_list -> {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
private fun searchFun() {
|
||||
loading()
|
||||
listLayout.visibility = View.GONE
|
||||
var range = ""
|
||||
if (range1.text.toString() != "" && range2.text.toString() != "") {
|
||||
range = "${range1.text}-${range2.text}"
|
||||
} else if (range1.text.toString() != "" && range2.text.toString() == "") {
|
||||
range = "${range1.text}"
|
||||
} else if (range1.text.toString() == "" && range2.text.toString() != "") {
|
||||
range = "${range2.text}"
|
||||
} else {
|
||||
range = ""
|
||||
}
|
||||
|
||||
viewModel.search(
|
||||
pageSize,
|
||||
currentPage,
|
||||
startDate.text.toString(),
|
||||
endDate.text.toString(),
|
||||
countryTypeValue,
|
||||
"",//flight.text.toString(),
|
||||
flightTypeValue,
|
||||
fno.text.toString(),
|
||||
range,
|
||||
inOrOutValue
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置数据,搜索
|
||||
*/
|
||||
private fun resetSearch() {
|
||||
//recyclerView 清除所有数据数据
|
||||
refreshLayout.setNoMoreData(false)
|
||||
adapter.notifyItemRangeRemoved(0, collectList.size)
|
||||
collectList.clear()
|
||||
currentPage = 1
|
||||
searchFun()
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置筛选条件
|
||||
*/
|
||||
private fun resetFun() {
|
||||
currentPage = 1
|
||||
val format = ymdSdf.format(Date())
|
||||
startDate.text = format
|
||||
endDate.text = ymdSdf.format(calendar.time)
|
||||
fno.setText("")
|
||||
flightType.text = ""
|
||||
flightTypeValue = ""
|
||||
//flight.setText("")
|
||||
inOrOut.text = ""
|
||||
inOrOutValue = ""
|
||||
countryType.text = ""
|
||||
countryTypeValue = ""
|
||||
range1.setText("")
|
||||
range2.setText("")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package com.lukouguoji.hangban.activity
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.core.widget.NestedScrollView
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.lukouguoji.hangban.R
|
||||
import com.lukouguoji.hangban.adapt.HangBanQueryInfoListAdapter
|
||||
import com.lukouguoji.hangban.model.HangBanQueryInfo
|
||||
import com.lukouguoji.hangban.viewModel.HangBanQueryInfoViewModel
|
||||
import com.lukouguoji.module_base.BaseActivity
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
|
||||
@Route(path = ARouterConstants.ACTIVITY_URL_HANG_BAN_QUERY_INFO)
|
||||
class HangBanQueryInfoActivity : BaseActivity(), View.OnClickListener {
|
||||
private lateinit var viewModel: HangBanQueryInfoViewModel
|
||||
|
||||
private lateinit var scrollView: NestedScrollView
|
||||
private lateinit var gncQueryInfoList: RecyclerView
|
||||
private lateinit var adapter: HangBanQueryInfoListAdapter
|
||||
private val queryInfoAdapterList = arrayListOf<HangBanQueryInfo>()
|
||||
|
||||
@JvmField
|
||||
@Autowired
|
||||
var id: Int = -9999
|
||||
|
||||
private fun initView() {
|
||||
viewModel = ViewModelProvider(this).get(HangBanQueryInfoViewModel::class.java)
|
||||
|
||||
scrollView = findViewById(R.id.scrollView)
|
||||
|
||||
val layoutManager = GridLayoutManager(this, 2)
|
||||
adapter = HangBanQueryInfoListAdapter(this, queryInfoAdapterList)
|
||||
gncQueryInfoList = findViewById(R.id.gncQueryInfoList)
|
||||
gncQueryInfoList.adapter = adapter
|
||||
gncQueryInfoList.layoutManager = layoutManager
|
||||
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_hang_ban_query_info)
|
||||
setBackArrow("航班查询详情")
|
||||
initView()
|
||||
|
||||
viewModel.queryFlightByIdHangBan(id)
|
||||
viewModel.queryFlightByIdHangBanObserver.observe(this) {
|
||||
val status = it.getString("status")
|
||||
if (Constant.Result.succ == status) {
|
||||
viewModel.wayBillInfo = it.getJSONObject("data")
|
||||
//航班日期 fdate -> 2022-06-08
|
||||
adapter.append(HangBanQueryInfo(1, "航班日期", viewModel.wayBillInfo.getString("fdate") ?: ""))
|
||||
//航班号 fno -> MU2021
|
||||
adapter.append(HangBanQueryInfo(1, "航班号", viewModel.wayBillInfo.getString("fno") ?: ""))
|
||||
//航程 range -> HFE-PEK
|
||||
adapter.append(HangBanQueryInfo(1, "航程", viewModel.wayBillInfo.getString("range") ?: ""))
|
||||
//经停 jtz -> null
|
||||
adapter.append(HangBanQueryInfo(1, "经停", viewModel.wayBillInfo.getString("jtz") ?: ""))
|
||||
//计划到达 scheduledArrival -> 2022-06-08 22:00:00
|
||||
adapter.append(HangBanQueryInfo(1, "计划到达", viewModel.wayBillInfo.getString("scheduledArrival") ?: ""))
|
||||
//计划起飞 scheduledTackOff -> 2022-06-08 20:00:00
|
||||
adapter.append(HangBanQueryInfo(1, "计划起飞", viewModel.wayBillInfo.getString("scheduledTackOff") ?: ""))
|
||||
//预计到达 estimatedArrival -> 2022-06-08 22:30:00
|
||||
adapter.append(HangBanQueryInfo(1, "预计到达", viewModel.wayBillInfo.getString("estimatedArrival") ?: ""))
|
||||
//预计起飞 estimatedTakeOff -> 2022-06-08 21:00:00
|
||||
adapter.append(HangBanQueryInfo(1, "预计起飞", viewModel.wayBillInfo.getString("estimatedTakeOff") ?: ""))
|
||||
//实际到达 actualArrival -> null
|
||||
adapter.append(HangBanQueryInfo(1, "实际到达", viewModel.wayBillInfo.getString("actualArrival") ?: ""))
|
||||
//实际起飞 actualTakeOff -> null
|
||||
adapter.append(HangBanQueryInfo(1, "实际起飞", viewModel.wayBillInfo.getString("actualTakeOff") ?: ""))
|
||||
//地区类型 countryType -> 国内
|
||||
adapter.append(HangBanQueryInfo(1, "地区类型", viewModel.wayBillInfo.getString("countryType") ?: ""))
|
||||
//服务类型 serviceType -> 客机
|
||||
adapter.append(HangBanQueryInfo(1, "服务类型", viewModel.wayBillInfo.getString("serviceType") ?: ""))
|
||||
//航班状态 flightStatus -> null
|
||||
adapter.append(HangBanQueryInfo(1, "航班状态", viewModel.wayBillInfo.getString("flightStatus") ?: ""))
|
||||
//飞行状态 portCode
|
||||
adapter.append(HangBanQueryInfo(1, "飞行状态", viewModel.wayBillInfo.getString("portCode") ?: ""))
|
||||
//延误原因 delayFreeText -> null
|
||||
adapter.append(HangBanQueryInfo(1, "延误原因", viewModel.wayBillInfo.getString("delayFreeText") ?: ""))
|
||||
//机型 aircraftCode -> 319
|
||||
adapter.append(HangBanQueryInfo(1, "机型", viewModel.wayBillInfo.getString("aircraftCode") ?: ""))
|
||||
//机号 registration -> null
|
||||
adapter.append(HangBanQueryInfo(1, "机号", viewModel.wayBillInfo.getString("registration") ?: ""))
|
||||
|
||||
} else {
|
||||
//无数据
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
v?.let {
|
||||
when (it.id) {
|
||||
else -> {
|
||||
Toast.makeText(this, "未找到对应操作", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.lukouguoji.hangban.adapt
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.lukouguoji.hangban.R
|
||||
import com.lukouguoji.hangban.model.HangBanListModel
|
||||
import com.lukouguoji.hangban.viewModel.HangBanListViewModel
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
|
||||
class HangBanListAdapter(
|
||||
val activity: Activity,
|
||||
private val viewModel: HangBanListViewModel,
|
||||
private val collectList: MutableList<HangBanListModel>
|
||||
) :
|
||||
RecyclerView.Adapter<HangBanListAdapter.ViewHolder>() {
|
||||
|
||||
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
val fdate: TextView = view.findViewById(R.id.fdate)
|
||||
val fno: TextView = view.findViewById(R.id.fno)
|
||||
val range: TextView = view.findViewById(R.id.range)
|
||||
val countryType: TextView = view.findViewById(R.id.countryType)
|
||||
val jtz: TextView = view.findViewById(R.id.jtz)
|
||||
|
||||
val inLayout: LinearLayout = view.findViewById(R.id.inLayout)
|
||||
val scheduledArrival: TextView = view.findViewById(R.id.scheduledArrival)
|
||||
val estimatedArrival: TextView = view.findViewById(R.id.estimatedArrival)
|
||||
val actualArrival: TextView = view.findViewById(R.id.actualArrival)
|
||||
|
||||
val outLayout: LinearLayout = view.findViewById(R.id.outLayout)
|
||||
val scheduledTackOff: TextView = view.findViewById(R.id.scheduledTackOff)
|
||||
val estimatedTakeOff: TextView = view.findViewById(R.id.estimatedTakeOff)
|
||||
val actualTakeOff: TextView = view.findViewById(R.id.actualTakeOff)
|
||||
|
||||
val delayFreeText: TextView = view.findViewById(R.id.delayFreeText)
|
||||
|
||||
/* val serviceType: TextView = view.findViewById(R.id.serviceType)
|
||||
val flightStatus: TextView = view.findViewById(R.id.flightStatus)
|
||||
val aircraftCode: TextView = view.findViewById(R.id.aircraftCode)
|
||||
val standId: TextView = view.findViewById(R.id.standId)*/
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.hang_ban_list_item, parent, false)
|
||||
val viewHolder = ViewHolder(view)
|
||||
|
||||
viewHolder.itemView.setOnClickListener {
|
||||
|
||||
var adapterPosition = viewHolder.adapterPosition
|
||||
if (adapterPosition < 0 || collectList.isEmpty()) {
|
||||
return@setOnClickListener
|
||||
}
|
||||
var queryList = collectList[adapterPosition]
|
||||
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_HANG_BAN_QUERY_INFO).withInt("id", queryList.id)
|
||||
.navigation()
|
||||
|
||||
}
|
||||
|
||||
return viewHolder
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val collect = collectList[position]
|
||||
|
||||
//0出港 1进港
|
||||
if (collect.status == "0") {
|
||||
holder.outLayout.visibility = View.VISIBLE
|
||||
holder.inLayout.visibility = View.GONE
|
||||
} else {
|
||||
holder.inLayout.visibility = View.VISIBLE
|
||||
holder.outLayout.visibility = View.GONE
|
||||
}
|
||||
|
||||
holder.fdate.text = collect.fdate
|
||||
holder.fno.text = collect.fno
|
||||
holder.range.text = collect.range
|
||||
holder.countryType.text = collect.countryType
|
||||
holder.jtz.text = collect.jtz
|
||||
|
||||
holder.scheduledArrival.text = collect.scheduledArrival
|
||||
holder.estimatedArrival.text = collect.estimatedArrival
|
||||
|
||||
holder.actualArrival.text = collect.actualArrival
|
||||
holder.scheduledTackOff.text = collect.scheduledTackOff
|
||||
holder.estimatedTakeOff.text = collect.estimatedTakeOff
|
||||
holder.actualTakeOff.text = collect.actualTakeOff
|
||||
|
||||
holder.delayFreeText.text = collect.delayFreeText
|
||||
|
||||
/*holder.serviceType.text = collect.serviceType
|
||||
holder.flightStatus.text = collect.flightStatus
|
||||
if (collect.flightStatus.contains("延误")) {
|
||||
holder.flightStatus.setTextColor(activity.resources.getColor(R.color.red, activity.theme))
|
||||
}
|
||||
holder.aircraftCode.text = collect.aircraftCode
|
||||
holder.standId.text = collect.standId*/
|
||||
}
|
||||
|
||||
override fun getItemCount() = collectList.size
|
||||
|
||||
fun append(hangBanListModel: HangBanListModel) {
|
||||
collectList.add(hangBanListModel)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.lukouguoji.hangban.adapt
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.EditText
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.lukouguoji.hangban.R
|
||||
import com.lukouguoji.hangban.model.HangBanQueryInfo
|
||||
|
||||
/**
|
||||
* 出港查询详情
|
||||
*/
|
||||
class HangBanQueryInfoListAdapter(val activity: Activity, val collectList: MutableList<HangBanQueryInfo>) :
|
||||
RecyclerView.Adapter<HangBanQueryInfoListAdapter.ViewHolder>() {
|
||||
|
||||
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
val title: TextView = view.findViewById(R.id.title)
|
||||
val content: EditText = view.findViewById(R.id.content)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.hang_ban_query_info_item, parent, false)
|
||||
val viewHolder = ViewHolder(view)
|
||||
|
||||
/* viewHolder.itemView.setOnClickListener {
|
||||
|
||||
var adapterPosition = viewHolder.adapterPosition
|
||||
if (adapterPosition < 0 || collectList.isEmpty()) {
|
||||
return@setOnClickListener
|
||||
}
|
||||
var gncFuBang = collectList[adapterPosition]
|
||||
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GOUT_FU_BANG_ACTIVITY).withString("userIdParam", gncFuBang.useId.toString())
|
||||
.navigation(activity, Constant.RequestCode.gnc_shouyun_list_refresh)
|
||||
|
||||
}
|
||||
*/
|
||||
return viewHolder
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val collect = collectList[position]
|
||||
holder.title.text = collect.title
|
||||
holder.content.setText(collect.content)
|
||||
}
|
||||
|
||||
override fun getItemCount() = collectList.size
|
||||
|
||||
fun append(hangBanQueryInfo: HangBanQueryInfo) {
|
||||
collectList.add(hangBanQueryInfo)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.lukouguoji.hangban.model
|
||||
|
||||
class HangBanListModel(
|
||||
val id: Int,
|
||||
val fdate: String,// --航班日期
|
||||
val fno: String,// --航班号
|
||||
val range: String,// --航程
|
||||
val jtz: String,// --经停
|
||||
val scheduledArrival: String,// --计划到达
|
||||
val estimatedArrival: String,// --预计到达
|
||||
val actualArrival: String,// --实际到达
|
||||
val scheduledTackOff: String,// --计划起飞
|
||||
val estimatedTakeOff: String,// --预计起飞
|
||||
val actualTakeOff: String,// --实际起飞
|
||||
val countryType: String,// --地区类型
|
||||
val serviceType: String,// --服务类型
|
||||
val flightStatus: String,// --航班状态
|
||||
val delayFreeText: String,// --延误原因
|
||||
val aircraftCode: String,// --机型
|
||||
val standId: String,// --机号
|
||||
val status: String,// --0:出港 1:进港
|
||||
)
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.lukouguoji.hangban.model
|
||||
|
||||
class HangBanQueryInfo(
|
||||
val id: Int,
|
||||
val title: String,
|
||||
val content: String
|
||||
)
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.lukouguoji.hangban.viewModel
|
||||
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.*
|
||||
import com.alibaba.fastjson.JSONArray
|
||||
import com.alibaba.fastjson.JSONObject
|
||||
import com.lukouguoji.module_base.common.String.emptyToNull
|
||||
import com.lukouguoji.module_base.http.user.UserNetwork
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
||||
class HangBanListViewModel : ViewModel() {
|
||||
|
||||
/**
|
||||
* 分页搜索
|
||||
*/
|
||||
private val searchParam = MutableLiveData<JSONObject>()
|
||||
val searchParamLive = Transformations.switchMap(searchParam) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
val response = UserNetwork.searchHangBan(param)
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e("GoutCollectionViewModel", e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun search(
|
||||
limit: Int,
|
||||
page: Int,
|
||||
beginDate: String,
|
||||
endDate: String,
|
||||
countryType: String,
|
||||
flight: String,
|
||||
flightType: String,
|
||||
fno: String,
|
||||
range: String,
|
||||
status: String
|
||||
) {
|
||||
|
||||
val param = JSONObject()
|
||||
param["limit"] = limit
|
||||
param["page"] = page
|
||||
param["beginDate"] = beginDate.emptyToNull()
|
||||
param["endDate"] = endDate.emptyToNull()
|
||||
param["countryType"] = countryType.emptyToNull()
|
||||
param["flight"] = flight.emptyToNull()
|
||||
param["flightType"] = flightType.emptyToNull()
|
||||
param["fno"] = fno.emptyToNull()
|
||||
param["range"] = range.emptyToNull()
|
||||
param["status"] = status.emptyToNull()
|
||||
|
||||
searchParam.value = param
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 航班类型
|
||||
*/
|
||||
var flightTypeList = JSONArray()
|
||||
private val flightTypeLiveData = MutableLiveData<String>()
|
||||
fun flightType(time: String) {
|
||||
flightTypeLiveData.value = time
|
||||
}
|
||||
|
||||
val flightTypeObserver = Transformations.switchMap(flightTypeLiveData) { _ ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
var response = UserNetwork.flightType()
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e("GoutStartViewModel", e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 地区类型
|
||||
*/
|
||||
var countryTypeList = JSONArray()
|
||||
private val countryTypeLiveData = MutableLiveData<String>()
|
||||
fun countryType(time: String) {
|
||||
countryTypeLiveData.value = time
|
||||
}
|
||||
|
||||
val countryTypeObserver = Transformations.switchMap(countryTypeLiveData) { _ ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
var response = UserNetwork.countryType()
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e("GoutStartViewModel", e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 进出港
|
||||
*/
|
||||
val inOrOutList = JSONArray()
|
||||
fun initInOrOutList(){
|
||||
val inOrOutObj1 = JSONObject()
|
||||
inOrOutObj1["code"] = ""
|
||||
inOrOutObj1["name"] = "请选择进出港"
|
||||
inOrOutList.add(inOrOutObj1)
|
||||
|
||||
val inOrOutObj2 = JSONObject()
|
||||
inOrOutObj2["code"] = "0"
|
||||
inOrOutObj2["name"] = "出港"
|
||||
inOrOutList.add(inOrOutObj2)
|
||||
|
||||
val inOrOutObj3 = JSONObject()
|
||||
inOrOutObj3["code"] = "1"
|
||||
inOrOutObj3["name"] = "进港"
|
||||
inOrOutList.add(inOrOutObj3)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.lukouguoji.hangban.viewModel
|
||||
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.liveData
|
||||
import com.alibaba.fastjson.JSONObject
|
||||
import com.lukouguoji.module_base.http.user.UserNetwork
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
||||
class HangBanQueryInfoViewModel : ViewModel() {
|
||||
|
||||
private val logName = "GncQueryInfoViewModel"
|
||||
|
||||
var wayBillInfo = JSONObject()
|
||||
|
||||
/**
|
||||
* 出港查询详情
|
||||
*/
|
||||
private val queryFlightByIdHangBanLiveData = MutableLiveData<Int>()
|
||||
val queryFlightByIdHangBanObserver = Transformations.switchMap(queryFlightByIdHangBanLiveData) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
var response = JSONObject()
|
||||
if (param != -9999) {
|
||||
response = UserNetwork.queryFlightByIdHangBan(param)
|
||||
}
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e(logName, e.stackTraceToString())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun queryFlightByIdHangBan(wbId: Int) {
|
||||
queryFlightByIdHangBanLiveData.value = wbId
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
23
module_hangban/src/main/release/AndroidManifest.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.lukouguoji.hangban">
|
||||
|
||||
<application>
|
||||
<activity
|
||||
android:name=".activity.HangBanQueryInfoActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.HangBanQueryActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape"
|
||||
android:exported="true" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -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>
|
||||
170
module_hangban/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -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,87 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/list_bg"
|
||||
tools:context=".activity.HangBanQueryInfoActivity">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<!--运单信息 中间-->
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/scrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_weight="5"
|
||||
android:background="@drawable/collect_item_shape"
|
||||
android:overScrollMode="never"
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!--主运单详情 内容区-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/gncQueryInfoList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
|
||||
<!-- 底部-->
|
||||
<!--<LinearLayout
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/submit"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/submit_shape"
|
||||
android:gravity="center"
|
||||
android:text="运单流程图"
|
||||
android:textColor="@color/white"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>-->
|
||||
</LinearLayout>
|
||||
610
module_hangban/src/main/res/layout/activity_hangban_query.xml
Normal file
@@ -0,0 +1,610 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activity.HangBanQueryActivity"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/main_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@color/colorPrimary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tool_back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:src="@mipmap/left_icon"
|
||||
app:tint="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|left"
|
||||
android:text="返回"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="航班查询"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<!-- 搜索、列表页-->
|
||||
<LinearLayout
|
||||
android:id="@+id/searchListFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<!-- 搜索 框 列表区域-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/list_bg"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp"
|
||||
>
|
||||
<!-- 搜索框 区域-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp">
|
||||
<!--提取开始时间-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:background="@drawable/bg_search_row"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/startDate"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:hint="航班日期"
|
||||
android:textSize="15dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/startDateIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/calendar_icon"
|
||||
app:tint="@color/weak_grey" />
|
||||
|
||||
</LinearLayout>
|
||||
<!-- 空格-->
|
||||
<LinearLayout
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<!--提取结束时间-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/bg_search_row"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/endDate"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:hint="航班结束时间"
|
||||
android:textSize="15dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/endDateIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/calendar_icon"
|
||||
app:tint="@color/weak_grey" />
|
||||
|
||||
</LinearLayout>
|
||||
<!-- 空格-->
|
||||
<LinearLayout
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 航班号-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_search_row">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/fno"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:gravity="center"
|
||||
android:hint="请输入航班号"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
android:textSize="15dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!--航班类型 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_search_row"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/flightType"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:gravity="center"
|
||||
android:hint="请选择航班类型"
|
||||
android:singleLine="true"
|
||||
android:textSize="15dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="match_parent" />
|
||||
<!-- 搜索图标-->
|
||||
<LinearLayout
|
||||
android:id="@+id/searchLayout"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:background="@drawable/search_shape_gnc_ware_house2"
|
||||
android:padding="10dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@mipmap/search"
|
||||
app:tint="@color/colorPrimary" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="10dp"
|
||||
android:visibility="gone"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 筛选图标-->
|
||||
<LinearLayout
|
||||
android:id="@+id/filtrateLayout"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/search_shape_gnc_ware_house2"
|
||||
android:padding="10dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@mipmap/filtrate"
|
||||
app:tint="@color/colorPrimary" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/input_shape"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<View
|
||||
android:id="@+id/leftIcon"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:text="航班"
|
||||
android:layout_margin="@dimen/dp_4"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="@dimen/dp_100"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:layout_margin="@dimen/dp_4"
|
||||
android:text="航程"
|
||||
android:textColor="@color/weak_grey" />
|
||||
<TextView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:layout_margin="@dimen/dp_4"
|
||||
android:text="计划"
|
||||
android:textColor="@color/weak_grey" />
|
||||
<TextView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:layout_margin="@dimen/dp_4"
|
||||
android:text="预计"
|
||||
android:textColor="@color/weak_grey" />
|
||||
<TextView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:layout_margin="@dimen/dp_4"
|
||||
android:text="实际"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
</LinearLayout>
|
||||
<!--列表-->
|
||||
<LinearLayout
|
||||
android:id="@+id/listLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/refreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.scwang.smart.refresh.header.ClassicsHeader
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/collectList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never" />
|
||||
|
||||
<com.scwang.smart.refresh.footer.ClassicsFooter
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 筛选 页-->
|
||||
<LinearLayout
|
||||
android:id="@+id/filtrateFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/list_bg"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<!-- 筛选内容-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="40dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginRight="40dp"
|
||||
android:layout_weight="5"
|
||||
android:background="@drawable/home_shape"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="50dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="50dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 过滤航班-->
|
||||
<!--<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|right"
|
||||
android:text="过滤航班" />
|
||||
|
||||
<!–内容–>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="3"
|
||||
android:background="@drawable/input_shape"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/flight"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:hint="请输入过滤航班"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>-->
|
||||
|
||||
|
||||
<!-- 进出港-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|right"
|
||||
android:text="进出港" />
|
||||
|
||||
<!--内容-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="3"
|
||||
android:background="@drawable/input_shape"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/inOrOut"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center|start"
|
||||
android:hint="请选择进出港"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 地区类型-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|right"
|
||||
android:text="地区类型" />
|
||||
|
||||
<!--内容-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="3"
|
||||
android:background="@drawable/input_shape"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/countryType"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center|start"
|
||||
android:hint="请选择地区类型"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<!-- 航程-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|right"
|
||||
android:text="航程" />
|
||||
|
||||
<!--内容-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="3"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/range1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="10dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_shape"
|
||||
android:hint=""
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
/>
|
||||
|
||||
<View
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="1px"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@color/black" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/range2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="10dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_shape"
|
||||
android:hint=""
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 底部-->
|
||||
<LinearLayout
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reset"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/submit_shape"
|
||||
android:gravity="center"
|
||||
android:text="重置"
|
||||
android:textColor="@color/white"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/submit"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/submit_shape"
|
||||
android:gravity="center"
|
||||
android:text="搜索"
|
||||
android:textColor="@color/white"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
18
module_hangban/src/main/res/layout/activity_main.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Hello World!"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
401
module_hangban/src/main/res/layout/hang_ban_list_item.xml
Normal file
@@ -0,0 +1,401 @@
|
||||
<?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:layout_marginTop="1dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:background="@drawable/collect_item_shape"
|
||||
android:orientation="horizontal"
|
||||
android:padding="3dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/leftIcon"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/gnc_ware_house_left_icon" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 第一行-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 航班日期-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="6"
|
||||
android:visibility="gone"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="航班日期"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fdate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 航班号-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="3"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="航班号"
|
||||
android:visibility="gone"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fno"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 航程-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="4"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="航程"
|
||||
android:visibility="gone"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/range"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 经停-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="经停"
|
||||
android:visibility="gone"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/jtz"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 第二行-->
|
||||
<LinearLayout
|
||||
android:id="@+id/inLayout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 计划到达-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
android:text="计划到达"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/scheduledArrival"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 预计到达-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="预计到达"
|
||||
android:visibility="gone"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/estimatedArrival"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 实际到达-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
android:text="实际到达"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/actualArrival"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 第三行-->
|
||||
<LinearLayout
|
||||
android:id="@+id/outLayout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 计划起飞-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
android:text="计划起飞"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/scheduledTackOff"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 预计起飞-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
android:text="预计起飞"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/estimatedTakeOff"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<!-- 实际起飞-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
android:text="实际起飞"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/actualTakeOff"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<!-- 分割线-->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="@drawable/dash_line"
|
||||
android:layerType="software" />
|
||||
|
||||
<!-- 第四行-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
<!-- 地区类型-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
android:text="地区类型"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/countryType"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
<!-- 延误原因-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="3"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="延误原因"
|
||||
android:textColor="@color/weak_grey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/delayFreeText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/weak_grey2"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?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:gravity="start|center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:padding="3dp">
|
||||
|
||||
<!--内容-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/input_shape"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:gravity="start|center"
|
||||
android:text="过磅重量" />
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="3"
|
||||
android:gravity="center|start"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:cursorVisible="false"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:text="0.0"
|
||||
|
||||
android:textColor="@color/black"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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" />
|
||||
</adaptive-icon>
|
||||
BIN
module_hangban/src/main/res/mipmap-hdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
module_hangban/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
module_hangban/src/main/res/mipmap-mdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 982 B |
BIN
module_hangban/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
module_hangban/src/main/res/mipmap-xhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
module_hangban/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
module_hangban/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
module_hangban/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
module_hangban/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
16
module_hangban/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Aerologic" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
||||
10
module_hangban/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="hb_purple_200">#FFBB86FC</color>
|
||||
<color name="hb_purple_500">#FF6200EE</color>
|
||||
<color name="hb_purple_700">#FF3700B3</color>
|
||||
<color name="hb_teal_200">#FF03DAC5</color>
|
||||
<color name="hb_teal_700">#FF018786</color>
|
||||
<color name="hb_black">#FF000000</color>
|
||||
<color name="hb_white">#FFFFFFFF</color>
|
||||
</resources>
|
||||
3
module_hangban/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="hb_app_name">My Application</string>
|
||||
</resources>
|
||||
16
module_hangban/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="hb_Theme.Aerologic" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_700</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.lukouguoji.hangban
|
||||
|
||||
import org.junit.Test
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
class ExampleUnitTest {
|
||||
@Test
|
||||
fun addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2)
|
||||
}
|
||||
}
|
||||