Author: Adam Evyčędo <git@apiote.xyz>
add exact to transitous favourites
%!v(PANIC=String method: strings: negative Repeat count)
diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/home/HomeViewModel.kt b/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/home/HomeViewModel.kt index 6a680cae533f9a7a5d7cd02238a13c691493768d..a29ee2ccca5d92c7bff96a401d89999cce5a91d4 100644 --- a/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/home/HomeViewModel.kt +++ b/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/home/HomeViewModel.kt @@ -87,7 +87,7 @@ favourite.stopCode, null, context, 12, // XXX heuristics - false // TODO save exact in favourite + favourite.exact ) stopDepartures?.let { sDs -> if (sDs.events.isEmpty()) { diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/departures/DeparturesActivity.kt b/app/src/main/java/xyz/apiote/bimba/czwek/departures/DeparturesActivity.kt index 99ec4bb97a1bba448ce9f1b7df2e0aad8214e898..af176f7bd8b1395c34e44696e3784252d0ad07af 100644 --- a/app/src/main/java/xyz/apiote/bimba/czwek/departures/DeparturesActivity.kt +++ b/app/src/main/java/xyz/apiote/bimba/czwek/departures/DeparturesActivity.kt @@ -592,7 +592,8 @@ feedID, feedName, code, getName(), - linesFilter.toList() + linesFilter.toList(), + getExact() )).copy(lines = linesFilter.toList()) repo.saveFavourite(favourite) repo.close() diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/repo/Favourite.kt b/app/src/main/java/xyz/apiote/bimba/czwek/repo/Favourite.kt index fa0a08da12719f5e4c70a44f5f002a995adbeb45..e646289182e4bc43f395baa22349625c864941a3 100644 --- a/app/src/main/java/xyz/apiote/bimba/czwek/repo/Favourite.kt +++ b/app/src/main/java/xyz/apiote/bimba/czwek/repo/Favourite.kt @@ -4,4 +4,12 @@ // SPDX-License-Identifier: AGPL-3.0-or-later package xyz.apiote.bimba.czwek.repo -data class Favourite(val sequence: Int?, val feedID: String, val feedName: String, val stopCode: String, val stopName: String, val lines: List<String>) \ No newline at end of file +data class Favourite( + val sequence: Int?, + val feedID: String, + val feedName: String, + val stopCode: String, + val stopName: String, + val lines: List<String>, + val exact: Boolean +) \ No newline at end of file diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/repo/OfflineRepository.kt b/app/src/main/java/xyz/apiote/bimba/czwek/repo/OfflineRepository.kt index 04f964cc639a9facf25c760ed9ef487d06801c4e..07850536570dac297712700dc046d3805f2912c7 100644 --- a/app/src/main/java/xyz/apiote/bimba/czwek/repo/OfflineRepository.kt +++ b/app/src/main/java/xyz/apiote/bimba/czwek/repo/OfflineRepository.kt @@ -55,7 +55,8 @@ cursor.getString(2), cursor.getString(3), stopCode, cursor.getString(1), - cursor.getString(4).split("||").filter { it != "" } + cursor.getString(4).split("||").filter { it != "" }, + false // TODO get exact from database ) cursor.close() return f @@ -81,7 +82,8 @@ cursor.getString(2), cursor.getString(3), cursor.getString(4), cursor.getString(1), - cursor.getString(5).split("||").filter { it != "" } + cursor.getString(5).split("||").filter { it != "" }, + false // TODO get exact from database ) ) }