Compare commits

...

4 Commits

3 changed files with 69 additions and 22 deletions

View File

@ -101,11 +101,14 @@ class TempCallActivity : AppCompatActivity() {
instance = this
isMinimized = false
val groupName = intent.getStringExtra("group_name") ?: "临时会话"
val rawGroupName = intent.getStringExtra("group_name")
val groupName = if (rawGroupName.isNullOrEmpty() || rawGroupName == "null") "临时会话" else rawGroupName
val gid = intent.getStringExtra("gid") ?: ""
currentGroupName = groupName
currentTempGroupId = com.example.kingway.ptt.SendAtUtil.str2HexStr(gid)
MainActivity.executeJs("if(window.startPullGroupLock){ window.startPullGroupLock('$currentTempGroupId'); }")
if (gid.isNotEmpty()) {
currentTempGroupId = com.example.kingway.ptt.SendAtUtil.str2HexStr(gid)
MainActivity.executeJs("if(window.startPullGroupLock){ window.startPullGroupLock('$currentTempGroupId'); }")
}
findViewById<TextView>(R.id.tv_group_name).text = groupName
setupMinimizeButton()
@ -373,17 +376,22 @@ class TempCallActivity : AppCompatActivity() {
val dataArray = json.optJSONArray("data")
if (dataArray != null && dataArray.length() > 0) {
val record = dataArray.optJSONObject(0) ?: return
val pullTitle = record.optString("pullTitle", "")
val pullTime = record.optString("pullTime", "")
val sourceUnitName = record.optString("sourceUnitName", "")
val pullTitle = record.optString("pullTitle", "")
val pullTime = record.optString("pullTime", "")
val sourceUnitName = record.optString("sourceUnitName", "")
val pocGid = record.optString("pocGid", "")
if (pocGid.isNotEmpty() && currentTempGroupId.isEmpty()) {
currentTempGroupId = pocGid
MainActivity.executeJs("if(window.startPullGroupLock){ window.startPullGroupLock('$currentTempGroupId'); }")
}
runOnUiThread {
findViewById<View>(R.id.ll_pull_info)?.visibility = View.VISIBLE
findViewById<TextView>(R.id.tv_pull_title)?.text = "标题:$pullTitle"
findViewById<TextView>(R.id.tv_pull_source_unit)?.text = "发送单位:$sourceUnitName"
findViewById<TextView>(R.id.tv_pull_time)?.text = "拉动时间:$pullTime"
findViewById<TextView>(R.id.tv_pull_content)?.text = "内容:请注意!正在对你单位进行视频拉动。"
}
runOnUiThread {
findViewById<View>(R.id.ll_pull_info)?.visibility = View.VISIBLE
findViewById<TextView>(R.id.tv_pull_title)?.text = "标题:$pullTitle"
findViewById<TextView>(R.id.tv_pull_source_unit)?.text = "发送单位:$sourceUnitName"
findViewById<TextView>(R.id.tv_pull_time)?.text = "拉动时间:$pullTime"
findViewById<TextView>(R.id.tv_pull_content)?.text = "内容:请注意!正在对你单位进行视频拉动。"
}
}
}
} catch (e: Exception) {

View File

@ -113,7 +113,7 @@
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:layout_marginTop="8dp"
android:layout_marginTop="12dp"
android:visibility="gone">
<TextView
@ -121,16 +121,16 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:textSize="16sp"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_pull_source_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginTop="6dp"
android:textColor="#CCFFFFFF"
android:textSize="12sp" />
android:textSize="13sp" />
<TextView
android:id="@+id/tv_pull_time"
@ -144,9 +144,9 @@
android:id="@+id/tv_pull_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:textColor="#FFD700"
android:textSize="13sp"
android:layout_marginTop="10dp"
android:textColor="#EF4444"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
@ -179,9 +179,10 @@
<!-- 用于确认并静音语音的按钮 -->
<Button
android:id="@+id/btn_confirm_alert"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_width="160dp"
android:layout_height="40dp"
android:layout_marginTop="16dp"
android:layout_gravity="center_horizontal"
android:background="@drawable/btn_minimize_bg"
android:text="确认"
android:textColor="#FFFFFF"

View File

@ -0,0 +1,38 @@
# 临时呼叫界面优化与 pocGid 逻辑对接设计规约 (Design Spec)
## 1. 需求概述
为 StandAPP 临时呼叫功能做进一步改进与视觉优化:
1. **pocGid 解析与覆盖**:异步查询接口 `/api/vid-pull-record/my-list` 后,若返回数据包含 `pocGid` 字段且有效,需要用其覆盖当前的 `currentTempGroupId` 缓存,并通知前端接口 `startPullGroupLock(pocGid)`
2. **第一排“临时群组”显示为 null 的修复**:防范传递的 Intent Extra `"group_name"` 出现为空、`null` 或 `"null"` 字符串的情形,确保兜底展示为 `"临时会话"`
3. **界面字体、颜色与确认按钮样式优化**:美化拉动记录卡片排版,包括增大标题字号、加粗、改变按钮背景与宽度、调整配色提升对比度等。
## 2. 方案设计
### 2.1 pocGid 覆盖机制
`TempCallActivity.kt``fetchPullRecord()` 成功响应体处理中:
```kotlin
val pocGid = record.optString("pocGid", "")
if (pocGid.isNotEmpty()) {
currentTempGroupId = pocGid
MainActivity.executeJs("if(window.startPullGroupLock){ window.startPullGroupLock('$currentTempGroupId'); }")
}
```
### 2.2 null 值防御
`onCreate()` 中,对 intent 传入的群组名称进行过滤判断:
```kotlin
val rawGroupName = intent.getStringExtra("group_name")
val groupName = if (rawGroupName.isNullOrEmpty() || rawGroupName == "null") "临时会话" else rawGroupName
currentGroupName = groupName
```
### 2.3 UI 优化
* **布局文件**`app/src/main/res/layout/activity_temp_call.xml`
* **拉动记录区域样式优化**
* `tv_pull_title` (标题):字体设为 `#FFFFFF``textSize="18sp"`,加粗,`layout_marginTop="12dp"`。
* `tv_pull_source_unit` (发送单位):字体设为 `#CCFFFFFF``textSize="13sp"``layout_marginTop="6dp"`。
* `tv_pull_time` (拉动时间):字体设为 `#99FFFFFF``textSize="12sp"``layout_marginTop="2dp"`。
* `tv_pull_content` (拉动内容):字体设为警示的红色 `#EF4444` 或黄色 `#FBBF24``textSize="14sp"`,加粗,`layout_marginTop="10dp"`。
* **确认按钮样式优化**
* 修改为固定宽度 `layout_width="160dp"`(居中显示),高为 `40dp`
* 背景使用带有圆角的深蓝或半透明按钮背景,字体颜色为纯白,字号为 `14sp`