Android
Library that implements Learn functionality (articles, videos, links)
Getting Started
- Example
- Installing
- Readme
- Changelog
Opening learn articles activity:
startActivity(LearnArticlesActivity.getIntent(this))
For custom views (such as LearnSectionView in Huma Module Kit), inject and use LearnArticleViewModel:
class LearnArticleSectionView(/*..*/) : HumaSdkKoinComponent {
private val viewModel: LearnArticleViewModel by inject()
/*...*/
fun onAttachedToWindow() {
viewModel.getLearnArticles(learnArticleIds)
viewModel.learnArticles.observe(context) { /*...*/ }
}
}
- Add the dependency in your local build.gradle file:
implementation("com.huma.sdk:learn:<latest-version>")
- Initialize
HumaLearnManagerin your Application class:
HumaLearnManager.init(
learnRepository: LearnRepository? = null,
articleInteractionDelegate: LearnArticleInteractionDelegate? = null
)
Definitions
Learn screen consists of sections to divide articles by categories
Section item - section/category that contains a list of articles
Learn article - guide content aimed to help the user. It can be an article, a video or a link.
Customization
- By default learn content is fetched from
Deployment. It is possible to overrideLearnRepositoryfor any custom logic and pass it toHumaLearnManager.init() - You can implement
LearnArticleInteractionDelegateand pass it toHumaLearnManager.init()