Skip to content

Commit 6333081

Browse files
committed
feat(currency-creator): add core types, feature module, and app wiring
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 996fe2e commit 6333081

27 files changed

Lines changed: 2255 additions & 171 deletions

File tree

apps/flipcash/app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ dependencies {
184184
implementation(project(":apps:flipcash:features:tokens"))
185185
implementation(project(":apps:flipcash:features:transactions"))
186186
implementation(project(":apps:flipcash:features:bill-customization"))
187+
implementation(project(":apps:flipcash:features:currency-creator"))
187188
implementation(project(":apps:flipcash:features:discovery"))
188189
implementation(project(":apps:flipcash:features:userflags"))
189190

apps/flipcash/app/src/main/kotlin/com/flipcash/app/inject/AppModule.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ import androidx.core.app.NotificationManagerCompat
77
import com.flipcash.app.android.BuildConfig
88
import com.flipcash.app.core.android.VersionInfo
99
import com.flipcash.app.core.annotations.AccountType
10+
import com.getcode.util.resources.AndroidContentReader
1011
import com.getcode.util.resources.AndroidResources
1112
import com.getcode.util.resources.AndroidSettingsHelper
13+
import com.getcode.util.resources.ContentReader
1214
import com.getcode.util.resources.ResourceHelper
1315
import com.getcode.util.resources.SettingsHelper
1416
import dagger.Module
@@ -33,6 +35,11 @@ object AppModule {
3335
@AccountType
3436
fun providesAccountType(): String = "flipcash.com"
3537

38+
@Provides
39+
fun providesContentReader(
40+
@ApplicationContext context: Context,
41+
): ContentReader = AndroidContentReader(context)
42+
3643
@Provides
3744
fun providesResourceHelper(
3845
@ApplicationContext context: Context,

apps/flipcash/app/src/main/kotlin/com/flipcash/app/internal/ui/App.kt

Lines changed: 144 additions & 146 deletions
Large diffs are not rendered by default.

apps/flipcash/app/src/main/kotlin/com/flipcash/app/internal/ui/navigation/AppScreenContent.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import com.flipcash.app.backupkey.BackupKeyScreen
2525
import com.flipcash.app.balance.BalanceScreen
2626
import com.flipcash.app.cash.CashScreen
2727
import com.flipcash.app.contact.verification.VerificationFlowScreen
28+
import com.flipcash.app.currencycreator.CurrencyCreatorFlowScreen
2829
import com.flipcash.app.core.AppRoute
2930
import com.flipcash.app.currency.RegionSelectionScreen
3031
import com.flipcash.app.deposit.DepositScreen
@@ -112,6 +113,9 @@ fun appEntryProvider(
112113
}
113114
annotatedEntry<AppRoute.Token.OnRamp> { key -> OnRampCustomAmountScreen(key.mint) }
114115
annotatedEntry<AppRoute.Token.Discovery> { TokenDiscoveryScreen() }
116+
annotatedEntry<AppRoute.Token.CurrencyCreator> { key ->
117+
CurrencyCreatorFlowScreen(route = key, resultStateRegistry = resultStateRegistry)
118+
}
115119

116120
// Verification
117121
annotatedEntry<AppRoute.Verification> { key ->

apps/flipcash/core/src/main/kotlin/com/flipcash/app/core/AppRoute.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package com.flipcash.app.core
33
import android.os.Parcelable
44
import androidx.navigation3.runtime.NavKey
55
import com.flipcash.app.core.money.RegionSelectionKind
6+
import com.flipcash.app.core.tokens.CurrencyCreatorResult
7+
import com.flipcash.app.core.tokens.CurrencyCreatorStep
68
import com.flipcash.app.core.tokens.SwapPurpose
79
import com.flipcash.app.core.tokens.SwapResult
810
import com.flipcash.app.core.tokens.SwapStep
@@ -143,6 +145,11 @@ sealed interface AppRoute : NavKey, Parcelable {
143145
@Serializable
144146
data object Discovery: AppRoute
145147

148+
@Serializable
149+
data object CurrencyCreator : Token, FlowRouteWithResult<CurrencyCreatorResult> {
150+
override val initialStack: List<NavKey>
151+
get() = listOf(CurrencyCreatorStep.Info)
152+
}
146153
}
147154

148155
@Serializable
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.flipcash.app.core.tokens
2+
3+
import android.os.Parcelable
4+
import kotlinx.parcelize.Parcelize
5+
import kotlinx.serialization.Serializable
6+
7+
@Serializable
8+
sealed interface CurrencyCreatorResult : Parcelable {
9+
@Parcelize
10+
@Serializable
11+
data object Success : CurrencyCreatorResult
12+
13+
@Parcelize
14+
@Serializable
15+
data object Canceled : CurrencyCreatorResult
16+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package com.flipcash.app.core.tokens
2+
3+
import android.os.Parcelable
4+
import com.getcode.navigation.flow.FlowStep
5+
import com.getcode.opencode.model.ui.TokenBillCustomizations
6+
import kotlinx.parcelize.Parcelize
7+
import kotlinx.serialization.Serializable
8+
9+
@Serializable
10+
sealed interface CurrencyCreatorStep: FlowStep, Parcelable {
11+
12+
@Parcelize
13+
@Serializable
14+
data object Info : CurrencyCreatorStep
15+
16+
@Parcelize
17+
@Serializable
18+
data class NameSelection(val name: String? = null) : CurrencyCreatorStep
19+
20+
@Parcelize
21+
@Serializable
22+
data class IconSelection(val icon: ByteArray? = null): CurrencyCreatorStep {
23+
override fun equals(other: Any?): Boolean {
24+
if (this === other) return true
25+
if (javaClass != other?.javaClass) return false
26+
if (other !is IconSelection) return false
27+
return icon.contentEquals(other.icon)
28+
}
29+
30+
override fun hashCode(): Int {
31+
return icon?.contentHashCode() ?: 0
32+
}
33+
}
34+
35+
@Parcelize
36+
@Serializable
37+
data class DescriptionSelection(val description: String? = null): CurrencyCreatorStep
38+
39+
@Parcelize
40+
@Serializable
41+
data class BillCustomization(val customizations: TokenBillCustomizations? = null): CurrencyCreatorStep
42+
43+
@Parcelize
44+
@Serializable
45+
data object BillReviewAndPurchase: CurrencyCreatorStep
46+
47+
@Parcelize
48+
@Serializable
49+
data object Processing: CurrencyCreatorStep
50+
}

apps/flipcash/core/src/main/res/values/strings.xml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,37 @@
363363
<string name="title_noTransactionHistory">No Activity</string>
364364
<string name="description_noTransactionHistory">Your recent activity will appear here when you send or receive money</string>
365365

366-
<string name="title_billCustomizer">Bill Creator</string>
366+
<string name="title_createYourCurrency">Create Your Currency</string>
367+
<string name="subtitle_currencyCreatorInfo">Launch your own currency in %1$d easy steps</string>
368+
<string name="title_currencyCreatorStepName">Name</string>
369+
<string name="subtitle_currencyCreatorStepName">Choose a unique name for your currency</string>
370+
<string name="title_currencyCreatorStepIcon">Icon</string>
371+
<string name="subtitle_currencyCreatorStepIcon">Upload an icon to represent your currency</string>
372+
<string name="title_currencyCreatorStepDescription">Description</string>
373+
<string name="subtitle_currencyCreatorStepDescription">Describe what your currency is about</string>
374+
<string name="title_currencyCreatorStepDesign">Cash Design</string>
375+
<string name="subtitle_currencyCreatorStepDesign">Customize the look of your cash</string>
376+
<string name="title_currencyCreatorStepPurchase">Purchase %1$s</string>
377+
<string name="subtitle_currencyCreatorStepPurchase">Buy the first %1$s to create your currency</string>
378+
<string name="action_getStarted">Get Started</string>
379+
<string name="title_currencyCreatorNameSelection">What do you want to call your currency?</string>
380+
<string name="hint_currencyName">Currency Name</string>
381+
<string name="action_next">Next</string>
382+
<string name="title_currencyCreatorIconSelection">Upload Currency Icon</string>
383+
<string name="subtitle_currencyCreatorIconSelection">Et nulla qui esse adipisicing veniam deserunt amet veniam veniam veniam cupidatat enim id</string>
384+
<string name="subtitle_currencyCreatorIconRecommended">500x500 Recommended</string>
385+
<string name="title_currencyCreatorDescription">Provide a description for your currency</string>
386+
<string name="hint_description">Description</string>
387+
<string name="label_characters">characters</string>
388+
<string name="label_remaining">remaining</string>
389+
<string name="placeholder_currencyName">Currency Name</string>
390+
<string name="placeholder_currencyTicker">$BadBoys</string>
391+
<string name="action_buyFirstToCreate">Buy the First %1$s to Create</string>
392+
<string name="title_creatingCurrency">Creating %1$s</string>
393+
<string name="title_currencyIsLive">%1$s Is Live</string>
394+
<string name="subtitle_currencyIsLive">Your currency is ready to receive and use</string>
395+
<string name="action_done">Done</string>
396+
367397
<string name="title_deviceLogs">Application Logs</string>
368398
<string name="action_clearLogs">Clear</string>
369399
<string name="action_shareLogs">Share</string>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build/
2+
.gradle/
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
plugins {
2+
alias(libs.plugins.flipcash.android.feature)
3+
}
4+
5+
android {
6+
namespace = "${Gradle.flipcashNamespace}.features.currencycreator"
7+
}
8+
9+
dependencies {
10+
implementation(project(":apps:flipcash:features:bill-customization"))
11+
implementation(project(":apps:flipcash:shared:bills"))
12+
implementation(project(":apps:flipcash:shared:userflags"))
13+
implementation(project(":libs:messaging"))
14+
15+
implementation(project(":services:flipcash"))
16+
implementation(project(":services:opencode"))
17+
}

0 commit comments

Comments
 (0)