Skip to content

Commit

Permalink
Merge branch 'release/v1.0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
junhaesung committed Jan 11, 2023
2 parents e5e9e0c + 357bb18 commit 2f6ac73
Show file tree
Hide file tree
Showing 19 changed files with 95 additions and 81 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/update_version_code.yml

This file was deleted.

2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ android {
]
buildConfigField 'String', 'BASE_URL', "\"${properties.getProperty('release.three-days.base-url')}\""
buildConfigField 'String', 'KAKAO_APP_KEY', "\"${properties.getProperty('release.kakao.app-key')}\""
buildConfigField 'String', 'MIXPANEL_PROJECT_TOKEN', "\"${properties.getProperty('release.mixpanel.project-token')}\""
}
debug {
applicationIdSuffix '.debug'
Expand All @@ -53,6 +54,7 @@ android {
]
buildConfigField 'String', 'BASE_URL', "\"${properties.getProperty('debug.three-days.base-url')}\""
buildConfigField 'String', 'KAKAO_APP_KEY', "\"${properties.getProperty('debug.kakao.app-key')}\""
buildConfigField 'String', 'MIXPANEL_PROJECT_TOKEN', "\"${properties.getProperty('debug.mixpanel.project-token')}\""
}
alpha {
initWith debug
Expand Down
3 changes: 3 additions & 0 deletions app/src/debug/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">짝심삼일 (debug)</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ enum class BuildProperty(
) {
BASE_URL("api 서버 주소"),
KAKAO_APP_KEY("Kakao native app key"),
MIXPANEL_PROJECT_TOKEN("Mixpanel project token")
;

/**
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ buildscript {

ext {
threeDaysApplicationId = "com.depromeet.threedays"
threeDaysAppVersionCode = 7
threeDaysAppVersionName = "1.0.3"
threeDaysAppVersionCode = 8
threeDaysAppVersionName = "1.0.4"
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.depromeet.threedays.core.analytics

import android.content.Context
import com.depromeet.threedays.buildproperty.BuildProperty
import com.mixpanel.android.mpmetrics.MixpanelAPI
import org.json.JSONObject
import timber.log.Timber
Expand All @@ -10,10 +11,24 @@ class MixpanelAnalyticsSdk : AnalyticsSdk {
private var initialized = false

override fun init(context: Context) {
mixpanelAPI = MixpanelAPI.getInstance(context, "823f0e71338dd687bbe4d1b2f34e1272", true)
val projectToken = resolveToken(context)
mixpanelAPI = MixpanelAPI.getInstance(context, projectToken, true)
initialized = true
}

// FIXME: DI 받아서 접근하도록 변경
private fun resolveToken(context: Context): String {
return try {
context.classLoader
.loadClass("com.depromeet.threedays.BuildConfig")
.getDeclaredField(BuildProperty.MIXPANEL_PROJECT_TOKEN.name)
.get(null) as String
} catch (e: Exception) {
Timber.e(e, "Failed to resolve mixpanel project token")
throw e
}
}

override fun isInitialized(): Boolean = initialized

override fun event(name: String, properties: Map<String, Any>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ enum class Screen {
MateCompleted,
MateShare,
MateMaking,
Push
}

enum class ThreeDaysEvent {
Expand All @@ -53,4 +54,5 @@ enum class ThreeDaysEvent {
MateLevelupViewed,
MateCompletedViewed,
MateSaveClicked,
PushViewed
}
3 changes: 0 additions & 3 deletions data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ dependencies {
implementation deps.network.adapter
implementation deps.network.interceptor

implementation(roomDeps)
kapt deps.room.roomCompiler

implementation deps.timber

testImplementation(testDeps)
Expand Down
19 changes: 1 addition & 18 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ ext {
"leakcanary" : "2.9.1",
"chucker" : "3.5.2",
"google" : "20.2.0",
"room" : "2.4.3",
"emoji" : "1.0.0-alpha03",
"lottie" : "5.2.0",
"datastore" : "1.0.0",
"ossLicenses" : "17.0.0",
"facebook" : "15.2.0",
"mixpanel" : "7.+",
]
deps = [
Expand Down Expand Up @@ -107,22 +105,14 @@ ext {
"kakao" : "com.kakao.sdk:v2-user:${versions.kakao}",
"google" : "com.google.android.gms:play-services-auth:${versions.google}"
],
"room" : [
"roomCommon" : "androidx.room:room-common:${versions.room}",
"roomCompiler" : "androidx.room:room-compiler:${versions.room}",
"roomKtx" : "androidx.room:room-ktx:${versions.room}",
"roomRuntime" : "androidx.room:room-runtime:${versions.room}",
"roomRxjava2" : "androidx.room:room-rxjava2:${versions.room}"
],
"emoji" : [
"emoji2" : "androidx.emoji2:emoji2:${versions.emoji}",
"emoji2View" : "androidx.emoji2:emoji2-views:${versions.emoji}"
],
"lottie" : "com.airbnb.android:lottie:${versions.lottie}",
"splash" : "androidx.core:core-splashscreen:1.0.0",
"ossLicenses" : "com.google.android.gms:play-services-oss-licenses:${versions.ossLicenses}",
"facebook" : "com.facebook.android:facebook-share:${versions.facebook}",
"mixpanel" : "com.mixpanel.android:mixpanel-android:${versions.mixpanel}"
"mixpanel" : "com.mixpanel.android:mixpanel-android:${versions.mixpanel}",
]

coroutines = [
Expand Down Expand Up @@ -171,13 +161,6 @@ ext {
deps.login.google
]

roomDeps = [
deps.room.roomCommon,
deps.room.roomKtx,
deps.room.roomRuntime,
deps.room.roomRxjava2
]

emojiDeps = [
deps.emoji.emoji2,
deps.emoji.emoji2View
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,21 @@ import com.depromeet.threedays.domain.key.RESULT_CREATE
import com.depromeet.threedays.domain.key.RESULT_UPDATE
import com.depromeet.threedays.home.MainActivity
import com.depromeet.threedays.home.R
import com.depromeet.threedays.core_design_system.R as core_design
import com.depromeet.threedays.home.databinding.FragmentHomeBinding
import com.depromeet.threedays.home.home.dialog.MoreActionModal
import com.depromeet.threedays.home.home.dialog.NotiGuideBottomSheet
import com.depromeet.threedays.home.home.dialog.NotiRecommendBottomSheet
import com.depromeet.threedays.mate.MateFragment
import com.depromeet.threedays.navigator.*
import com.depromeet.threedays.navigator.ArchivedHabitNavigator
import com.depromeet.threedays.navigator.HabitCreateNavigator
import com.depromeet.threedays.navigator.HabitUpdateNavigator
import com.depromeet.threedays.navigator.NotificationNavigator
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch
import java.time.ZoneId
import java.time.ZonedDateTime
import javax.inject.Inject
import com.depromeet.threedays.core_design_system.R as core_design

@AndroidEntryPoint
class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(R.layout.fragment_home) {
Expand Down Expand Up @@ -80,9 +83,9 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(R.layout.f
private fun onCreateHabitClick() {
if(viewModel.habits.value.isEmpty()) {
AnalyticsUtil.event(
name = ThreeDaysEvent.NewMateClicked.toString(),
name = ThreeDaysEvent.NewHabitClicked.toString(),
properties = mapOf(
MixPanelEvent.ScreenName to Screen.HomeDefault,
MixPanelEvent.ScreenName to Screen.HomeDefault.toString(),
MixPanelEvent.ButtonType to ButtonType.NewHabit.toString()
)
)
Expand Down Expand Up @@ -248,15 +251,14 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(R.layout.f
viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) {
launch {
viewModel.habits.collect { list ->
if(list.isNotEmpty()) {
if (list.isEmpty()) {
AnalyticsUtil.event(
name = ThreeDaysEvent.HomeDefaultViewed.toString(),
properties = mapOf(
MixPanelEvent.ScreenName to Screen.HomeDefault.toString()
)
)
}
else {
} else {
AnalyticsUtil.event(
name = ThreeDaysEvent.HomeActivatedViewed.toString(),
properties = mapOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ import com.depromeet.threedays.home.home.model.HabitUI
import com.depromeet.threedays.home.home.model.toHabitUI
import com.depromeet.threedays.mate.MateImageResourceResolver.Companion.levelToResourceFunction
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.launch
import java.time.LocalDate
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import com.depromeet.threedays.core.analytics.*
import com.depromeet.threedays.core.util.setOnSingleClickListener
import com.depromeet.threedays.home.R
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
Expand All @@ -17,6 +18,13 @@ class NotiRecommendBottomSheet(
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
AnalyticsUtil.event(
name = ThreeDaysEvent.PushViewed.toString(),
properties = mapOf(
MixPanelEvent.ScreenName to Screen.Push.toString()
)
)

super.onCreateView(inflater, container, savedInstanceState)
return inflater.inflate(R.layout.bottom_sheet_noti_recommend, container, false)
}
Expand All @@ -26,6 +34,13 @@ class NotiRecommendBottomSheet(

val btnConfirm = view.findViewById<Button>(R.id.btn_confirm)
btnConfirm.setOnSingleClickListener {
AnalyticsUtil.event(
name = ThreeDaysEvent.ButtonClicked.toString(),
properties = mapOf(
MixPanelEvent.ScreenName to Screen.Push.toString(),
MixPanelEvent.ButtonType to ButtonType.Next.toString()
)
)
dismiss()
onConfirmClick()
}
Expand Down
2 changes: 0 additions & 2 deletions presentation/mate/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,4 @@ dependencies {

testImplementation(testDeps)
androidTestImplementation(androidTestDeps)

implementation deps.facebook
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ class MateFragment: BaseFragment<FragmentMateBinding, MateViewModel>(R.layout.fr
AnalyticsUtil.event(
name = ThreeDaysEvent.MateDefaultViewed.toString(),
properties = mapOf(
MixPanelEvent.ScreenName to Screen.MateDefault,
MixPanelEvent.ButtonType to ButtonType.NewMate,
MixPanelEvent.ScreenName to Screen.MateDefault.toString(),
MixPanelEvent.ButtonType to ButtonType.NewMate.toString(),
)
)

Expand All @@ -99,8 +99,8 @@ class MateFragment: BaseFragment<FragmentMateBinding, MateViewModel>(R.layout.fr
AnalyticsUtil.event(
name = ThreeDaysEvent.MateShareClicked.toString(),
properties = mapOf(
MixPanelEvent.ScreenName to Screen.MateHome,
MixPanelEvent.ButtonType to ButtonType.Share,
MixPanelEvent.ScreenName to Screen.MateHome.toString(),
MixPanelEvent.ButtonType to ButtonType.Share.toString(),
)
)

Expand Down Expand Up @@ -139,8 +139,8 @@ class MateFragment: BaseFragment<FragmentMateBinding, MateViewModel>(R.layout.fr
AnalyticsUtil.event(
name = ThreeDaysEvent.MateSaveClicked.toString(),
properties = mapOf(
MixPanelEvent.ScreenName to Screen.MateCompleted,
MixPanelEvent.ButtonType to ButtonType.MateSave,
MixPanelEvent.ScreenName to Screen.MateCompleted.toString(),
MixPanelEvent.ButtonType to ButtonType.MateSave.toString(),
)
)

Expand Down Expand Up @@ -175,8 +175,8 @@ class MateFragment: BaseFragment<FragmentMateBinding, MateViewModel>(R.layout.fr
AnalyticsUtil.event(
name = ThreeDaysEvent.MateClapOpenClicked.toString(),
properties = mapOf(
MixPanelEvent.ScreenName to Screen.MateDefault,
MixPanelEvent.ButtonType to ButtonType.MateClapOpen,
MixPanelEvent.ScreenName to Screen.MateDefault.toString(),
MixPanelEvent.ButtonType to ButtonType.MateClapOpen.toString(),
)
)
binding.ivArrow.setImageResource(core_design.drawable.ic_arrow_down)
Expand Down Expand Up @@ -264,7 +264,7 @@ class MateFragment: BaseFragment<FragmentMateBinding, MateViewModel>(R.layout.fr
AnalyticsUtil.event(
name = ThreeDaysEvent.MateCompletedViewed.toString(),
properties = mapOf(
MixPanelEvent.ScreenName to Screen.MateCompleted,
MixPanelEvent.ScreenName to Screen.MateCompleted.toString(),
)
)

Expand Down Expand Up @@ -315,7 +315,7 @@ class MateFragment: BaseFragment<FragmentMateBinding, MateViewModel>(R.layout.fr
AnalyticsUtil.event(
name = ThreeDaysEvent.MateLevelupViewed.toString(),
properties = mapOf(
MixPanelEvent.ScreenName to Screen.MateLevelup,
MixPanelEvent.ScreenName to Screen.MateLevelup.toString(),
)
)

Expand All @@ -332,14 +332,14 @@ class MateFragment: BaseFragment<FragmentMateBinding, MateViewModel>(R.layout.fr
AnalyticsUtil.event(
name = ThreeDaysEvent.MateHomeViewed.toString(),
properties = mapOf(
MixPanelEvent.ScreenName to Screen.MateHome,
MixPanelEvent.ScreenName to Screen.MateHome.toString(),
)
)
} else {
AnalyticsUtil.event(
name = ThreeDaysEvent.MateDefaultViewed.toString(),
properties = mapOf(
MixPanelEvent.ScreenName to Screen.MateDefault,
MixPanelEvent.ScreenName to Screen.MateDefault.toString(),
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.depromeet.threedays.core.BaseActivity
import com.depromeet.threedays.core.analytics.*
import com.depromeet.threedays.core.util.setOnSingleClickListener
import com.depromeet.threedays.core.util.dpToPx
import com.depromeet.threedays.core.util.setOnSingleClickListener
import com.depromeet.threedays.mate.R
import com.depromeet.threedays.mate.create.step2.ChooseMateTypeActivity
import com.depromeet.threedays.mate.databinding.ActivityConnectHabitBinding
Expand Down Expand Up @@ -70,7 +70,7 @@ class ConnectHabitActivity : BaseActivity<ActivityConnectHabitBinding>(R.layout.
name = ThreeDaysEvent.ButtonClicked.toString(),
properties = mapOf(
MixPanelEvent.ScreenName to "${Screen.MateMaking}1",
MixPanelEvent.ButtonType to ButtonType.Next,
MixPanelEvent.ButtonType to ButtonType.Next.toString(),
)
)

Expand Down
Loading

0 comments on commit 2f6ac73

Please sign in to comment.