Skip to content

Commit

Permalink
Merge pull request #28 from MONEYMONG/release/release-1.2.0
Browse files Browse the repository at this point in the history
Release/release 1.2.0
  • Loading branch information
eunseo0105 authored Aug 19, 2024
2 parents 3c169ca + 84ad945 commit 62a9e63
Show file tree
Hide file tree
Showing 88 changed files with 1,107 additions and 536 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ keystore.properties

# Keystore Files
*.jks
*.keystore
*.keystore

*.json
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ android {
applicationId = "com.moneymong.moneymong"
minSdk = 24
targetSdk = 34
versionCode = 13
versionName = "1.1.0"
versionCode = 15
versionName = "1.2.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/java/com/moneymong/moneymong/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.Modifier
import com.moneymong.moneymong.common.event.EventTracker
import dagger.hilt.android.AndroidEntryPoint
import com.moneymong.moneymong.design_system.theme.MMTheme
import com.moneymong.moneymong.domain.repository.TokenRepository
Expand All @@ -32,8 +33,13 @@ class MainActivity : ComponentActivity() {
lateinit var tokenRepository: TokenRepository
private val expired = mutableStateOf(false)

@Inject
lateinit var eventTracker: EventTracker

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
eventTracker.initialize()

setContent {
MMTheme {
MoneyMongApp(expired.value) {
Expand Down
5 changes: 5 additions & 0 deletions core/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
plugins {
alias(libs.plugins.moneymong.android.library)
alias(libs.plugins.moneymong.android.library.compose)
alias(libs.plugins.moneymong.android.hilt)
}

android {
Expand All @@ -20,6 +21,10 @@ dependencies {
implementation(libs.orbit.viewModel)
implementation(libs.okhttp)

implementation(platform(libs.firebase.bom))
implementation(libs.firebase.analytics)
implementation(libs.firebase.crashlytics)

testImplementation(libs.junit4)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.test.espresso.core)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.moneymong.moneymong.common.di

import com.moneymong.moneymong.common.event.EventTracker
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object EventModule {

@Provides
@Singleton
fun provideEventTracker(): EventTracker =
EventTracker()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.moneymong.moneymong.common.event

enum class Event(val eventName: String, val desc: String) {
OPERATION_COST_CLICK(
eventName = "operation_cost_click",
desc = "운영비 등록하기 버튼 클릭"
),
LEDGER_CLICK(
eventName = "ledger_click",
desc = "소속 장부 확인 버튼 클릭"
),
OCR_REGISTER_CLICK(
eventName = "ocr_register_click",
desc = "등록하기 버튼 클릭"
),
OCR_MODIFY_CLICK(
eventName = "ocr_modify_click",
desc = "수정하기 버튼 클릭"
),
OCR_MODIFY_TO_REGISTER_CLICK(
eventName = "ocr_modify_to_register_click",
desc = "등록하기 버튼 클릭"
),
PLUS_CLICK(
eventName = "plus_click",
desc = "+ 플로팅 버튼 클릭"
),
HAND_CLICK(
eventName = "hand_click",
desc = "수동 등록 플로팅 버튼 클릭"
),
OCR_CLICK(
eventName = "ocr_click",
desc = "OCR 등록 플로팅 버튼 클릭"
)
;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.moneymong.moneymong.common.event

import android.os.Bundle
import com.google.firebase.Firebase
import com.google.firebase.analytics.FirebaseAnalytics
import com.google.firebase.analytics.analytics
import javax.inject.Inject

class EventTracker @Inject constructor() {

private lateinit var firebaseAnalytics: FirebaseAnalytics
private var initialized: Boolean = false

fun initialize() {
firebaseAnalytics = Firebase.analytics
initialized = true
}

fun logEvent(event: Event, param: Bundle? = null) {
check(initialized) { "logEvent를 호출하기 전 초기화가 필요합니다." }

firebaseAnalytics.logEvent(event.eventName, param)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,43 @@ import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.moneymong.moneymong.design_system.theme.Body3
import com.moneymong.moneymong.design_system.theme.Gray03

@Composable
fun MDSSelection(
modifier: Modifier = Modifier,
text: String,
isSelected: Boolean,
enabled: Boolean = true,
isSelected: Boolean = false,
type: MDSSelectionType = MDSSelectionType.PRIMARY,
onClick: () -> Unit
onClick: () -> Unit = {}
) {

val backgroundColor =
if (isSelected) type.backgroundColor else unSelectedBackgroundColor
val contentColor =
if (isSelected) type.contentColor else unSelectedContentColor
val borderColor =
if (isSelected) type.backgroundColor else Gray03
val backgroundColor = selectionBackgroundColor(enabled, isSelected, type)
val contentColor = selectionContentColor(enabled, isSelected, type)
val borderColor = selectionBorderColor(enabled, isSelected, type)

Box(
modifier = modifier
.clip(RoundedCornerShape(8.dp))
.background(color = backgroundColor)
.clickable { onClick() }
.clickable(enabled = enabled) { onClick() }
.border(
width = 1.dp,
color = borderColor,
Expand All @@ -59,28 +62,35 @@ fun MDSSelection(
@Preview(showBackground = true)
@Composable
private fun MDSSelectionPreview() {
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(10.dp)
var selectedType by remember { mutableIntStateOf(1) }

Box(
modifier = Modifier
.fillMaxSize()
.background(Color.White)
) {
MDSSelection(
modifier = Modifier.weight(1f),
text = "동아리",
isSelected = true,
onClick = {}
)
MDSSelection(
modifier = Modifier.weight(1f),
text = "나는 Secondary",
isSelected = true,
type = MDSSelectionType.SECONDARY,
onClick = {}
)
MDSSelection(
modifier = Modifier.weight(1f),
text = "학생회",
isSelected = false,
onClick = {}
)
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(10.dp)
) {
MDSSelection(
modifier = Modifier.weight(1f),
text = "동아리",
isSelected = selectedType == 1,
onClick = { selectedType = 1 }
)
MDSSelection(
modifier = Modifier.weight(1f),
text = "나는 Secondary",
isSelected = selectedType == 2,
type = MDSSelectionType.SECONDARY,
onClick = { selectedType = 2 }
)
MDSSelection(
modifier = Modifier.weight(1f),
text = "나는 disabled",
enabled = false,
)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package com.moneymong.moneymong.design_system.component.selection

import androidx.compose.ui.graphics.Color
import com.moneymong.moneymong.design_system.theme.Blue01
import com.moneymong.moneymong.design_system.theme.Blue04
import com.moneymong.moneymong.design_system.theme.Gray03
import com.moneymong.moneymong.design_system.theme.Gray04
import com.moneymong.moneymong.design_system.theme.Gray05
import com.moneymong.moneymong.design_system.theme.White


enum class MDSSelectionType(
val backgroundColor: Color,
val contentColor: Color
) {
PRIMARY(
backgroundColor = Blue04,
contentColor = White
),
SECONDARY(
backgroundColor = Blue01,
contentColor = Blue04
)
}

internal val unSelectedBackgroundColor = White
internal val unSelectedContentColor = Gray05

internal val disabledBackgroundColor = Gray03
internal val disabledContentColor = Gray04

internal val selectionBackgroundColor: (
enabled: Boolean,
isSelected: Boolean,
type: MDSSelectionType
) -> Color = { enabled, isSelected, type ->
when {
enabled.not() -> disabledBackgroundColor
isSelected.not() -> unSelectedBackgroundColor
else -> type.backgroundColor
}
}

internal val selectionContentColor: (
enabled: Boolean,
isSelected: Boolean,
type: MDSSelectionType
) -> Color = { enabled, isSelected, type ->
when {
enabled.not() -> disabledContentColor
isSelected.not() -> unSelectedContentColor
else -> type.contentColor
}
}

internal val selectionBorderColor: (
enabled: Boolean,
isSelected: Boolean,
type: MDSSelectionType
) -> Color = { enabled, isSelected, type ->
when {
enabled.not() -> disabledBackgroundColor
isSelected.not() -> Gray03
else -> type.backgroundColor
}
}

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.moneymong.moneymong.model.sign

enum class LoginType {
KAKAO
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ package com.moneymong.moneymong.model.sign

data class TokenRequest (
val provider : String,
val accessToken : String
val accessToken : String,
val name: String,
val code: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ data class TokenResponse(
val accessToken : String,
val refreshToken : String,
val loginSuccess : Boolean,
val schoolInfoExist : Boolean
val schoolInfoExist : Boolean,
val schoolInfoProvided: Boolean
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.moneymong.moneymong.model.sign

data class UnivRequest(
val universityName: String,
val grade: Int
val universityName: String?,
val grade: Int?
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.moneymong.moneymong.model.sign

data class UnivResponse(
val universityName: String,
val universityName: String?,
val grade: Int
)
Loading

0 comments on commit 62a9e63

Please sign in to comment.