Compare commits
4 Commits
967700ff58
...
a74cdb7769
| Author | SHA1 | Date |
|---|---|---|
|
|
a74cdb7769 | |
|
|
f41557db0e | |
|
|
e807974315 | |
|
|
1733b2a971 |
|
|
@ -101,11 +101,14 @@ class TempCallActivity : AppCompatActivity() {
|
||||||
instance = this
|
instance = this
|
||||||
isMinimized = false
|
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") ?: ""
|
val gid = intent.getStringExtra("gid") ?: ""
|
||||||
currentGroupName = groupName
|
currentGroupName = groupName
|
||||||
currentTempGroupId = com.example.kingway.ptt.SendAtUtil.str2HexStr(gid)
|
if (gid.isNotEmpty()) {
|
||||||
MainActivity.executeJs("if(window.startPullGroupLock){ window.startPullGroupLock('$currentTempGroupId'); }")
|
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
|
findViewById<TextView>(R.id.tv_group_name).text = groupName
|
||||||
|
|
||||||
setupMinimizeButton()
|
setupMinimizeButton()
|
||||||
|
|
@ -373,17 +376,22 @@ class TempCallActivity : AppCompatActivity() {
|
||||||
val dataArray = json.optJSONArray("data")
|
val dataArray = json.optJSONArray("data")
|
||||||
if (dataArray != null && dataArray.length() > 0) {
|
if (dataArray != null && dataArray.length() > 0) {
|
||||||
val record = dataArray.optJSONObject(0) ?: return
|
val record = dataArray.optJSONObject(0) ?: return
|
||||||
val pullTitle = record.optString("pullTitle", "")
|
val pullTitle = record.optString("pullTitle", "")
|
||||||
val pullTime = record.optString("pullTime", "")
|
val pullTime = record.optString("pullTime", "")
|
||||||
val sourceUnitName = record.optString("sourceUnitName", "")
|
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 {
|
runOnUiThread {
|
||||||
findViewById<View>(R.id.ll_pull_info)?.visibility = View.VISIBLE
|
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_title)?.text = "标题:$pullTitle"
|
||||||
findViewById<TextView>(R.id.tv_pull_source_unit)?.text = "发送单位:$sourceUnitName"
|
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_time)?.text = "拉动时间:$pullTime"
|
||||||
findViewById<TextView>(R.id.tv_pull_content)?.text = "内容:请注意!正在对你单位进行视频拉动。"
|
findViewById<TextView>(R.id.tv_pull_content)?.text = "内容:请注意!正在对你单位进行视频拉动。"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="12dp"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
@ -121,16 +121,16 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="16sp"
|
android:textSize="18sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_pull_source_unit"
|
android:id="@+id/tv_pull_source_unit"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="6dp"
|
||||||
android:textColor="#CCFFFFFF"
|
android:textColor="#CCFFFFFF"
|
||||||
android:textSize="12sp" />
|
android:textSize="13sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_pull_time"
|
android:id="@+id/tv_pull_time"
|
||||||
|
|
@ -144,9 +144,9 @@
|
||||||
android:id="@+id/tv_pull_content"
|
android:id="@+id/tv_pull_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="6dp"
|
android:layout_marginTop="10dp"
|
||||||
android:textColor="#FFD700"
|
android:textColor="#EF4444"
|
||||||
android:textSize="13sp"
|
android:textSize="14sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
@ -179,9 +179,10 @@
|
||||||
<!-- 用于确认并静音语音的按钮 -->
|
<!-- 用于确认并静音语音的按钮 -->
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_confirm_alert"
|
android:id="@+id/btn_confirm_alert"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="160dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="40dp"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
android:background="@drawable/btn_minimize_bg"
|
android:background="@drawable/btn_minimize_bg"
|
||||||
android:text="确认"
|
android:text="确认"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
|
|
|
||||||
|
|
@ -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`。
|
||||||
Loading…
Reference in New Issue