diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..29ed9ff
Binary files /dev/null and b/.DS_Store differ
diff --git a/README.md b/README.md
index 5b342ea..b28b04f 100644
--- a/README.md
+++ b/README.md
@@ -1,30 +1,3 @@
-## Android Programming Task
-In order to be considered for the Android position, you must complete the following steps.
-
-*Note: This task should take no longer than 1-2 hours at the most.*
-
-
-
-### Prerequisites
-
-- Please note that this will require some basic [Java](http://heather.cs.ucdavis.edu/~matloff/Java/JavaIntro.html) and [Android](http://d.android.com) knowledge.
-
-- If you don't know java, [take a few minutes to learn the basics](http://mobile.tutsplus.com/series/learn-java-android-development/) and if you don't know Android [learn about it here](http://d.android.com/resources/index.html).
-
-- You will need to have [Java](http://www.java.com/en/download/), [Android Studio](http://developer.android.com/sdk/installing/studio.html) or [IntelliJ](http://www.jetbrains.com/idea/download/), and the [Android SDK](http://d.android.com/sdk/index.html) installed.
-
-## Task
-
-1. Fork this repository (if you don't know how to do that, Google is your friend)
-2. Create a *source* folder to contain your code.
-3. In the *source* directory, please create an Android app that accomplishes the following:
- - Connect to the [Github API](http://developer.github.com/)
- - Find the [rails/rails](http://github.com/rails/rails) repository
- - Find the most recent commits (choose at least 25 or more of the commits)
- - Create a RecyclerView that displays the recent commits by author in a view.
- - [Click here](example.jpg) for a screenshot mock up of what the final product should look like
-4. Commit and Push your code to your new repository
-5. Send us a pull request, we will review your code and get back to you
diff --git a/source/.DS_Store b/source/.DS_Store
new file mode 100644
index 0000000..7383cb9
Binary files /dev/null and b/source/.DS_Store differ
diff --git a/source/GithubDemo/.gitignore b/source/GithubDemo/.gitignore
new file mode 100644
index 0000000..aa724b7
--- /dev/null
+++ b/source/GithubDemo/.gitignore
@@ -0,0 +1,15 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
+local.properties
diff --git a/source/GithubDemo/.idea/$CACHE_FILE$ b/source/GithubDemo/.idea/$CACHE_FILE$
new file mode 100644
index 0000000..f16d8a2
--- /dev/null
+++ b/source/GithubDemo/.idea/$CACHE_FILE$
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+ Android
+
+
+ Chrome OSCorrectnessLintAndroid
+
+
+ Code style issuesJava
+
+
+ Control flow issuesJava
+
+
+ CorrectnessLintAndroid
+
+
+ EditorConfig
+
+
+ Groovy
+
+
+ IconsUsabilityLintAndroid
+
+
+ Java
+
+
+ LintAndroid
+
+
+ PerformanceLintAndroid
+
+
+ PortabilityJava
+
+
+ Potentially confusing code constructsGroovy
+
+
+ Probable bugsJava
+
+
+ StyleGroovy
+
+
+ UsabilityLintAndroid
+
+
+
+
+ Android
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source/GithubDemo/.idea/.gitignore b/source/GithubDemo/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/source/GithubDemo/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/source/GithubDemo/.idea/.name b/source/GithubDemo/.idea/.name
new file mode 100644
index 0000000..8646dd3
--- /dev/null
+++ b/source/GithubDemo/.idea/.name
@@ -0,0 +1 @@
+DaggerHiltPlayground
\ No newline at end of file
diff --git a/source/GithubDemo/.idea/codeStyles/Project.xml b/source/GithubDemo/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..3c7772a
--- /dev/null
+++ b/source/GithubDemo/.idea/codeStyles/Project.xml
@@ -0,0 +1,139 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source/GithubDemo/.idea/codeStyles/codeStyleConfig.xml b/source/GithubDemo/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000..79ee123
--- /dev/null
+++ b/source/GithubDemo/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/source/GithubDemo/.idea/compiler.xml b/source/GithubDemo/.idea/compiler.xml
new file mode 100644
index 0000000..61a9130
--- /dev/null
+++ b/source/GithubDemo/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source/GithubDemo/.idea/gradle.xml b/source/GithubDemo/.idea/gradle.xml
new file mode 100644
index 0000000..23a89bb
--- /dev/null
+++ b/source/GithubDemo/.idea/gradle.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source/GithubDemo/.idea/jarRepositories.xml b/source/GithubDemo/.idea/jarRepositories.xml
new file mode 100644
index 0000000..a5f05cd
--- /dev/null
+++ b/source/GithubDemo/.idea/jarRepositories.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source/GithubDemo/.idea/misc.xml b/source/GithubDemo/.idea/misc.xml
new file mode 100644
index 0000000..d5d35ec
--- /dev/null
+++ b/source/GithubDemo/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source/GithubDemo/app/.gitignore b/source/GithubDemo/app/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/source/GithubDemo/app/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/source/GithubDemo/app/build.gradle b/source/GithubDemo/app/build.gradle
new file mode 100644
index 0000000..0bd2516
--- /dev/null
+++ b/source/GithubDemo/app/build.gradle
@@ -0,0 +1,83 @@
+plugins {
+ id 'com.android.application'
+ id 'kotlin-android'
+ id 'kotlin-kapt'
+ id 'dagger.hilt.android.plugin'
+}
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.2"
+
+ defaultConfig {
+ applicationId "com.maxx.github_demo"
+ minSdkVersion 21
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+ kotlinOptions {
+ jvmTarget = '1.8'
+ }
+ buildFeatures {
+ viewBinding true
+ dataBinding true
+ }
+}
+
+dependencies {
+
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
+ implementation 'androidx.core:core-ktx:1.3.2'
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
+ implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
+ implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
+ testImplementation 'junit:junit:4.+'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.2'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
+
+ implementation "com.android.support:appcompat-v7:$supportLibVersion"
+ implementation "com.android.support:design:$supportLibVersion"
+ implementation "com.android.support:recyclerview-v7:$supportLibVersion"
+ implementation "com.android.support:cardview-v7:$supportLibVersion"
+ implementation "com.android.support:support-v4:$supportLibVersion"
+
+ //retrofit 2
+ implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
+ implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"
+ implementation 'com.google.code.gson:gson:2.8.6'
+
+ //retrofit http interceptor
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.7.2'
+
+ //room
+ implementation "androidx.room:room-runtime:$room_version"
+ kapt "androidx.room:room-compiler:$room_version"
+ // optional - Kotlin Extensions and Coroutines support for Room
+ implementation "androidx.room:room-ktx:$room_version"
+
+ //dagger
+ implementation "com.google.dagger:hilt-android:$hilt_version"
+ kapt "com.google.dagger:hilt-android-compiler:$hilt_version"
+
+ implementation "androidx.hilt:hilt-lifecycle-viewmodel:$hilt_viewmodels"
+ kapt "androidx.hilt:hilt-compiler:$hilt_viewmodels"
+
+ implementation "androidx.fragment:fragment-ktx:$fragment_ktx"
+ implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.2.0"
+}
\ No newline at end of file
diff --git a/source/GithubDemo/app/proguard-rules.pro b/source/GithubDemo/app/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/source/GithubDemo/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/androidTest/java/com/maxx/github_demo/ExampleInstrumentedTest.kt b/source/GithubDemo/app/src/androidTest/java/com/maxx/github_demo/ExampleInstrumentedTest.kt
new file mode 100644
index 0000000..71aca4a
--- /dev/null
+++ b/source/GithubDemo/app/src/androidTest/java/com/maxx/github_demo/ExampleInstrumentedTest.kt
@@ -0,0 +1,24 @@
+package com.maxx.github_demo
+
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.test.ext.junit.runners.AndroidJUnit4
+
+import org.junit.Test
+import org.junit.runner.RunWith
+
+import org.junit.Assert.*
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+@RunWith(AndroidJUnit4::class)
+class ExampleInstrumentedTest {
+ @Test
+ fun useAppContext() {
+ // Context of the app under test.
+ val appContext = InstrumentationRegistry.getInstrumentation().targetContext
+ assertEquals("com.maxx.daggerhiltplayground", appContext.packageName)
+ }
+}
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/AndroidManifest.xml b/source/GithubDemo/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..b19773a
--- /dev/null
+++ b/source/GithubDemo/app/src/main/AndroidManifest.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/MyApplication.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/MyApplication.kt
new file mode 100644
index 0000000..1255831
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/MyApplication.kt
@@ -0,0 +1,12 @@
+package com.maxx.github_demo
+
+import android.app.Application
+import dagger.hilt.android.HiltAndroidApp
+
+@HiltAndroidApp
+class MyApplication : Application(){
+
+ override fun onCreate() {
+ super.onCreate()
+ }
+}
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/di/RepositoryModule.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/di/RepositoryModule.kt
new file mode 100644
index 0000000..4843e42
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/di/RepositoryModule.kt
@@ -0,0 +1,27 @@
+package com.maxx.github_demo.di
+
+import com.maxx.github_demo.repository.MainRepository
+import com.maxx.github_demo.retrofit.ApiService
+import com.maxx.github_demo.retrofit.NetworkMapper
+import com.maxx.github_demo.room.Dao
+import com.maxx.github_demo.room.CacheMapper
+import dagger.Module
+import dagger.Provides
+import dagger.hilt.InstallIn
+import dagger.hilt.android.components.ApplicationComponent
+import javax.inject.Singleton
+
+@InstallIn(ApplicationComponent::class)
+@Module
+object RepositoryModule {
+
+ @Singleton
+ @Provides
+ fun provideMainRepository(dao: Dao,
+ ApiService: ApiService,
+ cacheMapper: CacheMapper,
+ networkMapper: NetworkMapper
+ ) : MainRepository{
+ return MainRepository(dao, ApiService, cacheMapper, networkMapper)
+ }
+}
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/di/RetrofitModule.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/di/RetrofitModule.kt
new file mode 100644
index 0000000..97649e1
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/di/RetrofitModule.kt
@@ -0,0 +1,48 @@
+package com.maxx.github_demo.di
+
+import com.google.gson.Gson
+import com.google.gson.GsonBuilder
+import com.maxx.github_demo.BuildConfig
+import com.maxx.github_demo.retrofit.ApiService
+import com.maxx.github_demo.util.Constants
+import dagger.Module
+import dagger.Provides
+import dagger.hilt.InstallIn
+import dagger.hilt.android.components.ApplicationComponent
+import okhttp3.OkHttpClient
+import okhttp3.logging.HttpLoggingInterceptor
+import retrofit2.Retrofit
+import retrofit2.converter.gson.GsonConverterFactory
+import javax.inject.Singleton
+
+@Module
+@InstallIn(ApplicationComponent::class)
+object RetrofitModule {
+
+ @Singleton
+ @Provides
+ fun provideGsonBuilder(): Gson {
+ return GsonBuilder().setPrettyPrinting().create()
+ }
+
+ @Singleton
+ @Provides
+ fun provideRetrofit(gson: Gson): Retrofit.Builder {
+ val httpClient = OkHttpClient.Builder()
+ if (BuildConfig.DEBUG)
+ httpClient.addInterceptor(HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY))
+
+ return Retrofit.Builder()
+ .client(httpClient.build())
+ .baseUrl(Constants.BASE_URL)
+ .addConverterFactory(GsonConverterFactory.create(gson))
+ }
+
+ @Singleton
+ @Provides
+ fun provideApiService(retrofit: Retrofit.Builder): ApiService {
+ return retrofit
+ .build()
+ .create(ApiService::class.java)
+ }
+}
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/di/RoomModule.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/di/RoomModule.kt
new file mode 100644
index 0000000..3edf257
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/di/RoomModule.kt
@@ -0,0 +1,35 @@
+package com.maxx.github_demo.di
+
+import android.content.Context
+import androidx.room.Room
+import com.maxx.github_demo.room.Dao
+import com.maxx.github_demo.room.Database
+import dagger.Module
+import dagger.Provides
+import dagger.hilt.InstallIn
+import dagger.hilt.android.components.ApplicationComponent
+import dagger.hilt.android.qualifiers.ApplicationContext
+import javax.inject.Singleton
+
+@InstallIn(ApplicationComponent::class)
+@Module
+object RoomModule {
+
+ @Singleton
+ @Provides
+ fun provideBlogDb(@ApplicationContext context: Context): Database {
+ return Room.databaseBuilder(
+ context,
+ Database::class.java,
+ Database.DATABASE_NAME
+ )
+ .fallbackToDestructiveMigration()
+ .build()
+ }
+
+ @Singleton
+ @Provides
+ fun provideBlogDAO(database: Database) : Dao{
+ return database.blogDao()
+ }
+}
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/model/Commit.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/model/Commit.kt
new file mode 100644
index 0000000..d433e2d
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/model/Commit.kt
@@ -0,0 +1,7 @@
+package com.maxx.github_demo.model
+
+data class Commit(
+ var authorName: String,
+ var date: String,
+ var commitMessage: String
+)
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/repository/MainRepository.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/repository/MainRepository.kt
new file mode 100644
index 0000000..26f6759
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/repository/MainRepository.kt
@@ -0,0 +1,30 @@
+package com.maxx.github_demo.repository
+
+import com.maxx.github_demo.model.Commit
+import com.maxx.github_demo.retrofit.ApiService
+import com.maxx.github_demo.retrofit.NetworkMapper
+import com.maxx.github_demo.room.Dao
+import com.maxx.github_demo.room.CacheMapper
+import com.maxx.github_demo.util.DataState
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.flow
+
+class MainRepository
+constructor(
+ private val dao: Dao,
+ private val ApiService: ApiService,
+ private val cacheMapper: CacheMapper,
+ private val networkMapper: NetworkMapper
+) {
+ suspend fun getBlogs(): Flow>> = flow {
+ emit(DataState.Loading)
+ try {
+ val networkBlogs = ApiService.getAllCommits()
+ val commitList = networkMapper.mapFromEntityList(networkBlogs)
+
+ emit(DataState.Success(commitList))
+ } catch (e: Exception) {
+ emit(DataState.Error(e))
+ }
+ }
+}
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/ApiService.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/ApiService.kt
new file mode 100644
index 0000000..92f765e
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/ApiService.kt
@@ -0,0 +1,12 @@
+package com.maxx.github_demo.retrofit
+
+import com.maxx.github_demo.retrofit.model.GetCommitResponse
+import retrofit2.http.GET
+
+interface ApiService {
+
+ @GET("commits")
+ suspend fun getAllCommits() : GetCommitResponse
+
+
+}
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/NetworkEntity.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/NetworkEntity.kt
new file mode 100644
index 0000000..6a2115a
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/NetworkEntity.kt
@@ -0,0 +1,27 @@
+package com.maxx.github_demo.retrofit
+
+import com.google.gson.annotations.Expose
+import com.google.gson.annotations.SerializedName
+
+data class NetworkEntity(
+ @SerializedName("pk")
+ @Expose
+ var id : Int,
+
+ @SerializedName("title")
+ @Expose
+ var title : String,
+
+ @SerializedName("body")
+ @Expose
+ var body : String,
+
+ @SerializedName("category")
+ @Expose
+ var category : String,
+
+ @SerializedName("image")
+ @Expose
+ var image : String,
+
+)
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/NetworkMapper.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/NetworkMapper.kt
new file mode 100644
index 0000000..b4d93e2
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/NetworkMapper.kt
@@ -0,0 +1,29 @@
+package com.maxx.github_demo.retrofit
+
+import com.maxx.github_demo.model.Commit
+import com.maxx.github_demo.retrofit.model.GetCommitResponseItem
+import com.maxx.github_demo.util.EntityMapper
+import javax.inject.Inject
+
+class NetworkMapper
+@Inject
+constructor() : EntityMapper {
+ override fun mapFromEntity(entity: GetCommitResponseItem): Commit {
+ val authorName = entity.commit.author.name
+ val date = entity.commit.author.date
+ val commitMessage = entity.commit.message
+
+ return Commit(
+ authorName = authorName,
+ date = date,
+ commitMessage = commitMessage
+ )
+ }
+
+ fun mapFromEntityList(entities: ArrayList): List {
+ return entities.map {
+ mapFromEntity(it)
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/Author.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/Author.kt
new file mode 100644
index 0000000..a317f48
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/Author.kt
@@ -0,0 +1,43 @@
+package com.maxx.github_demo.retrofit.model
+
+
+import com.google.gson.annotations.SerializedName
+
+data class Author(
+ @SerializedName("avatar_url")
+ var avatarUrl: String,
+ @SerializedName("events_url")
+ var eventsUrl: String,
+ @SerializedName("followers_url")
+ var followersUrl: String,
+ @SerializedName("following_url")
+ var followingUrl: String,
+ @SerializedName("gists_url")
+ var gistsUrl: String,
+ @SerializedName("gravatar_id")
+ var gravatarId: String,
+ @SerializedName("html_url")
+ var htmlUrl: String,
+ @SerializedName("id")
+ var id: Int,
+ @SerializedName("login")
+ var login: String,
+ @SerializedName("node_id")
+ var nodeId: String,
+ @SerializedName("organizations_url")
+ var organizationsUrl: String,
+ @SerializedName("received_events_url")
+ var receivedEventsUrl: String,
+ @SerializedName("repos_url")
+ var reposUrl: String,
+ @SerializedName("site_admin")
+ var siteAdmin: Boolean,
+ @SerializedName("starred_url")
+ var starredUrl: String,
+ @SerializedName("subscriptions_url")
+ var subscriptionsUrl: String,
+ @SerializedName("type")
+ var type: String,
+ @SerializedName("url")
+ var url: String
+)
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/AuthorX.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/AuthorX.kt
new file mode 100644
index 0000000..6e00385
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/AuthorX.kt
@@ -0,0 +1,13 @@
+package com.maxx.github_demo.retrofit.model
+
+
+import com.google.gson.annotations.SerializedName
+
+data class AuthorX(
+ @SerializedName("date")
+ var date: String,
+ @SerializedName("email")
+ var email: String,
+ @SerializedName("name")
+ var name: String
+)
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/CommitX.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/CommitX.kt
new file mode 100644
index 0000000..b0efc8f
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/CommitX.kt
@@ -0,0 +1,21 @@
+package com.maxx.github_demo.retrofit.model
+
+
+import com.google.gson.annotations.SerializedName
+
+data class CommitX(
+ @SerializedName("author")
+ var author: AuthorX,
+ @SerializedName("comment_count")
+ var commentCount: Int,
+ @SerializedName("committer")
+ var committer: Committer,
+ @SerializedName("message")
+ var message: String,
+ @SerializedName("tree")
+ var tree: Tree,
+ @SerializedName("url")
+ var url: String,
+ @SerializedName("verification")
+ var verification: Verification
+)
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/Committer.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/Committer.kt
new file mode 100644
index 0000000..fb7d37a
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/Committer.kt
@@ -0,0 +1,13 @@
+package com.maxx.github_demo.retrofit.model
+
+
+import com.google.gson.annotations.SerializedName
+
+data class Committer(
+ @SerializedName("date")
+ var date: String,
+ @SerializedName("email")
+ var email: String,
+ @SerializedName("name")
+ var name: String
+)
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/CommitterX.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/CommitterX.kt
new file mode 100644
index 0000000..b611f15
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/CommitterX.kt
@@ -0,0 +1,43 @@
+package com.maxx.github_demo.retrofit.model
+
+
+import com.google.gson.annotations.SerializedName
+
+data class CommitterX(
+ @SerializedName("avatar_url")
+ var avatarUrl: String,
+ @SerializedName("events_url")
+ var eventsUrl: String,
+ @SerializedName("followers_url")
+ var followersUrl: String,
+ @SerializedName("following_url")
+ var followingUrl: String,
+ @SerializedName("gists_url")
+ var gistsUrl: String,
+ @SerializedName("gravatar_id")
+ var gravatarId: String,
+ @SerializedName("html_url")
+ var htmlUrl: String,
+ @SerializedName("id")
+ var id: Int,
+ @SerializedName("login")
+ var login: String,
+ @SerializedName("node_id")
+ var nodeId: String,
+ @SerializedName("organizations_url")
+ var organizationsUrl: String,
+ @SerializedName("received_events_url")
+ var receivedEventsUrl: String,
+ @SerializedName("repos_url")
+ var reposUrl: String,
+ @SerializedName("site_admin")
+ var siteAdmin: Boolean,
+ @SerializedName("starred_url")
+ var starredUrl: String,
+ @SerializedName("subscriptions_url")
+ var subscriptionsUrl: String,
+ @SerializedName("type")
+ var type: String,
+ @SerializedName("url")
+ var url: String
+)
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/GetCommitResponse.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/GetCommitResponse.kt
new file mode 100644
index 0000000..0e2f98a
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/GetCommitResponse.kt
@@ -0,0 +1,4 @@
+package com.maxx.github_demo.retrofit.model
+
+
+class GetCommitResponse : ArrayList()
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/GetCommitResponseItem.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/GetCommitResponseItem.kt
new file mode 100644
index 0000000..459da1e
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/GetCommitResponseItem.kt
@@ -0,0 +1,25 @@
+package com.maxx.github_demo.retrofit.model
+
+
+import com.google.gson.annotations.SerializedName
+
+data class GetCommitResponseItem(
+ @SerializedName("author")
+ var author: Author,
+ @SerializedName("comments_url")
+ var commentsUrl: String,
+ @SerializedName("commit")
+ var commit: CommitX,
+ @SerializedName("committer")
+ var committer: CommitterX,
+ @SerializedName("html_url")
+ var htmlUrl: String,
+ @SerializedName("node_id")
+ var nodeId: String,
+ @SerializedName("parents")
+ var parents: List,
+ @SerializedName("sha")
+ var sha: String,
+ @SerializedName("url")
+ var url: String
+)
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/Parent.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/Parent.kt
new file mode 100644
index 0000000..5ee2489
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/Parent.kt
@@ -0,0 +1,13 @@
+package com.maxx.github_demo.retrofit.model
+
+
+import com.google.gson.annotations.SerializedName
+
+data class Parent(
+ @SerializedName("html_url")
+ var htmlUrl: String,
+ @SerializedName("sha")
+ var sha: String,
+ @SerializedName("url")
+ var url: String
+)
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/Tree.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/Tree.kt
new file mode 100644
index 0000000..3d09640
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/Tree.kt
@@ -0,0 +1,11 @@
+package com.maxx.github_demo.retrofit.model
+
+
+import com.google.gson.annotations.SerializedName
+
+data class Tree(
+ @SerializedName("sha")
+ var sha: String,
+ @SerializedName("url")
+ var url: String
+)
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/Verification.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/Verification.kt
new file mode 100644
index 0000000..4120f3c
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/retrofit/model/Verification.kt
@@ -0,0 +1,15 @@
+package com.maxx.github_demo.retrofit.model
+
+
+import com.google.gson.annotations.SerializedName
+
+data class Verification(
+ @SerializedName("payload")
+ var payload: Any,
+ @SerializedName("reason")
+ var reason: String,
+ @SerializedName("signature")
+ var signature: Any,
+ @SerializedName("verified")
+ var verified: Boolean
+)
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/room/CacheEntity.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/room/CacheEntity.kt
new file mode 100644
index 0000000..b3065b2
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/room/CacheEntity.kt
@@ -0,0 +1,29 @@
+package com.maxx.github_demo.room
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+
+@Entity(tableName = "blog")
+class CacheEntity (
+
+ @PrimaryKey(autoGenerate = false)
+ @ColumnInfo(name = "id")
+ var id : Int,
+
+ @ColumnInfo(name = "title")
+ var title : String,
+
+ @ColumnInfo(name = "body")
+ var body : String,
+
+ @ColumnInfo(name = "category")
+ var category : String,
+
+ @ColumnInfo(name = "image")
+ var image : String,
+
+
+
+)
+
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/room/CacheMapper.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/room/CacheMapper.kt
new file mode 100644
index 0000000..4504504
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/room/CacheMapper.kt
@@ -0,0 +1,25 @@
+package com.maxx.github_demo.room
+
+import com.maxx.github_demo.model.Commit
+import com.maxx.github_demo.retrofit.model.GetCommitResponseItem
+import com.maxx.github_demo.util.EntityMapper
+import javax.inject.Inject
+
+class CacheMapper
+@Inject
+constructor() : EntityMapper{
+ override fun mapFromEntity(entity: GetCommitResponseItem): Commit {
+ return Commit(
+ authorName = entity.commit.author.name,
+ date = entity.commit.author.date,
+ commitMessage = entity.commit.message
+ )
+ }
+
+ fun mapFromEntityList(entities: ArrayList) : List{
+ return entities.map {
+ mapFromEntity(it)
+ }
+ }
+
+}
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/room/Dao.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/room/Dao.kt
new file mode 100644
index 0000000..b130799
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/room/Dao.kt
@@ -0,0 +1,19 @@
+package com.maxx.github_demo.room
+
+import androidx.room.Dao
+import androidx.room.Insert
+import androidx.room.OnConflictStrategy
+import androidx.room.Query
+
+@Dao
+interface Dao {
+
+ @Insert(onConflict = OnConflictStrategy.REPLACE)
+ suspend fun insert(entity: CacheEntity)
+
+ @Query("SELECT * FROM blog")
+ suspend fun get() : List
+
+
+
+}
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/room/Database.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/room/Database.kt
new file mode 100644
index 0000000..6d4f43d
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/room/Database.kt
@@ -0,0 +1,15 @@
+package com.maxx.github_demo.room
+
+import androidx.room.Database
+import androidx.room.RoomDatabase
+
+
+@Database(entities = [CacheEntity::class], version = 1)
+abstract class Database : RoomDatabase(){
+
+ abstract fun blogDao() : Dao
+
+ companion object{
+ val DATABASE_NAME: String = "MyDB"
+ }
+}
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/ui/adapter/CommitAdapter.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/ui/adapter/CommitAdapter.kt
new file mode 100644
index 0000000..af7a43f
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/ui/adapter/CommitAdapter.kt
@@ -0,0 +1,34 @@
+package com.maxx.github_demo.ui.adapter
+
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.recyclerview.widget.RecyclerView
+import com.maxx.github_demo.databinding.AdapterCommitBinding
+import com.maxx.github_demo.model.Commit
+
+class CommitAdapter(private val commitList: List) :
+ RecyclerView.Adapter() {
+ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CommitHolder {
+ val itemBinding =
+ AdapterCommitBinding.inflate(LayoutInflater.from(parent.context), parent, false)
+ return CommitHolder(itemBinding)
+ }
+
+ override fun onBindViewHolder(holder: CommitHolder, position: Int) {
+ val paymentBean = commitList[position]
+ holder.bind(paymentBean)
+ }
+
+ override fun getItemCount(): Int = commitList.size
+
+ class CommitHolder(private val itemBinding: AdapterCommitBinding) :
+ RecyclerView.ViewHolder(itemBinding.root) {
+ fun bind(commit: Commit) {
+ itemBinding.apply {
+ authorNameTextView.text = commit.authorName
+ dateTextView.text = commit.date
+ messageTextView.text = commit.commitMessage
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/ui/main/MainActivity.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/ui/main/MainActivity.kt
new file mode 100644
index 0000000..274d987
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/ui/main/MainActivity.kt
@@ -0,0 +1,27 @@
+package com.maxx.github_demo.ui.main
+
+import androidx.appcompat.app.AppCompatActivity
+import android.os.Bundle
+import com.maxx.github_demo.R
+import com.maxx.github_demo.databinding.MainActivityBinding
+import dagger.hilt.android.AndroidEntryPoint
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+
+@ExperimentalCoroutinesApi
+@AndroidEntryPoint
+class MainActivity : AppCompatActivity() {
+
+ private lateinit var binding: MainActivityBinding
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ binding = MainActivityBinding.inflate(layoutInflater)
+ setContentView(binding.root)
+
+ if (savedInstanceState == null) {
+ supportFragmentManager.beginTransaction()
+ .replace(R.id.container, MainFragment.newInstance())
+ .commitNow()
+ }
+ }
+}
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/ui/main/MainFragment.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/ui/main/MainFragment.kt
new file mode 100644
index 0000000..819015e
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/ui/main/MainFragment.kt
@@ -0,0 +1,87 @@
+package com.maxx.github_demo.ui.main
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.fragment.app.Fragment
+import androidx.fragment.app.viewModels
+import androidx.lifecycle.Observer
+import com.maxx.github_demo.databinding.MainFragmentBinding
+import com.maxx.github_demo.model.Commit
+import com.maxx.github_demo.ui.adapter.CommitAdapter
+import com.maxx.github_demo.util.DataState
+import dagger.hilt.android.AndroidEntryPoint
+
+@AndroidEntryPoint
+class MainFragment : Fragment() {
+
+ companion object {
+ fun newInstance() = MainFragment()
+ }
+
+ private val viewModel: MainViewModel by viewModels()
+ private var _binding: MainFragmentBinding? = null
+ private val binding get() = _binding
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View {
+ _binding = MainFragmentBinding.inflate(inflater, container, false)
+ return binding?.root!!
+ }
+
+ override fun onDestroyView() {
+ super.onDestroyView()
+ _binding = null
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+
+ subscribeObservers()
+ viewModel.setStateEvent(MainStateEvent.GetBlogEvents)
+ }
+
+ override fun onActivityCreated(savedInstanceState: Bundle?) {
+ super.onActivityCreated(savedInstanceState)
+ //viewModel = ViewModelProvider(this).get(MainViewModel::class.java)
+ }
+
+ private fun subscribeObservers() {
+ viewModel.dataState.observe(requireActivity(), Observer {
+ when (it) {
+ is DataState.Success> -> {
+ displayProgressBar(false)
+ setUpRecyclerView(it.data)
+ }
+ is DataState.Error -> {
+ displayProgressBar(false)
+ displayError(it.exception.message)
+
+ }
+ is DataState.Loading -> {
+ displayProgressBar(true)
+ }
+ }
+ })
+ }
+
+ private fun displayError(message: String?) {
+ if (message != null) {
+ binding?.dataTextView?.text = message.toString()
+ } else {
+ binding?.dataTextView?.text = "Unknown Error"
+ }
+ }
+
+ private fun displayProgressBar(isDisplayed: Boolean) {
+ binding?.progressBar?.visibility = if (isDisplayed) View.VISIBLE else View.GONE
+ }
+
+ private fun setUpRecyclerView(commits: List) {
+ binding?.recyclerView?.adapter = CommitAdapter(commits)
+ }
+
+}
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/ui/main/MainViewModel.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/ui/main/MainViewModel.kt
new file mode 100644
index 0000000..dcba335
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/ui/main/MainViewModel.kt
@@ -0,0 +1,49 @@
+package com.maxx.github_demo.ui.main
+
+import androidx.hilt.Assisted
+import androidx.hilt.lifecycle.ViewModelInject
+import androidx.lifecycle.*
+import com.maxx.github_demo.model.Commit
+import com.maxx.github_demo.repository.MainRepository
+import com.maxx.github_demo.util.DataState
+import kotlinx.coroutines.flow.launchIn
+import kotlinx.coroutines.flow.onEach
+import kotlinx.coroutines.launch
+
+class MainViewModel
+@ViewModelInject
+constructor(
+ private val mainRepository: MainRepository,
+ @Assisted private val savedStateHandle: SavedStateHandle
+) : ViewModel() {
+
+ private var _dataState: MutableLiveData>> = MutableLiveData()
+
+ val dataState: MutableLiveData>> get() = _dataState
+
+ fun setStateEvent(mainStateEvent: MainStateEvent){
+ viewModelScope.launch {
+ when(mainStateEvent){
+ is MainStateEvent.GetBlogEvents ->{
+ mainRepository.getBlogs()
+ .onEach {
+ _dataState.value = it
+ }
+ .launchIn(viewModelScope)
+ }
+
+ is MainStateEvent.None ->{
+
+ }
+ }
+ }
+ }
+}
+
+sealed class MainStateEvent {
+
+ object GetBlogEvents : MainStateEvent()
+
+ object None : MainStateEvent()
+
+}
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/util/Constants.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/util/Constants.kt
new file mode 100644
index 0000000..bde034a
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/util/Constants.kt
@@ -0,0 +1,7 @@
+package com.maxx.github_demo.util
+
+
+object Constants {
+
+ const val BASE_URL = "https://api.github.com/repos/rails/rails/"
+}
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/util/DataState.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/util/DataState.kt
new file mode 100644
index 0000000..cdc2bc2
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/util/DataState.kt
@@ -0,0 +1,10 @@
+package com.maxx.github_demo.util
+
+import java.lang.Exception
+
+sealed class DataState {
+
+ data class Success(val data: T) : DataState()
+ data class Error(val exception: Exception) : DataState()
+ object Loading : DataState()
+}
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/java/com/maxx/github_demo/util/EntityMapper.kt b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/util/EntityMapper.kt
new file mode 100644
index 0000000..c291331
--- /dev/null
+++ b/source/GithubDemo/app/src/main/java/com/maxx/github_demo/util/EntityMapper.kt
@@ -0,0 +1,9 @@
+package com.maxx.github_demo.util
+
+interface EntityMapper {
+
+ fun mapFromEntity(entity: Entity) : DomainModel
+
+ //fun mapToEntity(domainModel: DomainModel) : Entity
+
+}
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/source/GithubDemo/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/source/GithubDemo/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/res/drawable/ic_launcher_background.xml b/source/GithubDemo/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/source/GithubDemo/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source/GithubDemo/app/src/main/res/layout/adapter_commit.xml b/source/GithubDemo/app/src/main/res/layout/adapter_commit.xml
new file mode 100644
index 0000000..cbf0db3
--- /dev/null
+++ b/source/GithubDemo/app/src/main/res/layout/adapter_commit.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/res/layout/main_activity.xml b/source/GithubDemo/app/src/main/res/layout/main_activity.xml
new file mode 100644
index 0000000..55f3545
--- /dev/null
+++ b/source/GithubDemo/app/src/main/res/layout/main_activity.xml
@@ -0,0 +1,7 @@
+
+
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/res/layout/main_fragment.xml b/source/GithubDemo/app/src/main/res/layout/main_fragment.xml
new file mode 100644
index 0000000..8084dd2
--- /dev/null
+++ b/source/GithubDemo/app/src/main/res/layout/main_fragment.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source/GithubDemo/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/source/GithubDemo/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/source/GithubDemo/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/source/GithubDemo/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/source/GithubDemo/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/res/mipmap-hdpi/ic_launcher.png b/source/GithubDemo/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..a571e60
Binary files /dev/null and b/source/GithubDemo/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/source/GithubDemo/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/source/GithubDemo/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..61da551
Binary files /dev/null and b/source/GithubDemo/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/source/GithubDemo/app/src/main/res/mipmap-mdpi/ic_launcher.png b/source/GithubDemo/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..c41dd28
Binary files /dev/null and b/source/GithubDemo/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/source/GithubDemo/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/source/GithubDemo/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..db5080a
Binary files /dev/null and b/source/GithubDemo/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/source/GithubDemo/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/source/GithubDemo/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..6dba46d
Binary files /dev/null and b/source/GithubDemo/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/source/GithubDemo/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/source/GithubDemo/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..da31a87
Binary files /dev/null and b/source/GithubDemo/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/source/GithubDemo/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/source/GithubDemo/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..15ac681
Binary files /dev/null and b/source/GithubDemo/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/source/GithubDemo/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/source/GithubDemo/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..b216f2d
Binary files /dev/null and b/source/GithubDemo/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/source/GithubDemo/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/source/GithubDemo/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..f25a419
Binary files /dev/null and b/source/GithubDemo/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/source/GithubDemo/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/source/GithubDemo/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..e96783c
Binary files /dev/null and b/source/GithubDemo/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/source/GithubDemo/app/src/main/res/values-night/themes.xml b/source/GithubDemo/app/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..e503f1d
--- /dev/null
+++ b/source/GithubDemo/app/src/main/res/values-night/themes.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/res/values/colors.xml b/source/GithubDemo/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..4331116
--- /dev/null
+++ b/source/GithubDemo/app/src/main/res/values/colors.xml
@@ -0,0 +1,11 @@
+
+
+ #FFBB86FC
+ #FF6200EE
+ #FF3700B3
+ #FF03DAC5
+ #FF018786
+ #FF000000
+ #FFFFFFFF
+ #696969
+
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/res/values/strings.xml b/source/GithubDemo/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..7f6dbf9
--- /dev/null
+++ b/source/GithubDemo/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ Github Demo
+
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/main/res/values/themes.xml b/source/GithubDemo/app/src/main/res/values/themes.xml
new file mode 100644
index 0000000..c4416b6
--- /dev/null
+++ b/source/GithubDemo/app/src/main/res/values/themes.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/source/GithubDemo/app/src/test/java/com/maxx/github_demo/ExampleUnitTest.kt b/source/GithubDemo/app/src/test/java/com/maxx/github_demo/ExampleUnitTest.kt
new file mode 100644
index 0000000..bdd704c
--- /dev/null
+++ b/source/GithubDemo/app/src/test/java/com/maxx/github_demo/ExampleUnitTest.kt
@@ -0,0 +1,17 @@
+package com.maxx.github_demo
+
+import org.junit.Test
+
+import org.junit.Assert.*
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+class ExampleUnitTest {
+ @Test
+ fun addition_isCorrect() {
+ assertEquals(4, 2 + 2)
+ }
+}
\ No newline at end of file
diff --git a/source/GithubDemo/build.gradle b/source/GithubDemo/build.gradle
new file mode 100644
index 0000000..470056c
--- /dev/null
+++ b/source/GithubDemo/build.gradle
@@ -0,0 +1,33 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+ ext.kotlin_version = "1.4.10"
+ ext.supportLibVersion = '30.0.0'
+ ext.hilt_version = "2.28-alpha"
+ ext.hilt_viewmodels = "1.0.0-alpha02"
+ ext.retrofit_version = '2.9.0'
+ ext.room_version = "2.2.5"
+ ext.fragment_ktx = "1.2.5"
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath "com.android.tools.build:gradle:4.1.1"
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
\ No newline at end of file
diff --git a/source/GithubDemo/gradle.properties b/source/GithubDemo/gradle.properties
new file mode 100644
index 0000000..98bed16
--- /dev/null
+++ b/source/GithubDemo/gradle.properties
@@ -0,0 +1,21 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app"s APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Automatically convert third-party libraries to use AndroidX
+android.enableJetifier=true
+# Kotlin code style for this project: "official" or "obsolete":
+kotlin.code.style=official
\ No newline at end of file
diff --git a/source/GithubDemo/gradle/wrapper/gradle-wrapper.jar b/source/GithubDemo/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..f6b961f
Binary files /dev/null and b/source/GithubDemo/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/source/GithubDemo/gradle/wrapper/gradle-wrapper.properties b/source/GithubDemo/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..21f6c31
--- /dev/null
+++ b/source/GithubDemo/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Sat Nov 14 17:50:33 NPT 2020
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
diff --git a/source/GithubDemo/gradlew b/source/GithubDemo/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/source/GithubDemo/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/source/GithubDemo/gradlew.bat b/source/GithubDemo/gradlew.bat
new file mode 100644
index 0000000..e95643d
--- /dev/null
+++ b/source/GithubDemo/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/source/GithubDemo/settings.gradle b/source/GithubDemo/settings.gradle
new file mode 100644
index 0000000..439ef59
--- /dev/null
+++ b/source/GithubDemo/settings.gradle
@@ -0,0 +1,2 @@
+include ':app'
+rootProject.name = "DaggerHiltPlayground"
\ No newline at end of file