Skip to content

Commit

Permalink
style: 코드 정리
Browse files Browse the repository at this point in the history
  • Loading branch information
CChuYong committed Jan 13, 2024
1 parent dd0c274 commit e594211
Show file tree
Hide file tree
Showing 26 changed files with 52 additions and 65 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ val secretProperties = Properties().apply {
val majorVersion = 1
val minorVersion = 0
val patchVersion = 1
val buildVersion = 0
val buildVersion = 1

android {
namespace = "com.no5ing.bbibbi"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.no5ing.bbibbi

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.*
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/com/no5ing/bbibbi/FirebaseService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import androidx.compose.ui.graphics.Color
import androidx.core.app.NotificationCompat
import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import androidx.compose.runtime.Stable
import androidx.compose.runtime.State
import com.no5ing.bbibbi.data.model.APIResponse
import com.no5ing.bbibbi.data.model.link.DeepLink
import com.no5ing.bbibbi.presentation.uistate.family.FamilyInviteLinkUiState

@Stable
data class FamilyPageInvitationState(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fun CameraCaptureButton(
modifier = modifier
.size(80.dp)
.clickable {
if(!isCapturing) onClick()
if (!isCapturing) onClick()
},
alpha = if (isCapturing) 0.3f else 1.0f,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
Expand All @@ -53,7 +52,6 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.DialogProperties
import androidx.compose.ui.window.DialogWindowProvider
import androidx.hilt.navigation.compose.hiltViewModel
import com.no5ing.bbibbi.R
import com.no5ing.bbibbi.data.model.member.Member
import com.no5ing.bbibbi.presentation.ui.common.button.CTAButton
Expand All @@ -75,7 +73,7 @@ fun ReactionListDialog(
selectedEmoji: String,
isEnabled: MutableState<Boolean> = remember { mutableStateOf(false) },
emojiMap: Map<String, List<PostReactionUiState>>,
// postViewReactionMemberViewModel: PostViewReactionMemberViewModel = hiltViewModel(),
// postViewReactionMemberViewModel: PostViewReactionMemberViewModel = hiltViewModel(),
) {
if (isEnabled.value) {
val navController = LocalNavigateControllerState.current
Expand Down Expand Up @@ -104,7 +102,7 @@ fun ReactionListDialog(
val (width, height) = getScreenSize()


// val memberState = postViewReactionMemberViewModel.uiState.collectAsState()
// val memberState = postViewReactionMemberViewModel.uiState.collectAsState()
val myGroup = emojiMap[selectedEmoji] ?: emptyList()
val totalCntMessage = stringResource(id = R.string.emoji_reaction_total, myGroup.size)
Box(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import com.no5ing.bbibbi.presentation.ui.theme.bbibbiScheme
import com.no5ing.bbibbi.presentation.ui.theme.bbibbiTypo

@Composable
fun JoinFamilyPageLinkBar(
fun JoinFamilyPageLinkBar(
onTap: () -> Unit,
modifier: Modifier = Modifier,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fun JoinFamilyWithLinkPage(
}
LaunchedEffect(deepLinkState) {
if (deepLinkState != null) {
if(isValidUrl(deepLinkState)){
if (isValidUrl(deepLinkState)) {
state.nicknameTextState.value = deepLinkState
state.isInvalidInputState.value = false
state.ctaButtonEnabledState.value = true
Expand Down Expand Up @@ -202,13 +202,13 @@ fun JoinFamilyWithLinkPage(
contentPadding = PaddingValues(vertical = 18.dp),
isActive = state.ctaButtonEnabledState.value && uiState.isIdle(),
onClick = {
joinFamilyWithLinkViewModel.invoke(
Arguments(
arguments = mapOf(
"linkId" to getLinkIdFromUrl(state.nicknameTextState.value),
)
)
)
joinFamilyWithLinkViewModel.invoke(
Arguments(
arguments = mapOf(
"linkId" to getLinkIdFromUrl(state.nicknameTextState.value),
)
)
)
},
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,10 @@ fun KakaoLoginButton(
) {
val alphaValue = if (isLoggingIn) 0.5f else 1.0f
Button(
colors = ButtonDefaults.buttonColors(containerColor =
MaterialTheme.bbibbiScheme.kakaoYellow.copy(alpha = alphaValue)),
colors = ButtonDefaults.buttonColors(
containerColor =
MaterialTheme.bbibbiScheme.kakaoYellow.copy(alpha = alphaValue)
),
onClick = onClick,
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(8.dp),
Expand Down Expand Up @@ -232,9 +234,11 @@ fun GoogleLoginButton(
val alphaValue = if (isLoggingIn) 0.5f else 1.0f
Button(
colors = ButtonDefaults
.buttonColors(containerColor = MaterialTheme.bbibbiScheme.white.copy(
alpha = alphaValue
)),
.buttonColors(
containerColor = MaterialTheme.bbibbiScheme.white.copy(
alpha = alphaValue
)
),
onClick = onClick,
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(8.dp),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ fun OnBoardingPage(
onAlreadyHaveFamily: () -> Unit = {},
onFamilyNotExists: () -> Unit = {},
onBoardingPageState: OnBoardingPageState = rememberOnBoardingPageState(),
// familyRegistrationViewModel: FamilyRegistrationViewModel = hiltViewModel(),
// familyRegistrationViewModel: FamilyRegistrationViewModel = hiltViewModel(),
) {
val sessionState = LocalSessionState.current
// val registrationState = familyRegistrationViewModel.uiState.collectAsState()
val nextViewRoute = if(sessionState.isLoggedIn() && sessionState.hasFamily()) onAlreadyHaveFamily else onFamilyNotExists
// val registrationState = familyRegistrationViewModel.uiState.collectAsState()
val nextViewRoute =
if (sessionState.isLoggedIn() && sessionState.hasFamily()) onAlreadyHaveFamily else onFamilyNotExists
val perm = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
rememberPermissionState(permission = Manifest.permission.POST_NOTIFICATIONS) { isAccepted ->
if (!isAccepted) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Icon
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.no5ing.bbibbi.presentation.ui.feature.main.calendar

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
Expand All @@ -20,13 +19,9 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.pager.HorizontalPager
import androidx.compose.foundation.pager.rememberPagerState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import com.no5ing.bbibbi.presentation.state.main.family.rememberFamilyPageInvita
import com.no5ing.bbibbi.presentation.ui.theme.bbibbiScheme
import com.no5ing.bbibbi.presentation.viewmodel.family.FamilyInviteLinkViewModel
import com.no5ing.bbibbi.util.LocalSessionState
import timber.log.Timber

@Composable
fun FamilyPageInviteButton(
Expand Down Expand Up @@ -92,7 +91,7 @@ fun FamilyPageInviteButton(
fontSize = 18.sp,
)
Text(
text = if(uiState.isReady()) uiState.data.url else "Loading...",
text = if (uiState.isReady()) uiState.data.url else "Loading...",
color = MaterialTheme.bbibbiScheme.textSecondary,
fontSize = 14.sp,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import com.no5ing.bbibbi.presentation.viewmodel.members.FamilyMembersViewModel
import com.no5ing.bbibbi.presentation.viewmodel.post.IsMeUploadedTodayViewModel
import com.no5ing.bbibbi.presentation.viewmodel.post.MainPostFeedViewModel
import com.no5ing.bbibbi.util.LocalSessionState
import timber.log.Timber

@Composable
fun HomePage(
Expand Down Expand Up @@ -62,7 +61,7 @@ fun HomePage(
isMeUploadedTodayViewModel.invoke(Arguments(arguments = mapOf("memberId" to memberId)))
}
LaunchedEffect(meState.value.status) {
if(meState.value.isIdle()) {
if (meState.value.isIdle()) {
retrieveMeViewModel.invoke(Arguments())
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ import com.no5ing.bbibbi.presentation.viewmodel.members.FamilyMembersViewModel
import com.no5ing.bbibbi.presentation.viewmodel.post.MainPostFeedViewModel
import com.no5ing.bbibbi.util.gapBetweenNow
import com.no5ing.bbibbi.util.todayAsString
import timber.log.Timber

@OptIn(ExperimentalMaterialApi::class)
@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ fun StoryBarIcon(
onTap = onTap,
)
Text(
text = if(isMe) stringResource(id = R.string.family_me) else member.name,
text = if (isMe) stringResource(id = R.string.family_me) else member.name,
color = MaterialTheme.bbibbiScheme.textSecondary,
overflow = TextOverflow.Ellipsis,
maxLines = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fun PostViewReactionBar(
familyPostReactionBarViewModel: PostReactionBarViewModel = hiltViewModel(),
removePostReactionViewModel: RemovePostReactionViewModel = hiltViewModel(),
addPostReactionViewModel: AddPostReactionViewModel = hiltViewModel(),
// postViewReactionMemberViewModel: PostViewReactionMemberViewModel = hiltViewModel(),
// postViewReactionMemberViewModel: PostViewReactionMemberViewModel = hiltViewModel(),
uiState: State<List<PostReactionUiState>> = familyPostReactionBarViewModel.uiState.collectAsState(),
onTapAddEmojiButton: () -> Unit,
) {
Expand All @@ -62,7 +62,7 @@ fun PostViewReactionBar(
)
)
)
// postViewReactionMemberViewModel.invoke(Arguments())
// postViewReactionMemberViewModel.invoke(Arguments())
}
val selectedEmoji = remember { mutableStateOf(emojiList.first()) }
val emojiMap = uiState.value.groupBy { it.emojiType }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import android.graphics.Rect
import android.text.TextPaint
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.TextUnit
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -95,8 +94,10 @@ class AppWidget : GlanceAppWidget() {
WidgetImageWorker::class.java,
Duration.ofMinutes(15),
)
.setConstraints(Constraints.Builder()
.setRequiredNetworkType(NetworkType.CONNECTED).build())
.setConstraints(
Constraints.Builder()
.setRequiredNetworkType(NetworkType.CONNECTED).build()
)
.build()
)
provideContent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ import com.no5ing.bbibbi.data.model.APIResponse
import com.no5ing.bbibbi.data.model.APIResponse.Companion.wrapToAPIResponse
import com.no5ing.bbibbi.data.model.link.DeepLink
import com.no5ing.bbibbi.data.repository.Arguments
import com.no5ing.bbibbi.presentation.uistate.family.FamilyInviteLinkUiState
import com.no5ing.bbibbi.presentation.viewmodel.BaseViewModel
import com.skydoves.sandwich.retrofit.body
import com.skydoves.sandwich.suspendOnFailure
import com.skydoves.sandwich.suspendOnSuccess
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.Dispatchers
import javax.inject.Inject
Expand All @@ -18,7 +14,7 @@ import javax.inject.Inject
class FamilyInviteLinkViewModel @Inject constructor(
private val restAPI: RestAPI,
) : BaseViewModel<APIResponse<DeepLink>>() {
override fun initState(): APIResponse<DeepLink> {
override fun initState(): APIResponse<DeepLink> {
return APIResponse.idle()
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.no5ing.bbibbi.presentation.viewmodel.family

import com.no5ing.bbibbi.data.datasource.local.LocalDataStorage
import com.no5ing.bbibbi.data.datasource.network.RestAPI
import com.no5ing.bbibbi.data.datasource.network.request.member.JoinFamilyRequest
import com.no5ing.bbibbi.data.model.APIResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@ package com.no5ing.bbibbi.presentation.viewmodel.members
import androidx.lifecycle.viewModelScope
import androidx.paging.PagingData
import androidx.paging.cachedIn
import androidx.paging.filter
import com.no5ing.bbibbi.data.model.member.Member
import com.no5ing.bbibbi.data.repository.Arguments
import com.no5ing.bbibbi.data.repository.member.GetMembersRepository
import com.no5ing.bbibbi.di.SessionModule
import com.no5ing.bbibbi.presentation.viewmodel.BaseViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.stateIn
import javax.inject.Inject

Expand Down
12 changes: 9 additions & 3 deletions app/src/main/res/drawable/notification_icon.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<vector android:height="48dp" android:viewportHeight="250"
android:viewportWidth="250" android:width="48dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#3FD960" android:fillType="evenOdd" android:pathData="M250,0H0V250H250V0ZM39,181.34H111.18V173.33H119.19V165.32H127.26V133.23H119.19V125.17H111.18V117.16H119.19V85.07H111.18V77.06H103.18V69H39V181.34ZM95.17,117.16H55.02V85.07H95.17V93.08H103.18V109.15H95.17V117.16ZM103.18,165.32H55.02V133.23H103.18V141.24H111.18V157.31H103.18V165.32ZM138.73,181.34H154.74V173.33H162.75V181.34H194.89V173.33H202.9V165.32H210.91V117.16H202.9V109.15H194.89V101.14H162.75V109.15H154.74V69H138.73V181.34ZM186.83,165.32H162.75V157.31H154.74V125.17H162.75V117.16H186.83V125.17H194.89V157.31H186.83V165.32Z"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="250"
android:viewportHeight="250">
<path
android:fillColor="#3FD960"
android:fillType="evenOdd"
android:pathData="M250,0H0V250H250V0ZM39,181.34H111.18V173.33H119.19V165.32H127.26V133.23H119.19V125.17H111.18V117.16H119.19V85.07H111.18V77.06H103.18V69H39V181.34ZM95.17,117.16H55.02V85.07H95.17V93.08H103.18V109.15H95.17V117.16ZM103.18,165.32H55.02V133.23H103.18V141.24H111.18V157.31H103.18V165.32ZM138.73,181.34H154.74V173.33H162.75V181.34H194.89V173.33H202.9V165.32H210.91V117.16H202.9V109.15H194.89V101.14H162.75V109.15H154.74V69H138.73V181.34ZM186.83,165.32H162.75V157.31H154.74V125.17H162.75V117.16H186.83V125.17H194.89V157.31H186.83V165.32Z" />
</vector>
6 changes: 3 additions & 3 deletions app/src/main/res/drawable/plus_icon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
android:height="46dp"
android:viewportWidth="45"
android:viewportHeight="46">
<path
android:pathData="M24.375,18.625V0.5H20.625V18.625C20.625,20 19.5,21.125 18.125,21.125H0V24.875H18.125C19.5,24.875 20.625,26 20.625,27.375V45.5H24.375V27.375C24.375,26 25.5,24.875 26.875,24.875H45V21.125H26.875C25.5,21.125 24.375,20 24.375,18.625Z"
android:fillColor="#B2B2B4"/>
<path
android:fillColor="#B2B2B4"
android:pathData="M24.375,18.625V0.5H20.625V18.625C20.625,20 19.5,21.125 18.125,21.125H0V24.875H18.125C19.5,24.875 20.625,26 20.625,27.375V45.5H24.375V27.375C24.375,26 25.5,24.875 26.875,24.875H45V21.125H26.875C25.5,21.125 24.375,20 24.375,18.625Z" />
</vector>
1 change: 1 addition & 0 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="Theme.Bbibbi" parent="android:Theme.Material.Light.NoActionBar">
<item name="android:windowBackground">#242427</item>
</style>
Expand Down
3 changes: 1 addition & 2 deletions app/src/test/java/com/no5ing/bbibbi/ExampleUnitTest.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.no5ing.bbibbi

import org.junit.Assert.assertEquals
import org.junit.Test

import org.junit.Assert.*

/**
* Example local unit test, which will execute on the development machine (host).
*
Expand Down

0 comments on commit e594211

Please sign in to comment.