Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
a746d3d
Merge pull request #53 from gruntsoftware/release/v4.4.1
kcw-grunt Mar 30, 2025
ba8ea45
Revert "Updated the APIManager"
kcw-grunt Mar 31, 2025
638ce3a
Reverted the Kotlin APIManager.
kcw-grunt Mar 31, 2025
5344a96
Add version and code to welcome screen
kcw-grunt Mar 31, 2025
ebc3bb9
reset padding
kcw-grunt Mar 31, 2025
03c68b8
Merge pull request #56 from gruntsoftware/feature/add-version-issue-108
kcw-grunt Apr 1, 2025
c770f01
Revert "Updated the APIManager"
kcw-grunt Mar 31, 2025
f8c1bd5
Reverted the Kotlin APIManager.
kcw-grunt Mar 31, 2025
ff58b57
fix: fix crash when FragmentSignal dismissed
andhikayuana Apr 4, 2025
d64ea93
fix: fix sync after wipe
andhikayuana Apr 7, 2025
277f387
Merge branch 'hotfix/api-manager-fix' of https://github.com/brainwall…
kcw-grunt Apr 7, 2025
9a8a20f
fix: fix wrong lifecycle to trigger callback at FragmentSignal
andhikayuana Apr 7, 2025
832fa36
Update issue templates
kcw-grunt Apr 8, 2025
b294cd6
updated core changes
kcw-grunt Apr 8, 2025
4ed8af3
Merge pull request #57 from gruntsoftware/hotfix/api-manager-fix
kcw-grunt Apr 8, 2025
089995a
Rename .java to .kt
andhikayuana Apr 11, 2025
7e85987
chore: refactor BRApiManager & APIClient
andhikayuana Apr 11, 2025
0aa41e7
chore: remove unused part at APIClient
andhikayuana Apr 14, 2025
0cc29cb
feat: wip new peer discovery
andhikayuana Apr 14, 2025
54d2d9e
feat: implement selected peer ip address from cache (fetched from API)
andhikayuana Apr 14, 2025
c6923b1
feat: implement selected peer ip address from cache (fetched from API)
andhikayuana Apr 14, 2025
ef4e6d2
feat: filter out peers with NODE_NETWORK, NODE_BLOOM
andhikayuana Apr 15, 2025
2336939
fix: race condition when clear shared prefs values after wipeAll
andhikayuana Apr 16, 2025
51a4d9a
Merge pull request #62 from gruntsoftware/hotfix/prefs-race-condition
kcw-grunt Apr 16, 2025
62afb9d
Merge pull request #61 from gruntsoftware/feat/new-peer-discovery
kcw-grunt Apr 16, 2025
391e319
Updating the core library
kcw-grunt Apr 16, 2025
836b6f0
Chore/revert pre peer discovery (Android) (#69)
andhikayuana Apr 25, 2025
3caa1a7
feat: remove unused activity (ImportActivity) at AndroidManifest.xml …
andhikayuana Apr 29, 2025
a324444
fix: fix crash IllegalStateException: cannot make a new request becau…
andhikayuana May 2, 2025
1f9c5d0
code bump
kcw-grunt May 2, 2025
7ca17d3
Feat/move tx fee (#74)
andhikayuana May 5, 2025
e7fb2b7
fix: fix dismiss allow state loss (#76)
andhikayuana May 7, 2025
3d8ef98
fix: fix typo at strings.xml (#75)
andhikayuana May 7, 2025
25be1a8
feat: new UI for receive and topup flow (moonpay integration) (#72)
andhikayuana May 12, 2025
18eda46
version and code bump
kcw-grunt May 12, 2025
dbb6a5f
Added support url (#81)
kcw-grunt May 19, 2025
c82a5e3
version and code bump
kcw-grunt May 19, 2025
2981ec6
Revert from eda0f532 & cherry pick (#86)
andhikayuana May 25, 2025
c161fed
build bump
kcw-grunt May 25, 2025
63d7494
chore: open bread activity first then open moonpay widget (#88)
andhikayuana May 26, 2025
f09eb28
Adjustment for circleci (#89)
andhikayuana May 29, 2025
47c69cd
fix: android: Footer version label is obfuscated (#92)
andhikayuana May 29, 2025
a9c4a63
fix: You saved it right screen reset button covers words (#93)
andhikayuana May 29, 2025
d8f08ad
tiny resizing (#94)
kcw-grunt May 29, 2025
ef93585
code and version bump
kcw-grunt May 29, 2025
174d612
change break (#97)
kcw-grunt May 30, 2025
a4521d7
build code number
andhikayuana May 31, 2025
6fec1e2
fix: [#137] fix: Reset fiat options in Buy / Receive modal (#99)
andhikayuana Jun 2, 2025
c8fdf8d
Chore/update device data (#100)
kcw-grunt Jun 2, 2025
3f646df
Add agent string obfuscation (#103)
kcw-grunt Jun 14, 2025
642f9e6
updated metadata (#105)
kcw-grunt Jun 24, 2025
50f44de
chore: remove screen lock detection (#106)
andhikayuana Jun 24, 2025
ea15423
🧰 Fx/seed words UI polish (#108)
kcw-grunt Jun 25, 2025
5b6dff3
❇️ Feat/add polish punjabi farsi (#109)
kcw-grunt Jun 27, 2025
4ff50b8
fix: fix YourSeedProveItState.isWordUsedCorrectly (#111)
andhikayuana Jun 29, 2025
2fd094f
Upgrade targetSdk 36 (#113)
andhikayuana Aug 5, 2025
4efd95f
feat(#195): adopt koin annotation for dependency injection (#120)
JosephSanjaya Aug 18, 2025
5900ed4
Create PULL_REQUEST_TEMPLATE.md
kcw-grunt Aug 19, 2025
3b1f628
bump for test (#121)
kcw-grunt Aug 19, 2025
f11d5a8
feat(#174): initiate games module (#119)
JosephSanjaya Aug 20, 2025
77ed7df
Force pushed the version and code bump and catch up with Prod.
kcw-grunt Aug 20, 2025
ef353e3
🚀[Release v4.7.2] Merge into Develop (#127)
kcw-grunt Aug 25, 2025
e25e9e1
Fix(#227): Crash when launching MoonPay Widget (#126)
JosephSanjaya Aug 25, 2025
e0aebb5
feat(#138): Improve Unlock Screen UI and add dark mode toggle (#122)
JosephSanjaya Aug 25, 2025
7d8dd14
Redesign welcome screen (#123)
josikie Aug 25, 2025
18df293
fix(#226): android test failure on RecoverWalletScreenGrabsTest (#130)
JosephSanjaya Aug 26, 2025
9b191b7
fix(#223): fix issue on test environment SLF4J + agent warnings in te…
JosephSanjaya Aug 26, 2025
c9b1ef0
feat(#225): Send sync duration in Firebase Analytics as a custom even…
JosephSanjaya Aug 30, 2025
58f0cd8
feat(#234): Implement language-specific Firebase messaging topics (#132)
JosephSanjaya Aug 30, 2025
4bb06cf
bump code
kcw-grunt Aug 30, 2025
9f4908b
chore(#234): normalize Indonesian language code to "id" (#133)
JosephSanjaya Aug 30, 2025
4a27ae0
Feat: Detekt and Test Plugins, (Including Create Detekt Baseline) (#136)
JosephSanjaya Sep 22, 2025
3285d8e
Chore/renamed gp module (#140)
kcw-grunt Sep 29, 2025
94459d0
create private gp submodule
kcw-grunt Sep 23, 2025
13c39a0
Update settings.gradle.kts
kcw-grunt Sep 23, 2025
c0683ad
chore: Migrate build logic to version catalog and update submodules
JosephSanjaya Sep 24, 2025
2fcb1b2
feat(deps): add kotlin-immutable dependency
JosephSanjaya Oct 5, 2025
631b4f6
refactor(app): Relocate core module imports
JosephSanjaya Oct 8, 2025
0b46614
Merge pull request #141 from gruntsoftware/js/feat/iap
JosephSanjaya Oct 9, 2025
279fa23
build bump
kcw-grunt Oct 9, 2025
5ea5fe9
Merge branch 'main' into release/v4.8.0
kcw-grunt Oct 9, 2025
779f47f
removed cruft
kcw-grunt Oct 9, 2025
05813ad
chore(submodules): remove bugged games repository
JosephSanjaya Oct 10, 2025
67000e9
bump code
kcw-grunt Oct 10, 2025
83f1b85
Release/v4.8.0 (#147)
kcw-grunt Oct 13, 2025
798b7c9
Merge branch 'develop' of https://github.com/brainwallet-co/android i…
kcw-grunt Oct 18, 2025
d5b14db
bug(crashlytics): Remove InputWordsActivity from AndroidManifest
JosephSanjaya Oct 18, 2025
a08c6f6
fix(crashlytics): resolve ReEnterPinActivity crashes and deprecation …
JosephSanjaya Oct 22, 2025
56be50f
Remove resizability and orientation restrictions in our app (#146)
josikie Oct 22, 2025
2f06f5c
build: Build secp256k1 as a static library and add ABI splits (#149)
JosephSanjaya Nov 14, 2025
aeb5ab5
version bump (#159)
kcw-grunt Feb 7, 2026
8cabf2a
Revert "build: Build secp256k1 as a static library and add ABI splits…
kcw-grunt Feb 7, 2026
0a46627
Techdebt/adjust build logic (#161)
kcw-grunt Feb 8, 2026
5738254
Added auto translate (#178)
kcw-grunt Apr 9, 2026
25fcc5d
Add auto-translate workflow for strings.xml
kcw-grunt Apr 12, 2026
34e6d65
Create PR summary workflow with GitHub Copilot
kcw-grunt Apr 12, 2026
914bcd3
Changed the AI completions
kcw-grunt Apr 13, 2026
ca4fcd9
Add more information of the README
kcw-grunt Apr 13, 2026
12a3d83
nit fix
kcw-grunt Apr 13, 2026
5d3a6c2
🦖😱 HUGE!! Bento Integration (#192)
kcw-grunt Apr 14, 2026
010be8c
Release/v4.9.0 (#201)
kcw-grunt Apr 16, 2026
ce9d121
Feat/add thai dutch (#197)
kcw-grunt Apr 16, 2026
083027f
update gitignore (#204)
kcw-grunt Apr 17, 2026
9495b47
Add send/receive transaction integration tests (#203)
kcw-grunt Apr 18, 2026
e0b116a
Designdebt/polish main screen (#205)
kcw-grunt Apr 18, 2026
902f8fb
Feat/add gamehub minigame (#206)
kcw-grunt Apr 19, 2026
879ab6f
Moved clipboard test point into event (#207)
kcw-grunt Apr 20, 2026
334ce3b
moved out of the state update (#208)
kcw-grunt Apr 20, 2026
4455c07
Version bump
kcw-grunt Apr 20, 2026
fcc51f9
fix: issue when user tries to send (#210)
kcw-grunt Apr 22, 2026
b220d0f
reformatted the test
kcw-grunt Apr 18, 2026
5d01e5a
Added More comprehensive Send Tests to cover better stability
kcw-grunt Apr 23, 2026
2ad22d0
Add WalletManager; make validateAddress instance
kcw-grunt Apr 23, 2026
f0e16f6
Updated the InstrumentedTest
kcw-grunt Apr 23, 2026
9a88ed3
adjust the config
kcw-grunt Apr 23, 2026
a11b4db
adjust config for running
kcw-grunt Apr 23, 2026
39cb5f4
Further fix
kcw-grunt Apr 23, 2026
b981834
Fixes the bug: BreadActivity.initializeViews
kcw-grunt Apr 23, 2026
7828223
Merge branch 'main' into release/v4.9.1
kcw-grunt Apr 24, 2026
4c0e7d3
updated README
kcw-grunt Apr 24, 2026
0bfe9d7
bump
kcw-grunt Apr 24, 2026
8c3f1b2
chore(i18n): auto-translate missing strings [skip ci] (#213)
kcw-grunt Apr 24, 2026
bc79335
Feat/add tutorial functionality (#214)
kcw-grunt Apr 24, 2026
2af613b
Feat/bitrefill in topsecret (#217)
kcw-grunt Apr 25, 2026
38be6d1
Feat/bitrefill in topsecret (#221)
kcw-grunt Apr 25, 2026
04e8546
added polish
kcw-grunt Apr 25, 2026
7224aff
Merge branch 'main' into develop
kcw-grunt Apr 27, 2026
c792f3e
✨ 🛍️ 🛠️ Fix/sendmodelonevent crash (#224)
kcw-grunt Apr 27, 2026
6efad7a
Fixxed the layout of the LTC fiat picker (#225)
kcw-grunt Apr 27, 2026
2025282
Refactored the analytics (#226)
kcw-grunt Apr 28, 2026
f403751
Merge branch 'main' into develop
kcw-grunt Apr 28, 2026
734b3d7
🧼 Techdebt/sync reduce rate fpf (#228)
kcw-grunt May 1, 2026
a20d678
bump
kcw-grunt May 1, 2026
d046259
Techdebt/sync reduce rate fpf (#229)
kcw-grunt May 3, 2026
9cc425d
Feat/add remote shop (#230)
kcw-grunt May 9, 2026
728f354
version bump
kcw-grunt May 10, 2026
e57563d
add part of test
kcw-grunt May 10, 2026
d0886db
Techdebt/improve shop (#232)
kcw-grunt May 28, 2026
44fcc8f
Added analytics when user shows invoice in shop (#233)
kcw-grunt May 28, 2026
89a8974
Techdebt/modules update (#235)
kcw-grunt Jun 6, 2026
9fbfeae
Fallinmoji closed branch (#241)
kcw-grunt Jul 6, 2026
143bdac
version bump
kcw-grunt Jul 6, 2026
bc615f5
Techdebt/polish interface (#242)
kcw-grunt Jul 16, 2026
28f8f56
Fix/polish clear set emojis (#243)
kcw-grunt Jul 17, 2026
81a8870
Set the clean process
kcw-grunt Jul 17, 2026
afdfcfb
Merge branch 'main' into release/v4.10.4
kcw-grunt Jul 17, 2026
b5ca771
Changed the pat
kcw-grunt Jul 17, 2026
26e5c90
polish yml
kcw-grunt Jul 17, 2026
134926c
Use typical GH TOKEN
kcw-grunt Jul 17, 2026
c45fa05
Refactor yml
kcw-grunt Jul 17, 2026
ec2a406
chore(i18n): auto-translate missing strings [skip ci] (#245)
github-actions[bot] Jul 17, 2026
f43bd4b
Unescaped the ' in the translated strings in non-exist
kcw-grunt Jul 17, 2026
3bf7a25
fix(BreadActivity): remove dead bottom-nav/toolbar cruft causing star…
grunt-claude-bot Jul 22, 2026
5eba52b
fix(submodules): remove stale modules/bw-gdlib gitlink breaking CI (#…
grunt-claude-bot Jul 22, 2026
116df6a
fix(shop-bento): eliminate flaky ShopBentoViewModelTest + version bum…
grunt-claude-bot Jul 22, 2026
cb556da
docs: real SECURITY.md + restructured README for external visitors (#…
grunt-claude-bot Jul 22, 2026
459fe19
Bump bw-gdlib submodule to pick up ghost-launcher fix (#252)
grunt-claude-bot Jul 26, 2026
01c2e60
Merge branch 'main' into develop
grunt-claude-bot Jul 29, 2026
7f6aaec
docs: standardize release headers to bold version + PR + divider form…
grunt-claude-bot Jul 29, 2026
91b91dd
🎮 Fallinmoji v1.6.0: Ready, Set, GO! (#257)
grunt-claude-bot Jul 30, 2026
9d89ff3
Add this skill
grunt-claude-bot Jul 30, 2026
07224b9
test: add unit test coverage for pure utility helpers and gameinterfa…
grunt-claude-bot Jul 30, 2026
faac661
Merge branch 'main' into release/v4.11.0
kcw-grunt Jul 30, 2026
1a71dad
docs: add v4.11.0 release notes to README
grunt-claude-bot Jul 30, 2026
f701d2d
Activate InAppReviewService and wire up review prompts (#260)
grunt-claude-bot Jul 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ service-data.json
canary-file.json

# Claude
.claude/
.claude/
CLAUDE.local.md
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,29 @@ For the full, up-to-date changelog see [GitHub Releases](https://github.com/grun

---

### **v4.11.0** [PR [#259](https://github.com/gruntsoftware/android/pull/259)]
---
#### 🎮 Fallinmoji v1.6.0 — Ready, Set, GO!
Tapping **Play** (or **Play Again** from the end screen) now runs a short intro sequence before the round begins instead of dropping straight into gameplay:
- **Ready dialog** — shows the round's 3 target emojis on star icons alongside the bonus-scoring rules for ~4.8s
- **3-2-1-GO! countdown** — a rewired full-screen countdown over a looping 6-frame ray-burst flipbook and center star accent, replacing the old libGDX `ParticleEffect`-driven burst for more reliable screen coverage and consistent timing
- Main menu button artwork polished (Play / How-To buttons)

#### 🧪 Test Coverage
Added 48 new unit tests across 7 new test classes, closing coverage gaps on previously-untested pure-logic utilities and the `gameinterface` package:
- `Base58Test`, `TypesConverterTest`, `BytesUtilTest`, `BRCompressorTest`, `BRDateUtilTest` — encode/decode round-trips, gzip/bz2 compression round-trips, and relative-time formatting edge cases
- `GameKoinModuleTest` — verifies the `gameModule` Koin DI wiring resolves `GameSlot` to `GdxGameSlot` as a singleton
- `GdxGameViewTest` — covers `GameExitData` JSON parsing (defaults, unknown-key tolerance) and the social-share dispatch logic in `handleGameExit` (Twitter/Instagram screenshot sharing, missing/empty screenshots, malformed JSON, unrecognized networks)

#### 🔧 Chores
- Added `skills-lock.json` to track installed Claude Code skills (`aso`, `mobile-android-design`)
- `.gitignore`: also exclude `CLAUDE.local.md`
- Version bumped: **v4.10.6 (202506345) → v4.11.0 (202506346)**

**Full Changelog**: https://github.com/gruntsoftware/android/compare/v4.10.6...v4.11.0

---

### **v4.10.6** [PR [#253](https://github.com/gruntsoftware/android/pull/253)]
---
#### 🐛 Crash Fixes
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ android {
applicationId = "ltd.grunt.brainwallet"
minSdk = 29
targetSdk = 35
versionCode = 202506345
versionName = "v4.10.6"
versionCode = 202506347
versionName = "v4.11.0"
multiDexEnabled = true
base.archivesName.set("${defaultConfig.versionName}(${defaultConfig.versionCode})")
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class InAppReviewService(
public fun showInAppReviewDialogIfNeeded() {
val activity = activityProvider() ?: return
if (!BRSharedPrefs.isInAppReviewDone(app) &&
BRSharedPrefs.getSendTransactionCount(app) > 2
BRSharedPrefs.getSendTransactionCount(app) > 1
) {
val manager = ReviewManagerFactory.create(app)
val request = manager.requestReviewFlow()
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/com/brainwallet/di/AppModule.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.brainwallet.di

import android.app.Activity
import android.content.Context
import android.content.SharedPreferences
import com.brainwallet.BrainwalletApp
import com.brainwallet.BuildConfig
import com.brainwallet.appreview.InAppReviewService
import com.brainwallet.data.repository.TxRepository
import com.brainwallet.data.source.RemoteApiSource
import com.brainwallet.tools.sqlite.CurrencyDataSource
Expand Down Expand Up @@ -45,6 +48,7 @@ object AppModule {
single<SharedPreferences> { provideSharedPreferences(context = androidApplication()) }
single<TxRepository> { TxRepositoryImpl(get()) }
single { SyncThreadManager(get(), get()) }
single { InAppReviewService(androidApplication()) { BrainwalletApp.breadContext as? Activity } }
}

private fun provideSharedPreferences(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import org.koin.compose.viewmodel.koinViewModel
import timber.log.Timber

@Serializable
private data class GameExitData(
internal data class GameExitData(
@SerialName("social_network") val socialNetwork: String = "none",
val timestamp: Long = 0L,
@SerialName("total_score") val totalScore: Int = 0,
Expand Down Expand Up @@ -102,7 +102,7 @@ private fun removeFragment(fm: FragmentManager, tag: String) {
}
}

private fun handleGameExit(
internal fun handleGameExit(
jsonString: String,
bytes: ByteArray?,
gameHubViewModel: GameHubViewModel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -51,6 +52,7 @@ import androidx.lifecycle.Lifecycle
import androidx.lifecycle.compose.LifecycleEventEffect
import androidx.lifecycle.viewmodel.compose.viewModel
import com.brainwallet.R
import com.brainwallet.appreview.InAppReviewService
import com.brainwallet.presenter.entities.TxItem
import com.brainwallet.tools.manager.AnalyticsManager
import com.brainwallet.ui.screens.main.MainScreenEvent
Expand All @@ -61,6 +63,9 @@ import com.brainwallet.ui.theme.IBMPlexSans
import com.brainwallet.ui.theme.balanceGameBentoSurface
import com.brainwallet.ui.theme.blurWhen
import kotlinx.collections.immutable.ImmutableList
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.koin.compose.koinInject
import org.koin.compose.viewmodel.koinViewModel
import java.math.BigDecimal

Expand Down Expand Up @@ -107,8 +112,10 @@ fun BalanceBentoScreen(
onDebugStatusUpdate: () -> Unit = {},
onDebugTxAdded: () -> Unit = {},
onDebugBalanceChanged: () -> Unit = {},
inAppReviewService: InAppReviewService = koinInject(),
) {
val context = LocalContext.current
val coroutineScope = rememberCoroutineScope()
val infiniteTransition = rememberInfiniteTransition()
var previousBalance by remember { mutableStateOf(BigDecimal.ZERO) }
val boingAudioPlayer = remember { MediaPlayer.create(context, R.raw.boingspringmouthharp042013) }
Expand Down Expand Up @@ -183,6 +190,12 @@ fun BalanceBentoScreen(
isSwapped = !isSwapped
boingAudioPlayer.start()
AnalyticsManager.logCustomEventWithParams("did_toggle_fiat_ltc", null)
if (isSwapped) {
coroutineScope.launch {
delay(800L)
inAppReviewService.showInAppReviewDialogIfNeeded()
}
}
}
) {
// ──────── MY BALANCE LABEL ────────
Expand Down Expand Up @@ -255,9 +268,14 @@ fun BalanceBentoScreen(
.clickable(
interactionSource = remember { MutableInteractionSource() },
) {
AnalyticsManager.logCustomEventWithParams("did_toggle_balance_visibility", null)

onEvent(BalanceBentoEvent.OnToggleBalanceVisibility)
AnalyticsManager.logCustomEventWithParams("did_toggle_balance_visibility", null)
if (state.balanceHidden) {
coroutineScope.launch {
delay(800L)
inAppReviewService.showInAppReviewDialogIfNeeded()
}
}
}
.blurWhen(!mainState.isInternetReachable),
painter = iconImage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Color
Expand All @@ -21,15 +22,21 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.brainwallet.appreview.InAppReviewService
import com.brainwallet.ui.composable.CalloutWithPointers
import com.brainwallet.ui.composable.Pointer
import com.brainwallet.ui.theme.IBMPlexSans
import org.koin.compose.koinInject

@Composable
fun TutorialSendPage2(
darkMode: Boolean,
modifier: Modifier = Modifier
modifier: Modifier = Modifier,
inAppReviewService: InAppReviewService = koinInject()
) {
LaunchedEffect(Unit) {
inAppReviewService.showInAppReviewDialogIfNeeded()
}
Box(
modifier = Modifier
.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Color
Expand All @@ -20,15 +21,22 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.brainwallet.appreview.InAppReviewService
import com.brainwallet.ui.composable.CalloutWithPointers
import com.brainwallet.ui.composable.Pointer
import com.brainwallet.ui.theme.IBMPlexSans
import org.koin.compose.koinInject

@Composable
fun TutorialWalkthroughPage3(
darkMode: Boolean,
modifier: Modifier = Modifier
modifier: Modifier = Modifier,
inAppReviewService: InAppReviewService = koinInject()
) {
LaunchedEffect(Unit) {
inAppReviewService.showInAppReviewDialogIfNeeded()
}

Box(
modifier = Modifier
.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ import android.graphics.BitmapFactory
import android.os.Bundle
import android.os.Environment
import androidx.core.content.FileProvider
import androidx.lifecycle.viewModelScope
import com.brainwallet.appreview.InAppReviewService
import com.brainwallet.tools.manager.AnalyticsManager
import com.brainwallet.ui.BrainwalletViewModel
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.launch
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.jsonObject
import kotlinx.serialization.json.jsonPrimitive
Expand All @@ -22,6 +26,7 @@ import java.io.FileOutputStream
@KoinViewModel
class GameHubViewModel(
private val app: Application,
private val inAppReviewService: InAppReviewService,
) : BrainwalletViewModel<GameHubEvent>() {
private val _state =
MutableStateFlow(GameHubState())
Expand Down Expand Up @@ -115,6 +120,12 @@ class GameHubViewModel(
}
)
}

AnalyticsManager.logCustomEventWithParams("did_play_game", null)
viewModelScope.launch {
delay(800L)
inAppReviewService.showInAppReviewDialogIfNeeded()
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.brainwallet.ui.screens.send
import android.app.Application
import androidx.lifecycle.viewModelScope
import com.brainwallet.R
import com.brainwallet.appreview.InAppReviewService
import com.brainwallet.constants.BWConstants
import com.brainwallet.data.repository.SettingRepository
import com.brainwallet.data.repository.TxRepository
Expand Down Expand Up @@ -46,6 +47,7 @@ class SendViewModel(
private val txRepository: TxRepository,
private val settingRepository: SettingRepository,
private val currencyDataGetter: CurrencyDataGetter,
private val inAppReviewService: InAppReviewService,
private val isWalletCreated: () -> Boolean = { BRWalletManager.getInstance().isCreated() },
private val validateAddress: (String) -> Boolean = { BRWalletManager.getInstance().validateAddress(it) },
private val getBalance: () -> Long = { BRWalletManager.getInstance().getBalance(app) },
Expand All @@ -57,7 +59,6 @@ class SendViewModel(
val state: StateFlow<SendState> = _state.asStateFlow()
private val _effect = MutableSharedFlow<SendEffect>(extraBufferCapacity = 1)
val effect: SharedFlow<SendEffect> = _effect.asSharedFlow()

init {
viewModelScope.launch {
settingRepository.currentSettings.collect { currentSettings ->
Expand Down Expand Up @@ -281,8 +282,10 @@ class SendViewModel(
_effect.emit(SendEffect.DismissSheet)
AnalyticsManager.logCustomEvent(BWConstants._20191105_DSL)
BRSharedPrefs.incrementSendTransactionCount(app)
delay(800L)
inAppReviewService.showInAppReviewDialogIfNeeded()
}
is BWSendResult.Error.InsufficientFunds -> {
is Error.InsufficientFunds -> {
_state.update {
it.copy(
errorResultString = String.format(
Expand All @@ -293,7 +296,7 @@ class SendViewModel(
)
}
}
is BWSendResult.Error.AmountTooSmall -> {
is Error.AmountTooSmall -> {
_state.update {
it.copy(
errorResultString = String.format(
Expand All @@ -304,9 +307,9 @@ class SendViewModel(
)
}
}
BWSendResult.Error.AlreadySending,
BWSendResult.Error.TimedOut,
is BWSendResult.Error.Unknown -> {
Error.AlreadySending,
Error.TimedOut,
is Error.Unknown -> {
Timber.e("Send unknown error: $result")
_state.update {
it.copy(
Expand Down
Loading