https://github.com/zahraheydari/kotlinbaseproject
This is a base code for every Kotlin project in Android
https://github.com/zahraheydari/kotlinbaseproject
abstract abstraction abstraction-layer coroutines coroutines-android data koin koin-kotlin koin-mvvm kotlin-coroutines moshi mvvm-android mvvm-architecture usecase
Last synced: 2 months ago
JSON representation
This is a base code for every Kotlin project in Android
- Host: GitHub
- URL: https://github.com/zahraheydari/kotlinbaseproject
- Owner: ZahraHeydari
- Created: 2019-11-12T14:34:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-12T14:39:12.000Z (over 5 years ago)
- Last Synced: 2025-03-27T16:49:38.815Z (3 months ago)
- Topics: abstract, abstraction, abstraction-layer, coroutines, coroutines-android, data, koin, koin-kotlin, koin-mvvm, kotlin-coroutines, moshi, mvvm-android, mvvm-architecture, usecase
- Language: Kotlin
- Homepage:
- Size: 166 KB
- Stars: 23
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# KotlinBaseProject
A base code which I almost use in every project I work on!
It shows how to use ViewModels and Room together with Coroutines & Koin by Clean Architecture in Kotlin!
This way you don`t need to repeat the same code in different parts of your project over & over.### BaseActivity:
All activities can extends this abstract class.
- To handle the back process for all its child fragments
- To handle the navigation of fragments(add/replace)
- To inflate the view of activities using data binding util### BaseFragment:
All fragments extend this abstract class.
- To inflate root view using data binding util
- To override a Toolbar for fragment using toolBarId if it exists
- To check the Authentication of user### BaseViewGroup
It`s an interface that interacts with activities and fragments to determine ViewModel, LayoutId and ViewDataBinding of them### BaseViewModel
Sometimes we have a same login in many parts of our application. Such as checking the internet connection,
showing/hiding progressBar when there is no data, or displaying a message/an error message when needed.
So we put all these cases in only one ViewModel as called BaseViewModel and all our ViewModels extend it.### CommonToast
This class is used to customize toasts(appearance)