Radiot app with comments
Android app for Radio-T podcast with comments support. A project in development at the moment. Author create the project for learn new technologies.
App has following feature:
- Podcast and themes lists
- Comments list with reply
- Votes
- Post new comment
- Edit exist comment
- Auth (github, twitter)
Technologies:
- Language: Kotlin 1.6.0
- Serialization: KotlinX serialization
- UI: Jetpack compose
- UI pattern: MVVM
- Threading: coroutine
- Linter: detekt
- Testing: Junit and mockk
- CI: Github actions (run test, static code analysis, release app to google play)
Project guideline
Don't use standard structures/classes for domain entities. For instance, don't use String for
comment id, use value class CommentId with one field raw
.
Project structure
radiot-app
Main product of this repo. App for radiot podcast. Don't use this app for work with remark api.
demo-app
App for develop and testing remark sdk.
remark
remark-api
Wrapper for remark api remark42
Provide useful interface with caching data from BE, and possibility for observable actual data.
Handle data change after new comment and vote. Also provide middleware for work with BE apply
query site
for each request. Doesn't execute calls which required auth without user data.
Init remark api
val remarkSettings = RemarkSettings("remark", "https://demo.remark42.com/")
val api: RemarkApi by lazy { RemarkApi(context, remarkSettings.siteId, remarkSettings.baseUrl) }
RemarkApi:
val commentDataControllerProvider: CommentDataControllerProvider
fun saveByCookies(cookies: String): Boolean
fun addLoginStateListener(onLoginChange: (RemarkCredentials) -> Unit)
suspend fun getConfig(): Config
CommentDataControllerProvider:
fun getDataController(postUrl: String): CommentDataController
CommentDataController:
suspend fun observeComments(commentRoot: CommentRoot): Flow<FullCommentInfo>
suspend fun vote(commentId: String, vote: VoteType): RemarkError?
suspend fun postComment(commentRoot: CommentRoot, text: String): RemarkError?
Remark sdk
Software development kit for integrate comment widget into your app.
Init remark sdk
RemarkComponent.init(applicationContext, RemarkSettings("remark", "https://demo.remark42.com/"))
Add comment widget:
Just call RemarkView compose fun into your compose fun.
RemarkView(postUrl = "https://remark42.com/demo/")