-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into feature/#25-mypage-ui
# Conflicts: # presentation/src/main/res/values/strings.xml
- Loading branch information
Showing
50 changed files
with
1,579 additions
and
474 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.sopt.noostak.di | ||
|
||
import com.sopt.noostak.BuildConfig | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Named | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
object GoogleIdModule { | ||
@Provides | ||
@Singleton | ||
@Named("GoogleClientId") | ||
fun provideGoogleClientId(): String { | ||
return BuildConfig.GOOGLE_CLIENT_ID | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
app/src/main/java/com/sopt/noostak/di/PreferencesDataStore.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,25 @@ | ||
package com.sopt.noostak.di | ||
|
||
import android.content.Context | ||
import androidx.datastore.core.DataStore | ||
import androidx.datastore.preferences.core.Preferences | ||
import androidx.datastore.preferences.preferencesDataStore | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.android.qualifiers.ApplicationContext | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
object PreferencesDataStore { | ||
private val Context.dataStore by preferencesDataStore(name = "noostak_data_store") | ||
|
||
@Singleton | ||
@Provides | ||
fun provideDataStore( | ||
@ApplicationContext context: Context | ||
): DataStore<Preferences> = | ||
context.dataStore | ||
} |
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,27 @@ | ||
package com.sopt.noostak.di | ||
|
||
import com.sopt.data.datasource.UserDataSource | ||
import com.sopt.data.datasourceimpl.UserDataSourceImpl | ||
import com.sopt.data.repositoryimpl.UserInfoRepositoryImpl | ||
import com.sopt.domain.repository.UserInfoRepository | ||
import dagger.Binds | ||
import dagger.Module | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
abstract class UserInfoModule { | ||
@Binds | ||
@Singleton | ||
abstract fun bindsAuthDataSource( | ||
authDataSourceImpl: UserDataSourceImpl | ||
): UserDataSource | ||
|
||
@Binds | ||
@Singleton | ||
abstract fun bindAuthRepository( | ||
authDataSourceImpl: UserInfoRepositoryImpl | ||
): UserInfoRepository | ||
} |
42 changes: 42 additions & 0 deletions
42
core/src/main/java/com/sopt/core/designsystem/component/box/CategoryBox.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,42 @@ | ||
package com.sopt.core.designsystem.component.box | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.shape.CircleShape | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.platform.LocalContext | ||
import androidx.compose.ui.unit.dp | ||
import com.sopt.core.designsystem.theme.NoostakTheme | ||
import com.sopt.core.type.CategoryType | ||
|
||
@Composable | ||
fun CategoryBox( | ||
text: String | ||
) { | ||
val context = LocalContext.current | ||
val categoryType = CategoryType.fromText(context, text) | ||
val backgroundColor = when (categoryType) { | ||
CategoryType.IMPORTANT -> NoostakTheme.colors.orange | ||
CategoryType.SCHEDULE -> NoostakTheme.colors.blue | ||
CategoryType.HOBBY -> NoostakTheme.colors.purple | ||
CategoryType.ETC -> NoostakTheme.colors.mint | ||
} | ||
|
||
Box( | ||
modifier = Modifier | ||
.padding( | ||
top = 5.dp, | ||
start = 4.dp, | ||
bottom = 5.dp, | ||
end = 3.dp | ||
) | ||
.background( | ||
color = backgroundColor, | ||
shape = CircleShape | ||
) | ||
.size(13.dp) | ||
) | ||
} |
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,3 @@ | ||
package com.sopt.core.type | ||
|
||
enum class SocialType { KAKAO, GOOGLE } |
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,45 @@ | ||
package com.sopt.core.util | ||
|
||
import java.time.LocalDateTime | ||
import java.time.format.DateTimeFormatter | ||
import java.time.format.TextStyle | ||
import java.util.Locale | ||
|
||
class CalculateTime { | ||
fun extractFullDateWithSlash(dateTime: String): String { | ||
return parseDateTime(dateTime).toLocalDate().format(DateTimeFormatter.ofPattern("MM/dd")) | ||
} | ||
|
||
fun extractDateWithSlash(dateTime: String): String { | ||
return parseDateTime(dateTime).toLocalDate().format(DateTimeFormatter.ofPattern("M/d")) | ||
} | ||
|
||
fun extractFullDateWithKorean(dateTime: String): String { | ||
return parseDateTime(dateTime).toLocalDate().format(DateTimeFormatter.ofPattern("MM월 dd일")) | ||
} | ||
|
||
fun extractDateWithKorean(dateTime: String): String { | ||
return parseDateTime(dateTime).toLocalDate().format(DateTimeFormatter.ofPattern("M월 d일")) | ||
} | ||
|
||
fun extractDayOfWeek(dateTime: String): String { | ||
return parseDateTime(dateTime).dayOfWeek.getDisplayName(TextStyle.SHORT, Locale.KOREAN) | ||
} | ||
|
||
fun extractDayOfWeekWithBraces(dateTime: String): String { | ||
return "(${parseDateTime(dateTime).dayOfWeek.getDisplayName(TextStyle.SHORT, Locale.KOREAN)})" | ||
} | ||
|
||
fun extractHourWithKorean(dateTime: String): String { | ||
return "${parseDateTime(dateTime).hour}시" | ||
} | ||
|
||
fun extractHourWithZero(dateTime: String): String { | ||
return "${parseDateTime(dateTime).hour}:00" | ||
} | ||
|
||
private fun parseDateTime(dateTime: String): LocalDateTime { | ||
val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss") | ||
return LocalDateTime.parse(dateTime, formatter) | ||
} | ||
} |
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,17 @@ | ||
package com.sopt.core.util | ||
|
||
import com.sopt.domain.entity.IdentityEntity | ||
|
||
class RearrangeList { | ||
fun rearrangeMembersBasedOnAvailability( | ||
identity: IdentityEntity, | ||
data: List<String> | ||
): List<String> { | ||
val membersList = data.toMutableList() | ||
if (identity.position in membersList.indices && membersList[identity.position] == identity.name) { | ||
val myInfo = membersList.removeAt(identity.position) | ||
membersList.add(0, myInfo) | ||
} | ||
return membersList | ||
} | ||
} |
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
28 changes: 28 additions & 0 deletions
28
data/src/main/java/com/sopt/data/datasource/UserDataSource.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,28 @@ | ||
package com.sopt.data.datasource | ||
|
||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface UserDataSource { | ||
val accessToken: Flow<String> | ||
val refreshToken: Flow<String> | ||
val userId: Flow<Int> | ||
val isAutoLogin: Flow<Boolean> | ||
val nickName: Flow<String> | ||
val profileImage: Flow<String> | ||
|
||
suspend fun updateAccessToken(accessToken: String) | ||
|
||
suspend fun updateRefreshToken(refreshToken: String) | ||
|
||
suspend fun updateUserId(userId: Int) | ||
|
||
suspend fun updateIsAutoLogin(isAutoLogin: Boolean) | ||
|
||
suspend fun updateNickName(nickName: String) | ||
|
||
suspend fun updateProfileImage(profileImage: String) | ||
|
||
suspend fun clear() | ||
|
||
suspend fun clearForRefreshToken() | ||
} |
Oops, something went wrong.