refactor: rename & format
This commit is contained in:
parent
ea60b6ea4b
commit
5139512b4c
5 changed files with 14 additions and 11 deletions
|
@ -40,7 +40,13 @@ class Setting(
|
||||||
modifier = rowModifier
|
modifier = rowModifier
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.fillMaxWidth(0.8f)
|
modifier = Modifier.fillMaxWidth(
|
||||||
|
if (checkState != null) {
|
||||||
|
0.8f
|
||||||
|
} else {
|
||||||
|
1f
|
||||||
|
}
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = name,
|
text = name,
|
||||||
|
@ -54,8 +60,9 @@ class Setting(
|
||||||
style = descriptionTextStyle
|
style = descriptionTextStyle
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
|
||||||
if (checkState != null) {
|
if (checkState != null) {
|
||||||
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
|
|
||||||
Switch(
|
Switch(
|
||||||
checked = checkState!!,
|
checked = checkState!!,
|
||||||
onCheckedChange = {
|
onCheckedChange = {
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,6 +1,5 @@
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">文件管理器</string>
|
<string name="app_name">文件管理器</string>
|
||||||
<string name="hello">文件管理器</string>
|
|
||||||
<string name="search">浏览</string>
|
<string name="search">浏览</string>
|
||||||
<string name="edit">编辑</string>
|
<string name="edit">编辑</string>
|
||||||
<string name="picture">图片</string>
|
<string name="picture">图片</string>
|
||||||
|
@ -12,11 +11,8 @@
|
||||||
<string name="store">内部存储</string>
|
<string name="store">内部存储</string>
|
||||||
<string name="delete">最近删除</string>
|
<string name="delete">最近删除</string>
|
||||||
<string name="download">下载与接收</string>
|
<string name="download">下载与接收</string>
|
||||||
<string name="source">来源</string>
|
<string name="source">快速查看</string>
|
||||||
<string name="internet">浏览器</string>
|
|
||||||
<string name="radio">录音机</string>
|
<string name="radio">录音机</string>
|
||||||
<string name="next">Next</string>
|
|
||||||
<string name="previous">Previous</string>
|
|
||||||
<string name="Delete">删除</string>
|
<string name="Delete">删除</string>
|
||||||
<string name="copy">复制</string>
|
<string name="copy">复制</string>
|
||||||
<string name="cut">剪切</string>
|
<string name="cut">剪切</string>
|
||||||
|
@ -59,7 +55,7 @@
|
||||||
最后修改时间:%s
|
最后修改时间:%s
|
||||||
</string>
|
</string>
|
||||||
|
|
||||||
<string name="advanced">查看什么</string>
|
<string name="advanced">查看</string>
|
||||||
<string name="settings">软件设置</string>
|
<string name="settings">软件设置</string>
|
||||||
<string name="all_files">全部文件</string>
|
<string name="all_files">全部文件</string>
|
||||||
<string name="storage_info">内部存储信息</string>
|
<string name="storage_info">内部存储信息</string>
|
||||||
|
|
|
@ -17,12 +17,12 @@ fn get_sys() -> String {
|
||||||
let available_memory = sys.available_memory()/1024/1024;
|
let available_memory = sys.available_memory()/1024/1024;
|
||||||
|
|
||||||
let kernel_string = match kernel {
|
let kernel_string = match kernel {
|
||||||
Some(k) => format!("kernel: {}\n", k),
|
Some(k) => format!("Kernel: {}\n", k),
|
||||||
None => String::new(),
|
None => String::new(),
|
||||||
};
|
};
|
||||||
|
|
||||||
format!(
|
format!(
|
||||||
"{}memory:{}MB available, {}MB in total",
|
"{}Memory: {}MB available, {}MB in total",
|
||||||
kernel_string, available_memory, all_memory
|
kernel_string, available_memory, all_memory
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ pub extern "system" fn Java_com_example_myapplication_utils_Sysinfo_getSystemNat
|
||||||
) -> jstring {
|
) -> jstring {
|
||||||
let page_size = get_page_size();
|
let page_size = get_page_size();
|
||||||
let output = env
|
let output = env
|
||||||
.new_string(format!("{}\nPagesize: {}", get_sys(), page_size))
|
.new_string(format!("{}\nPage Size: {}", get_sys(), page_size))
|
||||||
.expect("Couldn't create java string!");
|
.expect("Couldn't create java string!");
|
||||||
output.into_raw()
|
output.into_raw()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue