forked from Scottish-Tech-Army/Soundscape-Android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This was a duplication of code, but MarkerData is more neatly written, so use it.
- Loading branch information
Showing
10 changed files
with
77 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 14 additions & 3 deletions
17
app/src/main/java/org/scottishtecharmy/soundscape/database/local/model/MarkerData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
package org.scottishtecharmy.soundscape.database.local.model | ||
|
||
import io.realm.kotlin.ext.backlinks | ||
import io.realm.kotlin.query.RealmResults | ||
import io.realm.kotlin.types.RealmObject | ||
import kotlin.Double.Companion.NaN | ||
|
||
class MarkerData( | ||
var addressName: String, | ||
var fullAddress: String, | ||
var location: Location?, | ||
var fullAddress: String = "" | ||
) : RealmObject { | ||
constructor() : this("", "", Location(NaN, NaN)) | ||
} | ||
constructor() : this("", Location(NaN, NaN)) | ||
|
||
val route: RealmResults<RouteData> by backlinks(RouteData::waypoints) | ||
override fun equals(other: Any?): Boolean { | ||
if (this === other) return true | ||
if (javaClass != other?.javaClass) return false | ||
other as MarkerData | ||
return (addressName == other.addressName) && | ||
(location?.latitude == other.location?.latitude) && | ||
(location?.longitude == other.location?.longitude) | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters