优化图标

状态
各种接口
This commit is contained in:
844143714@qq,com 2026-05-06 19:45:58 +08:00
parent cafdfe3e4d
commit 3da7f99741
34 changed files with 64 additions and 119 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

View File

@ -165,6 +165,11 @@
</div> </div>
</div> </div>
<div style="margin-top: 8px; font-size: 13px;">
当前群组: <span id="ptt-current-group" style="color: #6366f1; font-weight: bold;">-</span>
<span id="ptt-current-group-id" style="color: #94a3b8; font-size: 11px; margin-left: 5px;"></span>
</div>
<div class="ws-input-group" style="margin-top: 10px;"> <div class="ws-input-group" style="margin-top: 10px;">
<div style="display: flex; gap: 8px;"> <div style="display: flex; gap: 8px;">
<div style="flex: 1;"> <div style="flex: 1;">
@ -194,6 +199,7 @@
<button class="btn ptt-btn ptt-action-btn" style="background: #6366f1;" onclick="pttGetGroups()" disabled>获取群组</button> <button class="btn ptt-btn ptt-action-btn" style="background: #6366f1;" onclick="pttGetGroups()" disabled>获取群组</button>
<button class="btn ptt-btn ptt-action-btn" style="background: #8b5cf6;" onclick="pttGetMembers()" disabled>获取成员</button> <button class="btn ptt-btn ptt-action-btn" style="background: #8b5cf6;" onclick="pttGetMembers()" disabled>获取成员</button>
<button class="btn ptt-btn ptt-action-btn" style="background: #3b82f6;" onclick="pttJumpGroup()" disabled>切换群组</button> <button class="btn ptt-btn ptt-action-btn" style="background: #3b82f6;" onclick="pttJumpGroup()" disabled>切换群组</button>
<button class="btn ptt-btn ptt-action-btn" style="background: #0ea5e9;" onclick="pttGetCurrentGroup()">当前群组</button>
<button class="btn ptt-btn ptt-action-btn btn-orange" onclick="pttForceRelease()" disabled>强制释放</button> <button class="btn ptt-btn ptt-action-btn btn-orange" onclick="pttForceRelease()" disabled>强制释放</button>
<button class="btn ptt-btn ptt-action-btn" style="background: #000; color: #fca5a5;" onclick="pttSimulateConflict()" disabled>模拟冲突</button> <button class="btn ptt-btn ptt-action-btn" style="background: #000; color: #fca5a5;" onclick="pttSimulateConflict()" disabled>模拟冲突</button>
</div> </div>
@ -552,6 +558,14 @@
var loginId = window.android.pttGetLoginId ? window.android.pttGetLoginId() : ""; var loginId = window.android.pttGetLoginId ? window.android.pttGetLoginId() : "";
updatePttLoginStatus(status, loginId); updatePttLoginStatus(status, loginId);
} }
if (window.android && window.android.pttGetCurrentGroup) {
try {
var group = JSON.parse(window.android.pttGetCurrentGroup());
if (group.groupId) {
updatePttCurrentGroup(group.groupId, group.groupName);
}
} catch(e) {}
}
}, 500); }, 500);
// 告知 Android 页面加载完成 // 告知 Android 页面加载完成
@ -748,6 +762,13 @@
} }
}; };
// 更新当前群组信息 (由 Android 实时推送)
function updatePttCurrentGroup(groupId, groupName) {
document.getElementById('ptt-current-group').innerText = groupName || '-';
document.getElementById('ptt-current-group-id').innerText = groupId ? '(' + groupId + ')' : '';
showPttResult("进入群组: " + groupName + " (" + groupId + ")");
};
// PTT 登录成功回调 (由 Android 调用) // PTT 登录成功回调 (由 Android 调用)
function onPttLoginSuccess() { function onPttLoginSuccess() {
updatePttLoginStatusUI("02"); updatePttLoginStatusUI("02");
@ -872,6 +893,21 @@
} }
} }
function pttGetCurrentGroup() {
if (window.android && window.android.pttGetCurrentGroup) {
try {
var group = JSON.parse(window.android.pttGetCurrentGroup());
if (group.groupId) {
updatePttCurrentGroup(group.groupId, group.groupName);
} else {
showPttResult("当前无群组信息");
}
} catch(e) {
showPttResult("获取群组信息失败");
}
}
}
function pttSendAtCmd() { function pttSendAtCmd() {
var cmd = document.getElementById('ptt-at-cmd').value.trim(); var cmd = document.getElementById('ptt-at-cmd').value.trim();
if (!cmd) { if (!cmd) {

View File

@ -40,6 +40,14 @@ public class CallBackResolution {
pttLoginId = ""; pttLoginId = "";
} }
public static String getCurrentGroupId() {
return indexGroupId;
}
public static String getCurrentGroupName() {
return indexGroupName;
}
public static void at_OEM_AT_cb(List<String> lisHex){ public static void at_OEM_AT_cb(List<String> lisHex){
if (lisHex.size() == 0) { if (lisHex.size() == 0) {
return; return;

View File

@ -31,6 +31,7 @@ class AndroidInterface(private val activity: MainActivity) {
"pttSpeakPlay" -> { pttSpeakPlay(); "" } "pttSpeakPlay" -> { pttSpeakPlay(); "" }
"pttGetLoginStatus" -> pttGetLoginStatus() "pttGetLoginStatus" -> pttGetLoginStatus()
"pttGetLoginId" -> pttGetLoginId() "pttGetLoginId" -> pttGetLoginId()
"pttGetCurrentGroup" -> pttGetCurrentGroup()
"pttSpeakRelease" -> { pttSpeakRelease(); "" } "pttSpeakRelease" -> { pttSpeakRelease(); "" }
"pttForceRelease" -> { pttForceRelease(); "" } "pttForceRelease" -> { pttForceRelease(); "" }
"pttGetGroupInfo" -> { pttGetGroupInfo(); "" } "pttGetGroupInfo" -> { pttGetGroupInfo(); "" }
@ -113,6 +114,17 @@ class AndroidInterface(private val activity: MainActivity) {
return com.example.kingway.ptt.CallBackResolution.getPttLoginId() return com.example.kingway.ptt.CallBackResolution.getPttLoginId()
} }
fun pttGetCurrentGroup(): String {
return try {
val json = JSONObject()
json.put("groupId", com.example.kingway.ptt.CallBackResolution.getCurrentGroupId())
json.put("groupName", com.example.kingway.ptt.CallBackResolution.getCurrentGroupName())
json.toString()
} catch (e: Exception) {
"{\"groupId\":\"\",\"groupName\":\"\"}"
}
}
fun pttSpeakRelease() { fun pttSpeakRelease() {
if (isSpeaking) { if (isSpeaking) {
val now = System.currentTimeMillis() val now = System.currentTimeMillis()

View File

@ -152,7 +152,7 @@ class LoginActivity : AppCompatActivity() {
// 使用 Handler 替代硬编码 Thread.sleep避免阻塞或随意开辟线程 // 使用 Handler 替代硬编码 Thread.sleep避免阻塞或随意开辟线程
android.os.Handler(android.os.Looper.getMainLooper()).postDelayed({ android.os.Handler(android.os.Looper.getMainLooper()).postDelayed({
try { try {
com.example.kingway.ptt.SendAtUtil.toLogin("gzzdweb01", "123456", "61.243.1.123", 1, 1) com.example.kingway.ptt.SendAtUtil.toLogin(username, "123456", "220.154.131.231", 1, 1)
} catch (e: Exception) { } catch (e: Exception) {
Timber.tag("PTT").e(e, "PTT login error") Timber.tag("PTT").e(e, "PTT login error")
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -1,38 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="200"
android:viewportHeight="200">
<!-- 背景圆盘 (纯净白) -->
<path
android:fillColor="#FFFFFF"
android:pathData="M100,100m-90,0a90,90 0,1 1,180 0a90,90 0,1 1,-180 0" />
<!-- 消防盾牌外廓 (消防红) -->
<path
android:fillColor="#D62828"
android:pathData="M100,40 L155,62 L155,115 C155,145 130,170 100,180 C70,170 45,145 45,115 L45,62 Z" />
<!-- 盾牌内嵌线条 (深红) -->
<path
android:fillColor="#9B2226"
android:pathData="M100,50 L145,68 L145,115 C145,140 125,160 100,170 C75,160 55,140 55,115 L55,68 Z" />
<!-- 核心星芒/十字 (象征调度指挥) -->
<path
android:fillColor="#FFFFFF"
android:pathData="M100,75 L112,98 L138,98 L118,115 L125,140 L100,125 L75,140 L82,115 L62,98 L88,98 Z" />
<!-- 外部环绕科技蓝装饰条 -->
<path
android:strokeColor="#004A8F"
android:strokeWidth="5"
android:strokeLineCap="round"
android:pathData="M100,20 A80,80 0,0 1,180,100" />
<path
android:strokeColor="#004A8F"
android:strokeWidth="5"
android:strokeLineCap="round"
android:pathData="M100,180 A80,80 0,0 1,20,100" />
</vector>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#004A8F"
android:pathData="M0,0h108v108h-108z" />
</vector>

View File

@ -1,46 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<!-- 消防盾牌图标,适配 Android 108dp 规范 -->
<group
android:translateX="18.5"
android:translateY="18.5"
android:scaleX="0.355"
android:scaleY="0.355">
<!-- 背景白底,确保中心可见 -->
<path
android:fillColor="#FFFFFF"
android:pathData="M100,100m-90,0a90,90 0,1 1,180 0a90,90 0,1 1,-180 0" />
<!-- 消防盾牌外廓 -->
<path
android:fillColor="#D62828"
android:pathData="M100,40 L155,62 L155,115 C155,145 130,170 100,180 C70,170 45,145 45,115 L45,62 Z" />
<!-- 盾牌内嵌线条 -->
<path
android:fillColor="#9B2226"
android:pathData="M100,50 L145,68 L145,115 C145,140 125,160 100,170 C75,160 55,140 55,115 L55,68 Z" />
<!-- 核心星芒/十字 -->
<path
android:fillColor="#FFFFFF"
android:pathData="M100,75 L112,98 L138,98 L118,115 L125,140 L100,125 L75,140 L82,115 L62,98 L88,98 Z" />
<!-- 科技蓝环绕装饰 -->
<path
android:strokeColor="#004A8F"
android:strokeWidth="5"
android:strokeLineCap="round"
android:pathData="M100,20 A80,80 0,0 1,180,100" />
<path
android:strokeColor="#004A8F"
android:strokeWidth="5"
android:strokeLineCap="round"
android:pathData="M100,180 A80,80 0,0 1,20,100" />
</group>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_launcher_background" />
<item android:drawable="@drawable/ic_launcher_foreground" />
</layer-list>

View File

@ -72,14 +72,14 @@
android:textSize="20sp" /> android:textSize="20sp" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="15dp" android:layout_marginBottom="15dp"
android:text="测试账号: admin 密码: 123456" android:text="测试账号 锋: test004 助力农: test005 kui: test006 密码: 123456 必须不然用不了ptt或者2个后台都要加"
android:textColor="#CCFFFFFF" android:textColor="#CCFFFFFF"
android:textSize="14sp" /> android:textSize="14sp" />
<EditText <EditText
android:id="@+id/et_username" android:id="@+id/et_username"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB