Skip to content

Commit

Permalink
Merge pull request #7 from AND-SOPT-ANDROID/feat/#6-week3
Browse files Browse the repository at this point in the history
[feat/#6] 3주차 과제 구현
  • Loading branch information
kangyein9892 authored Nov 12, 2024
2 parents 9b2ac74 + f7a5a73 commit 2deea38
Show file tree
Hide file tree
Showing 30 changed files with 308 additions and 223 deletions.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools">

<application
android:name=".WavveApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/java/org/sopt/and/WavveApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import org.sopt.and.util.PreferenceUtil

class WavveApplication: Application() {

private lateinit var prefs: PreferenceUtil

override fun onCreate() {
super.onCreate()
prefs = PreferenceUtil(applicationContext)
PreferenceUtil.init(this)
}
}
8 changes: 4 additions & 4 deletions app/src/main/java/org/sopt/and/component/BackTopBar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package org.sopt.and.component

import androidx.annotation.DrawableRes
import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
Expand All @@ -22,6 +21,7 @@ import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.sopt.and.R
import org.sopt.and.extension.noRippleClickable
import org.sopt.and.ui.theme.FirstGrey

@OptIn(ExperimentalMaterial3Api::class)
Expand Down Expand Up @@ -51,9 +51,9 @@ fun BackTopBar(
modifier = Modifier
.size(40.dp)
.padding(end = 4.dp)
.clickable {
onButtonClick()
}
.noRippleClickable(
onClick = onButtonClick
)
)
},
colors = TopAppBarDefaults.centerAlignedTopAppBarColors(
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/java/org/sopt/and/component/CloseTopBar.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.sopt.and.component

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
Expand All @@ -20,7 +18,9 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import org.sopt.and.R
import org.sopt.and.extension.noRippleClickable
import org.sopt.and.ui.theme.FirstGrey
import org.sopt.and.ui.theme.White

@OptIn(ExperimentalMaterial3Api::class)
@Composable
Expand All @@ -29,8 +29,8 @@ fun CloseTopBar(
onBtnClick: () -> Unit,
modifier: Modifier = Modifier,
containerColor: Color = FirstGrey,
titleContentColor: Color = Color.White,
actionIconContentColor: Color = Color.White
titleContentColor: Color = White,
actionIconContentColor: Color = White
) {
CenterAlignedTopAppBar(
modifier = modifier
Expand All @@ -48,9 +48,9 @@ fun CloseTopBar(
modifier = Modifier
.size(40.dp)
.padding(end = 4.dp)
.clickable {
onBtnClick()
}
.noRippleClickable(
onClick = onBtnClick
)
)
},
colors = TopAppBarDefaults.centerAlignedTopAppBarColors(
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/java/org/sopt/and/component/ContentRow.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package org.sopt.and.component

import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
Expand All @@ -30,6 +28,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import org.sopt.and.R
import org.sopt.and.extension.noRippleClickable
import org.sopt.and.ui.theme.White

@Composable
Expand Down Expand Up @@ -62,10 +61,9 @@ fun ContentRow(
contentDescription = stringResource(R.string.icon_arrow_right),
modifier = Modifier
.size(24.dp)
.clickable {
onRightArrowClick()
}

.noRippleClickable(
onClick = onRightArrowClick
)
)
}

Expand All @@ -84,7 +82,9 @@ fun ContentRow(
modifier = modifier
.width(100.dp)
.clip(RoundedCornerShape(8.dp))
.clickable { onItemClick(index) }
.noRippleClickable(
onClick = { onItemClick(index) }
)
)
}
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/org/sopt/and/component/ContentsView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import org.sopt.and.R
import org.sopt.and.ui.theme.ThirdGrey
import org.sopt.and.ui.theme.White

@Composable
fun ContentsView(
title: String,
contentText: String,
modifier: Modifier = Modifier,
titleColor: Color = Color.White,
titleColor: Color = White,
contentTextColor: Color = ThirdGrey,
) {
Column(
Expand Down
53 changes: 53 additions & 0 deletions app/src/main/java/org/sopt/and/component/InfoWithText.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package org.sopt.and.component

import androidx.annotation.StringRes
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Info
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import org.sopt.and.R
import org.sopt.and.ui.theme.ThirdGrey

@Composable
fun InfoWithText(
@StringRes textRes: Int,
modifier: Modifier = Modifier,
color: Color = ThirdGrey
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = modifier.padding(top = 4.dp, start = 8.dp, end = 8.dp)
) {
Icon(
imageVector = Icons.Outlined.Info,
contentDescription = stringResource(R.string.icon_info),
tint = color,
modifier = modifier.height(24.dp)
)
Spacer(modifier = modifier.width(8.dp))
Text(
text = stringResource(textRes),
fontSize = 12.sp,
color = color
)
}
}

@Preview
@Composable
fun InfoWithTextPreview() {
InfoWithText(textRes = R.string.signup_login_guide)
}
5 changes: 3 additions & 2 deletions app/src/main/java/org/sopt/and/component/LogoTopBar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.sopt.and.R
import org.sopt.and.ui.theme.FirstGrey
import org.sopt.and.ui.theme.White

@OptIn(ExperimentalMaterial3Api::class)
@Composable
Expand All @@ -38,8 +39,8 @@ fun LogoTopBar(
},
colors = TopAppBarDefaults.topAppBarColors(
containerColor = FirstGrey,
titleContentColor = Color.White,
actionIconContentColor = Color.White
titleContentColor = White,
actionIconContentColor = White
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.sopt.and.R
import org.sopt.and.ui.theme.FacebookColor
import org.sopt.and.ui.theme.KakaoColor
import org.sopt.and.ui.theme.NaverColor
import org.sopt.and.ui.theme.TworldColor
import org.sopt.and.ui.theme.White

@Composable
fun OtherServiceIconRow(
Expand Down Expand Up @@ -102,7 +100,7 @@ fun OtherServiceIconRow(
modifier = Modifier
.size(48.dp)
.clip(CircleShape)
.background(Color.White)
.background(White)
) {
Image(
painter = painterResource(id = R.drawable.apple_icon),
Expand Down
19 changes: 10 additions & 9 deletions app/src/main/java/org/sopt/and/component/RankContentRow.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.sopt.and.component

import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -30,6 +29,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import org.sopt.and.R
import org.sopt.and.extension.noRippleClickable
import org.sopt.and.ui.theme.White

@Composable
Expand Down Expand Up @@ -62,10 +62,9 @@ fun RankContentRow(
contentDescription = stringResource(R.string.icon_arrow_right),
modifier = Modifier
.size(24.dp)
.clickable {
onRightArrowClick()
}

.noRippleClickable(
onClick = onRightArrowClick
)
)
}

Expand All @@ -80,9 +79,9 @@ fun RankContentRow(
Box(
modifier = Modifier
.width(100.dp)
.clickable {
onItemClick(index)
},
.noRippleClickable(
onClick = { onItemClick(index) }
),
contentAlignment = Alignment.BottomStart
) {
Image(
Expand All @@ -92,7 +91,9 @@ fun RankContentRow(
modifier = modifier
.fillMaxWidth()
.clip(RoundedCornerShape(8.dp))
.clickable { onItemClick(index) }
.noRippleClickable(
onClick = { onItemClick(index) }
)
)

Text(
Expand Down
32 changes: 31 additions & 1 deletion app/src/main/java/org/sopt/and/component/TypeTabRow.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,22 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.rememberScrollState
import androidx.compose.material3.TabPosition
import androidx.compose.material3.TabRow
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.sopt.and.extension.noRippleClickable
import org.sopt.and.home.HomeTabType
import org.sopt.and.ui.theme.FirstGrey
import org.sopt.and.ui.theme.ThirdGrey
import org.sopt.and.ui.theme.White

@Composable
fun TypeTabRow(
Expand All @@ -30,7 +38,8 @@ fun TypeTabRow(
selectedTabIndex = selectedTabIndex,
modifier = modifier,
containerColor = containerColor,
indicator = indicator
indicator = indicator,
divider = {}
){
Row(
horizontalArrangement = Arrangement.SpaceEvenly,
Expand All @@ -44,4 +53,25 @@ fun TypeTabRow(
}

}
}

@Preview
@Composable
private fun TypeTabRowPreview() {
TypeTabRow(
tabTitles = HomeTabType.entries.map { it.titleRes }.toList(),
selectedTabIndex = 0,
) { index, tab ->
Text(
text = stringResource(tab),
color = if (0 == index) White
else ThirdGrey,
modifier = Modifier
.wrapContentWidth()
.padding(horizontal = 8.dp)
.noRippleClickable(
onClick = { }
)
)
}
}
Loading

0 comments on commit 2deea38

Please sign in to comment.