-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix search list #68
Fix search list #68
Conversation
Renamed to `Search` because the list is included ⇒ not a "bar".
This did nothing.
:whartonearth:
The container looks better now.
This a hack to some extent, we should probably change this after we start using Scaffolds.
The list is drawn behind the search bar now. The "best" result is at the top by default so I set padding to make the list start from just below the status bar.
FQ R class was used.
start = dimensionResource(R.dimen.large_padding), | ||
end = dimensionResource(R.dimen.large_padding) | ||
), | ||
navController = navController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we lift navController out of SearchBar while we're here? Passing a lambda can achieve the same thing while making it slightly easier to change nav framework in the future
app/src/main/java/com/imashnake/animite/features/searchbar/Search.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/imashnake/animite/features/searchbar/Search.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/imashnake/animite/features/searchbar/Search.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/imashnake/animite/features/searchbar/Search.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/imashnake/animite/features/searchbar/SearchViewModel.kt
Outdated
Show resolved
Hide resolved
The ripple has a pill shape now.
app/src/main/java/com/imashnake/animite/features/searchbar/SearchViewModel.kt
Show resolved
Hide resolved
app/src/main/java/com/imashnake/animite/features/searchbar/SearchFrontDrop.kt
Show resolved
Hide resolved
app/src/main/java/com/imashnake/animite/features/searchbar/SearchFrontDrop.kt
Outdated
Show resolved
Hide resolved
@@ -11,7 +11,9 @@ class MediaRepository @Inject constructor( | |||
) { | |||
suspend fun fetchMedia(id: Int?, mediaType: MediaType): MediaQuery.Media? { | |||
// TODO: Is there a better way to "wait for animations to complete"? | |||
delay(100) | |||
// searchBarBottomPadding's animateDpAsState has a finishedListener, how do I propagate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you're faced with strange and complex logic like this, it usually means you need to rethink your approach to whatever you're doing in general
Of course, there are cases where complex logic is needed, but I don't think it's this :P
Why do we need to wait for animations to complete before navigating?
app/src/main/java/com/imashnake/animite/features/searchbar/SearchFrontDrop.kt
Outdated
Show resolved
Hide resolved
@@ -177,9 +215,7 @@ fun ExpandedSearchBar(viewModel: SearchViewModel = viewModel()) { | |||
IconButton( | |||
onClick = { | |||
text = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does text not update based on VM state automatically? Maybe we can do something about that
}, | ||
modifier = Modifier | ||
.align(Alignment.End) | ||
.wrapContentSize(), | ||
.wrapContentWidth() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does wrapContentWidth make a difference here?
Unwrapped it in the parent.
Put it on top of the navigation bar.
Redundant scope function.
Made `modifier` optional.
@@ -62,7 +62,7 @@ import com.imashnake.animite.R as Res | |||
) | |||
@Composable | |||
fun SearchFrontDrop( | |||
modifier: Modifier, | |||
modifier: Modifier = Modifier, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default parameters should be last in the list, bring navController
up (or remove it as per my last comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
o7
CONTRIBUTING.md
.Padding is still a mess but this works better than the current implementation. As @boswelja suggested, we should probably use custom layouts to automatically apply padding.
Summary of changes:
1. This is only to test the newSearch
component, we probably won't merge this since padding inHome
is a goddamn mess, i.e., I concede to @boswelja's awfulScaffold
refactor.2. Let's refactor to a
Scaffold
somehow and bring in this new component.Search
since it is not necessarily a "bar".imePadding()
.imeNestedScroll()
.Tested changes:
:heh: