Skip to content

Commit 2b27a09

Browse files
authored
Merge pull request #689 from Daily-DAYO/release/2.0.0
Release v2.0.0
2 parents 4f7a874 + 3b013b2 commit 2b27a09

449 files changed

Lines changed: 27045 additions & 21446 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ build/
3030

3131
# Local configuration file (sdk path, etc)
3232
local.properties
33+
*.properties
3334

3435
# Proguard folder generated by Eclipse
3536
proguard/
@@ -54,7 +55,7 @@ captures/
5455
*.keystore
5556

5657
# Google Services (e.g. APIs or Firebase)
57-
# google-services.json
58+
google-services.json
5859

5960
# Android Patch
6061
gen-external-apklibs
@@ -71,30 +72,7 @@ obj/
7172
/out/
7273

7374
# User-specific configurations
74-
.idea/caches/
75-
.idea/libraries/
76-
.idea/shelf/
77-
.idea/workspace.xml
78-
.idea/tasks.xml
79-
.idea/.name
80-
.idea/compiler.xml
81-
.idea/copyright/profiles_settings.xml
82-
.idea/encodings.xml
83-
.idea/misc.xml
84-
.idea/modules.xml
85-
.idea/scopes/scope_settings.xml
86-
.idea/dictionaries
87-
.idea/vcs.xml
88-
.idea/jsLibraryMappings.xml
89-
.idea/datasources.xml
90-
.idea/dataSources.ids
91-
.idea/sqlDataSources.xml
92-
.idea/dynamic.xml
93-
.idea/uiDesigner.xml
94-
.idea/assetWizardSettings.xml
95-
.idea/gradle.xml
96-
.idea/jarRepositories.xml
97-
.idea/navEditor.xml
75+
.idea/
9876

9977
# OS-specific files
10078
.DS_Store

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ git clone git@github.com:Daily-DAYO/DAYO_Android.git
2727

2828
## Application Version
2929
- minSdkVersion : 26<br>
30-
- targetSdkVersion : 33
30+
- targetSdkVersion : 35
3131

3232
## Git Convention
3333
- Create issue<br>

app/build.gradle

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ plugins {
1111
Properties properties = new Properties()
1212
properties.load(project.rootProject.file('local.properties').newDataInputStream())
1313
def NATIVE_APP_KEY = properties.getProperty('NATIVE_APP_KEY')
14+
def ADS_APPLICATION_ID = properties.getProperty('ADS_APPLICATION_ID')
1415
def keystorePropertiesFile = rootProject.file("app/keystore-release.properties")
1516

1617
sentry {
@@ -26,18 +27,22 @@ kotlin {
2627
}
2728

2829
android {
30+
compileSdk rootProject.ext.compileSdkVersion
31+
2932
defaultConfig {
3033
applicationId "com.daily.dayo"
31-
compileSdk 34
32-
minSdkVersion 26
33-
targetSdkVersion 34
34-
versionCode 11500
35-
versionName "1.1.5"
34+
minSdkVersion rootProject.ext.minSdkVersion
35+
targetSdkVersion rootProject.ext.targetSdkVersion
36+
versionCode 20000
37+
versionName "2.0.0"
3638

3739
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3840

3941
buildConfigField ("String", "NATIVE_APP_KEY", properties['NATIVE_APP_KEY_STR'])
40-
manifestPlaceholders = [NATIVE_APP_KEY: NATIVE_APP_KEY]
42+
manifestPlaceholders = [
43+
NATIVE_APP_KEY : NATIVE_APP_KEY,
44+
ADS_APPLICATION_ID: ADS_APPLICATION_ID
45+
]
4146
}
4247

4348
signingConfigs {
@@ -59,6 +64,7 @@ android {
5964

6065
buildTypes {
6166
debug {
67+
minifyEnabled false
6268
applicationIdSuffix ".debug"
6369
versionNameSuffix "-debug"
6470
resValue "string", "app_name", "DAYO (Debug)"
@@ -70,6 +76,17 @@ android {
7076
signingConfig signingConfigs.release
7177
}
7278
}
79+
flavorDimensions = ["environment"]
80+
productFlavors {
81+
dev {
82+
dimension "environment"
83+
buildConfigField("String", "BASE_URL", properties['BASE_URL_DEV'])
84+
}
85+
prod {
86+
dimension "environment"
87+
buildConfigField("String", "BASE_URL", properties['BASE_URL_PROD'])
88+
}
89+
}
7390
kotlinOptions {
7491
jvmTarget = JavaVersion.VERSION_17.toString()
7592
}
@@ -102,4 +119,7 @@ dependencies {
102119
// Firebase
103120
implementation 'com.google.firebase:firebase-crashlytics-ktx'
104121
implementation 'com.google.firebase:firebase-analytics-ktx'
122+
123+
// Google Ads
124+
implementation 'com.google.android.gms:play-services-ads:23.6.0'
105125
}

app/src/main/AndroidManifest.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
<meta-data
3131
android:name="com.google.firebase.messaging.default_notification_icon"
3232
android:resource="@drawable/ic_dayo_logo" />
33+
34+
<meta-data
35+
android:name="com.google.android.gms.ads.APPLICATION_ID"
36+
android:value="${ADS_APPLICATION_ID}" />
37+
3338
<provider
3439
android:name="androidx.core.content.FileProvider"
3540
android:authorities="${applicationId}.fileprovider"
@@ -43,6 +48,7 @@
4348
<activity android:name="daily.dayo.presentation.activity.LoginActivity"
4449
android:theme="@style/Theme.DAYO.Splash"
4550
android:screenOrientation="portrait"
51+
android:windowSoftInputMode="adjustResize"
4652
android:exported="true">
4753
<intent-filter>
4854
<action android:name="android.intent.action.MAIN" />
@@ -64,7 +70,7 @@
6470
</activity>
6571
<activity android:name="daily.dayo.presentation.activity.MainActivity"
6672
android:screenOrientation="portrait"
67-
android:windowSoftInputMode="adjustNothing" />
73+
android:windowSoftInputMode="adjustResize" />
6874
<service
6975
android:name="daily.dayo.presentation.service.firebase.FirebaseMessagingService"
7076
android:exported="false">

app/src/main/java/com/daily/dayo/DayoApplication.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@ package com.daily.dayo
22

33
import android.app.Application
44
import com.bumptech.glide.Glide
5+
import com.google.android.gms.ads.MobileAds
56
import com.google.firebase.analytics.FirebaseAnalytics
67
import com.google.firebase.analytics.ktx.analytics
78
import com.google.firebase.ktx.Firebase
89
import com.kakao.sdk.common.KakaoSdk
910
import dagger.hilt.android.HiltAndroidApp
1011

1112
@HiltAndroidApp
12-
class DayoApplication : Application(){
13+
class DayoApplication : Application() {
1314
private lateinit var firebaseAnalytics: FirebaseAnalytics
1415
override fun onCreate() {
1516
super.onCreate()
1617
KakaoSdk.init(this, BuildConfig.NATIVE_APP_KEY)
18+
MobileAds.initialize(this)
1719
firebaseAnalytics = Firebase.analytics
1820
}
1921

build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ buildscript {
66
compose_version = '1.4.6'
77
nav_version = '2.6.0'
88
paging_version = "3.2.0"
9+
targetSdkVersion = 35
10+
compileSdkVersion = 35
11+
minSdkVersion = 26
912
}
1013
repositories {
1114
google()

data/build.gradle

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ properties.load(project.rootProject.file('local.properties').newDataInputStream(
1414

1515
android {
1616
namespace 'daily.dayo.data'
17-
compileSdk 33
17+
compileSdk rootProject.ext.compileSdkVersion
1818

1919
defaultConfig {
20-
minSdk 26
20+
minSdk rootProject.ext.minSdkVersion
2121

2222
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2323
consumerProguardFiles "consumer-rules.pro"
@@ -32,11 +32,17 @@ android {
3232
release {
3333
minifyEnabled false
3434
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
35-
buildConfigField("String", "BASE_URL", properties['BASE_URL_RELEASE'])
3635
}
37-
38-
debug {
39-
buildConfigField("String", "BASE_URL", properties['BASE_URL_DEBUG'])
36+
}
37+
flavorDimensions = ["environment"]
38+
productFlavors {
39+
dev {
40+
dimension "environment"
41+
buildConfigField("String", "BASE_URL", properties['BASE_URL_DEV'])
42+
}
43+
prod {
44+
dimension "environment"
45+
buildConfigField("String", "BASE_URL", properties['BASE_URL_PROD'])
4046
}
4147
}
4248
compileOptions {

data/src/main/java/daily/dayo/data/datasource/local/SharedManager.kt

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ package daily.dayo.data.datasource.local
22

33
import android.content.Context
44
import android.content.SharedPreferences
5+
import com.google.gson.Gson
56
import daily.dayo.data.util.PreferenceHelper
67
import daily.dayo.data.util.PreferenceHelper.get
78
import daily.dayo.data.util.PreferenceHelper.set
89
import com.google.gson.JsonArray
910
import dagger.hilt.android.qualifiers.ApplicationContext
11+
import daily.dayo.domain.model.SearchHistory
12+
import daily.dayo.domain.model.SearchHistoryDetail
1013
import daily.dayo.domain.model.User
1114
import daily.dayo.domain.model.UserTokens
1215
import org.json.JSONArray
@@ -16,6 +19,7 @@ import javax.inject.Singleton
1619
@Singleton
1720
class SharedManager @Inject constructor(@ApplicationContext context: Context) {
1821
private val prefs: SharedPreferences = PreferenceHelper.defaultPrefs(context)
22+
private val KEY_SEARCH_HISTORY = "search_history"
1923

2024
fun saveCurrentUser(userInfo: Any?) = when (userInfo) {
2125
is UserTokens -> {
@@ -58,31 +62,47 @@ class SharedManager @Inject constructor(@ApplicationContext context: Context) {
5862
prefs["notiNoticePermit"] = value
5963
}
6064

61-
fun setSearchKeywordRecent(searchKeywordRecent: ArrayList<String>) {
62-
val jsonArr = JsonArray()
63-
for (i in searchKeywordRecent) {
64-
jsonArr.add(i)
65-
}
65+
fun saveSearchHistory(searchHistory: SearchHistory) {
66+
val gson = Gson()
67+
val json = gson.toJson(searchHistory)
68+
val editor = prefs.edit()
69+
editor.putString(KEY_SEARCH_HISTORY, json)
70+
editor.apply()
71+
}
6672

67-
var result = jsonArr.toString()
68-
prefs["recentSearchKeyword"] = result
73+
fun getSearchKeywordRecent(): SearchHistory {
74+
val json = prefs.getString(KEY_SEARCH_HISTORY, null)
75+
val gson = Gson()
76+
return gson.fromJson(json, SearchHistory::class.java) ?: SearchHistory(0, mutableListOf())
6977
}
7078

71-
fun getSearchKeywordRecent(): ArrayList<String> {
72-
val result = prefs["recentSearchKeyword", ""]
73-
val resultArr = ArrayList<String>()
74-
val jsonArr: JSONArray = if (result.isEmpty()) {
75-
JSONArray()
76-
} else {
77-
JSONArray(result)
79+
fun updateSearchHistory(newItem: SearchHistoryDetail) {
80+
var searchHistory = getSearchKeywordRecent()
81+
// History에 Type 구분을 하지 않음에 따라 OR문으로 처리
82+
val existingItem = searchHistory.data.find {
83+
it.history == newItem.history || it.searchHistoryType == newItem.searchHistoryType
7884
}
7985

80-
if (jsonArr.length() != 0) {
81-
for (i in 0 until jsonArr.length()) {
82-
resultArr.add(jsonArr.optString(i))
83-
}
86+
if (existingItem != null) {
87+
searchHistory = searchHistory.copy(
88+
count = searchHistory.count - 1,
89+
data = searchHistory.data.filter {
90+
it.history != existingItem.history || it.searchHistoryType != existingItem.searchHistoryType
91+
}.toMutableList()
92+
)
8493
}
85-
return resultArr
94+
95+
searchHistory = searchHistory.copy(
96+
count = searchHistory.count + 1,
97+
data = listOf(newItem) + searchHistory.data
98+
)
99+
saveSearchHistory(searchHistory)
100+
}
101+
102+
fun clearSearchHistory() {
103+
val editor = prefs.edit()
104+
editor.remove(KEY_SEARCH_HISTORY)
105+
editor.apply()
86106
}
87107

88108
fun clearPreferences() {

data/src/main/java/daily/dayo/data/datasource/remote/alarm/AlarmApiService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ interface AlarmApiService {
1212
suspend fun requestAllAlarmList(@Query("end") end: Int): NetworkResponse<ListAllAlarmResponse>
1313

1414
@POST("/api/v1/alarms/{alarmId}")
15-
suspend fun requestIsCheckAlarm(@Path("alarmId") alarmId: Int): NetworkResponse<Void>
15+
suspend fun markAlarmAsChecked(@Path("alarmId") alarmId: Int): NetworkResponse<Void>
1616
}

data/src/main/java/daily/dayo/data/datasource/remote/alarm/AlarmResponse.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,7 @@ data class AlarmDto(
3030
@SerializedName("memberId")
3131
val memberId: String?,
3232
@SerializedName("postId")
33-
val postId: Int?
33+
val postId: Long?,
34+
@SerializedName("profileImage")
35+
val profileImage: String?,
3436
)

0 commit comments

Comments
 (0)