Skip to content

Commit

Permalink
Bug fixes. KRemote is available in all screens
Browse files Browse the repository at this point in the history
  • Loading branch information
lockevod committed Jan 29, 2025
1 parent d9b205e commit fef7d74
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ If you have karoo > 1.535 you can use showmap option also

## Know Bugs
- Sometimes app isn't working fine. You've to stop the app and re-start again (you can do this from karoo menu).


- Hammerhead doesn't provide a way to detect the current screen, so KRemote only worked when you're in Ride app and ride is recording. This produce some problems when you auto-pause your ride.
KRemote will work in every screen now.
## Credits

- Made possible by the generous usage terms of timklge (apache 2.0). He has a great development and I use part of his code to create this extension.
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
applicationId = "com.enderthor.kremote"
minSdk = 26
targetSdk = 34
versionCode = 202501091
versionName = "1.4"
versionCode = 202501291
versionName = "1.5"
}

buildTypes {
Expand Down
6 changes: 3 additions & 3 deletions app/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"packageName": "com.enderthor.kremote",
"latestApkUrl": "https://github.com/lockevod/Karoo-KRemote/releases/latest/download/kremote.apk",
"iconUrl": "https://github.com/lockevod/Karoo-KRemote/releases/latest/download/kremote.png",
"latestVersion": "1.4",
"latestVersionCode": 202501091,
"latestVersion": "1.5",
"latestVersionCode": 202501291,
"developer": "Enderthor",
"description": "This extension for Karoo allows to use a remote to change screens remotely.",
"releaseNotes": "Added showmap/zoom option "
"releaseNotes": "Remove only available in Ride App. There is not a valid option to get the current screnen and produces some issues"
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@ import com.dsi.ant.plugins.antplus.pcc.defines.DeviceState
import com.dsi.ant.plugins.antplus.pcc.defines.RequestAccessResult
import com.dsi.ant.plugins.antplus.pccbase.AntPluginPcc.IDeviceStateChangeReceiver
import com.dsi.ant.plugins.antplus.pccbase.AntPluginPcc.IPluginAccessResultReceiver
import com.enderthor.kremote.data.RemoteSettings
//import com.enderthor.kremote.data.RemoteSettings
import io.hammerhead.karooext.models.ShowMapPage
import io.hammerhead.karooext.models.RideState
//import io.hammerhead.karooext.models.RideState


import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.combine
//import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.launch


import timber.log.Timber
import java.util.EnumSet

val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = "settings")
data class combinedSettings(val settings: RemoteSettings, val active: Boolean)
//data class combinedSettings(val settings: RemoteSettings, val active: Boolean)

class KremoteExtension : KarooExtension("kremote", "1.3") {
class KremoteExtension : KarooExtension("kremote", "1.5") {

lateinit var karooSystem: KarooSystemService

Expand Down Expand Up @@ -123,12 +123,13 @@ class KremoteExtension : KarooExtension("kremote", "1.3") {

applicationContext
.streamSettings()
.combine(karooSystem.streamRideState()) { settings, rideState ->
/*.combine(karooSystem.streamRideState()) { settings, rideState ->
//combinedSettings(settings, !settings.onlyWhileRiding || rideState is RideState.Recording)
combinedSettings(settings, rideState is RideState.Recording)
}
.collectLatest { (settings, active) ->
if (active) {
if (active) {*/
.collectLatest { settings ->
fun sendkaction(action: PerformHardwareAction) {
karooSystem.dispatch(TurnScreenOn)

Expand Down Expand Up @@ -161,8 +162,8 @@ class KremoteExtension : KarooExtension("kremote", "1.3") {
}
}
}
else Timber.d("IN ANTPLUS NOT ACTIVE PARAMETER")
}
// else Timber.d("IN ANTPLUS NOT ACTIVE PARAMETER")
//}

}
return CommandStatus.PASS
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling", vers

androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "datastorePreferences" }
color = { module = "com.maxkeppeler.sheets-compose-dialogs:color", version.ref = "color" }
hammerhead-karoo-ext = { group = "io.hammerhead", name = "karoo-ext", version = "1.1.2" }
hammerhead-karoo-ext = { group = "io.hammerhead", name = "karoo-ext", version = "1.1.4" }


# lifecycle
Expand Down

0 comments on commit fef7d74

Please sign in to comment.