feat(phone): 5.5 寸手持端首页按新设计稿改版
按 documents/5.5寸首页新样式/ 设计稿还原 PDAEnterActivity 四个 Tab(仅 module_p,平板不经过该页): - 国内/国际 Tab:分组标题栏 + 三列宫格(PdaMenuGroup / PdaMenuRenderer),分组与顺序按设计稿; 20 个入口换新图标(源 GIF/PNG 转 PNG 放 drawable-nodpi,放 xxhdpi 会先缩后放发糊), 设计稿未覆盖的入口追加到组尾沿用旧图标 - 权限过滤 authList.contains(key) 与改版前逐字一致:ADMIN 账号入口集合改版前后 diff 为空 (国内 9、国际 12),21 个入口逐个点击跳转目标不变 - 首页航班动态:卡片 + 国内/国际、进港/出港分段 + 日期卡片(‹ › 翻日)+ 浅色表格 + 设置悬浮钮; 默认方向改为进港,日期统一补零,日期选择器从当前选中日期打开 - 底部 Tab 栏(16dp 图标与文字居中)、消息铃铛与角标(四个 Tab 统一位置、切换不再移动)、 状态栏 #3B71E8;「我的」顶栏同步新导航栏样式;首页 AutoSize 基准 400 → 390 - 删除 module_p 中不再引用的旧菜单/Tab 图标副本 - CLAUDE.md / phone-adapt skill 更新首页菜单入口说明,补图标发糊、分段控件描边与取整两个坑 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -2,9 +2,11 @@ package com.sixin.module_p.ui.enter
|
||||
|
||||
import android.content.Context.RECEIVER_EXPORTED
|
||||
import android.content.IntentFilter
|
||||
import android.graphics.Typeface
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.lukouguoji.module_base.base.CustomVP2Adapter
|
||||
import com.lukouguoji.module_base.bean.SocketEventBean
|
||||
@@ -41,6 +43,9 @@ class PDAEnterActivity : BasePdaActivity<ActivityPdaenterBinding, PDAEnterViewMo
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
binding.viewModel = viewModel
|
||||
|
||||
// 状态栏与顶部导航栏同色(设计稿状态栏为 #3B71E8 蓝底白字)
|
||||
window.statusBarColor = ContextCompat.getColor(this, R.color.phone_home_primary)
|
||||
|
||||
binding.vp.adapter =
|
||||
CustomVP2Adapter(viewModel.fragmentList, supportFragmentManager, lifecycle)
|
||||
binding.vp.isUserInputEnabled = false
|
||||
@@ -48,6 +53,7 @@ class PDAEnterActivity : BasePdaActivity<ActivityPdaenterBinding, PDAEnterViewMo
|
||||
|
||||
viewModel.index.observe(this) {
|
||||
binding.vp.setCurrentItem(it, false)
|
||||
updateTabStyle(it)
|
||||
}
|
||||
|
||||
FlowBus.with<Any>(ConstantEvent.LOGOUT)
|
||||
@@ -93,6 +99,17 @@ class PDAEnterActivity : BasePdaActivity<ActivityPdaenterBinding, PDAEnterViewMo
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tab 切换时的纯 UI 调整:选中 Tab 文字加粗(设计稿 font-weight 500,选择器表达不了字重)
|
||||
*/
|
||||
private fun updateTabStyle(index: Int) {
|
||||
listOf(binding.tvTabHome, binding.tvTabGn, binding.tvTabGj, binding.tvTabMine)
|
||||
.forEachIndexed { i, tv ->
|
||||
tv.typeface = if (i == index) Typeface.create("sans-serif-medium", Typeface.NORMAL)
|
||||
else Typeface.DEFAULT
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
unregisterReceiver(receiver)
|
||||
@@ -101,6 +118,7 @@ class PDAEnterActivity : BasePdaActivity<ActivityPdaenterBinding, PDAEnterViewMo
|
||||
|
||||
override fun isBaseOnWidth() = true
|
||||
|
||||
override fun getSizeInDp(): Float = PDAHelper.PDA_WIDTH
|
||||
/** 首页按 documents/5.5寸首页新样式/ 设计稿 390dp 画布等比还原(其余 PDA 页仍为 [PDAHelper.PDA_WIDTH]) */
|
||||
override fun getSizeInDp(): Float = 390f
|
||||
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package com.sixin.module_p.ui.enter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.Space
|
||||
import com.lukouguoji.module_base.bean.ActionBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.db.perference.SharedPreferenceUtil
|
||||
import com.sixin.module_p.databinding.ItemPdaActionBinding
|
||||
import com.sixin.module_p.databinding.ItemPdaMenuGroupBinding
|
||||
|
||||
/**
|
||||
* 手持端首页「国内 / 国际」Tab 的菜单分组(标题 + 组内顺序取自 documents/5.5寸首页新样式/ 设计稿)
|
||||
*/
|
||||
data class PdaMenuGroup(
|
||||
val title: String,
|
||||
val items: List<ActionBean>
|
||||
)
|
||||
|
||||
/**
|
||||
* 按登录返回的 authList 过滤,**判定方式与改版前逐字一致**(`authList.contains(key)`),
|
||||
* 保证改版前后同一账号看到的入口集合不变;过滤后为空的分组整组不显示
|
||||
*/
|
||||
fun List<PdaMenuGroup>.filterByAuth(): List<PdaMenuGroup> =
|
||||
map { group ->
|
||||
group.copy(items = group.items.filter {
|
||||
SharedPreferenceUtil.getString(Constant.Share.authList).contains(it.key)
|
||||
})
|
||||
}.filter { it.items.isNotEmpty() }
|
||||
|
||||
/**
|
||||
* 把分组菜单渲染成设计稿的「分组标题栏 + 三列宫格」
|
||||
*
|
||||
* 入口数量是固定的小清单,直接按行铺 LinearLayout,比 RecyclerView 多类型 + 网格装饰简单,
|
||||
* 也能精确还原设计稿的行距与内边距
|
||||
*/
|
||||
object PdaMenuRenderer {
|
||||
|
||||
private const val SPAN_COUNT = 3
|
||||
|
||||
/** 宫格行距(设计稿 row-gap 12px) */
|
||||
private const val ROW_GAP_DP = 12f
|
||||
|
||||
/** 最后一组宫格底部内边距(设计稿 padding-bottom: clamp(16px, 5.6vw, 22px)) */
|
||||
private const val LAST_GRID_PADDING_BOTTOM_DP = 22f
|
||||
|
||||
fun render(
|
||||
container: LinearLayout,
|
||||
groups: List<PdaMenuGroup>,
|
||||
onItemClick: (ActionBean) -> Unit
|
||||
) {
|
||||
container.removeAllViews()
|
||||
val inflater = LayoutInflater.from(container.context)
|
||||
|
||||
groups.forEachIndexed { groupIndex, group ->
|
||||
val groupBinding = ItemPdaMenuGroupBinding.inflate(inflater, container, true)
|
||||
groupBinding.title = group.title
|
||||
groupBinding.executePendingBindings()
|
||||
|
||||
val grid = groupBinding.llGrid
|
||||
if (groupIndex == groups.lastIndex) {
|
||||
grid.setPadding(
|
||||
grid.paddingLeft,
|
||||
grid.paddingTop,
|
||||
grid.paddingRight,
|
||||
grid.dp(LAST_GRID_PADDING_BOTTOM_DP)
|
||||
)
|
||||
}
|
||||
|
||||
group.items.chunked(SPAN_COUNT).forEachIndexed { rowIndex, rowItems ->
|
||||
val row = LinearLayout(container.context).apply {
|
||||
orientation = LinearLayout.HORIZONTAL
|
||||
}
|
||||
grid.addView(
|
||||
row,
|
||||
LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
).apply {
|
||||
if (rowIndex > 0) topMargin = grid.dp(ROW_GAP_DP)
|
||||
}
|
||||
)
|
||||
|
||||
rowItems.forEach { bean ->
|
||||
val cell = ItemPdaActionBinding.inflate(inflater, row, false)
|
||||
cell.bean = bean
|
||||
cell.ivIcon.setImageResource(bean.icon)
|
||||
// 圆角裁剪:XML 的 android:clipToOutline 仅 API 31+ 生效,需代码设置
|
||||
cell.ivIcon.clipToOutline = true
|
||||
cell.executePendingBindings()
|
||||
cell.ll.setOnClickListener { onItemClick(bean) }
|
||||
row.addView(cell.root, cellParams())
|
||||
}
|
||||
// 末行不足三个时补位,保证列宽一致
|
||||
repeat(SPAN_COUNT - rowItems.size) {
|
||||
row.addView(Space(container.context), cellParams())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun cellParams() =
|
||||
LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1f)
|
||||
|
||||
/** 用 View 自身 resources 换算(已被 AutoSize 改写为当前页面基准) */
|
||||
private fun View.dp(value: Float) = (value * resources.displayMetrics.density + 0.5f).toInt()
|
||||
}
|
||||
@@ -2,13 +2,9 @@ package com.sixin.module_p.ui.enter.gj
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.lukouguoji.module_base.base.BaseBindingFragment
|
||||
import com.lukouguoji.module_base.base.CommonAdapter
|
||||
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.loge
|
||||
import com.lukouguoji.module_base.ktx.refresh
|
||||
import com.sixin.module_p.R
|
||||
import com.sixin.module_p.databinding.FragmentGjBinding
|
||||
import com.sixin.module_p.ui.enter.PdaMenuRenderer
|
||||
|
||||
class GjFragment : BaseBindingFragment<FragmentGjBinding, GjViewModel>() {
|
||||
override fun layoutId(): Int {
|
||||
@@ -22,16 +18,9 @@ class GjFragment : BaseBindingFragment<FragmentGjBinding, GjViewModel>() {
|
||||
override fun initOnViewCreated() {
|
||||
binding.viewModel = viewModel
|
||||
|
||||
binding.rv.adapter =
|
||||
CommonAdapter(requireContext(), R.layout.item_pda_action, GjViewHolder::class.java)
|
||||
|
||||
binding.rv.addOnItemClickListener(object : IOnItemClickListener {
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
viewModel.onItemClick(position)
|
||||
}
|
||||
})
|
||||
|
||||
binding.rv.refresh(viewModel.actionList)
|
||||
PdaMenuRenderer.render(binding.llMenu, viewModel.groups) {
|
||||
viewModel.onItemClick(it)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.sixin.module_p.ui.enter.gj
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.ActionBean
|
||||
import com.sixin.module_p.databinding.ItemPdaActionBinding
|
||||
|
||||
class GjViewHolder(view: View) : BaseViewHolder<ActionBean, ItemPdaActionBinding>(view) {
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
binding.bean = getItemBean(item)
|
||||
notifyItemClick(position, binding.ll)
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,11 @@ import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.lukouguoji.module_base.base.BaseViewModel
|
||||
import com.lukouguoji.module_base.bean.ActionBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.db.perference.SharedPreferenceUtil
|
||||
import com.lukouguoji.module_base.ktx.loge
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
import com.sixin.module_p.R
|
||||
import com.sixin.module_p.ui.enter.PdaMenuGroup
|
||||
import com.sixin.module_p.ui.enter.filterByAuth
|
||||
import com.sixin.module_p.ui.guobang.PdaGuoBangActivity
|
||||
import com.sixin.module_p.ui.lihuo.PdaLiHuoActivity
|
||||
import com.sixin.module_p.ui.shouyun.PdaShouYunActivity
|
||||
@@ -21,87 +22,97 @@ import dev.DevUtils
|
||||
* 某项没配 [ActionBean.key] 对应的权限串时不显示。所以新页面适配完之后
|
||||
* **必须回来这里加一行**,否则手机端首页根本没有入口。
|
||||
*
|
||||
* 分组与组内顺序按 documents/5.5寸首页新样式/home.html 设计稿;设计稿没画的入口追加到
|
||||
* 所属分组末尾并沿用旧图标。入口集合、权限串、跳转与改版前完全一致(过滤见 [filterByAuth])。
|
||||
*
|
||||
* 两类跳转:
|
||||
* - 带 [ActionBean.route] → 通用 ARouter 跳转(module_p 不依赖 module_gjc 等业务模块,
|
||||
* 跨模块只能走路由)。**5.5 寸适配页一律用这种,加一行即可。**
|
||||
* - 不带 route → 落到 [onItemClick] 的 when 分支(module_p 内部的 PDA 专用页面)
|
||||
* - 不带 route → 落到 [onItemClick] 的 when 分支(module_p 内的 PDA 专用页面)
|
||||
*/
|
||||
class GjViewModel : BaseViewModel() {
|
||||
|
||||
val actionList = listOf(
|
||||
// ===== module_p 内的 PDA 专用页面(无 route,走 when 分支) =====
|
||||
ActionBean("普货收运", R.drawable.gjc_shou_yun_icon, Constant.AuthName.GjcAppDomExpCheckin),
|
||||
ActionBean("板箱组装", R.drawable.img_bxzz, Constant.AuthName.GjcBanXListActivity),
|
||||
ActionBean("板箱过磅", R.drawable.gjc_fu_bang_icon, Constant.AuthName.GjcFuBangActivity),
|
||||
ActionBean("进港理货", R.drawable.img_jglh, Constant.AuthName.GjjTallyListActivity),
|
||||
|
||||
// ===== 5.5 寸手机版已适配页面(图标复用 Pad 端同款,跳转走 ARouter) =====
|
||||
ActionBean(
|
||||
"出港移库",
|
||||
R.drawable.gjc_yi_ku_icon,
|
||||
Constant.AuthName.GjcYiKuListActivity,
|
||||
ARouterConstants.ACTIVITY_URL_INT_EXP_MOVE
|
||||
),
|
||||
ActionBean(
|
||||
"出库交接",
|
||||
R.drawable.img_gjc_chuku_jiaojie,
|
||||
Constant.AuthName.GjcIntExpOutHandover,
|
||||
ARouterConstants.ACTIVITY_URL_INT_EXP_OUT_HANDOVER
|
||||
),
|
||||
ActionBean(
|
||||
"出港计重",
|
||||
R.drawable.img_gjc_chugangjizhong,
|
||||
Constant.AuthName.GjcCheckWeighing,
|
||||
ARouterConstants.ACTIVITY_URL_GJC_WEIGHING_LIST
|
||||
),
|
||||
ActionBean(
|
||||
"出港运抵",
|
||||
R.drawable.img_gjc_chugang_diyun,
|
||||
Constant.AuthName.GjcIntExpArrive,
|
||||
ARouterConstants.ACTIVITY_URL_INT_EXP_ARRIVE
|
||||
),
|
||||
ActionBean(
|
||||
"出港查询",
|
||||
R.drawable.gjc_query_icon,
|
||||
Constant.AuthName.GjcQueryListActivity,
|
||||
ARouterConstants.ACTIVITY_URL_GJC_QUERY_LIST
|
||||
),
|
||||
ActionBean(
|
||||
"出港仓库",
|
||||
R.drawable.gjc_cang_ku_icon,
|
||||
Constant.AuthName.GjcIntExpStorageUse,
|
||||
ARouterConstants.ACTIVITY_URL_INT_EXP_STORAGE_USE
|
||||
),
|
||||
ActionBean(
|
||||
"进港仓库",
|
||||
R.drawable.gjc_cang_ku_icon, // Pad 端进港仓库菜单同样复用出港仓库图标
|
||||
Constant.AuthName.GjjWareHouseActivity,
|
||||
ARouterConstants.ACTIVITY_URL_GJJ_WARE_HOUSE
|
||||
),
|
||||
ActionBean(
|
||||
"进港查询",
|
||||
R.drawable.gjj_query_icon,
|
||||
Constant.AuthName.GjjQueryListActivity,
|
||||
ARouterConstants.ACTIVITY_URL_GJJ_QUERY_LIST
|
||||
),
|
||||
ActionBean(
|
||||
"提取出库",
|
||||
R.drawable.gjj_chu_ku_icon,
|
||||
Constant.AuthName.IntImpPickUpDLV,
|
||||
ARouterConstants.ACTIVITY_URL_INT_IMP_PICK_UP_DLV
|
||||
),
|
||||
// ULD管理属综合管理业务(Pad 端在「综合管理」菜单组),手机端首页暂无综合 Tab,挂在国际 Tab 下
|
||||
ActionBean(
|
||||
"ULD管理",
|
||||
com.lukouguoji.module_base.R.mipmap.cargo, // 图标复用 Pad 端同款(在 module_base,直接引用)
|
||||
Constant.AuthName.ComprehensiveUld, // 权限串与 Pad 端菜单一致
|
||||
ARouterConstants.ACTIVITY_URL_ULD_LIST
|
||||
),
|
||||
).filter { SharedPreferenceUtil.getString(Constant.Share.authList).contains(it.key) }
|
||||
|
||||
fun onItemClick(position: Int) {
|
||||
val bean = actionList.getOrNull(position) ?: return
|
||||
val groups = listOf(
|
||||
PdaMenuGroup(
|
||||
"国际出港", listOf(
|
||||
ActionBean(
|
||||
"出港计重",
|
||||
R.drawable.img_pda_menu_gjc_weighing,
|
||||
Constant.AuthName.GjcCheckWeighing,
|
||||
ARouterConstants.ACTIVITY_URL_GJC_WEIGHING_LIST
|
||||
),
|
||||
ActionBean(
|
||||
"出港运抵",
|
||||
R.drawable.img_pda_menu_gjc_arrive,
|
||||
Constant.AuthName.GjcIntExpArrive,
|
||||
ARouterConstants.ACTIVITY_URL_INT_EXP_ARRIVE
|
||||
),
|
||||
ActionBean(
|
||||
"出库交接",
|
||||
R.drawable.img_pda_menu_gjc_out_handover,
|
||||
Constant.AuthName.GjcIntExpOutHandover,
|
||||
ARouterConstants.ACTIVITY_URL_INT_EXP_OUT_HANDOVER
|
||||
),
|
||||
ActionBean(
|
||||
"出港移库",
|
||||
R.drawable.img_pda_menu_gjc_move,
|
||||
Constant.AuthName.GjcYiKuListActivity,
|
||||
ARouterConstants.ACTIVITY_URL_INT_EXP_MOVE
|
||||
),
|
||||
ActionBean(
|
||||
"出港仓库",
|
||||
R.drawable.img_pda_menu_gjc_storage,
|
||||
Constant.AuthName.GjcIntExpStorageUse,
|
||||
ARouterConstants.ACTIVITY_URL_INT_EXP_STORAGE_USE
|
||||
),
|
||||
ActionBean(
|
||||
"出港查询",
|
||||
R.drawable.img_pda_menu_gjc_query,
|
||||
Constant.AuthName.GjcQueryListActivity,
|
||||
ARouterConstants.ACTIVITY_URL_GJC_QUERY_LIST
|
||||
),
|
||||
// ===== 设计稿未覆盖:module_p 内的 PDA 专用页面(无 route,走 when 分支),沿用旧图标 =====
|
||||
ActionBean("普货收运", R.drawable.gjc_shou_yun_icon, Constant.AuthName.GjcAppDomExpCheckin),
|
||||
ActionBean("板箱组装", R.drawable.img_bxzz, Constant.AuthName.GjcBanXListActivity),
|
||||
ActionBean("板箱过磅", R.drawable.gjc_fu_bang_icon, Constant.AuthName.GjcFuBangActivity),
|
||||
)
|
||||
),
|
||||
PdaMenuGroup(
|
||||
"国际进港", listOf(
|
||||
ActionBean("进港理货", R.drawable.img_pda_menu_gjj_tally, Constant.AuthName.GjjTallyListActivity),
|
||||
ActionBean(
|
||||
"提取出库",
|
||||
R.drawable.img_pda_menu_gjj_pick_up,
|
||||
Constant.AuthName.IntImpPickUpDLV,
|
||||
ARouterConstants.ACTIVITY_URL_INT_IMP_PICK_UP_DLV
|
||||
),
|
||||
ActionBean(
|
||||
"进港仓库",
|
||||
R.drawable.img_pda_menu_gjj_storage,
|
||||
Constant.AuthName.GjjWareHouseActivity,
|
||||
ARouterConstants.ACTIVITY_URL_GJJ_WARE_HOUSE
|
||||
),
|
||||
ActionBean(
|
||||
"进港查询",
|
||||
R.drawable.img_pda_menu_gjj_query,
|
||||
Constant.AuthName.GjjQueryListActivity,
|
||||
ARouterConstants.ACTIVITY_URL_GJJ_QUERY_LIST
|
||||
),
|
||||
)
|
||||
),
|
||||
PdaMenuGroup(
|
||||
"综合管理", listOf(
|
||||
ActionBean(
|
||||
"ULD管理",
|
||||
R.drawable.img_pda_menu_uld,
|
||||
Constant.AuthName.ComprehensiveUld, // 权限串与 Pad 端菜单一致
|
||||
ARouterConstants.ACTIVITY_URL_ULD_LIST
|
||||
),
|
||||
)
|
||||
),
|
||||
).filterByAuth()
|
||||
|
||||
fun onItemClick(bean: ActionBean) {
|
||||
// 配了路由的直接跳(5.5 寸适配页走这条)
|
||||
if (bean.route.isNotEmpty()) {
|
||||
ARouter.getInstance().build(bean.route).navigation()
|
||||
|
||||
@@ -2,14 +2,9 @@ package com.sixin.module_p.ui.enter.gn
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.lukouguoji.module_base.base.BaseBindingFragment
|
||||
import com.lukouguoji.module_base.base.CommonAdapter
|
||||
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.loge
|
||||
import com.lukouguoji.module_base.ktx.refresh
|
||||
import com.sixin.module_p.R
|
||||
import com.sixin.module_p.databinding.FragmentGnBinding
|
||||
import com.sixin.module_p.ui.enter.gj.GjViewHolder
|
||||
import com.sixin.module_p.ui.enter.PdaMenuRenderer
|
||||
|
||||
class GnFragment : BaseBindingFragment<FragmentGnBinding, GnViewModel>() {
|
||||
override fun layoutId(): Int {
|
||||
@@ -23,16 +18,9 @@ class GnFragment : BaseBindingFragment<FragmentGnBinding, GnViewModel>() {
|
||||
override fun initOnViewCreated() {
|
||||
binding.viewModel = viewModel
|
||||
|
||||
binding.rv.adapter =
|
||||
CommonAdapter(requireContext(), R.layout.item_pda_action, GjViewHolder::class.java)
|
||||
|
||||
binding.rv.addOnItemClickListener(object : IOnItemClickListener {
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
viewModel.onItemClick(position)
|
||||
}
|
||||
})
|
||||
|
||||
binding.rv.refresh(viewModel.actionList)
|
||||
PdaMenuRenderer.render(binding.llMenu, viewModel.groups) {
|
||||
viewModel.onItemClick(it)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -5,11 +5,12 @@ import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.lukouguoji.module_base.base.BaseViewModel
|
||||
import com.lukouguoji.module_base.bean.ActionBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.db.perference.SharedPreferenceUtil
|
||||
import com.lukouguoji.module_base.ktx.logd
|
||||
import com.lukouguoji.module_base.ktx.loge
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
import com.sixin.module_p.R
|
||||
import com.sixin.module_p.ui.enter.PdaMenuGroup
|
||||
import com.sixin.module_p.ui.enter.filterByAuth
|
||||
import com.sixin.module_p.ui.enter.gn.document.PdaDocumentHandoverActivity
|
||||
import com.sixin.module_p.ui.gnc.cunfang.list.PdaGncCunFangListActivity
|
||||
import com.sixin.module_p.ui.gnc.fubang.add.PdaGncFuBangAddActivity
|
||||
@@ -20,65 +21,53 @@ import com.sixin.module_p.ui.goods.transport.list.PdaGoodsTransportListActivity
|
||||
import com.sixin.module_p.ui.goods.transportLog.list.PdaTransportLogActivity
|
||||
import dev.DevUtils
|
||||
|
||||
/**
|
||||
* 手持端首页「国内业务」Tab
|
||||
*
|
||||
* 菜单是手写清单 + authList 权限过滤(同 [com.sixin.module_p.ui.enter.gj.GjViewModel])。
|
||||
* 分组与组内顺序按 documents/5.5寸首页新样式/domestic.html 设计稿;入口集合、权限串、
|
||||
* 跳转与改版前完全一致(过滤见 [filterByAuth])。
|
||||
*/
|
||||
class GnViewModel : BaseViewModel() {
|
||||
|
||||
val actionList = listOf(
|
||||
ActionBean(
|
||||
"出港收运",
|
||||
com.lukouguoji.module_base.R.drawable.img_gnc_shouyun,
|
||||
Constant.AuthName.AppDomExpCheckin
|
||||
val groups = listOf(
|
||||
PdaMenuGroup(
|
||||
"国内出港", listOf(
|
||||
ActionBean("出港收运", R.drawable.img_pda_menu_gnc_shou_yun, Constant.AuthName.AppDomExpCheckin),
|
||||
ActionBean("出港复磅", R.drawable.img_pda_menu_gnc_fu_bang, Constant.AuthName.AppDomExpWeighting),
|
||||
ActionBean("出港存放", R.drawable.img_pda_menu_gnc_cun_fang, Constant.AuthName.AppDomExpDeposit),
|
||||
ActionBean("单证交接", R.drawable.img_pda_menu_document_handover, Constant.AuthName.DocumentHandover),
|
||||
ActionBean("货物转运", R.drawable.img_pda_menu_goods_transport, Constant.AuthName.ComprehensiveTransfer),
|
||||
ActionBean("转运记录", R.drawable.img_pda_menu_transport_log, Constant.AuthName.TransportLog),
|
||||
)
|
||||
),
|
||||
ActionBean("出港复磅", R.drawable.gnc_fubang, Constant.AuthName.AppDomExpWeighting),
|
||||
ActionBean(
|
||||
"出港存放",
|
||||
com.lukouguoji.module_base.R.drawable.img_gnc_cunfang,
|
||||
Constant.AuthName.AppDomExpDeposit
|
||||
PdaMenuGroup(
|
||||
"国内进港", listOf(
|
||||
ActionBean("进港卸机", R.drawable.img_pda_menu_gnj_xie_ji, Constant.AuthName.MonitorInPack),
|
||||
ActionBean(
|
||||
"进港移库",
|
||||
R.drawable.img_pda_menu_gnj_move,
|
||||
Constant.AuthName.GnjYiKu, // 权限串与 Pad 端菜单一致(AppDomImpMove)
|
||||
ARouterConstants.ACTIVITY_URL_GNJ_MOVE_STASH_LIST // 与 Pad 首页菜单同一跳转页(app 模块,走路由)
|
||||
),
|
||||
)
|
||||
),
|
||||
ActionBean(
|
||||
"进港卸机",
|
||||
com.lukouguoji.module_base.R.drawable.img_gnc_xieji,
|
||||
Constant.AuthName.MonitorInPack
|
||||
PdaMenuGroup(
|
||||
"综合管理", listOf(
|
||||
ActionBean("事故签证", R.drawable.img_pda_menu_accident_visa, Constant.AuthName.ComprehensiveAccidentVisa),
|
||||
)
|
||||
),
|
||||
ActionBean(
|
||||
"货物转运",
|
||||
com.lukouguoji.module_base.R.drawable.img_gnc_huowuzhuanyun,
|
||||
Constant.AuthName.ComprehensiveTransfer
|
||||
),
|
||||
ActionBean(
|
||||
"转运记录",
|
||||
com.lukouguoji.module_base.R.mipmap.transport_log,
|
||||
Constant.AuthName.TransportLog
|
||||
),
|
||||
ActionBean(
|
||||
"事故签证",
|
||||
R.mipmap.mit_accident_visa,
|
||||
Constant.AuthName.ComprehensiveAccidentVisa
|
||||
),
|
||||
ActionBean(
|
||||
"单证交接",
|
||||
R.mipmap.gnc_document_handover,
|
||||
Constant.AuthName.DocumentHandover
|
||||
),
|
||||
ActionBean(
|
||||
"进港移库",
|
||||
R.drawable.gnj_yi_ku_icon, // 图标复制自 module_gnj(module_p 看不到业务模块资源)
|
||||
Constant.AuthName.GnjYiKu, // 权限串与 Pad 端菜单一致(AppDomImpMove)
|
||||
ARouterConstants.ACTIVITY_URL_GNJ_MOVE_STASH_LIST // 与 Pad 首页菜单同一跳转页(app 模块,走路由)
|
||||
),
|
||||
)
|
||||
.filter { SharedPreferenceUtil.getString(Constant.Share.authList).contains(it.key) }
|
||||
).filterByAuth()
|
||||
|
||||
|
||||
fun onItemClick(position: Int) {
|
||||
val bean = actionList.getOrNull(position) ?: return
|
||||
|
||||
fun onItemClick(bean: ActionBean) {
|
||||
// 配了路由的直接跳(5.5 寸适配页走这条,与 GjViewModel 同模式)
|
||||
if (bean.route.isNotEmpty()) {
|
||||
ARouter.getInstance().build(bean.route).navigation()
|
||||
return
|
||||
}
|
||||
|
||||
when (val title = actionList[position].title) {
|
||||
when (val title = bean.title) {
|
||||
"出港收运" -> {
|
||||
GncUnShouYunActivity.start(DevUtils.getTopActivity())
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.sixin.module_p.ui.enter.home
|
||||
|
||||
import android.widget.LinearLayout
|
||||
import android.graphics.Typeface
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.lukouguoji.module_base.base.BaseBindingFragment
|
||||
import com.lukouguoji.module_base.base.CommonAdapter
|
||||
import com.sixin.module_p.R
|
||||
@@ -25,9 +25,24 @@ class HomeFragment : BaseBindingFragment<FragmentPdaHomeBinding, HomeViewModel>(
|
||||
CommonAdapter(requireContext(), R.layout.item_pda_home, HomeViewHolder::class.java)
|
||||
viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)
|
||||
|
||||
// 分段按钮选中态加粗(设计稿 font-weight 500,选择器表达不了字重)
|
||||
viewModel.countryType.observe(viewLifecycleOwner) {
|
||||
setMedium(binding.tvScopeGn, it != true)
|
||||
setMedium(binding.tvScopeGj, it == true)
|
||||
}
|
||||
viewModel.type.observe(viewLifecycleOwner) {
|
||||
setMedium(binding.tvDirArrival, it == HomeViewModel.TYPE_ARRIVAL)
|
||||
setMedium(binding.tvDirLeave, it == HomeViewModel.TYPE_LEAVE)
|
||||
}
|
||||
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
private fun setMedium(tv: TextView, medium: Boolean) {
|
||||
tv.typeface = if (medium) Typeface.create("sans-serif-medium", Typeface.NORMAL)
|
||||
else Typeface.DEFAULT
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun newInstance(): Fragment {
|
||||
return HomeFragment()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.sixin.module_p.ui.enter.home
|
||||
|
||||
import android.graphics.Color
|
||||
import android.view.View
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.FlightBean
|
||||
@@ -10,12 +9,6 @@ class HomeViewHolder(view: View) : BaseViewHolder<FlightBean, ItemPdaHomeBinding
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
binding.bean = getItemBean(item)
|
||||
|
||||
if (position % 2 == 0) {
|
||||
binding.ll.setBackgroundColor(Color.parseColor("#8c8c8c"))
|
||||
} else {
|
||||
binding.ll.setBackgroundColor(Color.parseColor("#41cea5"))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.sixin.module_p.ui.enter.home
|
||||
import android.app.DatePickerDialog
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import androidx.lifecycle.observe
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
@@ -12,6 +13,7 @@ import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.sixin.module_p.ui.gnc.shouyun.dialog.PdaDaiShouYunFilterDialogModel
|
||||
import dev.DevUtils
|
||||
import dev.utils.common.DateUtils
|
||||
import java.util.Calendar
|
||||
|
||||
class HomeViewModel : BasePageViewModel() {
|
||||
|
||||
@@ -19,8 +21,12 @@ class HomeViewModel : BasePageViewModel() {
|
||||
// 日期
|
||||
val date = MutableLiveData(DateUtils.formatDate(DateUtils.getCurrentTime(), "yyyy-MM-dd"))
|
||||
|
||||
// 类型
|
||||
val type = MutableLiveData(TYPE_LEAVE)
|
||||
// 日期卡片的「10月」/「20」(设计稿 .date-picker 两行显示)
|
||||
val dateMonth = Transformations.map(date) { "${parseDate(it).get(Calendar.MONTH) + 1}月" }
|
||||
val dateDay = Transformations.map(date) { parseDate(it).get(Calendar.DAY_OF_MONTH).toString() }
|
||||
|
||||
// 类型(设计稿默认「进港」= 到达)
|
||||
val type = MutableLiveData(TYPE_ARRIVAL)
|
||||
|
||||
// 航班类型- 0:国内, 1:国际
|
||||
val countryType = MutableLiveData(false)
|
||||
@@ -28,7 +34,7 @@ class HomeViewModel : BasePageViewModel() {
|
||||
private val datePicker by lazy {
|
||||
DatePickerDialog(getTopActivity()).apply {
|
||||
setOnDateSetListener { _, year, month, dayOfMonth ->
|
||||
date.value = "${year}-${month + 1}-${dayOfMonth}"
|
||||
date.value = formatDate(Calendar.getInstance().apply { set(year, month, dayOfMonth) })
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
@@ -69,10 +75,35 @@ class HomeViewModel : BasePageViewModel() {
|
||||
configModel.show()
|
||||
}
|
||||
|
||||
/**
|
||||
* 国内 / 国际 切换(countryType 的 observer 负责刷新)
|
||||
*/
|
||||
fun onCountryTypeChange(isGj: Boolean) {
|
||||
if (countryType.value != isGj) countryType.value = isGj
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期前后翻一天(设计稿日期两侧的 ‹ ›)
|
||||
*/
|
||||
fun onDateStep(offset: Int) {
|
||||
date.value = formatDate(parseDate(date.value).apply { add(Calendar.DAY_OF_MONTH, offset) })
|
||||
refresh()
|
||||
}
|
||||
|
||||
private fun parseDate(value: String?): Calendar =
|
||||
DateUtils.getCalendar(DateUtils.parseDate(value, "yyyy-MM-dd") ?: java.util.Date())
|
||||
|
||||
private fun formatDate(calendar: Calendar): String =
|
||||
DateUtils.formatDate(calendar.time, "yyyy-MM-dd")
|
||||
|
||||
/**
|
||||
* 日期点击
|
||||
*/
|
||||
fun onDateClick() {
|
||||
// 从当前选中日期打开(‹ › 翻日后不再是今天)
|
||||
parseDate(date.value).let {
|
||||
datePicker.updateDate(it.get(Calendar.YEAR), it.get(Calendar.MONTH), it.get(Calendar.DAY_OF_MONTH))
|
||||
}
|
||||
datePicker.show()
|
||||
}
|
||||
|
||||
|
||||
5
module_p/src/main/res/color/phone_home_segment_text.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@android:color/white" android:state_selected="true" />
|
||||
<item android:color="@color/phone_home_text_secondary" />
|
||||
</selector>
|
||||
5
module_p/src/main/res/color/phone_home_tab_tint.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/phone_home_primary" android:state_selected="true" />
|
||||
<item android:color="@color/phone_home_text_hint" />
|
||||
</selector>
|
||||
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
BIN
module_p/src/main/res/drawable-nodpi/img_pda_menu_gjc_arrive.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
module_p/src/main/res/drawable-nodpi/img_pda_menu_gjc_move.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
BIN
module_p/src/main/res/drawable-nodpi/img_pda_menu_gjc_query.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 9.5 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
BIN
module_p/src/main/res/drawable-nodpi/img_pda_menu_gjj_query.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
BIN
module_p/src/main/res/drawable-nodpi/img_pda_menu_gjj_tally.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 9.1 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
BIN
module_p/src/main/res/drawable-nodpi/img_pda_menu_gnj_move.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
module_p/src/main/res/drawable-nodpi/img_pda_menu_gnj_xie_ji.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 9.5 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 9.9 KiB |
BIN
module_p/src/main/res/drawable-nodpi/img_pda_menu_uld.png
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
5
module_p/src/main/res/drawable/bg_phone_home_badge.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@color/phone_home_badge" />
|
||||
<corners android:radius="999dp" />
|
||||
</shape>
|
||||
6
module_p/src/main/res/drawable/bg_phone_home_card.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="rectangle">
|
||||
<solid android:color="@android:color/white" />
|
||||
<stroke android:width="1dp" android:color="@color/phone_home_border" />
|
||||
<corners android:radius="10dp" />
|
||||
</shape>
|
||||
6
module_p/src/main/res/drawable/bg_phone_home_date.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="rectangle">
|
||||
<solid android:color="@android:color/white" />
|
||||
<stroke android:width="1dp" android:color="@color/phone_home_border" />
|
||||
<corners android:radius="6dp" />
|
||||
</shape>
|
||||
4
module_p/src/main/res/drawable/bg_phone_home_fab.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||
<solid android:color="@color/phone_home_fab_bg" />
|
||||
</shape>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@color/phone_home_group_bg" />
|
||||
<stroke android:width="1dp" android:color="@color/phone_home_border" />
|
||||
<corners android:radius="999dp" />
|
||||
</shape>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/phone_home_primary" />
|
||||
<corners android:radius="999dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:drawable="@android:color/transparent" />
|
||||
</selector>
|
||||
14
module_p/src/main/res/drawable/bg_phone_home_tab_bar.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 底部 Tab 栏:白底 + 顶部 1dp 描边 -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/phone_home_border" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:top="1dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@android:color/white" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
6
module_p/src/main/res/drawable/bg_phone_home_tile.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 宫格图标圆角裁剪轮廓(圆角 = 边长 × 0.267),白底用于投影 -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@android:color/white" />
|
||||
<corners android:radius="15.9dp" />
|
||||
</shape>
|
||||
11
module_p/src/main/res/drawable/ic_phone_home_bell.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Material Design Icons: mdi:bell-outline -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M10 21h4c0 1.1-.9 2-2 2s-2-.9-2-2m11-2v1H3v-1l2-2v-6c0-3.1 2-5.8 5-6.7V4c0-1.1.9-2 2-2s2 .9 2 2v.3c3 .9 5 3.6 5 6.7v6zm-4-8c0-2.8-2.2-5-5-5s-5 2.2-5 5v7h10z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Material Design Icons: mdi:chevron-left -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M15.41 16.58L10.83 12l4.58-4.59L14 6l-6 6l6 6z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Material Design Icons: mdi:chevron-right -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M8.59 16.58L13.17 12L8.59 7.41L10 6l6 6l-6 6z" />
|
||||
</vector>
|
||||
11
module_p/src/main/res/drawable/ic_phone_home_settings.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Material Design Icons: mdi:cog(设计稿 settings-fab 内联 SVG) -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z" />
|
||||
</vector>
|
||||
11
module_p/src/main/res/drawable/ic_phone_home_tab_earth.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Material Design Icons: mdi:earth -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M17.9 17.39c-.26-.8-1.01-1.39-1.9-1.39h-1v-3a1 1 0 0 0-1-1H8v-2h2a1 1 0 0 0 1-1V7h2a2 2 0 0 0 2-2v-.41a7.984 7.984 0 0 1 2.9 12.8M11 19.93c-3.95-.49-7-3.85-7-7.93c0-.62.08-1.22.21-1.79L9 15v1a2 2 0 0 0 2 2m1-16A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2" />
|
||||
</vector>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 首页 Tab:选中实心 mdi:home,未选中描边 mdi:home-outline(同设计稿) -->
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/ic_phone_home_tab_home_filled" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/ic_phone_home_tab_home_outline" />
|
||||
</selector>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Material Design Icons: mdi:home -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M10 20v-6h4v6h5v-8h3L12 3L2 12h3v8z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Material Design Icons: mdi:home-outline -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="m12 5.69l5 4.5V18h-2v-6H9v6H7v-7.81zM12 3L2 12h3v8h6v-6h2v6h6v-8h3" />
|
||||
</vector>
|
||||
40
module_p/src/main/res/drawable/ic_phone_home_tab_intl.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
国际 Tab 组合图标(地球 + 右上角飞机),构图取自设计稿 .tab-icon-stack:
|
||||
- mdi:earth 16 单位贴左下 (0,2)-(16,18);mdi:airplane 16 单位 (10,0)-(26,16) 再绕 (18.5,8.5) 旋转 -14°
|
||||
- viewport 裁到两者可见区域的并集 (1.33,1.38)-(23.44,17.38),这样 ImageView 居中 = 视觉居中
|
||||
- 尺寸按单个图形 16dp 换算(16 单位 → 16dp),与其余 Tab 图标同大
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="22.11dp"
|
||||
android:height="16dp"
|
||||
android:viewportWidth="22.11"
|
||||
android:viewportHeight="16">
|
||||
<group
|
||||
android:translateX="-1.33"
|
||||
android:translateY="-1.38">
|
||||
<group
|
||||
android:pivotX="12"
|
||||
android:pivotY="12"
|
||||
android:scaleX="0.6667"
|
||||
android:scaleY="0.6667"
|
||||
android:translateX="-4"
|
||||
android:translateY="-2">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M17.9 17.39c-.26-.8-1.01-1.39-1.9-1.39h-1v-3a1 1 0 0 0-1-1H8v-2h2a1 1 0 0 0 1-1V7h2a2 2 0 0 0 2-2v-.41a7.984 7.984 0 0 1 2.9 12.8M11 19.93c-3.95-.49-7-3.85-7-7.93c0-.62.08-1.22.21-1.79L9 15v1a2 2 0 0 0 2 2m1-16A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2" />
|
||||
</group>
|
||||
<group
|
||||
android:pivotX="12"
|
||||
android:pivotY="12"
|
||||
android:rotation="-14"
|
||||
android:scaleX="0.6667"
|
||||
android:scaleY="0.6667"
|
||||
android:translateX="5.894"
|
||||
android:translateY="-3.864">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M20.56 3.91c.59.59.59 1.54 0 2.12l-3.89 3.89l2.12 9.19l-1.41 1.42l-3.88-7.43L9.6 17l.36 2.47l-1.07 1.06l-1.76-3.18l-3.19-1.77L5 14.5l2.5.37L11.37 11L3.94 7.09l1.42-1.41l9.19 2.12l3.89-3.89c.56-.58 1.56-.58 2.12 0" />
|
||||
</group>
|
||||
</group>
|
||||
</vector>
|
||||
11
module_p/src/main/res/drawable/ic_phone_home_tab_mine.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Material Design Icons: mdi:account-circle-outline -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2M7.07 18.28c.43-.9 3.05-1.78 4.93-1.78s4.5.88 4.93 1.78A7.9 7.9 0 0 1 12 20c-1.86 0-3.57-.64-4.93-1.72m11.29-1.45c-1.43-1.74-4.9-2.33-6.36-2.33s-4.93.59-6.36 2.33A7.93 7.93 0 0 1 4 12c0-4.41 3.59-8 8-8s8 3.59 8 8c0 1.82-.62 3.5-1.64 4.83M12 6c-1.94 0-3.5 1.56-3.5 3.5S10.06 13 12 13s3.5-1.56 3.5-3.5S13.94 6 12 6m0 5a1.5 1.5 0 0 1-1.5-1.5A1.5 1.5 0 0 1 12 8a1.5 1.5 0 0 1 1.5 1.5A1.5 1.5 0 0 1 12 11" />
|
||||
</vector>
|
||||
@@ -1,6 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
手持端首页容器:四个 Tab 的 ViewPager2 + 右上角消息铃铛 + 底部 Tab 栏
|
||||
样式按 documents/5.5寸首页新样式/ 设计稿(小屏紧凑档:导航 46dp、Tab 栏 58dp)
|
||||
Tab 选中态通过 android:selected 下发到子 View,图标/文字颜色走 phone_home_tab_tint 选择器
|
||||
Tab 图标:16dp(与设计稿实际图形同大),与文字水平居中(设计稿 iconify 图标实际只有 16px 且偏在 24px 盒子左上角,按需求不照搬)
|
||||
-->
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
@@ -13,60 +18,67 @@
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/backgroud_gray"
|
||||
android:background="@color/phone_home_bg"
|
||||
tools:context=".ui.enter.PDAEnterActivity">
|
||||
|
||||
<RelativeLayout
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/vp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="50dp">
|
||||
android:layout_above="@id/ll_tab" />
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/vp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
<!--
|
||||
消息铃铛(四个 Tab 共用一处、位置固定):按设计稿 domestic.html / home.html 的 .nav-bell——
|
||||
34dp 按钮距右 12dp、垂直居中于 46dp 导航栏,16dp 图形距按钮左上 4.5dp;角标相对按钮 right:-2dp / top:0,
|
||||
所以容器比按钮宽 2dp、右边距 10dp。dashboard.html 的铃铛位置略有不同(右 8dp),按多数统一,不随 Tab 切换
|
||||
-->
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_message"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="34dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:onClick="@{() -> viewModel.onMessageClick()}">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="10dp"
|
||||
android:onClick="@{() -> viewModel.onMessageClick()}">
|
||||
<ImageView
|
||||
android:id="@+id/iv_message"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
android:paddingStart="4.5dp"
|
||||
android:paddingTop="4.5dp"
|
||||
android:paddingEnd="13.5dp"
|
||||
android:paddingBottom="13.5dp"
|
||||
android:src="@drawable/ic_phone_home_bell"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginRight="10dp"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/img_message_svg" />
|
||||
<TextView
|
||||
android:id="@+id/tv_message"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="15dp"
|
||||
android:layout_gravity="top|end"
|
||||
android:background="@drawable/bg_phone_home_badge"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:minWidth="24dp"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="11sp"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone"
|
||||
tools:text="341"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_message"
|
||||
shape_bg_color="@{@color/red}"
|
||||
shape_radius="@{10}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@color/red"
|
||||
android:gravity="center"
|
||||
android:minWidth="20dp"
|
||||
android:paddingHorizontal="3dp"
|
||||
android:text="2"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="11sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_tab"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_height="58dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@color/white">
|
||||
android:background="@drawable/bg_phone_home_tab_bar"
|
||||
android:paddingTop="1dp"
|
||||
android:paddingBottom="4dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
@@ -74,20 +86,20 @@
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:onClick="@{()->viewModel.onIndexChanged(0)}"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:selected="@{viewModel.index == 0}">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:src="@{viewModel.index == 0 ? @drawable/img_pda_tab_1_s : @drawable/img_pda_tab_1_n}"
|
||||
tools:src="@drawable/img_pda_tab_1_s" />
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_phone_home_tab_home"
|
||||
android:tint="@color/phone_home_tab_tint"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="首页"
|
||||
android:textColor="@{viewModel.index == 0 ? @color/colorPrimary : @color/text_gray}"
|
||||
android:textSize="12sp" />
|
||||
android:id="@+id/tv_tab_home"
|
||||
style="@style/PhoneHomeTabLabel"
|
||||
android:text="首页" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -97,20 +109,20 @@
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:onClick="@{()->viewModel.onIndexChanged(1)}"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:selected="@{viewModel.index == 1}">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:src="@{viewModel.index == 1 ? @drawable/img_pda_tab_2_s : @drawable/img_pda_tab_2_n}"
|
||||
tools:src="@drawable/img_pda_tab_2_s" />
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_phone_home_tab_earth"
|
||||
android:tint="@color/phone_home_tab_tint"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="国内"
|
||||
android:textColor="@{viewModel.index == 1 ? @color/colorPrimary : @color/text_gray}"
|
||||
android:textSize="12sp" />
|
||||
android:id="@+id/tv_tab_gn"
|
||||
style="@style/PhoneHomeTabLabel"
|
||||
android:text="国内" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -119,20 +131,20 @@
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:onClick="@{()->viewModel.onIndexChanged(2)}"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:selected="@{viewModel.index == 2}">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:src="@{viewModel.index == 2 ? @drawable/img_pda_tab_3_s : @drawable/img_pda_tab_3_n}"
|
||||
tools:src="@drawable/img_pda_tab_3_s" />
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_phone_home_tab_intl"
|
||||
android:tint="@color/phone_home_tab_tint"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="国际"
|
||||
android:textColor="@{viewModel.index == 2 ? @color/colorPrimary : @color/text_gray}"
|
||||
android:textSize="12sp" />
|
||||
android:id="@+id/tv_tab_gj"
|
||||
style="@style/PhoneHomeTabLabel"
|
||||
android:text="国际" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -141,23 +153,23 @@
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:onClick="@{()->viewModel.onIndexChanged(3)}"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:selected="@{viewModel.index == 3}">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:src="@{viewModel.index == 3 ? @drawable/img_pda_tab_4_s : @drawable/img_pda_tab_4_n}"
|
||||
tools:src="@drawable/img_pda_tab_4_s" />
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_phone_home_tab_mine"
|
||||
android:tint="@color/phone_home_tab_tint"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="我的"
|
||||
android:textColor="@{viewModel.index == 3 ? @color/colorPrimary : @color/text_gray}"
|
||||
android:textSize="12sp" />
|
||||
android:id="@+id/tv_tab_mine"
|
||||
style="@style/PhoneHomeTabLabel"
|
||||
android:text="我的" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</layout>
|
||||
</layout>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- 手持端首页「国际」Tab(设计稿 documents/5.5寸首页新样式/home.html),分组宫格由 PdaMenuRenderer 渲染 -->
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
@@ -13,31 +12,29 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/backgroud_gray"
|
||||
android:background="@color/phone_home_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp"
|
||||
android:background="@color/colorPrimary">
|
||||
<TextView
|
||||
style="@style/PhoneHomeNavBar"
|
||||
android:text="国际业务" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none">
|
||||
|
||||
<!-- 底部 8dp 留白(设计稿最后一组 section 的 pb-2) -->
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="国际业务"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp" />
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="8dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv"
|
||||
android:layout_width="match_parent"
|
||||
tools:listitem="@layout/item_pda_action"
|
||||
android:layout_height="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="2" />
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
</layout>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- 手持端首页「国内」Tab(设计稿 documents/5.5寸首页新样式/domestic.html),分组宫格由 PdaMenuRenderer 渲染 -->
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
@@ -13,31 +12,29 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/backgroud_gray"
|
||||
android:background="@color/phone_home_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp"
|
||||
android:background="@color/colorPrimary">
|
||||
<TextView
|
||||
style="@style/PhoneHomeNavBar"
|
||||
android:text="国内业务" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none">
|
||||
|
||||
<!-- 底部 8dp 留白(设计稿最后一组 section 的 pb-2) -->
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="国内业务"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp" />
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="8dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="2"
|
||||
tools:listitem="@layout/item_pda_action"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
</layout>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
手持端首页「首页」Tab:航班动态(设计稿 documents/5.5寸首页新样式/dashboard.html)
|
||||
卡片高度随内容(至少 120dp 表体),数据多时卡片撑满可用高度、表体内部滚动分页
|
||||
-->
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
@@ -13,224 +17,233 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/phone_home_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
<TextView
|
||||
style="@style/PhoneHomeNavBar"
|
||||
android:text="首页" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp"
|
||||
android:background="@color/colorPrimary">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="首页"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="10dp">
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:background="@drawable/bg_phone_home_card"
|
||||
android:orientation="vertical"
|
||||
android:padding="1dp"
|
||||
app:layout_constrainedHeight="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0">
|
||||
|
||||
<!--
|
||||
首行:国内/国际 + 进港/出港 + 日期,三组之间等分剩余空间(47dp + 1dp 分隔线 = 设计稿 48px)
|
||||
分段控件 padding 3dp = 设计稿 1px 描边 + 2px 内边距(Android 的 padding 不含 stroke,写 2dp 选中块会上下不居中);
|
||||
高度用 wrap_content(= 3 + 22 + 3 = 28dp)——写死 28dp 时 dp→px 各自取整,内框比 22dp 选中块少 1px,底边被截
|
||||
-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:gravity="center_vertical">
|
||||
android:layout_height="47dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="9dp">
|
||||
|
||||
<TextView
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="航班动态"
|
||||
android:textColor="#333"
|
||||
android:textSize="16sp" />
|
||||
android:background="@drawable/bg_phone_home_segment_group"
|
||||
android:padding="3dp">
|
||||
|
||||
<View
|
||||
<TextView
|
||||
style="@style/PhoneHomeSegment"
|
||||
android:id="@+id/tv_scope_gn"
|
||||
android:onClick="@{() -> viewModel.onCountryTypeChange(false)}"
|
||||
android:selected="@{!viewModel.countryType}"
|
||||
android:text="国内" />
|
||||
|
||||
<TextView
|
||||
style="@style/PhoneHomeSegment"
|
||||
android:layout_marginStart="2dp"
|
||||
android:id="@+id/tv_scope_gj"
|
||||
android:onClick="@{() -> viewModel.onCountryTypeChange(true)}"
|
||||
android:selected="@{viewModel.countryType}"
|
||||
android:text="国际" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<CheckBox
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:button="@drawable/p_home_cb_selector"
|
||||
android:checked="@={!viewModel.countryType}"
|
||||
android:paddingStart="5dp"
|
||||
android:text="国内"
|
||||
android:textSize="12sp" />
|
||||
android:background="@drawable/bg_phone_home_segment_group"
|
||||
android:padding="3dp">
|
||||
|
||||
<CheckBox
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:button="@drawable/p_home_cb_selector"
|
||||
android:checked="@={viewModel.countryType}"
|
||||
android:paddingStart="5dp"
|
||||
android:text="国际"
|
||||
android:textSize="12sp" />
|
||||
<TextView
|
||||
style="@style/PhoneHomeSegment"
|
||||
android:id="@+id/tv_dir_arrival"
|
||||
android:onClick="@{() -> viewModel.onTypeChange(viewModel.TYPE_ARRIVAL)}"
|
||||
android:selected="@{viewModel.type == viewModel.TYPE_ARRIVAL}"
|
||||
android:text="进港" />
|
||||
|
||||
<TextView
|
||||
style="@style/PhoneHomeSegment"
|
||||
android:layout_marginStart="2dp"
|
||||
android:id="@+id/tv_dir_leave"
|
||||
android:onClick="@{() -> viewModel.onTypeChange(viewModel.TYPE_LEAVE)}"
|
||||
android:selected="@{viewModel.type == viewModel.TYPE_LEAVE}"
|
||||
android:text="出港" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="19dp"
|
||||
android:layout_height="31dp"
|
||||
android:onClick="@{() -> viewModel.onDateStep(-1)}"
|
||||
android:paddingHorizontal="2dp"
|
||||
android:paddingVertical="8dp"
|
||||
android:src="@drawable/ic_phone_home_chevron_left"
|
||||
android:tint="@color/phone_home_text_title"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<LinearLayout
|
||||
shape_border_color="@{@color/backgroud_gray}"
|
||||
shape_border_width="@{1}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:onClick="@{()->viewModel.onDateClick()}"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:paddingVertical="4dp">
|
||||
android:layout_width="27dp"
|
||||
android:layout_height="31dp"
|
||||
android:layout_marginStart="3dp"
|
||||
android:background="@drawable/bg_phone_home_date"
|
||||
android:gravity="center"
|
||||
android:onClick="@{() -> viewModel.onDateClick()}"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.date}"
|
||||
android:textColor="#333"
|
||||
android:textSize="13sp"
|
||||
tools:text="2020-01-01" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:src="@drawable/img_daosanjiao" />
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:includeFontPadding="false"
|
||||
android:letterSpacing="0.029"
|
||||
android:text="@{viewModel.dateMonth}"
|
||||
android:textColor="@color/phone_home_text_hint"
|
||||
android:textSize="7sp"
|
||||
tools:text="10月" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="1dp"
|
||||
android:includeFontPadding="false"
|
||||
android:letterSpacing="0.017"
|
||||
android:text="@{viewModel.dateDay}"
|
||||
android:textColor="@color/phone_home_primary"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="20" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="19dp"
|
||||
android:layout_height="31dp"
|
||||
android:layout_marginStart="3dp"
|
||||
android:onClick="@{() -> viewModel.onDateStep(1)}"
|
||||
android:paddingHorizontal="2dp"
|
||||
android:paddingVertical="8dp"
|
||||
android:src="@drawable/ic_phone_home_chevron_right"
|
||||
android:tint="@color/phone_home_text_title"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/backgroud_gray" />
|
||||
android:background="@color/phone_home_divider" />
|
||||
|
||||
<!-- 表头:列宽比 0.95 : 1 : 1.05 : 1(与 item_pda_home 一致) -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="35dp"
|
||||
android:orientation="horizontal">
|
||||
android:layout_height="32dp"
|
||||
android:background="@color/phone_home_group_bg"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="4dp">
|
||||
|
||||
<LinearLayout
|
||||
shape_border_color='@{"#1ed4b3"}'
|
||||
shape_border_width="@{1}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginVertical="5dp"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
style="@style/PhoneHomeTableHead"
|
||||
android:layout_weight="0.95"
|
||||
android:text="航班号" />
|
||||
|
||||
<RelativeLayout
|
||||
shape_bg_color='@{viewModel.type == viewModel.TYPE_LEAVE ? "#1fd4b4" : @color/white}'
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="match_parent"
|
||||
android:onClick="@{()->viewModel.onTypeChange(viewModel.TYPE_LEAVE)}">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="出发"
|
||||
android:textColor="@{viewModel.type == viewModel.TYPE_LEAVE ? @color/white : @color/text_normal}" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
shape_bg_color='@{viewModel.type == viewModel.TYPE_ARRIVAL ? "#1fd4b4" : @color/white}'
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="match_parent"
|
||||
android:onClick="@{()->viewModel.onTypeChange(viewModel.TYPE_ARRIVAL)}">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="到达"
|
||||
android:textColor="@{viewModel.type == viewModel.TYPE_ARRIVAL ? @color/white : @color/text_normal}" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
<TextView
|
||||
style="@style/PhoneHomeTableHead"
|
||||
android:layout_weight="1"
|
||||
android:gravity="end">
|
||||
android:text="航程" />
|
||||
|
||||
<TextView
|
||||
style="@style/PhoneHomeTableHead"
|
||||
android:layout_weight="1.05"
|
||||
android:text="地区类型" />
|
||||
|
||||
<TextView
|
||||
style="@style/PhoneHomeTableHead"
|
||||
android:layout_weight="1"
|
||||
android:text='@{viewModel.type == viewModel.TYPE_ARRIVAL ? "计划降落" : "计划起飞"}' />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/img_config"
|
||||
android:onClick="@{()->viewModel.onConfigClick()}"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:background="#0702f0"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="航班号"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="航程"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="地区类型"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text='@{viewModel.type == viewModel.TYPE_ARRIVAL ? "计划降落" : "计划起飞"}'
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp" />
|
||||
|
||||
</LinearLayout>
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/phone_home_divider" />
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="120dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="120dp"
|
||||
android:overScrollMode="never"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:itemCount="2"
|
||||
tools:listitem="@layout/item_pda_home" />
|
||||
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
<!-- 航班动态设置(右下角悬浮) -->
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:background="@drawable/bg_phone_home_fab"
|
||||
android:elevation="4dp"
|
||||
android:onClick="@{() -> viewModel.onConfigClick()}"
|
||||
android:padding="13.5dp"
|
||||
android:src="@drawable/ic_phone_home_settings"
|
||||
android:tint="@color/phone_home_primary"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
</layout>
|
||||
|
||||
@@ -15,14 +15,15 @@
|
||||
android:background="@color/backgroud_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 顶栏与首页其余 Tab 统一(设计稿 .nav-bar:46dp、#3B71E8、16sp 加粗) -->
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp"
|
||||
android:background="@color/colorPrimary">
|
||||
android:layout_height="46dp"
|
||||
android:background="@color/phone_home_primary">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_width="46dp"
|
||||
android:layout_height="46dp"
|
||||
android:onClick="@{()-> viewModel.onLogoutClick()}"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/img_pda_exit" />
|
||||
@@ -31,9 +32,11 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:letterSpacing="0.019"
|
||||
android:text="我的"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp" />
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
手持端首页宫格入口(设计稿 .feature-card):59.7dp 圆角图标 + 12sp 名称
|
||||
图标由 PdaMenuRenderer 代码设置(含圆角裁剪),这里只绑定文字
|
||||
-->
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
@@ -13,26 +17,33 @@
|
||||
android:id="@+id/ll"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/home_right_item_sel"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
loadImage="@{bean.icon}"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/guoji_in" />
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="59.7dp"
|
||||
android:layout_height="59.7dp"
|
||||
android:background="@drawable/bg_phone_home_tile"
|
||||
android:elevation="3dp"
|
||||
android:outlineAmbientShadowColor="@android:color/transparent"
|
||||
android:outlineSpotShadowColor="#365063"
|
||||
android:scaleType="centerCrop"
|
||||
tools:ignore="ContentDescription,UnusedAttribute"
|
||||
tools:src="@drawable/img_pda_menu_gjc_weighing" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_height="15.6dp"
|
||||
android:layout_marginTop="8.6dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:text="@{bean.title}"
|
||||
android:textSize="16dp" />
|
||||
android:textColor="@color/phone_home_text_label"
|
||||
android:textSize="12sp"
|
||||
tools:text="出港计重" />
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
</layout>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 手持端首页航班动态行(设计稿 .flight-row),列宽比与 fragment_pda_home 表头一致 -->
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
@@ -12,39 +14,34 @@
|
||||
android:id="@+id/ll"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#8c8c8c"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:gravity="center_vertical">
|
||||
android:layout_height="32dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="4dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
style="@style/PhoneHomeTableCell"
|
||||
android:layout_weight="0.95"
|
||||
android:text="@{bean.fno}"
|
||||
android:textColor="@color/white" />
|
||||
tools:text="MU2222" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/PhoneHomeTableCell"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@{bean.hangCheng}"
|
||||
android:textColor="@color/white" />
|
||||
tools:text="HFE-PEK" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
style="@style/PhoneHomeTableCell"
|
||||
android:layout_weight="1.05"
|
||||
android:text="@{bean.countryType}"
|
||||
android:textColor="@color/white" />
|
||||
tools:text="国内" />
|
||||
|
||||
<!-- 计划时间;次日航班右上角标红色 +1 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -54,21 +51,32 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:text="@{bean.timeDesc}"
|
||||
android:textColor="@color/white" />
|
||||
android:textColor="@color/phone_home_text_title"
|
||||
android:textSize="11.5sp"
|
||||
tools:text="12:20" />
|
||||
|
||||
<TextView
|
||||
visible="@{bean.showAddOne()}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_gravity="top"
|
||||
android:layout_marginStart="2dp"
|
||||
android:includeFontPadding="false"
|
||||
android:text="+1"
|
||||
android:textColor="@color/red" />
|
||||
android:textColor="@color/phone_home_badge"
|
||||
android:textSize="9sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/phone_home_divider" />
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
</layout>
|
||||
|
||||
62
module_p/src/main/res/layout/item_pda_menu_group.xml
Normal file
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 手持端首页菜单分组(设计稿 .group-bar + .feature-grid),宫格行由 PdaMenuRenderer 填入 ll_grid -->
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="title"
|
||||
type="String" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 分组栏顶部 1px 白线(设计稿 border-top: 1px solid #FFFFFF) -->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@android:color/white" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="34dp"
|
||||
android:background="@color/phone_home_group_bg"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="16dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="17dp"
|
||||
android:layout_height="12dp"
|
||||
android:src="@drawable/img_pda_menu_group_arrow"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:includeFontPadding="false"
|
||||
android:letterSpacing="0.0154"
|
||||
android:text="@{title}"
|
||||
android:textColor="@color/phone_home_text_title"
|
||||
android:textSize="13sp"
|
||||
tools:text="国际出港" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_grid"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/white"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="12dp"
|
||||
android:paddingTop="14dp"
|
||||
android:paddingRight="12dp"
|
||||
android:paddingBottom="18dp" />
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
15
module_p/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- 手持端首页(PDAEnterActivity 四个 Tab)配色,取自 documents/5.5寸首页新样式/ 设计稿 -->
|
||||
<color name="phone_home_primary">#3B71E8</color> <!-- 状态栏 / 导航栏 / 选中态 -->
|
||||
<color name="phone_home_bg">#F5F7FA</color> <!-- 页面背景 -->
|
||||
<color name="phone_home_group_bg">#F4F6F9</color> <!-- 分组标题栏 / 表头 / 分段控件底 -->
|
||||
<color name="phone_home_border">#EDF0F4</color> <!-- 卡片描边 / Tab 栏顶线 -->
|
||||
<color name="phone_home_divider">#EEF1F5</color> <!-- 表格行分隔线 -->
|
||||
<color name="phone_home_text_title">#16202A</color> <!-- 分组标题 / 表格正文 / 日期箭头 -->
|
||||
<color name="phone_home_text_label">#2D3640</color> <!-- 宫格入口文字 -->
|
||||
<color name="phone_home_text_secondary">#6B7A8D</color> <!-- 表头 / 未选中分段 -->
|
||||
<color name="phone_home_text_hint">#98A4B3</color> <!-- 未选中 Tab / 日期月份 -->
|
||||
<color name="phone_home_badge">#E1192D</color> <!-- 消息角标 -->
|
||||
<color name="phone_home_fab_bg">#E8EFFD</color> <!-- 航班动态设置悬浮按钮 -->
|
||||
</resources>
|
||||
@@ -13,4 +13,55 @@
|
||||
<item name="background">@null</item>
|
||||
</style>
|
||||
|
||||
<!-- 手持端首页四个 Tab 的顶部导航栏(设计稿 .nav-bar:46dp、#3B71E8、16sp 加粗) -->
|
||||
<style name="PhoneHomeNavBar">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">46dp</item>
|
||||
<item name="android:background">@color/phone_home_primary</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:letterSpacing">0.019</item>
|
||||
<item name="android:textColor">@android:color/white</item>
|
||||
<item name="android:textSize">16sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
|
||||
<!-- 手持端首页底部 Tab 文字(设计稿 .tab-label:11sp、行高 1.4 → 15.4dp,选中态加粗由 Activity 设置字重) -->
|
||||
<style name="PhoneHomeTabLabel">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">15.4dp</item>
|
||||
<item name="android:layout_marginTop">4dp</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:includeFontPadding">false</item>
|
||||
<item name="android:textColor">@color/phone_home_tab_tint</item>
|
||||
<item name="android:textSize">11sp</item>
|
||||
</style>
|
||||
|
||||
<!-- 首页航班动态分段按钮(设计稿 .scope-option / .dir-tab:22dp 高、11.5sp,选中蓝底白字) -->
|
||||
<style name="PhoneHomeSegment">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">22dp</item>
|
||||
<item name="android:background">@drawable/bg_phone_home_segment_option</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:includeFontPadding">false</item>
|
||||
<item name="android:paddingHorizontal">5.6dp</item>
|
||||
<item name="android:textColor">@color/phone_home_segment_text</item>
|
||||
<item name="android:textSize">11.5sp</item>
|
||||
</style>
|
||||
|
||||
<!-- 首页航班动态表头 / 单元格(设计稿 .table-head span / .flight-row span:11.5sp 居中) -->
|
||||
<style name="PhoneHomeTableHead">
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:includeFontPadding">false</item>
|
||||
<item name="android:maxLines">1</item>
|
||||
<item name="android:paddingHorizontal">2dp</item>
|
||||
<item name="android:textColor">@color/phone_home_text_secondary</item>
|
||||
<item name="android:textSize">11.5sp</item>
|
||||
</style>
|
||||
|
||||
<style name="PhoneHomeTableCell" parent="PhoneHomeTableHead">
|
||||
<item name="android:textColor">@color/phone_home_text_title</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||