Compare commits

...

2 commits

Author SHA1 Message Date
5139512b4c refactor: rename & format 2024-10-13 17:00:34 +08:00
ea60b6ea4b refactor: use available memory instead of free memory 2024-10-13 16:45:38 +08:00
7 changed files with 17 additions and 31 deletions

1
.idea/.gitignore vendored
View file

@ -1,3 +1,4 @@
# Default ignored files
/shelf/
/workspace.xml
/deploymentTargetSelector.xml

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2024-10-13T08:08:20.168147544Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="LocalEmulator" identifier="path=/home/kagura/.android/avd/Pixel_6_API_35.avd" />
</handle>
</Target>
</DropdownSelection>
<DialogSelection />
</SelectionState>
</selectionStates>
</component>
</project>

View file

@ -40,7 +40,13 @@ class Setting(
modifier = rowModifier
) {
Column(
modifier = Modifier.fillMaxWidth(0.8f)
modifier = Modifier.fillMaxWidth(
if (checkState != null) {
0.8f
} else {
1f
}
)
) {
Text(
text = name,
@ -54,8 +60,9 @@ class Setting(
style = descriptionTextStyle
)
}
Spacer(modifier = Modifier.weight(1f))
if (checkState != null) {
Spacer(modifier = Modifier.weight(1f))
Switch(
checked = checkState!!,
onCheckedChange = {

View file

@ -1,6 +1,5 @@
<resources>
<string name="app_name">文件管理器</string>
<string name="hello">文件管理器</string>
<string name="search">浏览</string>
<string name="edit">编辑</string>
<string name="picture">图片</string>
@ -12,11 +11,8 @@
<string name="store">内部存储</string>
<string name="delete">最近删除</string>
<string name="download">下载与接收</string>
<string name="source">来源</string>
<string name="internet">浏览器</string>
<string name="source">快速查看</string>
<string name="radio">录音机</string>
<string name="next">Next</string>
<string name="previous">Previous</string>
<string name="Delete">删除</string>
<string name="copy">复制</string>
<string name="cut">剪切</string>
@ -59,7 +55,7 @@
最后修改时间:%s
</string>
<string name="advanced">查看什么</string>
<string name="advanced">查看</string>
<string name="settings">软件设置</string>
<string name="all_files">全部文件</string>
<string name="storage_info">内部存储信息</string>

View file

@ -14,16 +14,16 @@ fn get_sys() -> String {
let kernel = System::kernel_version();
// In mb (original result is in b)
let all_memory = sys.total_memory()/1024/1024;
let free_memory = sys.free_memory()/1024/1024;
let available_memory = sys.available_memory()/1024/1024;
let kernel_string = match kernel {
Some(k) => format!("kernel: {}\n", k),
Some(k) => format!("Kernel: {}\n", k),
None => String::new(),
};
format!(
"{}{}MB free of {}MB memory",
kernel_string, free_memory, all_memory
"{}Memory: {}MB available, {}MB in total",
kernel_string, available_memory, all_memory
)
}
@ -34,7 +34,7 @@ pub extern "system" fn Java_com_example_myapplication_utils_Sysinfo_getSystemNat
) -> jstring {
let page_size = get_page_size();
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!");
output.into_raw()
}