-
Notifications
You must be signed in to change notification settings - Fork 49
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
show politeia proposals #503
Conversation
app/src/main/java/com/dcrandroid/activities/more/PoliteiaActivity.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/dcrandroid/activities/more/PoliteiaActivity.kt
Outdated
Show resolved
Hide resolved
currentFragment = PoliteiaFragment() | ||
supportFragmentManager | ||
.beginTransaction() | ||
.replace(R.id.container, currentFragment) | ||
.commit() |
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.
Why is the activity displaying a single fragment? Move the fragment code to this activity if it's not required.
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.
the code from the activity was moved to a fragment, so the sync function can be accessed from the base fragment
app/src/main/java/com/dcrandroid/fragments/more/PoliteiaFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/dcrandroid/fragments/more/PoliteiaFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/dcrandroid/fragments/more/PoliteiaFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/dcrandroid/fragments/more/PoliteiaFragment.kt
Outdated
Show resolved
Hide resolved
feat: fetched proposal details from api style: modified some layouts
feat: added approporiate message for proposal status(publishes, abandoned) feat: implemeted politeia from dcrlibwallet
perf: updated proposal status util chore: refined code in proposal class chore: added yes/no votes to proposal details chore: cleaned up code
…oved, rejected and abandoned) proposals feat: added category filter for proposals
…ed localy fetched data
chore: made green background darker so text can be more readeable chore: centered percentage in progress bar
chore: add button to manually sync proposal incase initial sync fails chore: implemented changes requested from PR review
…ices chore: fixed crash occuring on proposal details page
remove unused class members and update variables according to dcrlibwallet
- rotate sync icon while fetching missing proposals - add option to stop sync
} | ||
|
||
override fun onNothingSelected(parent: AdapterView<*>?) {} | ||
} | ||
|
||
go_back.setOnClickListener { | ||
multiWallet!!.politeia.clearSavedProposals() |
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.
why does going back clear all fetched proposals?, shouldn't it still remain saved for when next the user needs to access them?
also after going back the first time, entering the proposal page again and going back again crashes the app, because there's no data to be 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.
That was for debugging, will remove it.
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.
alright
tv_sync_label.setText(R.string.stop_sync) | ||
|
||
if(multiWallet!!.politeia.synced()) { | ||
sync_icon.animation = null |
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.
tv_sync_label.setText("Synced")
after the sync completes, the text could be changed to disconnect
or something similar, so the user can know the sync is done, right now it shows stop sync
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.
Sync doesn't 'complete', what completed is the fetching of all unfetched proposals and dcrlibwallet will continue to check every 30 minutes for proposal updates.
This is why I don't really support that 'Sync' phrase in this part of the app because it's going to be confused with normal syncing.
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.
oh i see, yes it's a bit confusing, we might have to find a suitable synonym
- add proposal title and author name to notifications - allow proposal sync if wallet is not connected
Reviewed and everything looks good |
Requires planetdecred/dcrlibwallet#161
This PR allows users to;
How the notifications work
When the client launches the app for the first time, a sync is initiated and all proposals are fetched, now when next the client launches the app the sync initiates again, and if there are new proposals or changes to the proposals fetched initially, our callback listeners are triggered
We have listeners for
onNewProposal, onVoteStarted, and onVoteEnded
. When any of the listeners are triggered, it sends the appropriate notification to the clientWhen the client taps on a particular notification, it takes them to the proposal details page for that particular proposal
Screenshots