Skip to content

Commit 1fb49d9

Browse files
manager: Misc changes
1 parent 07c77b5 commit 1fb49d9

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

manager/app/src/main/java/me/weishu/kernelsu/ui/screen/AppProfile.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,8 @@ private fun AppMenuBox(packageName: String, content: @Composable () -> Unit) {
326326
touchPoint = it
327327
expanded = true
328328
}
329-
}) {
329+
}
330+
) {
330331

331332
content()
332333

manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Install.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,6 @@ private fun TopBar(
356356

357357
@Composable
358358
@Preview
359-
fun SelectInstall_Preview() {
359+
fun SelectInstallPreview() {
360360
InstallScreen(EmptyDestinationsNavigator)
361361
}

manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt

+1-4
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ fun ModuleScreen(navigator: DestinationsNavigator) {
131131
)
132132
},
133133
floatingActionButton = {
134-
if (hideInstallButton) {
135-
/* Empty */
136-
} else {
134+
if (!hideInstallButton) {
137135
val moduleInstall = stringResource(id = R.string.module_install)
138136
val selectZipLauncher = rememberLauncherForActivityResult(
139137
contract = ActivityResultContracts.StartActivityForResult()
@@ -162,7 +160,6 @@ fun ModuleScreen(navigator: DestinationsNavigator) {
162160
icon = { Icon(Icons.Filled.Add, moduleInstall) },
163161
text = { Text(text = moduleInstall) },
164162
)
165-
166163
}
167164
},
168165
contentWindowInsets = WindowInsets.safeDrawing.only(WindowInsetsSides.Top + WindowInsetsSides.Horizontal),

manager/app/src/main/java/me/weishu/kernelsu/ui/util/KsuCli.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ inline fun <T> withNewRootShell(
5151
return createRootShell(globalMnt).use(block)
5252
}
5353

54-
fun getFileNameFromUri(context: Context, uri: Uri): String? {
54+
fun Uri.getFileName(context: Context): String? {
5555
var fileName: String? = null
5656
val contentResolver: ContentResolver = context.contentResolver
57-
val cursor: Cursor? = contentResolver.query(uri, null, null, null, null)
57+
val cursor: Cursor? = contentResolver.query(this, null, null, null, null)
5858
cursor?.use {
5959
if (it.moveToFirst()) {
6060
fileName = it.getString(it.getColumnIndexOrThrow(OpenableColumns.DISPLAY_NAME))

0 commit comments

Comments
 (0)