Fix Search IME padding.
This commit is contained in:
parent
dc35a694ba
commit
eadaf7ef4f
5 changed files with 23 additions and 10 deletions
|
|
@ -1,6 +1,7 @@
|
|||
# 0.1.4
|
||||
> Not yet
|
||||
* Fix SignIn and EditProfile Url.
|
||||
* Fix Search IME padding.
|
||||
|
||||
# 0.1.3
|
||||
> Published 25 October 2022
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class SearchRepository @Inject constructor(
|
|||
var query = "SELECT ${BookDbo.TABLE}.* FROM ${BookDbo.TABLE}"
|
||||
// add where arguments.
|
||||
query += args.where(argument = search) {
|
||||
BookDbo.run { "$TABLE.$TITLE LIKE '%'||?||'%'" }
|
||||
BookDbo.run { "$TABLE.$TITLE LIKE '%' || ? || '%'" }
|
||||
}
|
||||
query += args.where(argument = authorId) {
|
||||
"${BookDbo.ID} IN (SELECT ${BookDbo.ID} FROM ${BookAuthorCrossRef.TABLE} WHERE ${AuthorDbo.ID} LIKE ?)"
|
||||
|
|
@ -62,7 +62,7 @@ class SearchRepository @Inject constructor(
|
|||
// build the SQL query.
|
||||
val query = AuthorDbo.run {
|
||||
"SELECT $TABLE.* FROM $TABLE" +
|
||||
args.where(argument = search) { "$TABLE.$NAME LIKE '%'||?||'%'" } +
|
||||
args.where(argument = search) { "$TABLE.$NAME LIKE '%' || ? || '%'" } +
|
||||
" ORDER BY $TABLE.$SORT" +
|
||||
" LIMIT $limit OFFSET $offset;"
|
||||
}
|
||||
|
|
@ -78,7 +78,7 @@ class SearchRepository @Inject constructor(
|
|||
// build the SQL query.
|
||||
val query = GenreDbo.run {
|
||||
"SELECT $TABLE.* FROM $TABLE" +
|
||||
args.where(argument = search) { "$TABLE.$NAME LIKE '%'||?||'%'" } +
|
||||
args.where(argument = search) { "$TABLE.$NAME LIKE '%' || ? || '%'" } +
|
||||
" ORDER BY $TABLE.$NAME" +
|
||||
" LIMIT $limit OFFSET $offset;"
|
||||
}
|
||||
|
|
@ -94,7 +94,7 @@ class SearchRepository @Inject constructor(
|
|||
// build the SQL query.
|
||||
val query = SeriesDbo.run {
|
||||
"SELECT $TABLE.* FROM $TABLE" +
|
||||
args.where(argument = search) { "$TABLE.$NAME LIKE '%'||?||'%'" } +
|
||||
args.where(argument = search) { "$TABLE.$NAME LIKE '%' || ? || '%'" } +
|
||||
" ORDER BY $TABLE.$SORT" +
|
||||
" LIMIT $limit OFFSET $offset;"
|
||||
}
|
||||
|
|
@ -110,7 +110,7 @@ class SearchRepository @Inject constructor(
|
|||
// build the SQL query.
|
||||
val query = LanguageDbo.run {
|
||||
"SELECT $TABLE.* FROM $TABLE" +
|
||||
args.where(argument = search) { "$TABLE.$NAME LIKE '%'||?||'%'" } +
|
||||
args.where(argument = search) { "$TABLE.$NAME LIKE '%' || ? || '%'" } +
|
||||
" ORDER BY $TABLE.$NAME" +
|
||||
" LIMIT $limit OFFSET $offset;"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import androidx.compose.ui.platform.LocalFocusManager
|
|||
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.max
|
||||
import androidx.paging.PagingData
|
||||
import androidx.paging.compose.collectAsLazyPagingItems
|
||||
import androidx.paging.compose.items
|
||||
|
|
@ -30,6 +31,7 @@ import com.pixelized.biblib.ui.screen.home.page.search.viewModel.BookSearchViewM
|
|||
import com.pixelized.biblib.ui.theme.BibLibTheme
|
||||
import com.pixelized.biblib.utils.extention.bibLib
|
||||
import com.pixelized.biblib.utils.extention.default
|
||||
import com.pixelized.biblib.utils.extention.imeHeight
|
||||
import com.pixelized.biblib.utils.extention.navigationBarsHeight
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.emptyFlow
|
||||
|
|
@ -87,7 +89,10 @@ private fun SearchPageContent(
|
|||
LazyColumn(
|
||||
modifier = modifier,
|
||||
contentPadding = PaddingValues(
|
||||
bottom = MaterialTheme.bibLib.dimen.thumbnail.padding + navigationBarsHeight()
|
||||
bottom = MaterialTheme.bibLib.dimen.thumbnail.padding + max(
|
||||
navigationBarsHeight(),
|
||||
imeHeight()
|
||||
)
|
||||
),
|
||||
verticalArrangement = Arrangement.spacedBy(
|
||||
space = MaterialTheme.bibLib.dimen.thumbnail.arrangement
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
package com.pixelized.biblib.utils.extention
|
||||
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
import androidx.compose.foundation.layout.asPaddingValues
|
||||
import androidx.compose.foundation.layout.navigationBars
|
||||
import androidx.compose.foundation.layout.statusBars
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.unit.Dp
|
||||
|
||||
|
|
@ -11,6 +8,10 @@ import androidx.compose.ui.unit.Dp
|
|||
fun navigationBarsHeight(): Dp =
|
||||
WindowInsets.navigationBars.asPaddingValues().calculateBottomPadding()
|
||||
|
||||
@Composable
|
||||
fun imeHeight(): Dp =
|
||||
WindowInsets.ime.asPaddingValues().calculateBottomPadding()
|
||||
|
||||
@Composable
|
||||
fun statusBarsHeight(): Dp =
|
||||
WindowInsets.statusBars.asPaddingValues().calculateTopPadding()
|
||||
Loading…
Add table
Add a link
Reference in a new issue