Skip to content

Commit

Permalink
Changed some dependencies. Note feature works.
Browse files Browse the repository at this point in the history
  • Loading branch information
kKrzysciak96 committed Nov 5, 2023
1 parent 02e8cff commit afe4b4f
Show file tree
Hide file tree
Showing 72 changed files with 1,555 additions and 50 deletions.
4 changes: 4 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 12 additions & 9 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ dependencies {
implementation(project(Modules.photo_domain))
implementation(project(Modules.photo_presentation))

implementation(project(Modules.notes_data))
implementation(project(Modules.notes_domain))
implementation(project(Modules.notes_presentation))

implementation(AndroidX.coreKtx)
implementation(AndroidX.lifecycleRuntime)
Expand All @@ -94,14 +97,14 @@ dependencies {
implementation(Coil.coilCompose)

implementation(Google.material)

implementation(Retrofit.okHttp)
implementation(Retrofit.retrofit)
implementation(Retrofit.okHttpLoggingInterceptor)
implementation(Retrofit.moshiConverter)

kapt(Room.roomCompiler)
implementation(Room.roomKtx)
implementation(Room.roomRuntime)
//
// implementation(Retrofit.okHttp)
// implementation(Retrofit.retrofit)
// implementation(Retrofit.okHttpLoggingInterceptor)
// implementation(Retrofit.moshiConverter)

// kapt(Room.roomCompiler)
// implementation(Room.roomKtx)
// implementation(Room.roomRuntime)
implementation(WorkManager.workManager)
}
85 changes: 78 additions & 7 deletions app/src/main/java/com/eltescode/warhbook/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ import android.os.Bundle
import android.util.Log
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.navigation.NavBackStackEntry
import androidx.navigation.NavType
Expand All @@ -25,6 +28,8 @@ import androidx.work.WorkManager
import com.eltescode.auth_presentation.sign_in_screen.SignInScreen
import com.eltescode.auth_presentation.sign_up_screen.SignUpScreen
import com.eltescode.core_ui.navigation.Routes
import com.eltescode.notes_presentation.add_edit_note.AddEditNoteScreen
import com.eltescode.notes_presentation.notes.NotesScreen
import com.eltescode.photo_presentation.search_screen.SearchPhotoScreen
import com.eltescode.user_presentation.user_screen.UserDataScreen
import com.eltescode.user_presentation.utils.UriHelper
Expand Down Expand Up @@ -64,7 +69,7 @@ class MainActivity : ComponentActivity() {
content = {
NavHost(
navController = navController,
startDestination = Routes.SIGN_IN
startDestination = Routes.SPLASH_SCREEN
)
{

Expand Down Expand Up @@ -119,19 +124,85 @@ class MainActivity : ComponentActivity() {
}
}
composable(route = Routes.NOTES) {

NotesScreen(snackBarHostState = snackBarHostState) {
navController.navigate(it ?: "")
}
}
composable(
route = Routes.ADD_EDIT_NOTE +
"?noteId={noteId}&noteColor={noteColor}",
arguments = listOf(
navArgument(name = "noteId") {
type = NavType.IntType
defaultValue = -1
},
navArgument(name = "noteColor") {
type = NavType.IntType
defaultValue = -1
})
) {
val color = it.arguments?.getInt("noteColor") ?: -1
AddEditNoteScreen(
snackBarHostState = snackBarHostState,
noteColor = color
) {
navController.navigateUp()
}
}
composable(route = Routes.YOUR_SHEETS) {
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
Text("Not implemented yet")
}
}
composable(route = Routes.FAVOURITE_PROFESSIONS) {
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
Text("Not implemented yet")
}
}
composable(route = Routes.FAVOURITE_MAGIC) {
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
Text("Not implemented yet")
}
}
composable(route = Routes.PROFESSION_CREATOR) {
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
Text("Not implemented yet")
}
}
composable(route = Routes.ADDITIONAL) {
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
Text("Not implemented yet")
}
}
composable(route = Routes.NEW_CHARACTER) {
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
Text("Not implemented yet")
}
}
}
})
}
}
}

override fun onResume() {
super.onResume()
Log.d("CYCLE main compose", "${uriHelper.oldUri}")
}

override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
val new = intent?.getParcelableExtra<Uri>(Intent.EXTRA_STREAM)
Expand Down
5 changes: 5 additions & 0 deletions auth/auth_data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ dependencies {
implementation(project(Modules.core_data))
implementation(project(Modules.core_domain))
implementation(project(Modules.auth_domain))

implementation(platform(Firebase.firebaseBom))
implementation(Firebase.firebaseAuth)
implementation(Firebase.firebaseFirestore)
implementation(Firebase.firebaseStorage)
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import com.eltescode.auth_presentation.utils.SignInScreenEvent
import com.eltescode.auth_presentation.utils.SignInScreenState
import com.eltescode.core_ui.R
import com.eltescode.core_ui.components.BoxWithAnimatedBorder
import com.eltescode.core_ui.components.backgroundBrush
import com.eltescode.core_ui.components.silverBackgroundBrush
import com.eltescode.core_ui.components.texFieldColors_1
import com.eltescode.core_ui.ui.fontFamily_croissant
import com.eltescode.core_ui.utils.UiEvent
Expand All @@ -65,9 +65,6 @@ fun SignInScreen(
LaunchedEffect(key1 = true) {
viewModel.uiEvent.collect { event ->
when (event) {
UiEvent.OnNavigateUp -> {

}

is UiEvent.ShowSnackBar -> {
snackBarHostState.currentSnackbarData?.dismiss()
Expand All @@ -83,6 +80,8 @@ fun SignInScreen(
is UiEvent.OnNextScreen -> {
onNextScreen()
}

else -> Unit
}
}
}
Expand All @@ -103,7 +102,7 @@ fun SignInScreen(
Box(
modifier = Modifier
.fillMaxSize()
.background(backgroundBrush()),
.background(silverBackgroundBrush()),
contentAlignment = Alignment.Center
) {
Button(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import com.eltescode.auth_presentation.utils.SignUpScreenEvent
import com.eltescode.auth_presentation.utils.SignUpScreenState
import com.eltescode.core_ui.R
import com.eltescode.core_ui.components.BoxWithAnimatedBorder
import com.eltescode.core_ui.components.backgroundBrush
import com.eltescode.core_ui.components.silverBackgroundBrush
import com.eltescode.core_ui.components.texFieldColors_1
import com.eltescode.core_ui.ui.fontFamily_croissant
import com.eltescode.core_ui.utils.UiEvent
Expand Down Expand Up @@ -78,7 +78,7 @@ fun SignUpScreen(state: SignUpScreenState, onEvent: (SignUpScreenEvent) -> Unit)
Box(
modifier = Modifier
.fillMaxSize()
.background(backgroundBrush()),
.background(silverBackgroundBrush()),
contentAlignment = Alignment.Center
) {
BoxWithAnimatedBorder(
Expand Down
4 changes: 4 additions & 0 deletions buildSrc/src/main/java/Modules.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ object Modules {
const val book_domain = ":book:book_domain"
const val book_data = ":book:book_data"
const val book_presentation = ":book_presentation"

const val notes_domain = ":notes:notes_domain"
const val notes_data = ":notes:notes_data"
const val notes_presentation = ":notes_presentation"
}
3 changes: 2 additions & 1 deletion buildSrc/src/main/java/Room.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
object Room {
private const val version = "2.5.0"
private const val version = "2.5.2"
const val roomRuntime = "androidx.room:room-runtime:$version"
const val roomCompiler = "androidx.room:room-compiler:$version"
const val roomKtx = "androidx.room:room-ktx:$version"

}
8 changes: 4 additions & 4 deletions core_data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
}

dependencies {
api(platform(Firebase.firebaseBom))
api(Firebase.firebaseAuth)
api(Firebase.firebaseFirestore)
api(Firebase.firebaseStorage)
implementation(platform(Firebase.firebaseBom))
implementation(Firebase.firebaseAuth)
implementation(Firebase.firebaseFirestore)
implementation(Firebase.firebaseStorage)
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fun backgroundShaderBrush(): ShaderBrush {
}

@Composable
fun backgroundBrush(): Brush {
fun silverBackgroundBrush(): Brush {
return Brush.linearGradient(
colors = listOf(Color.White, Color(0XFF979c9f)),
start = Offset.Zero,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ object Routes {
const val NEW_CHARACTER = "NEW_CHARACTER"
const val ADDITIONAL = "ADDITIONAL"
const val PROFESSION_CREATOR = "PROFESSION_CREATOR"
const val ADD_EDIT_NOTE = "ADD_EDIT_NOTE"

}
5 changes: 4 additions & 1 deletion core_ui/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,8 @@
<string name="career_screen_name">Career Creator</string>
<string name="something_screen_name">Something</string>
<string name="new_character_screen_name">New Character</string>
<string name="profession_creator_screen_name">Something</string>
<string name="profession_creator_screen_name">Profession Creator</string>
<string name="note_deleted">Note deleted</string>
<string name="undo">Undo</string>
<string name="your_notes">Your notes</string>
</resources>
1 change: 1 addition & 0 deletions notes/notes_data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
26 changes: 26 additions & 0 deletions notes/notes_data/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
plugins {
`android-library`
`kotlin-android`

}

apply(from = "$rootDir/base-module.gradle")

android {
namespace = "com.eltescode.notes_data"
}

dependencies {

implementation(project(Modules.core_data))
implementation(project(Modules.notes_domain))

implementation(Room.roomRuntime)
implementation(Room.roomKtx)
"kapt"(Room.roomCompiler)

implementation(platform(Firebase.firebaseBom))
implementation(Firebase.firebaseAuth)
implementation(Firebase.firebaseFirestore)
implementation(Firebase.firebaseStorage)
}
Empty file.
21 changes: 21 additions & 0 deletions notes/notes_data/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.eltescode.notes_data

import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.*
import org.junit.Test
import org.junit.runner.RunWith

/**
* 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.eltescode.notes_data.test", appContext.packageName)
}
}
4 changes: 4 additions & 0 deletions notes/notes_data/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
Loading

0 comments on commit afe4b4f

Please sign in to comment.