Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_47647075
emmagee
提交
21337431
E
emmagee
项目概览
weixin_47647075
/
emmagee
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
emmagee
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
21337431
编写于
12月 17, 2013
作者:
A
andrewleo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added: 优化浮窗界面
上级
09028b5e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
30 deletion
+25
-30
res/layout/floating.xml
res/layout/floating.xml
+18
-21
res/values/strings.xml
res/values/strings.xml
+1
-0
src/com/netease/qa/emmagee/service/EmmageeService.java
src/com/netease/qa/emmagee/service/EmmageeService.java
+6
-9
未找到文件。
res/layout/floating.xml
浏览文件 @
21337431
...
...
@@ -42,41 +42,38 @@
android:id=
"@+id/memtotal"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"3dp"
android:layout_weight=
"0.4"
android:gravity=
"right"
android:paddingRight=
"10.0dip"
android:textColor=
"#FFFFFF"
/>
<TextView
android:id=
"@+id/
batt
"
android:id=
"@+id/
traffic
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"3dp"
android:layout_weight=
"0.4"
android:gravity=
"right"
android:paddingRight=
"10.0dip"
android:textColor=
"#FFFFFF"
/>
<TextView
android:id=
"@+id/traffic"
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"3dp"
android:layout_weight=
"0.4"
android:gravity=
"right"
android:paddingRight=
"10.0dip"
android:textColor=
"#FFFFFF"
/>
<Button
android:id=
"@+id/wifi"
android:layout_width=
"50dp"
android:layout_height=
"25dp"
/>
<Button
android:id=
"@+id/stop"
android:layout_width=
"50dp"
android:layout_height=
"25dp"
/>
android:orientation=
"horizontal"
android:layout_weight=
"0.4"
>
<Button
android:id=
"@+id/wifi"
android:textSize =
"12dp"
android:layout_width=
"80dp"
android:layout_height=
"40dp"
/>
<Button
android:id=
"@+id/stop"
android:text=
"停止测试"
android:textSize =
"12dp"
android:layout_width=
"80dp"
android:layout_height=
"40dp"
/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
...
...
res/values/strings.xml
浏览文件 @
21337431
...
...
@@ -23,5 +23,6 @@
<string
name=
"ok"
>
保存
</string>
<string
name=
"openwifi"
>
开启wifi
</string>
<string
name=
"closewifi"
>
关闭wifi
</string>
<string
name=
"stopTest"
>
停止测试
</string>
</resources>
\ No newline at end of file
src/com/netease/qa/emmagee/service/EmmageeService.java
浏览文件 @
21337431
...
...
@@ -86,7 +86,6 @@ public class EmmageeService extends Service {
private
TextView
txtTotalMem
;
private
TextView
txtUnusedMem
;
private
TextView
txtTraffic
;
private
TextView
txtBatt
;
private
ImageView
imgViIcon
;
private
Button
btnWifi
;
private
int
delaytime
;
...
...
@@ -181,7 +180,6 @@ public class EmmageeService extends Service {
viFloatingWindow
=
LayoutInflater
.
from
(
this
).
inflate
(
R
.
layout
.
floating
,
null
);
txtUnusedMem
=
(
TextView
)
viFloatingWindow
.
findViewById
(
R
.
id
.
memunused
);
txtTotalMem
=
(
TextView
)
viFloatingWindow
.
findViewById
(
R
.
id
.
memtotal
);
txtBatt
=
(
TextView
)
viFloatingWindow
.
findViewById
(
R
.
id
.
batt
);
txtTraffic
=
(
TextView
)
viFloatingWindow
.
findViewById
(
R
.
id
.
traffic
);
btnWifi
=
(
Button
)
viFloatingWindow
.
findViewById
(
R
.
id
.
wifi
);
...
...
@@ -195,7 +193,6 @@ public class EmmageeService extends Service {
txtUnusedMem
.
setTextColor
(
android
.
graphics
.
Color
.
RED
);
txtTotalMem
.
setTextColor
(
android
.
graphics
.
Color
.
RED
);
txtTraffic
.
setTextColor
(
android
.
graphics
.
Color
.
RED
);
txtBatt
.
setTextColor
(
android
.
graphics
.
Color
.
RED
);
imgViIcon
=
(
ImageView
)
viFloatingWindow
.
findViewById
(
R
.
id
.
img2
);
imgViIcon
.
setVisibility
(
View
.
GONE
);
imgViIcon
.
setOnClickListener
(
new
OnClickListener
()
{
...
...
@@ -412,15 +409,15 @@ public class EmmageeService extends Service {
}
// 如果cpu使用率存在且都不小于0,则输出
if
(
processCpuRatio
!=
null
&&
totalCpuRatio
!=
null
)
{
txtUnusedMem
.
setText
(
"
占用内存:"
+
processMemory
+
"MB"
+
",机器剩余:
"
+
freeMemoryKb
+
"MB"
);
txtTotalMem
.
setText
(
"
占用CPU:"
+
processCpuRatio
+
"%"
+
",总体CPU:
"
+
totalCpuRatio
+
"%"
);
txtBatt
.
setText
(
"电量:"
+
totalBatt
+
",电流:"
+
currentBatt
+
"mA"
)
;
txtUnusedMem
.
setText
(
"
应用/剩余内存:"
+
processMemory
+
"/
"
+
freeMemoryKb
+
"MB"
);
txtTotalMem
.
setText
(
"
应用/总体CPU:"
+
processCpuRatio
+
"%/
"
+
totalCpuRatio
+
"%"
);
String
batt
=
"电流:"
+
currentBatt
+
"mA,"
;
if
(
"-1"
.
equals
(
trafficSize
))
{
txtTraffic
.
setText
(
"本程序或本设备不支持流量统计"
);
txtTraffic
.
setText
(
batt
+
"本程序或本设备不支持流量统计"
);
}
else
if
(
isMb
)
txtTraffic
.
setText
(
"流量:"
+
fomart
.
format
(
trafficMb
)
+
"MB"
);
txtTraffic
.
setText
(
batt
+
"流量:"
+
fomart
.
format
(
trafficMb
)
+
"MB"
);
else
txtTraffic
.
setText
(
"流量:"
+
trafficSize
+
"KB"
);
txtTraffic
.
setText
(
batt
+
"流量:"
+
trafficSize
+
"KB"
);
}
// 当内存为0切cpu使用率为0时则是被测应用退出
if
(
"0"
.
equals
(
processMemory
)
&&
"0.00"
.
equals
(
processCpuRatio
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录