Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature/#978] 홈 화면 개편(1) - 출석 및 바로가기 탭 구현 #1031

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
23 changes: 15 additions & 8 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -120,29 +120,36 @@ ksp {

dependencies {
implementation(projects.core.designsystem)
implementation(projects.core.common)
implementation(projects.core.analytics)
implementation(projects.core.network)
implementation(projects.core.auth)
implementation(projects.core.authimpl)
implementation(projects.core.security)
implementation(projects.core.webview)

implementation(projects.domain.soptamp)
implementation(projects.domain.mypage)
implementation(projects.domain.poke)
implementation(projects.domain.fortune)
implementation(projects.domain.notification)
implementation(projects.feature.soptamp)
implementation(projects.domain.home)

implementation(projects.data.fortune)
implementation(projects.data.soptamp)
implementation(projects.data.mypage)
implementation(projects.data.poke)
implementation(projects.data.notification)
implementation(projects.core.common)
implementation(projects.core.analytics)
implementation(projects.core.network)
implementation(projects.core.auth)
implementation(projects.core.authimpl)
implementation(projects.core.security)
implementation(projects.core.webview)
implementation(projects.data.home)

implementation(projects.feature.soptamp)
implementation(projects.feature.auth)
implementation(projects.feature.mypage)
implementation(projects.feature.poke)
implementation(projects.feature.notification)
implementation(projects.feature.fortune)
implementation(projects.feature.home)

baselineProfile(projects.baselineprofile)

implementation(libs.kotlin.coroutines.google.play)
Expand Down
9 changes: 6 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,13 @@
android:exported="false"
android:launchMode="singleTop" />
<activity
android:name=".feature.mypage.signout.SignOutActivity"
android:name=".feature.home.FakeActivity"
android:exported="true" />
<activity
android:name=".feature.mypage.signOut.SignOutActivity"
android:exported="false" />
<activity
android:name=".feature.mypage.soptamp.ui.AdjustSentenceActivity"
android:name=".feature.mypage.soptamp.sentence.AdjustSentenceActivity"
android:exported="false" />
<activity
android:name=".feature.poke.onboarding.OnboardingActivity"
Expand Down Expand Up @@ -154,4 +157,4 @@
</intent-filter>
</service>
</application>
</manifest>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ fun AlphaColor(color: Int, alphaPercentage: Int = 100): Color {
return Color((color and 0x00FFFFFF) or (alpha shl 24))
}

// Black Scale
val Black40 =Color(0xFF3C3D40)

// Gray Scale
val White = Color(0xFFFFFFFF)
val Black = Color(0xFF000000)
Expand Down
1 change: 1 addition & 0 deletions data/home/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
15 changes: 15 additions & 0 deletions data/home/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
plugins {
sopt("feature")
}

android {
namespace = "org.sopt.official.data.home"
}

dependencies {
implementation(projects.domain.home)
implementation(projects.core.network)
implementation(projects.core.common)
implementation(platform(libs.okhttp.bom))
implementation(libs.bundles.okhttp)
}
Empty file added data/home/consumer-rules.pro
Empty file.
21 changes: 21 additions & 0 deletions data/home/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
4 changes: 4 additions & 0 deletions data/home/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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* MIT License
* Copyright 2023-2024 SOPT - Shout Our Passion Together
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.sopt.official.data.home.di

import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import org.sopt.official.common.di.AppRetrofit
import org.sopt.official.data.home.remote.api.CalendarApi
import org.sopt.official.data.home.remote.api.UserApi
import retrofit2.Retrofit
import retrofit2.create
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
internal object ApiModule {

@Provides
@Singleton
internal fun provideHomeApi(@AppRetrofit(true) retrofit: Retrofit): UserApi = retrofit.create()

@Provides
@Singleton
internal fun provideCalendarApi(@AppRetrofit(true) retrofit: Retrofit): CalendarApi = retrofit.create()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* MIT License
* Copyright 2023-2024 SOPT - Shout Our Passion Together
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.sopt.official.data.home.di

import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import org.sopt.official.data.home.repository.DefaultHomeRepository
import org.sopt.official.domain.home.repository.HomeRepository
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
internal interface RepositoryModule {

@Binds
@Singleton
fun bindDefaultHomeRepository(defaultHomeRepository: DefaultHomeRepository): HomeRepository
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* MIT License
* Copyright 2024 SOPT - Shout Our Passion Together
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.sopt.official.data.home.mapper

import org.sopt.official.data.home.remote.response.HomeDescriptionResponseDto
import org.sopt.official.data.home.remote.response.RecentCalendarResponseDto
import org.sopt.official.data.home.remote.response.UserMainResponseDto
import org.sopt.official.domain.home.model.RecentCalendar
import org.sopt.official.domain.home.model.UserInfo
import org.sopt.official.domain.home.model.UserInfo.User
import org.sopt.official.domain.home.model.UserInfo.UserDescription

internal fun UserMainResponseDto.toDomain(): UserInfo = UserInfo(
user = user.toDomain(),
isAllConfirm = isAllConfirm,
)

internal fun UserMainResponseDto.UserResponseDto.toDomain(): User = User(
status = status,
name = name.orEmpty(),
profileImage = profileImage.orEmpty(),
generationList = generationList ?: emptyList()
)

internal fun RecentCalendarResponseDto.toDomain(): RecentCalendar = RecentCalendar(
date = date,
type = type,
title = title,
)

internal fun HomeDescriptionResponseDto.toDomain(): UserDescription = UserDescription(
activityDescription = activityDescription,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* MIT License
* Copyright 2024 SOPT - Shout Our Passion Together
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.sopt.official.data.home.remote.api

import org.sopt.official.data.home.remote.response.RecentCalendarResponseDto
import retrofit2.http.GET

internal interface CalendarApi {

@GET("calendar/recent")
suspend fun getRecentCalendar(): RecentCalendarResponseDto
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* MIT License
* Copyright 2024 SOPT - Shout Our Passion Together
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.sopt.official.data.home.remote.api

import org.sopt.official.data.home.remote.response.HomeDescriptionResponseDto
import org.sopt.official.data.home.remote.response.UserMainResponseDto
import retrofit2.http.GET

internal interface UserApi {

@GET("user/main")
suspend fun getUserMain(): UserMainResponseDto

@GET("home/description")
suspend fun getHomeDescription(): HomeDescriptionResponseDto
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* MIT License
* Copyright 2024 SOPT - Shout Our Passion Together
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.sopt.official.data.home.remote.response

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
internal data class HomeDescriptionResponseDto(
@SerialName("activityDescription")
val activityDescription: String,
)
Loading
Loading