Author: Adam <git@apiote.xyz>
go to departures if result is only one
app/src/main/java/xyz/apiote/bimba/czwek/search/Results.kt | 4 app/src/main/java/xyz/apiote/bimba/czwek/search/ResultsActivity.kt | 3
diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/search/Results.kt b/app/src/main/java/xyz/apiote/bimba/czwek/search/Results.kt index 0bbafad5fb4881f1844e67c1235381172636e8cc..409962c789481b83f7f2530fe71e0a79d7df0ed4 100644 --- a/app/src/main/java/xyz/apiote/bimba/czwek/search/Results.kt +++ b/app/src/main/java/xyz/apiote/bimba/czwek/search/Results.kt @@ -112,4 +112,8 @@ fun update(queryables: List) { this.queryables = queryables notifyDataSetChanged() } + + fun click(position: Int) { + onClickListener(queryables[position]) + } } \ No newline at end of file diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/search/ResultsActivity.kt b/app/src/main/java/xyz/apiote/bimba/czwek/search/ResultsActivity.kt index ce654214b2ecfb8a9bc0093bdf6ccdd6e5ac5ab9..72e786a2802d63564f3cf16d34fe1a6279313832 100644 --- a/app/src/main/java/xyz/apiote/bimba/czwek/search/ResultsActivity.kt +++ b/app/src/main/java/xyz/apiote/bimba/czwek/search/ResultsActivity.kt @@ -186,6 +186,9 @@ R.drawable.error_search ) ) } else { + if (queryables.size == 1) { + adapter.click(0) + } binding.resultsOverlay.visibility = View.GONE binding.errorImage.visibility = View.GONE binding.errorText.visibility = View.GONE