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

[release] 1.1.0 #25

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 44 additions & 83 deletions .github/workflows/ktlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,95 +11,56 @@ jobs:
runs-on: ubuntu-latest

env:
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
BASE_URL: ${{secrets.BASE_URL}}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
BASE_URL: ${{secrets.BASE_URL}}

steps:
- uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: BASE_URL
run: |
echo BASE_URL=$BASE_URL > local.properties
shell: bash
env:
API_KEY: ${{ secrets.BASE_URL }}

- name: Download Android keystore
id: android_keystore
uses: timheuer/[email protected]
with:
fileName: key.jks
encodedString: ${{ secrets.STORE_FILE }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- run : echo $STORE_FILE | base64 -d > release.keystore
- name: Ktlint Check
run: ./gradlew --no-daemon ktlintCheck --continue

- name: Create key.properties
run: |
echo "STORE_PATH=${{ secrets.STORE_PATH }}" >> local.properties
echo "STORE_PASSWORD=${{ secrets.STORE_PASSOWRD }}" >> local.properties
echo "KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}" >> local.properties
echo "KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> local.properties


- name: Create Google service file
run: cat /home/runner/work/Don-t-Forget---Android/Don-t-Forget---Android/app/google-services.json | base64

- name: Putting data
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $DATA > /home/runner/work/Don-t-Forget---Android/Don-t-Forget---Android/app/google-services.json
- name: BASE_URL
run: |
echo BASE_URL=$BASE_URL > local.properties
shell: bash
env:
API_KEY: ${{ secrets.BASE_URL }}

- name: Build with Gradle
run: ./gradlew build
- name: Download Android keystore
id: android_keystore
uses: timheuer/[email protected]
with:
fileName: key.jks
encodedString: ${{ secrets.STORE_FILE }}

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: BASE_URL
run: |
echo BASE_URL=$BASE_URL > local.properties
shell: bash
env:
API_KEY: ${{ secrets.BASE_URL }}

- name: Download Android keystore
id: android_keystore
uses: timheuer/[email protected]
with:
fileName: key.jks
encodedString: ${{ secrets.STORE_FILE }}
- run: echo $STORE_FILE | base64 -d > release.keystore
- name: Ktlint Check
run: ./gradlew --no-daemon ktlintCheck --continue

- run : echo $STORE_FILE | base64 -d > release.keystore

- name: Create key.properties
run: |
echo "STORE_PATH=${{ secrets.STORE_PATH }}" >> local.properties
echo "STORE_PASSWORD=${{ secrets.STORE_PASSOWRD }}" >> local.properties
echo "KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}" >> local.properties
echo "KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> local.properties


- name: Create Google service file
run: cat /home/runner/work/Don-t-Forget---Android/Don-t-Forget---Android/app/google-services.json | base64

- name: Putting data
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $DATA > /home/runner/work/Don-t-Forget---Android/Don-t-Forget---Android/app/google-services.json
- name: Create key.properties
run: |
echo "STORE_PATH=${{ secrets.STORE_PATH }}" >> local.properties
echo "STORE_PASSWORD=${{ secrets.STORE_PASSWORD }}" >> local.properties
echo "KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}" >> local.properties
echo "KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> local.properties

- name: Ktlint Check
run: ./gradlew --no-daemon ktlintCheck --continue

- name: Create Google service file
run: cat /home/runner/work/Don-t-Forget---Android/Don-t-Forget---Android/app/google-services.json | base64

- name: Putting data
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $DATA > /home/runner/work/Don-t-Forget---Android/Don-t-Forget---Android/app/google-services.json

- name: Build with Gradle
run: ./gradlew build
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.collectIsPressedAsState
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.material.ripple.LocalRippleTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
Expand Down Expand Up @@ -54,18 +52,23 @@ fun BaseButton(
LocalRippleTheme provides NoRippleTheme, // 버튼의 리플 이펙트 제거
) {
Surface(
modifier = modifier.height(72.dp),
modifier = modifier,
onClick = { if (enabled) onClick() },
shape = shape,
color = color,
interactionSource = interactionSource,
) {
Row(
modifier.wrapContentHeight().padding(horizontal = 20.dp),
modifier.padding(horizontal = 20.dp),
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically,
) {
Text(text = text, color = White, style = textStyle.copy(fontSize = 20.sp))
Text(
text = text,
modifier = Modifier.padding(vertical = 16.dp),
color = White,
style = textStyle.copy(fontSize = 20.sp),
)
}
}
}
Expand All @@ -75,5 +78,5 @@ fun BaseButton(
@Preview
fun PreviewBaseButton() {
var enabled by remember { mutableStateOf(false) }
BaseButton("text", onClick = { enabled = !enabled }, enabled = true)
BaseButton("text", onClick = { enabled = !enabled }, enabled = true, modifier = Modifier)
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package nexters.hyomk.dontforget.presentation.component

import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.collectIsFocusedAsState
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -18,6 +19,7 @@ import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
Expand Down Expand Up @@ -68,6 +70,8 @@ fun BaseTextField(

val keyboardController = LocalSoftwareKeyboardController.current

val isFocused by interactionSource.collectIsFocusedAsState()

val baseModifier =
Modifier.fillMaxWidth().heightIn(min = TextFieldMinHeight, max = TextFieldMaxHeight).padding(horizontal = 17.dp)

Expand All @@ -77,7 +81,7 @@ fun BaseTextField(
)

CompositionLocalProvider(LocalTextSelectionColors provides customTextSelectionColors) {
Column {
Column(modifier = modifier) {
BasicTextField(
modifier = modifier,
value = value,
Expand Down Expand Up @@ -112,9 +116,9 @@ fun BaseTextField(
modifier = Modifier.fillMaxWidth(),
contentAlignment = Alignment.Center,
) {
if (value.isEmpty()) {
if (!isFocused && value.isEmpty()) {
Text(
textAlign = TextAlign.Center,

text = hint,
color = Gray700,
style = MaterialTheme.typography.bodyMedium,
Expand All @@ -130,11 +134,12 @@ fun BaseTextField(
Text(
modifier = Modifier.fillMaxWidth().padding(top = 4.dp),
text = helperText,
textAlign = TextAlign.Center,
style = MaterialTheme.typography.bodyMedium,
color = White,
)
}
Divider(color = Gray800, modifier = Modifier.padding(top = 17.dp))
Divider(color = if (isFocused) Primary500 else Gray800, modifier = Modifier.padding(top = 17.dp))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import nexters.hyomk.domain.model.AnniversaryDateType
import nexters.hyomk.dontforget.ui.theme.Gray900
import timber.log.Timber
import java.time.YearMonth

@Composable
fun CustomDatePicker(
dateType: AnniversaryDateType,
yearPickerState: PickerState,
monthPickerState: PickerState,
dayPickerState: PickerState,
Expand All @@ -32,7 +34,12 @@ fun CustomDatePicker(
dInit: Int,
) {
fun getLastDay(month: Int, year: Int): Int {
return YearMonth.of(year, month).lengthOfMonth()
val lastDay = YearMonth.of(year, month).lengthOfMonth()
return if (dateType == AnniversaryDateType.LUNAR && lastDay > 30) {
30
} else {
YearMonth.of(year, month).lengthOfMonth()
}
}

val years = (1900..2050).toList()
Expand Down Expand Up @@ -114,6 +121,7 @@ fun PreviewDatePicker() {
mutableStateOf(PickerState(1))
}
CustomDatePicker(
dateType = AnniversaryDateType.LUNAR,
yearPickerState = year,
monthPickerState = month,
dayPickerState = day,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import nexters.hyomk.dontforget.presentation.utils.pixelsToDp
import nexters.hyomk.dontforget.ui.theme.Gray500
import nexters.hyomk.dontforget.ui.theme.Gray800
import nexters.hyomk.dontforget.ui.theme.Gray900
Expand Down Expand Up @@ -112,7 +113,7 @@ fun CustomDateTab(
tabWidth = with(density) {
it.size.width.toDp() / items.size - tabPadding
}
}.clip(RoundedCornerShape(8.dp))
}.clip(RoundedCornerShape(12.dp))
.background(Gray800)
.height(intrinsicSize = IntrinsicSize.Min),
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.Divider
Expand Down Expand Up @@ -132,8 +133,8 @@ fun Picker(
flingBehavior = flingBehavior,
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier
.height(itemHeightDp * visibleItemsCount)
.fillMaxWidth(),
.height(itemHeightDp * visibleItemsCount).offset(x = 20.dp)
.width(50.dp),
) {
items(listScrollCount) { index ->
val isSelectedItem = state.selectedItem == getItem(index)
Expand All @@ -152,13 +153,11 @@ fun Picker(
style = textStyle.plus(
TextStyle(color = isSelectedColor),
),
textAlign = TextAlign.Center,
modifier = Modifier
.onSizeChanged { size ->
if (size.height != itemHeightPixels.value) itemHeightPixels.value = size.height
}
.then(textModifier)
.offset(x = -10.dp),
.then(textModifier),

)
}
Expand Down Expand Up @@ -205,7 +204,7 @@ fun PickerExample() {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
modifier = Modifier.fillMaxSize(),
modifier = Modifier.fillMaxSize().padding(horizontal = 30.dp),
) {
val today = LocalDateTime.now()
var lastDay by remember { mutableIntStateOf(getLastDay(today.monthValue, today.year)) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import nexters.hyomk.domain.model.AnniversaryCardType
Expand Down Expand Up @@ -86,10 +87,11 @@ fun AnniversaryCard(
Text(
text = title,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
style = MaterialTheme.typography.headlineSmall.copy(color = properties.titleColor),
)
Text(
text = if (dday == 365L) "D-DAY" else "D$dday",
text = if (dday == 365L || dday == 0L) "D-DAY" else "D$dday",
style = MaterialTheme.typography.headlineMedium.copy(color = properties.dDayColor, fontWeight = FontWeight.Bold),
)
Spacer(modifier = Modifier.weight(1f))
Expand Down
Loading
Loading