init: init proj
1
module_cargo/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
76
module_cargo/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.cargo"
|
||||
}
|
||||
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_cargo/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.cargo
|
||||
|
||||
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.cargo", appContext.packageName)
|
||||
}
|
||||
}
|
||||
11
module_cargo/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<application>
|
||||
<activity
|
||||
android:name="com.lukouguoji.cargo.activity.CargoTrackingActivity"
|
||||
android:exported="false"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape"
|
||||
/>
|
||||
</application>
|
||||
</manifest>
|
||||
25
module_cargo/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.cargo">
|
||||
|
||||
<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.cargo
|
||||
|
||||
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,353 @@
|
||||
package com.lukouguoji.cargo.activity
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.fastjson.JSONArray
|
||||
import com.alibaba.fastjson.JSONObject
|
||||
import com.lukouguoji.cargo.R
|
||||
import com.lukouguoji.cargo.adapt.CargoTrackingListAdapter
|
||||
import com.lukouguoji.cargo.adapt.CargoTrackingToLeftListAdapter
|
||||
import com.lukouguoji.cargo.model.CargoTrackingList
|
||||
import com.lukouguoji.cargo.viewModel.CargoTrackingListViewModel
|
||||
import com.lukouguoji.module_base.BaseActivity
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.common.Constant.CargoTracking.Companion.exportStatus
|
||||
import com.lukouguoji.module_base.common.Constant.CargoTracking.Companion.gjStatus
|
||||
import com.lukouguoji.module_base.common.Constant.CargoTracking.Companion.gnStatus
|
||||
import com.lukouguoji.module_base.common.Constant.CargoTracking.Companion.importStatus
|
||||
import com.lukouguoji.module_base.common.String.isValidInt
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
|
||||
@Route(path = ARouterConstants.ACTIVITY_URL_CARGO_TRACKING)
|
||||
class CargoTrackingActivity : BaseActivity(), View.OnClickListener {
|
||||
private lateinit var viewModel: CargoTrackingListViewModel
|
||||
|
||||
private lateinit var adapter: CargoTrackingListAdapter
|
||||
private val collectList = ArrayList<CargoTrackingList>()
|
||||
private lateinit var adapter2: CargoTrackingToLeftListAdapter
|
||||
private val collectList2 = ArrayList<CargoTrackingList>()
|
||||
|
||||
//搜索条件
|
||||
private lateinit var wbNo: EditText
|
||||
private lateinit var wbNoScan: ImageView
|
||||
private lateinit var countryType: TextView
|
||||
private lateinit var ieFlag: TextView
|
||||
private lateinit var searchLayout: LinearLayout
|
||||
|
||||
private val countryTypeList = JSONArray()//地区类型
|
||||
private var countryTypeCode = ""
|
||||
private val ieFlagList = JSONArray()//进出港
|
||||
private var ieFlagCode = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired
|
||||
var countryTypeParam: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired
|
||||
var ieFlagParam: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired
|
||||
var wbNoParam: String? = null
|
||||
|
||||
private fun initView() {
|
||||
viewModel = ViewModelProvider(this).get(CargoTrackingListViewModel::class.java)
|
||||
val layoutManager = LinearLayoutManager(this)
|
||||
layoutManager.orientation = RecyclerView.HORIZONTAL
|
||||
adapter = CargoTrackingListAdapter(this, collectList)
|
||||
var recyclerView: RecyclerView = findViewById(R.id.recyclerList)
|
||||
recyclerView.layoutManager = layoutManager
|
||||
recyclerView.adapter = adapter
|
||||
|
||||
val layoutManager2 = LinearLayoutManager(this)
|
||||
layoutManager2.orientation = RecyclerView.HORIZONTAL
|
||||
layoutManager2.reverseLayout = true
|
||||
adapter2 = CargoTrackingToLeftListAdapter(this, collectList2)
|
||||
var recyclerView2: RecyclerView = findViewById(R.id.recyclerList2)
|
||||
recyclerView2.layoutManager = layoutManager2
|
||||
recyclerView2.adapter = adapter2
|
||||
|
||||
wbNo = findViewById(R.id.wbNo)
|
||||
wbNoScan = findViewById(R.id.wbNoScan)
|
||||
countryType = findViewById(R.id.countryType)
|
||||
ieFlag = findViewById(R.id.ieFlag)
|
||||
searchLayout = findViewById(R.id.searchLayout)
|
||||
|
||||
wbNoScan.setOnClickListener(this)
|
||||
searchLayout.setOnClickListener(this)
|
||||
countryType.setOnClickListener(this)
|
||||
ieFlag.setOnClickListener(this)
|
||||
|
||||
countryType.text = "国内"
|
||||
countryTypeCode = gnStatus
|
||||
ieFlag.text = "进港"
|
||||
ieFlagCode = importStatus
|
||||
|
||||
/////////////// 下拉框 start
|
||||
countryTypeList.clear()
|
||||
val countryType1 = JSONObject()
|
||||
countryType1["name"] = "国内"
|
||||
countryType1["code"] = gnStatus
|
||||
val countryType2 = JSONObject()
|
||||
countryType2["name"] = "国际"
|
||||
countryType2["code"] = gjStatus
|
||||
countryTypeList.add(countryType1)
|
||||
countryTypeList.add(countryType2)
|
||||
|
||||
ieFlagList.clear()
|
||||
val ieFlag1 = JSONObject()
|
||||
ieFlag1["name"] = "进港"
|
||||
ieFlag1["code"] = importStatus
|
||||
val ieFlag2 = JSONObject()
|
||||
ieFlag2["name"] = "出港"
|
||||
ieFlag2["code"] = exportStatus
|
||||
ieFlagList.add(ieFlag1)
|
||||
ieFlagList.add(ieFlag2)
|
||||
/////////////// 下拉框 end
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_cargo_tracking)
|
||||
setBackArrow("货物状态查询")
|
||||
initView()
|
||||
|
||||
//搜索查询
|
||||
viewModel.searchParamLive.observe(this) {
|
||||
loadingCancel()
|
||||
val status = it.getString("status")
|
||||
if (Constant.Result.succ == status) {
|
||||
val dataObject = it.getJSONObject("data")
|
||||
|
||||
val countryType = dataObject.getString("countryType") ?: ""
|
||||
val ieFlag = dataObject.getString("ieFlag") ?: ""
|
||||
val status = dataObject.getString("status") ?: ""
|
||||
val businessType = dataObject.getString("businessType") ?: ""
|
||||
|
||||
//赋值循环
|
||||
collectList.clear()
|
||||
collectList2.clear()
|
||||
val checkCargoList = getCheckCargoList(countryType, ieFlag, status, businessType)
|
||||
if (checkCargoList.size > 7) {
|
||||
collectList.addAll(checkCargoList.subList(0, 7))
|
||||
adapter.notifyDataSetChanged()
|
||||
|
||||
val subList2 = checkCargoList.subList(7, checkCargoList.size)
|
||||
var limitNum = 7 - subList2.size
|
||||
while (limitNum > 0) {
|
||||
subList2.add(CargoTrackingList(""))
|
||||
--limitNum
|
||||
}
|
||||
collectList2.addAll(checkCargoList.subList(7, checkCargoList.size))
|
||||
adapter2.notifyDataSetChanged()
|
||||
} else {
|
||||
collectList.addAll(checkCargoList)
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//国内际、进出港运单流程图 -> 路由带值过来,主动查询
|
||||
if (countryTypeParam != null && ieFlagParam != null && wbNoParam != null) {
|
||||
ieFlagList.forEach { obj ->
|
||||
val temp = obj as JSONObject
|
||||
val code = temp.getString("code")
|
||||
if (ieFlagParam == code) {
|
||||
val name = temp.getString("name")
|
||||
ieFlag.text = name
|
||||
ieFlagCode = code
|
||||
}
|
||||
}
|
||||
countryTypeList.forEach { obj ->
|
||||
val temp = obj as JSONObject
|
||||
val code = temp.getString("code")
|
||||
if (countryTypeParam == code) {
|
||||
val name = temp.getString("name")
|
||||
countryType.text = name
|
||||
countryTypeCode = code
|
||||
}
|
||||
}
|
||||
wbNo.setText(wbNoParam)
|
||||
searchFun()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* onActivityResult 回调
|
||||
*/
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
|
||||
// 扫描二维码/条码回传
|
||||
if (requestCode == Constant.RequestCode.cargo_query_wbno_scan && resultCode == RESULT_OK) {
|
||||
if (data != null) {
|
||||
val content =
|
||||
data.getStringExtra(com.yzq.zxinglibrary.common.Constant.CODED_CONTENT)
|
||||
wbNo.setText(content)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
v?.let {
|
||||
when (it.id) {
|
||||
R.id.wbNoScan -> {
|
||||
scanCode(Constant.RequestCode.cargo_query_wbno_scan)
|
||||
}
|
||||
|
||||
R.id.countryType -> {
|
||||
Common.singleSelect(
|
||||
this,
|
||||
"地区类型",
|
||||
countryTypeList,
|
||||
countryTypeCode
|
||||
) { _, item ->
|
||||
val jsonObject = item as JSONObject
|
||||
val name = jsonObject.getString("name")
|
||||
val code = jsonObject.getString("code")
|
||||
countryType.text = name
|
||||
countryTypeCode = code
|
||||
}
|
||||
}
|
||||
|
||||
R.id.ieFlag -> {
|
||||
Common.singleSelect(this, "进出港", ieFlagList, ieFlagCode) { _, item ->
|
||||
val jsonObject = item as JSONObject
|
||||
val name = jsonObject.getString("name")
|
||||
val code = jsonObject.getString("code")
|
||||
ieFlag.text = name
|
||||
ieFlagCode = code
|
||||
}
|
||||
}
|
||||
|
||||
R.id.searchLayout -> {
|
||||
searchFun()
|
||||
}
|
||||
|
||||
else -> {
|
||||
Toast.makeText(this, "未找到对应操作", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
private fun searchFun() {
|
||||
viewModel.search(
|
||||
countryTypeCode,
|
||||
ieFlagCode,
|
||||
wbNo.text.toString()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取货物流程列表 未选中
|
||||
*
|
||||
* countryType 地区类型 国内、国际
|
||||
*
|
||||
* ieFlag 进出港
|
||||
*/
|
||||
private fun getCargosStatus(
|
||||
countryType: String,
|
||||
ieFlag: String,
|
||||
status: Int,
|
||||
businessType: String,
|
||||
): ArrayList<CargoTrackingList> {
|
||||
val cargoStatusList = arrayListOf<CargoTrackingList>()
|
||||
val isMail = businessType == "YJE"//是否是邮件
|
||||
/**
|
||||
* 1.国内出港
|
||||
*/
|
||||
if (gnStatus == countryType && exportStatus == ieFlag) {
|
||||
//tw备注2022年7月12日14:16:13:为什么要这么写。是因为原先需要,状态选中的字和未选中的字是不一样的。后来需要改为都一样,偷懒就没修改结构了。变成下面这样,有的判断,有的没加判断。但展示的都一样
|
||||
cargoStatusList.add(CargoTrackingList("数据录入", 1))
|
||||
cargoStatusList.add(CargoTrackingList("收运", 2))
|
||||
cargoStatusList.add(CargoTrackingList("制单", 3))
|
||||
cargoStatusList.add(CargoTrackingList("复磅", 4))
|
||||
cargoStatusList.add(CargoTrackingList("配载", 5))
|
||||
cargoStatusList.add(CargoTrackingList("截载", 6))
|
||||
cargoStatusList.add(CargoTrackingList("航班关闭", 7))
|
||||
}
|
||||
/**
|
||||
* 2.国内进港
|
||||
*/
|
||||
else if (gnStatus == countryType && importStatus == ieFlag) {
|
||||
cargoStatusList.add(CargoTrackingList("舱单录入", 1))
|
||||
cargoStatusList.add(CargoTrackingList("发放", 2))
|
||||
cargoStatusList.add(CargoTrackingList("提取", 3))
|
||||
cargoStatusList.add(CargoTrackingList("出库", 4))
|
||||
}
|
||||
/**
|
||||
* 3.国际出港
|
||||
*/
|
||||
else if (gjStatus == countryType && exportStatus == ieFlag) {
|
||||
cargoStatusList.add(CargoTrackingList("数据录入", 1))
|
||||
if (!isMail)
|
||||
cargoStatusList.add(CargoTrackingList("预配放行", 2))
|
||||
cargoStatusList.add(CargoTrackingList("收运", 3))
|
||||
if (!isMail)
|
||||
cargoStatusList.add(CargoTrackingList("运抵放行", 4))
|
||||
if (!isMail)
|
||||
cargoStatusList.add(CargoTrackingList("海关放行", 5))
|
||||
cargoStatusList.add(CargoTrackingList("板箱组装", 6))
|
||||
cargoStatusList.add(CargoTrackingList("板箱过磅", 7))
|
||||
if (!isMail)
|
||||
cargoStatusList.add(CargoTrackingList("装载放行", 8))
|
||||
|
||||
cargoStatusList.add(CargoTrackingList("出库", 9))
|
||||
cargoStatusList.add(CargoTrackingList("关闭航班", 10))
|
||||
if (!isMail)
|
||||
cargoStatusList.add(CargoTrackingList("理货放行", 11))
|
||||
}
|
||||
/**
|
||||
* 4.国际进港
|
||||
*/
|
||||
else if (gjStatus == countryType && importStatus == ieFlag) {
|
||||
cargoStatusList.add(CargoTrackingList("舱单录入", 1))
|
||||
if (!isMail)
|
||||
cargoStatusList.add(CargoTrackingList("原始舱单放行", 2))
|
||||
if (!isMail)
|
||||
cargoStatusList.add(CargoTrackingList("理货放行", 3))
|
||||
if (!isMail)
|
||||
cargoStatusList.add(CargoTrackingList("海关放行", 4))
|
||||
cargoStatusList.add(CargoTrackingList("出库", 5))
|
||||
}
|
||||
cargoStatusList.forEach {
|
||||
it.setStatusForCurrent(status)
|
||||
}
|
||||
return cargoStatusList
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取对应状态的货物流程图
|
||||
*/
|
||||
private fun getCheckCargoList(
|
||||
countryType: String,
|
||||
ieFlag: String,
|
||||
status: String,
|
||||
businessType: String,
|
||||
): ArrayList<CargoTrackingList> {
|
||||
val resultList = ArrayList<CargoTrackingList>()
|
||||
if (status.isValidInt()) {
|
||||
val num = status.toInt()
|
||||
if (num > 0) {
|
||||
val cargoList = getCargosStatus(countryType, ieFlag, num, businessType)
|
||||
resultList.addAll(cargoList)
|
||||
}
|
||||
}
|
||||
return resultList
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.lukouguoji.cargo.adapt
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.lukouguoji.cargo.R
|
||||
import com.lukouguoji.cargo.model.CargoTrackingList
|
||||
|
||||
/**
|
||||
* 国内出港查询列表
|
||||
*/
|
||||
class CargoTrackingListAdapter(val activity: Activity, private val collectList: List<CargoTrackingList>) :
|
||||
RecyclerView.Adapter<CargoTrackingListAdapter.ViewHolder>() {
|
||||
|
||||
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
val title: TextView = view.findViewById(R.id.title)
|
||||
val rightIcon: ImageView = view.findViewById(R.id.rightIcon)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.cargo_tracking_list_item, parent, false)
|
||||
val viewHolder = ViewHolder(view)
|
||||
|
||||
/*viewHolder.itemView.setOnClickListener {
|
||||
|
||||
var adapterPosition = viewHolder.adapterPosition
|
||||
if (adapterPosition < 0 || collectList.isEmpty()) {
|
||||
return@setOnClickListener
|
||||
}
|
||||
var gncQueryList = collectList[adapterPosition]
|
||||
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJJ_QUERY_INFO).withInt("id", gncQueryList.mawbId)
|
||||
.navigation()
|
||||
|
||||
}*/
|
||||
|
||||
return viewHolder
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val collect = collectList[position]
|
||||
holder.title.text = collect.title
|
||||
if (collect.status) {
|
||||
holder.title.background = ContextCompat.getDrawable(activity, R.drawable.sel_round_shape);
|
||||
} else {
|
||||
holder.title.background = ContextCompat.getDrawable(activity, R.drawable.round_shape);
|
||||
}
|
||||
|
||||
if (position == collectList.size - 1) {
|
||||
holder.rightIcon.visibility = View.GONE
|
||||
}else{
|
||||
holder.rightIcon.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun getItemCount() = collectList.size
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.lukouguoji.cargo.adapt
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.lukouguoji.cargo.R
|
||||
import com.lukouguoji.cargo.model.CargoTrackingList
|
||||
|
||||
/**
|
||||
* 国内出港查询列表
|
||||
*/
|
||||
class CargoTrackingToLeftListAdapter(val activity: Activity, private val collectList: List<CargoTrackingList>) :
|
||||
RecyclerView.Adapter<CargoTrackingToLeftListAdapter.ViewHolder>() {
|
||||
|
||||
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
val toLeftItem: LinearLayout = view.findViewById(R.id.toLeftItem)
|
||||
val title: TextView = view.findViewById(R.id.title)
|
||||
val downIcon: ImageView = view.findViewById(R.id.downIcon)
|
||||
val leftIcon: ImageView = view.findViewById(R.id.leftIcon)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.cargo_tracking_to_left_list_item, parent, false)
|
||||
val viewHolder = ViewHolder(view)
|
||||
|
||||
/*viewHolder.itemView.setOnClickListener {
|
||||
|
||||
var adapterPosition = viewHolder.adapterPosition
|
||||
if (adapterPosition < 0 || collectList.isEmpty()) {
|
||||
return@setOnClickListener
|
||||
}
|
||||
var gncQueryList = collectList[adapterPosition]
|
||||
|
||||
ARouter.getInstance().build(ARouterConstants.ACTIVITY_URL_GJJ_QUERY_INFO).withInt("id", gncQueryList.mawbId)
|
||||
.navigation()
|
||||
|
||||
}*/
|
||||
|
||||
return viewHolder
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val collect = collectList[position]
|
||||
val title = collect.title
|
||||
val status = collect.status
|
||||
|
||||
holder.title.text = title
|
||||
if (status) {
|
||||
holder.title.background = ContextCompat.getDrawable(activity, R.drawable.sel_round_shape);
|
||||
} else {
|
||||
holder.title.background = ContextCompat.getDrawable(activity, R.drawable.round_shape);
|
||||
}
|
||||
|
||||
//第一个展示向下箭头(隐藏占位),不展示向左箭头(隐藏不占位)
|
||||
if (position == 0) {
|
||||
holder.downIcon.visibility = View.VISIBLE
|
||||
holder.leftIcon.visibility = View.GONE
|
||||
} else {
|
||||
holder.downIcon.visibility = View.INVISIBLE
|
||||
holder.leftIcon.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
//title为空,说明只占位,不显示
|
||||
if (title == "") {
|
||||
holder.toLeftItem.visibility = View.INVISIBLE
|
||||
} else {
|
||||
holder.toLeftItem.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun getItemCount() = collectList.size
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.lukouguoji.cargo.model
|
||||
|
||||
class CargoTrackingList(
|
||||
val title: String = "",
|
||||
val statusInt: Int = 0,
|
||||
var status: Boolean = false,//true选中 false未选中
|
||||
) {
|
||||
fun setStatusForCurrent(currentStatus: Int) {
|
||||
this.status = currentStatus >= statusInt
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.lukouguoji.cargo.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.JSONArray
|
||||
import com.alibaba.fastjson.JSONObject
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.common.String.emptyToNull
|
||||
import com.lukouguoji.module_base.http.user.UserNetwork
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
||||
class CargoTrackingListViewModel : ViewModel() {
|
||||
|
||||
private val searchParam = MutableLiveData<JSONObject>()
|
||||
|
||||
val searchParamLive = Transformations.switchMap(searchParam) { param ->
|
||||
liveData(Dispatchers.IO) {
|
||||
try {
|
||||
val response = UserNetwork.searchCargoStatus(param)
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e("GoutCollectionViewModel", e.stackTraceToString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun search(
|
||||
countryType: String,
|
||||
ieFlag: String,
|
||||
wbNo: String
|
||||
) {
|
||||
val param = JSONObject()
|
||||
param["countryType"] = countryType.emptyToNull()
|
||||
param["ieFlag"] = ieFlag.emptyToNull()
|
||||
param["wbNo"] = wbNo.emptyToNull()
|
||||
searchParam.value = param
|
||||
}
|
||||
|
||||
}
|
||||
17
module_cargo/src/main/release/AndroidManifest.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.lukouguoji.cargo">
|
||||
|
||||
<application>
|
||||
<activity android:name=".activity.CargoTrackingActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:screenOrientation="userLandscape"
|
||||
/>
|
||||
<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_cargo/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>
|
||||
6
module_cargo/src/main/res/drawable/sel_round_shape.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/cargo_status_check" />
|
||||
<stroke android:width="1dp" android:color="@color/black"/>
|
||||
</shape>
|
||||
176
module_cargo/src/main/res/layout/activity_cargo_tracking.xml
Normal file
@@ -0,0 +1,176 @@
|
||||
<?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"
|
||||
tools:context=".activity.CargoTrackingActivity"
|
||||
tools:ignore="ResourceName">
|
||||
|
||||
<include layout="@layout/title_tool_bar" />
|
||||
|
||||
<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="match_parent"
|
||||
android:background="@color/list_bg"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<!-- 搜索 区域-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="20dp"
|
||||
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">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/countryType"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_spinner_pda"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="地区类型"
|
||||
android:inputType="text"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:singleLine="true"
|
||||
android:textSize="15dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="20dp"
|
||||
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">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ieFlag"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_spinner_pda"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="进出港"
|
||||
android:inputType="text"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:singleLine="true"
|
||||
android:textSize="15dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="20dp"
|
||||
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">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/wbNo"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/input_edit_text"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="请输入运单号"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:paddingStart="10dp"
|
||||
android:singleLine="true"
|
||||
android:textSize="15dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/wbNoScan"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginRight="10dp"
|
||||
android:src="@mipmap/scan_code"
|
||||
app:tint="@color/weak_grey" />
|
||||
|
||||
</LinearLayout>
|
||||
<!-- 搜索-->
|
||||
<LinearLayout
|
||||
android:id="@+id/searchLayout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="3">
|
||||
|
||||
<ImageView
|
||||
style="@style/iv_search_action"
|
||||
android:src="@drawable/img_search"
|
||||
app:tint="@color/colorPrimary" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!--列表区域-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerList"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:overScrollMode="never" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerList2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:overScrollMode="never" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
18
module_cargo/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>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@drawable/round_shape"
|
||||
android:gravity="center"
|
||||
android:maxLines="2"
|
||||
android:text="关闭航班"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rightIcon"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/right_icon" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="120dp"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:id="@+id/toLeftItem"
|
||||
android:visibility="visible">
|
||||
|
||||
<!-- 上下布局-->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 向下箭头-->
|
||||
<LinearLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_gravity="start"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/downIcon"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:src="@mipmap/down_icon" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<!-- 下面布局-->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@drawable/round_shape"
|
||||
android:gravity="center"
|
||||
android:maxLines="2"
|
||||
android:text="关闭航班"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/leftIcon"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/to_left_icon"
|
||||
android:visibility="visible"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</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_cargo/src/main/res/mipmap-hdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
module_cargo/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
module_cargo/src/main/res/mipmap-mdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 982 B |
BIN
module_cargo/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
module_cargo/src/main/res/mipmap-xhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
module_cargo/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
module_cargo/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
module_cargo/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
module_cargo/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
module_cargo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
16
module_cargo/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>
|
||||
11
module_cargo/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFBB86FC</color>
|
||||
<color name="purple_500">#FF6200EE</color>
|
||||
<color name="purple_700">#FF3700B3</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="cargo_status_check">#FFFFF2AE</color>
|
||||
</resources>
|
||||
3
module_cargo/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="cg_app_name">My Application</string>
|
||||
</resources>
|
||||
16
module_cargo/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="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.cargo
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||