-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # build.gradle
- Loading branch information
Showing
88 changed files
with
1,174 additions
and
164 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 |
---|---|---|
|
@@ -12,17 +12,13 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 11 | ||
cache: gradle | ||
- run: sed -i "s/threeDaysAppVersionCode = [0-9]*/threeDaysAppVersionCode = $((`sed -n 's/threeDaysAppVersionCode = \([0-9]*\)/\1/p' build.gradle` + 1))/" build.gradle | ||
- run: "git config --global user.email \"[email protected]\"" | ||
- run: "git config --global user.name \"depromeet-12th-team8\"" | ||
- run: git add build.gradle | ||
- run: "git commit -m \"docs: Increment version code\"" | ||
- run: git push origin HEAD | ||
- run: echo $DEBUG_KEYSTORE_FILE | base64 -d > debug.keystore | ||
env: | ||
DEBUG_KEYSTORE_FILE: ${{ secrets.DEBUG_KEYSTORE_FILE }} | ||
|
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,22 @@ | ||
name: 'Update version code' | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [opened, ready_for_review] | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
update_version_code: | ||
name: Update version code | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- run: sed -i "s/threeDaysAppVersionCode = [0-9]*/threeDaysAppVersionCode = $((`sed -n 's/threeDaysAppVersionCode = \([0-9]*\)/\1/p' build.gradle` + 1))/" build.gradle | ||
- run: git config --local user.email `git log -1 --format='%ae'` | ||
- run: git config --local user.name `git log -1 --format='%an'` | ||
- run: git add build.gradle | ||
- run: "git commit -m \"docs: Increment version code\"" | ||
- run: git push origin HEAD |
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
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
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
22 changes: 22 additions & 0 deletions
22
app/src/main/java/com/depromeet/threedays/firebase/FirebaseTokenDataSource.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,22 @@ | ||
package com.depromeet.threedays.firebase | ||
|
||
import com.depromeet.threedays.data.datasource.notification.token.NotificationTokenLocalDataSource | ||
import com.google.firebase.messaging.FirebaseMessaging | ||
import kotlinx.coroutines.runBlocking | ||
import kotlinx.coroutines.tasks.await | ||
import timber.log.Timber | ||
import javax.inject.Inject | ||
|
||
class FirebaseTokenDataSource @Inject constructor() : NotificationTokenLocalDataSource { | ||
override suspend fun getToken(): String? { | ||
val registrationToken = runBlocking { | ||
FirebaseMessaging.getInstance().token | ||
.addOnCompleteListener { | ||
if (!it.isSuccessful) { | ||
Timber.e("Failed to get registration token") | ||
} | ||
}.await() | ||
} | ||
return registrationToken | ||
} | ||
} |
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
12 changes: 12 additions & 0 deletions
12
core-design-system/src/main/res/drawable/ic_star_check.xml
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,12 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="54dp" | ||
android:height="54dp" | ||
android:viewportWidth="54" | ||
android:viewportHeight="54"> | ||
<path | ||
android:pathData="M34.816,1.588L38.528,14.623L51.972,16.352L44.095,27.382L51.125,38.97L37.59,39.689L32.914,52.41L23.913,42.277L11.051,46.552L13.362,33.197L2,25.807L13.883,19.287L12.576,5.796L25.083,11.021L34.816,1.588Z" | ||
android:fillColor="#34C185"/> | ||
<path | ||
android:pathData="M25.759,32.838C25.408,32.838 25.056,32.721 24.822,32.37L19.438,26.986C18.853,26.4 18.853,25.581 19.438,24.996C20.023,24.41 20.843,24.41 21.428,24.996L25.759,29.326L33.484,21.601C34.07,21.016 34.889,21.016 35.474,21.601C36.06,22.186 36.06,23.006 35.474,23.591L26.812,32.253C26.461,32.721 26.11,32.838 25.759,32.838Z" | ||
android:fillColor="#ffffff"/> | ||
</vector> |
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
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
9 changes: 9 additions & 0 deletions
9
core/src/main/java/com/depromeet/threedays/core/analytics/AnalyticsSdk.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,9 @@ | ||
package com.depromeet.threedays.core.analytics | ||
|
||
import android.content.Context | ||
|
||
interface AnalyticsSdk { | ||
fun init(context: Context) | ||
fun isInitialized(): Boolean | ||
fun event(name:String, properties: Map<String, Any>) | ||
} |
23 changes: 23 additions & 0 deletions
23
core/src/main/java/com/depromeet/threedays/core/analytics/AnalyticsUtil.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.depromeet.threedays.core.analytics | ||
|
||
import android.content.Context | ||
|
||
object AnalyticsUtil : AnalyticsSdk { | ||
private const val MIXPANEL = "mixpanel" | ||
|
||
private val analyticsSdkList: Map<String, AnalyticsSdk> = | ||
mapOf( | ||
MIXPANEL to MixpanelAnalyticsSdk() | ||
) | ||
|
||
override fun init(context: Context) { | ||
analyticsSdkList.forEach { it.value.init(context) } | ||
} | ||
|
||
override fun isInitialized(): Boolean = analyticsSdkList.all { it.value.isInitialized() } | ||
|
||
|
||
override fun event(name: String, properties: Map<String, Any>) { | ||
analyticsSdkList.forEach { it.value.event(name = name, properties = properties) } | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
core/src/main/java/com/depromeet/threedays/core/analytics/MixPanelEvent.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,31 @@ | ||
package com.depromeet.threedays.core.analytics | ||
|
||
import android.content.Context | ||
|
||
data class MixPanelEvent ( | ||
val eventName: String, | ||
val properties: Map<String, String> | ||
) { | ||
companion object { | ||
const val ScreenName: String = "ScreenName" | ||
const val ButtonType: String = "ButtonType" | ||
} | ||
} | ||
|
||
fun getViewedEventName(context: Context): String { | ||
return getScreenName(context) + viewSuffix | ||
} | ||
|
||
fun getScreenName(context: Context): String { | ||
val className = context.javaClass.simpleName | ||
val suffixLength = | ||
if(className.contains("Fragment")) fragmentLength | ||
else if(className.contains("Activity")) activityLength | ||
else 0 | ||
|
||
return className.substring(0, className.length - suffixLength) | ||
} | ||
|
||
const val viewSuffix = "Viewed" | ||
const val activityLength = "Activity".length | ||
const val fragmentLength = "Fragment".length |
23 changes: 23 additions & 0 deletions
23
core/src/main/java/com/depromeet/threedays/core/analytics/MixpanelAnalyticsSdk.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.depromeet.threedays.core.analytics | ||
|
||
import android.content.Context | ||
import com.mixpanel.android.mpmetrics.MixpanelAPI | ||
import org.json.JSONObject | ||
import timber.log.Timber | ||
|
||
class MixpanelAnalyticsSdk : AnalyticsSdk { | ||
private lateinit var mixpanelAPI: MixpanelAPI | ||
private var initialized = false | ||
|
||
override fun init(context: Context) { | ||
mixpanelAPI = MixpanelAPI.getInstance(context, "823f0e71338dd687bbe4d1b2f34e1272", true) | ||
initialized = true | ||
} | ||
|
||
override fun isInitialized(): Boolean = initialized | ||
|
||
override fun event(name: String, properties: Map<String, Any>) { | ||
Timber.i("eventName : $name , properties : ${JSONObject(properties)}") | ||
mixpanelAPI.track(name, JSONObject(properties)) | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
core/src/main/java/com/depromeet/threedays/core/analytics/ThreeDaysEvent.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,56 @@ | ||
package com.depromeet.threedays.core.analytics | ||
|
||
enum class ButtonType{ | ||
Next, | ||
Save, | ||
NewHabit, | ||
Check, | ||
NewMate, | ||
Share, | ||
SaveImg, | ||
Insta, | ||
Close, | ||
MateClapOpen, | ||
Carrot, | ||
Sparta, | ||
MateSave, | ||
} | ||
|
||
enum class Screen { | ||
CreateHabit, | ||
HomeDefault, | ||
HomeActivated, | ||
MateDefault, | ||
MateHome, | ||
MateClap, | ||
MateLevelup, | ||
MateCompleted, | ||
MateShare, | ||
MateMaking, | ||
} | ||
|
||
enum class ThreeDaysEvent { | ||
SplashViewed, | ||
OnboardingViewed, | ||
SignupViewed, | ||
ButtonClicked, | ||
SignupCompletedViewed, | ||
HomeDefaultViewed, | ||
HomeHabitClicked, | ||
HomeActivatedViewed, | ||
CheckClicked, | ||
MateOnboardingViewed, | ||
MateDefaultViewed, | ||
NewMateClicked, | ||
MateHomeViewed, | ||
MateShareClicked, | ||
MateClapOpenClicked, | ||
MateClapViewed, | ||
NewHabitClicked, | ||
SharedPathClicked, | ||
MateMakingViewed, | ||
MateSelected, | ||
MateLevelupViewed, | ||
MateCompletedViewed, | ||
MateSaveClicked, | ||
} |
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
Oops, something went wrong.