-
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.
- Loading branch information
1 parent
f8602f4
commit ed8c698
Showing
13 changed files
with
383 additions
and
114 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
25 changes: 25 additions & 0 deletions
25
app/src/main/java/com/lilstiffy/mockgps/extensions/Address+Extensions.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.lilstiffy.mockgps.extensions | ||
|
||
import android.location.Address | ||
|
||
fun Address.displayString(): String { | ||
val addressLines = mutableListOf<String>() | ||
|
||
// Concatenate lines of the address | ||
for (i in 0..maxAddressLineIndex) { | ||
addressLines.add(getAddressLine(i) ?: "") | ||
} | ||
|
||
// Concatenate other details | ||
val otherDetails = mutableListOf<String>().apply { | ||
locality?.let { add(it) } | ||
adminArea?.let { add(it) } | ||
countryName?.let { add(it) } | ||
postalCode?.let { add(it) } | ||
} | ||
|
||
// Combine address lines and other details | ||
val result = (addressLines + otherDetails).joinToString(", ") | ||
|
||
return result.ifEmpty { "No address available" } | ||
} |
7 changes: 7 additions & 0 deletions
7
app/src/main/java/com/lilstiffy/mockgps/extensions/LatLng+Extensions.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.lilstiffy.mockgps.extensions | ||
|
||
import com.google.android.gms.maps.model.LatLng | ||
|
||
fun LatLng.prettyPrint(): String { | ||
return "Latitude: ${this.latitude}\nLongitude: ${this.longitude}" | ||
} |
16 changes: 16 additions & 0 deletions
16
app/src/main/java/com/lilstiffy/mockgps/extensions/Modifier+Extensions.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.lilstiffy.mockgps.extensions | ||
|
||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.shadow | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
|
||
fun Modifier.roundedShadow(radius: Dp): Modifier { | ||
return this | ||
.shadow( | ||
elevation = 4.dp, | ||
shape = RoundedCornerShape(radius), | ||
clip = true | ||
) | ||
} |
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
Oops, something went wrong.