-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from peterkrauz/develop
Develop
- Loading branch information
Showing
167 changed files
with
2,072 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,5 @@ | |
.idea | ||
/buildSrc/build/ | ||
/buildSrc/build/* | ||
*.jar | ||
*.jar | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Grimoire :crystal_ball: :open_book: | ||
## What is this | ||
Grimoire (pronounced **gruhm · waar**) is a hobby app that employs several Android modern technologies and best practices. <br> | ||
It is currently a work in progress being slowly refined weekend by weekend, for usage on my not-so-regular tabletop RPG gaming sessions. | ||
|
||
## Tech Stack | ||
|
||
|
||
## Architecture |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"project_info": { | ||
"project_number": "471809376764", | ||
"firebase_url": "https://grimoire-480b0.firebaseio.com", | ||
"project_id": "grimoire-480b0", | ||
"storage_bucket": "grimoire-480b0.appspot.com" | ||
}, | ||
"client": [ | ||
{ | ||
"client_info": { | ||
"mobilesdk_app_id": "1:471809376764:android:ef82e3596abba182903279", | ||
"android_client_info": { | ||
"package_name": "com.peterkrauz.grimoire" | ||
} | ||
}, | ||
"oauth_client": [ | ||
{ | ||
"client_id": "471809376764-r4fhgao995chl26pou0kb3feo3a8ed0k.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
], | ||
"api_key": [ | ||
{ | ||
"current_key": "AIzaSyDtJzE-Oo1EIgmqZRCbgmig08_I1CvNse8" | ||
} | ||
], | ||
"services": { | ||
"appinvite_service": { | ||
"other_platform_oauth_client": [ | ||
{ | ||
"client_id": "471809376764-r4fhgao995chl26pou0kb3feo3a8ed0k.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
"client_info": { | ||
"mobilesdk_app_id": "1:471809376764:android:924a832c114f8689903279", | ||
"android_client_info": { | ||
"package_name": "com.peterkrauz.grimoire.beta" | ||
} | ||
}, | ||
"oauth_client": [ | ||
{ | ||
"client_id": "471809376764-r4fhgao995chl26pou0kb3feo3a8ed0k.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
], | ||
"api_key": [ | ||
{ | ||
"current_key": "AIzaSyDtJzE-Oo1EIgmqZRCbgmig08_I1CvNse8" | ||
} | ||
], | ||
"services": { | ||
"appinvite_service": { | ||
"other_platform_oauth_client": [ | ||
{ | ||
"client_id": "471809376764-r4fhgao995chl26pou0kb3feo3a8ed0k.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"configuration_version": "1" | ||
} |
24 changes: 0 additions & 24 deletions
24
app/src/androidTest/java/com/peterkrauz/grimoire/ExampleInstrumentedTest.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions
7
app/src/main/java/com/peterkrauz/grimoire/GrimoireApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.peterkrauz.grimoire | ||
|
||
import android.app.Application | ||
import dagger.hilt.android.HiltAndroidApp | ||
|
||
@HiltAndroidApp | ||
class GrimoireApplication : Application() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,42 @@ | ||
package com.peterkrauz.grimoire | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import androidx.activity.viewModels | ||
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.lifecycle.observe | ||
import androidx.navigation.fragment.findNavController | ||
import androidx.navigation.ui.setupWithNavController | ||
import com.peterkrauz.grimoire.common.MainViewModel | ||
import com.peterkrauz.grimoire.common.extension.snackBar | ||
import com.peterkrauz.grimoire.common.snackbar.SnackBarType | ||
import dagger.hilt.android.AndroidEntryPoint | ||
import kotlinx.android.synthetic.main.activity_main.* | ||
|
||
@AndroidEntryPoint | ||
class MainActivity : AppCompatActivity() { | ||
|
||
private val mainViewModel: MainViewModel by viewModels() | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
setTheme(R.style.Theme_Grimoire) | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
setupView() | ||
observeViewModel() | ||
} | ||
|
||
private fun setupView() { | ||
bottomNavigationView.run { | ||
setOnNavigationItemReselectedListener { Unit } | ||
setupWithNavController(mainNavFragment.findNavController()) | ||
} | ||
} | ||
|
||
private fun observeViewModel() { | ||
mainViewModel.arcCreatedLiveEvent.observe(this) { showArcCreatedSnackBar() } | ||
} | ||
|
||
private fun showArcCreatedSnackBar() { | ||
snackBar(rootLayout, R.string.arc_created_success, SnackBarType.SUCCESS) | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
app/src/main/java/com/peterkrauz/grimoire/hilt/ArcModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.peterkrauz.grimoire.hilt | ||
|
||
import com.peterkrauz.grimoire.data.dao.ArcDao | ||
import com.peterkrauz.grimoire.data.repository.ArcRepositoryImpl | ||
import com.peterkrauz.grimoire.data.db.GrimoireDatabase | ||
import com.peterkrauz.grimoire.domain.entity.ArcRepository | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.android.components.ApplicationComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(ApplicationComponent::class) | ||
object ArcModule { | ||
|
||
@Provides | ||
@Singleton | ||
fun provideArcRepository(dao: ArcDao): ArcRepository { | ||
return ArcRepositoryImpl(dao) | ||
} | ||
|
||
@Provides | ||
@Singleton | ||
fun provideArcDao(database: GrimoireDatabase): ArcDao { | ||
return database.arcDao() | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/com/peterkrauz/grimoire/hilt/DatabaseModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.peterkrauz.grimoire.hilt | ||
|
||
import android.app.Application | ||
import androidx.room.Room | ||
import com.peterkrauz.grimoire.data.db.GrimoireDatabase | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.android.components.ApplicationComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(ApplicationComponent::class) | ||
object DatabaseModule { | ||
|
||
@Provides | ||
@Singleton | ||
fun provideGrimoireDatabase(app: Application): GrimoireDatabase { | ||
return Room.databaseBuilder(app, GrimoireDatabase::class.java, "grimoire") | ||
// .addMigrations(*MigrationHelper.getMigrations()) | ||
.build() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:state_selected="true" android:color="@color/colorAccent" /> | ||
<item android:color="@color/grey64" /> | ||
</selector> |
Oops, something went wrong.