Skip to content

An open-source Kotlin project where the most recent libraries and best practices are used

License

Notifications You must be signed in to change notification settings

DeveloperKurt/GameDatabase

Repository files navigation

Game Database


A Kotlin app made using the best practices, most recent Jetpack libraries, and Kotlin coroutines.







Dark Theme Light Theme

Game Database - Library Usage


To add a FloatingActionButton that opens up a Dialog which displays the installation date (persistent), current time (dynamic) and a downloaded image, add the code below to your project.


Root Gradle:

allprojects {
		repositories {
			maven { url 'https://jitpack.io' }
		}
	}

App Gradle

	dependencies {
	        implementation 'com.github.DeveloperKurt:GameDatabase:2.1'
	}

Activity

override fun onCreate(savedInstanceState: Bundle?)  
{  
	super.onCreate(savedInstanceState)
  
	Module(this)
}

Customize the Theme by Adding Attributes:

  • colorSecondary: FloatingActionButton's background color
  • colorOnSecondary: FloatingActionButton's icon color
  • colorSurface: Dialog's background color

Code Structure

Game Database's repository supports different configurations but by default, it treats network server's data as a rapidly-changing live data. Therefore, it fetches the data at short intervals and caches them if it detects any differences. It respects the single source of truth architecture and SOLID principles. The data is always retrieved through the Room database where it is exposed as a Flow in the repository layer. ViewModels collect those Flows and transforms them into LiveDatas. And from there on, the fragments display the data through data-binding.

Every I/O operation is done through coroutines and their lifecycle is managed by the coroutine scopes to avoid memory leaks.

Utilized Concepts

  • Design patterns
  • Dependency Injection
  • Object-Oriented Programming
  • Version Control
  • Day/Night Theme
  • Data and view binding
  • Single Activity pattern with the Navigation Component
  • Creating an Android library

Used Libraries

  • Retrofit
  • Room
  • HILT
  • OkHttp
  • GSON
  • Flow
  • LiveData
  • Coroutine
  • ViewModel
  • Glide
  • Timber
  • Palette

License

APACHE 2.0

About

An open-source Kotlin project where the most recent libraries and best practices are used

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages