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