Skip to content

Commit

Permalink
Clean up some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nonproto committed Jan 14, 2025
1 parent bf8a6b2 commit d49efdd
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Toonily : ReducedHttpSource() {
}
}

protected open val userAgentRandomizer = " ${Random.nextInt().absoluteValue}"
val userAgentRandomizer = " ${Random.nextInt().absoluteValue}"

override val client: OkHttpClient =
network.cloudFlareClient
Expand Down Expand Up @@ -99,7 +99,7 @@ class Toonily : ReducedHttpSource() {
return parseSearchManga(response)
}

open fun searchFormBuilder(query: String): FormBody.Builder =
fun searchFormBuilder(query: String): FormBody.Builder =
FormBody.Builder().apply {
add("action", "madara_load_more")
add("page", "0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class WeebCentral : ReducedHttpSource() {
return try {
when (this == null) {
true -> 0L
false -> dateFormat.parse(this).time
false -> dateFormat.parse(this)!!.time
}
} catch (_: ParseException) {
0L
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,22 +150,21 @@ class SettingsDataController : SettingsController() {
}

when (requestCode) {
STORAGE_DIR ->
if (data != null && resultCode == Activity.RESULT_OK) {
val context = applicationContext ?: return
val uri = data.data
val flags =
Intent.FLAG_GRANT_READ_URI_PERMISSION or
Intent.FLAG_GRANT_WRITE_URI_PERMISSION

if (uri != null) {
context.contentResolver.takePersistableUriPermission(uri, flags)
}

val file = UniFile.fromUri(context, uri)!!
STORAGE_DIR -> {
val context = applicationContext ?: return
val uri = data.data
val flags =
Intent.FLAG_GRANT_READ_URI_PERMISSION or
Intent.FLAG_GRANT_WRITE_URI_PERMISSION

storagePreferences.baseStorageDirectory().set(file.uri.toString())
if (uri != null) {
context.contentResolver.takePersistableUriPermission(uri, flags)
}

val file = UniFile.fromUri(context, uri)!!

storagePreferences.baseStorageDirectory().set(file.uri.toString())
}
CODE_BACKUP_CREATE -> {
val flags =
Intent.FLAG_GRANT_READ_URI_PERMISSION or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import okio.sink
fun BufferedSource.saveTo(file: File) {
try {
// Create parent dirs if needed
file.parentFile.mkdirs()
file.parentFile!!.mkdirs()

// Copy to destination
saveTo(file.outputStream())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package org.nekomanga.presentation.components

import ToolTipButton
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ViewList
import androidx.compose.material.icons.filled.MoreVert
import androidx.compose.material.icons.filled.ViewList
import androidx.compose.material.icons.filled.ViewModule
import androidx.compose.material.icons.filled.Visibility
import androidx.compose.material.icons.filled.VisibilityOff
Expand Down Expand Up @@ -36,7 +36,7 @@ fun listGridAppBarAction(
false ->
AppBar.Action(
title = UiText.StringResource(resourceId = R.string.display_as_list),
icon = Icons.Filled.ViewList,
icon = Icons.AutoMirrored.Filled.ViewList,
onClick = onClick,
isEnabled = isEnabled,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.LocalContentAlpha
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.filled.Search
import androidx.compose.material.icons.filled.SearchOff
Expand Down Expand Up @@ -84,7 +84,7 @@ fun NekoScaffold(
isRoot: Boolean = false,
scrollBehavior: TopAppBarScrollBehavior =
TopAppBarDefaults.enterAlwaysScrollBehavior(state = rememberTopAppBarState()),
navigationIcon: ImageVector = Icons.Filled.ArrowBack,
navigationIcon: ImageVector = Icons.AutoMirrored.Filled.ArrowBack,
navigationIconLabel: String = stringResource(id = R.string.back),
onSearch: (String?) -> Unit = {},
snackBarHost: @Composable () -> Unit = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.HelpOutline
import androidx.compose.material.icons.automirrored.outlined.HelpOutline
import androidx.compose.material.icons.outlined.Info
import androidx.compose.material.icons.outlined.QueryStats
import androidx.compose.material.icons.outlined.Settings
Expand Down Expand Up @@ -102,7 +102,7 @@ fun MainDropdownMenu(
)
Row(
title = UiText.StringResource(R.string.help),
icon = UiIcon.Icon(Icons.Outlined.HelpOutline),
icon = UiIcon.Icon(Icons.AutoMirrored.Outlined.HelpOutline),
onClick = helpClick,
onDismiss = onDismiss,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Icon
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowForward
import androidx.compose.material.icons.automirrored.filled.ArrowForward
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -86,7 +86,7 @@ fun BrowseHomePage(
)
Gap(Size.tiny)
Icon(
imageVector = Icons.Default.ArrowForward,
imageVector = Icons.AutoMirrored.Default.ArrowForward,
modifier = Modifier.size(24.dp),
contentDescription = null,
tint = MaterialTheme.colorScheme.onSurface,
Expand Down Expand Up @@ -148,7 +148,7 @@ fun BrowseHomePage(
)
Gap(Size.tiny)
Icon(
imageVector = Icons.Default.ArrowForward,
imageVector = Icons.AutoMirrored.Default.ArrowForward,
modifier = Modifier.size(24.dp),
contentDescription = null,
tint = MaterialTheme.colorScheme.onSurface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.Comment
import androidx.compose.material.icons.filled.Bookmarks
import androidx.compose.material.icons.filled.Comment
import androidx.compose.material.icons.filled.HotelClass
import androidx.compose.material.icons.outlined._18UpRating
import androidx.compose.material3.MaterialTheme
Expand Down Expand Up @@ -245,7 +245,7 @@ fun InformationBlock(

Gap(Size.tiny)
Image(
imageVector = Icons.Filled.Comment,
imageVector = Icons.AutoMirrored.Filled.Comment,
contentDescription = null,
colorFilter = ColorFilter.tint(mediumAlpha),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.items
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Sort
import androidx.compose.material.icons.automirrored.filled.Sort
import androidx.compose.material3.AssistChip
import androidx.compose.material3.ElevatedCard
import androidx.compose.material3.FilterChip
Expand Down Expand Up @@ -656,7 +656,9 @@ private fun SortChip(sortType: Sort, onClick: () -> Unit) {
AssistChip(
onClick = onClick,
label = { Text(text = stringResource(id = sortType.stringRes)) },
trailingIcon = { Icon(imageVector = Icons.Default.Sort, contentDescription = null) },
trailingIcon = {
Icon(imageVector = Icons.AutoMirrored.Default.Sort, contentDescription = null)
},
)
}
}
Expand Down

0 comments on commit d49efdd

Please sign in to comment.