-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NFC loading and storing implementation for Achievement Rally #1043
Conversation
# Conflicts: # app-android/src/main/java/io/github/droidkaigi/confsched2023/KaigiApp.kt
Snapshot diff report
|
if (uiState.isResetButtonEnabled) { | ||
item( | ||
key = "reset_button", | ||
span = { GridItemSpan(SingleItemSpanCount) }, | ||
) { | ||
Button( | ||
modifier = Modifier.fillMaxWidth(), | ||
onClick = onReset, | ||
) { | ||
Text(text = "Reset") | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This button is no longer included in the version of the release
val intent = Intent(this, MainActivity::class.java) | ||
startActivity(intent) | ||
finish() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If NFC reading fails, the default screen will be activated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please have a look? Questions are welcome.
app-android/src/main/java/io/github/droidkaigi/confsched2023/ResolveDynamicLinksActivity.kt
Outdated
Show resolved
Hide resolved
app-android/src/main/java/io/github/droidkaigi/confsched2023/ResolveDynamicLinksActivity.kt
Show resolved
Hide resolved
app-android/src/main/java/io/github/droidkaigi/confsched2023/ResolveDynamicLinksActivity.kt
Show resolved
Hide resolved
deepLink = intent.data.toString(), | ||
onFinished = { | ||
val intent = Intent(this, MainActivity::class.java) | ||
startActivity(intent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider the desired transitions after the animation finishes.
Currently, CompleteAchievementActivity will be visible when a user presses a back key on MainActivity. And then, if a user rotates their device, the animation restarts and show up MainActivity again.
MainActivity <- visible
CompleteAchievementActivity
// back key is pressed
CompleteAchievementActivity <- visible
// rotate their device
MainActivity <- visible
CompleteAchievementActivity
We have two options.
- Just finish CompleteAchievementActivity right after the animation finishes.
- Change the activity stack in the first place.
1.
is so easy.
MainActivity <- visible
For 2
, we can call startActivities(MainActivity's intent, CompleteAchievementActivity's intent
in ResolveDynamicLinksActivity, and allow CompleteAchievementActivity not to launch MainActivity and not to finish. The final state of activity stacks will be like the following:
CompleteAchievementActivity <- visible
MainActivity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I correct in recognizing that finishAndRemoveTask() is called after reading MainActivity?🤔
I actually tried pressing the back key after reading NFC and transitioning to MainActivity and the stack was cleared.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in this commit.🙏
|
||
fun onReachAnimationEnd() { | ||
viewModelScope.launch { | ||
achievementRepository.saveAchievements(animationLottieRawResStateFlow.value.first) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be dangerous. This is because the app finishes just after viewModelScope.launch(). So this block can be canceled.
I recommend saving this in onReadDeeplinkHash()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the following commit🙏
@momomomo111 |
) | ||
} | ||
if (uiState.isResetButtonEnabled) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we merge this implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@momomomo111 I'm wondering if this button will be released.
I don't check if this works and we don't have any tests for this. Please check it by yourself 🙇 |
Hi @takahirom! Codes seem to be unformatted. To resolve this issue, please run |
I confirmed that A through E actually work after testing them.🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your effort!
I'm not sure if @jmatsu is comfortable with this PR. I believe we can address any issues post-merge. Please let @momomomo111 know if there are any concerns. |
Issue
Overview (Required)
$ adb shell am start -W -a android.nfc.action.NDEF_DISCOVERED -d "https://confsched2023.page.link/e" io.github.droidkaigi.confsched2023.dev
The Compose part of the CompleteAchievementActivity has been added to a module called Animation.
Movie (Optional)
demo.mp4