Repository navigation
Release v2.1.0: live polls in comments - #45
Merged
Merged
Conversation
Readers vote on polls attached to comments and see results update live through poll-update events. The UI matches the web widget: option chips with result bars, a locked-results mode, a who-voted dialog, and a poll builder in the composer toolbar. - Requires fastcomments-java 3.1.1 (votePoll, getPollVoters, typed PublicComment.poll) - Live tally changes patch only the counts so bars animate in place - CallbackWrapper parses API errors with the client's Gson so error codes survive - Poll strings for all 13 bundled locales - Robolectric, integration and Espresso tests
- Host the who-voted dialog in a DialogFragment so it survives rotation and process death on its page and search - Save the composer's poll draft in BottomCommentInputView state; the builder's rows share ids, so it freezes its children - Size the poll builder from the window minus system bars and keyboard on every layout
…on locked polls - A locked poll that closes on screen offers Show results, which fetches the real counts; a failed fetch says so and can be retried, and a comment the fetch can't find says the results show on the next load. - Callbacks that find their card recycled rebind the comment's row instead, so no card stays dimmed. - Locked polls now receive live tallies; the card keeps them hidden until the viewer votes. - Toolbar visibility, builder option reuse, voter dialog lifecycle and draft state survive configuration changes. - Removed backspace-to-delete on empty options; the remove button is the only way to delete one. - E2E helpers shared between SDK integration tests and app UI tests, which wait on SDK idling instead of sleeps.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings the web widget's comment polls to the Android SDK.
What's included
PollCardView): option chips with result bars, percentages, a "your vote is in" pill, change vote, show/hide results, closes-at and privacy text, and a "See who voted" link. Matches the web design (comment-ui.polls.extension.ts).PublicApi.votePoll, with web error mapping (poll-login-required,poll-closed, translated errors).POLL_UPDATEevents patch only the counts (PollCardView.patchCounts) so bars animate in place, like webpatchPollCounts. Option or close-date changes fall back to a full bind.PollVotersDialog) with search and paging. Pager taps wait for the page in flight.PollBuilderView), gated bypollCreationand site-admin status: question, 2 to 10 options, duration, require-vote-to-see-results, privacy, and web validation messages.pollAccentColorplus poll color resources, documented inREADME.mdandTHEMING.md.fastcomments-localizationcomment-ui-polls.Other fixes
CallbackWrapperparsed API errors with a plainGson, which throws on the models'java.timefields, so every error code came backinternal. It now uses the client's Gson.broadcastIdsSentis now a bounded set (200 most recent) in both SDKs.isSiteAdminis now set from the load response.Dependency
Bumps
fastcomments(Java client) to 3.1.2: unknown response fields are ignored, and pubsub reconnects with backoff. Releases as v2.1.0.Tests
PollCardViewTest,PollBuilderViewTest,PollDraftTest,PollHelperTest,PollVotersDialogTest,CallbackWrapperTest,BroadcastIdsTestPollIntegrationTests(create, vote, change vote, live update across two SDKs, voters, login-required)PollUITests, 3/3 passing onMedium_Phone_API_36spotlessCheck,lintDebug,:app:assembleDebug,assembleDebugAndroidTestpass