feat: 国际出港/进港查询详情页增加日志详情入口
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
BIN
module_base/src/main/res/drawable-xhdpi/img_log.png
Normal file
BIN
module_base/src/main/res/drawable-xhdpi/img_log.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@@ -3,7 +3,12 @@ package com.lukouguoji.gjc.activity
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.lukouguoji.gjc.R
|
||||
import com.lukouguoji.gjc.databinding.ActivityGjcQueryDetailsBinding
|
||||
import com.lukouguoji.gjc.viewModel.GjcQueryDetailsViewModel
|
||||
@@ -43,10 +48,34 @@ class GjcQueryDetailsActivity :
|
||||
binding.vp.setCurrentItem(it, false) // false:无动画
|
||||
}
|
||||
|
||||
// 标题栏右侧添加日志查询图标
|
||||
val toolbar = findViewById<Toolbar>(com.lukouguoji.module_base.R.id.toolbar)
|
||||
val logIcon = ImageView(this).apply {
|
||||
setImageResource(com.lukouguoji.module_base.R.drawable.img_log)
|
||||
layoutParams = Toolbar.LayoutParams(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
).apply {
|
||||
gravity = Gravity.END or Gravity.CENTER_VERTICAL
|
||||
marginEnd = 15
|
||||
width = 30.dp
|
||||
height = 30.dp
|
||||
}
|
||||
setOnClickListener {
|
||||
ARouter.getInstance()
|
||||
.build(ARouterConstants.ACTIVITY_URL_LOG_DETAIL)
|
||||
.navigation()
|
||||
}
|
||||
}
|
||||
toolbar.addView(logIcon)
|
||||
|
||||
// 加载详情数据
|
||||
viewModel.loadDetails()
|
||||
}
|
||||
|
||||
private val Int.dp: Int
|
||||
get() = (this * resources!!.displayMetrics.density).toInt()
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context, maWbId: Long?) {
|
||||
|
||||
@@ -3,7 +3,12 @@ package com.lukouguoji.gjj.activity
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.lukouguoji.gjj.R
|
||||
import com.lukouguoji.gjj.databinding.ActivityIntImpQueryDetailsBinding
|
||||
import com.lukouguoji.gjj.viewModel.IntImpQueryDetailsViewModel
|
||||
@@ -42,10 +47,34 @@ class IntImpQueryDetailsActivity :
|
||||
binding.vp.setCurrentItem(it, false)
|
||||
}
|
||||
|
||||
// 标题栏右侧添加日志查询图标
|
||||
val toolbar = findViewById<Toolbar>(com.lukouguoji.module_base.R.id.toolbar)
|
||||
val logIcon = ImageView(this).apply {
|
||||
setImageResource(com.lukouguoji.module_base.R.drawable.img_log)
|
||||
layoutParams = Toolbar.LayoutParams(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
).apply {
|
||||
gravity = Gravity.END or Gravity.CENTER_VERTICAL
|
||||
marginEnd = 15
|
||||
width = 30.dp
|
||||
height = 30.dp
|
||||
}
|
||||
setOnClickListener {
|
||||
ARouter.getInstance()
|
||||
.build(ARouterConstants.ACTIVITY_URL_LOG_DETAIL)
|
||||
.navigation()
|
||||
}
|
||||
}
|
||||
toolbar.addView(logIcon)
|
||||
|
||||
// 加载详情数据
|
||||
viewModel.loadDetails()
|
||||
}
|
||||
|
||||
private val Int.dp: Int
|
||||
get() = (this * resources!!.displayMetrics.density).toInt()
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context, prefix: String?, no: String?) {
|
||||
|
||||
Reference in New Issue
Block a user