Skip to content

Commit

Permalink
Update LaunchUtils.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
Tonnie-Dev committed Aug 14, 2024
1 parent 7e0d5a8 commit 3c1f0af
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions app/src/main/java/com/uxstate/launchpad/utils/LaunchUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.uxstate.launchpad.domain.model.Provider
import com.uxstate.launchpad.domain.model.Rocket
import com.uxstate.launchpad.domain.model.Status
import java.util.Date
import java.util.Locale


fun generateRandomIntId(): Int {
Expand All @@ -29,6 +30,14 @@ fun generateLoremIpsum(wordCount: Int): String {
return (1..wordCount).joinToString(" ") { loremText.random() }
}

fun String.capitalizeFirstLetter():String {
return replaceFirstChar {
if (it.isLowerCase()) it.titlecase(
Locale.getDefault()
) else it.toString()
}
}


fun generateLaunch():Launch {

Expand All @@ -38,10 +47,10 @@ fun generateLaunch():Launch {
mission = Mission(
name = "My Mission",
description = generateLoremIpsum(30),
type = ""
type = generateLoremIpsum(2)
),
imageUrl = "android.resource://",
provider = Provider(id = generateRandomIntId(), name = "", type = ""),
provider = Provider(id = generateRandomIntId(), name = "Space X", type = generateLoremIpsum(1)),
status = Status(name = "Name", abbrev = "TBD", description = ""),
pad = Pad(
locationName = generateLoremIpsum(2),
Expand Down

0 comments on commit 3c1f0af

Please sign in to comment.