Skip to content

Commit

Permalink
Merge branch 'main' into feature/#160-2nd-qa
Browse files Browse the repository at this point in the history
  • Loading branch information
blueme0 committed Feb 16, 2024
2 parents cbbdc7c + 8aebaeb commit 016ce12
Show file tree
Hide file tree
Showing 17 changed files with 179 additions and 159 deletions.
168 changes: 84 additions & 84 deletions .github/workflows/debug_builder.yml
Original file line number Diff line number Diff line change
@@ -1,84 +1,84 @@
name: TeumTeum Push Builder

on:
push:
branches: [ main ]

defaults:
run:
shell: bash
working-directory: .

jobs:
build:
name: APK Builder When Push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Gradle cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17

- name: Change gradlew permissions
run: chmod +x ./gradlew

- name: Create Local Properties
run: touch local.properties

- name: Access Local Properties
env:
base_url: ${{ secrets.BASE_URL }}
image_url: ${{ secrets.IMAGE_URL }}
kakao_redirect_url: ${{ secrets.KAKAO_REDIRECT_URL }}
naver_redirect_url: ${{ secrets.KAKAO_REDIRECT_URL }}
kakao_api_key: ${{ secrets.KAKAO_API_KEY }}
naver_api_key: ${{ secrets.NAVER_API_KEY }}
run: |
echo base.url=\"$base_url\" >> local.properties
echo image.url=\"$image_url\" >> local.properties
echo kakao.redirect=\"$kakao_redirect_url\" >> local.properties
echo naver.redirect=\"$naver_redirect_url\" >> local.properties
echo kakao.key=\"$kakao_api_key\" >> local.properties
echo naver.key=\"$naver_api_key\" >> local.properties
- name: Access Firebase Service
run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > ./app/google-services.json

- name: Build debug APK
run: ./gradlew assembleDebug --stacktrace

- name: On Success
if: ${{ success() }}
uses: MeilCli/slack-upload-file@v1
with:
slack_token: ${{ secrets.SLACK_BOT_TOKEN}}
channels: ${{ secrets.SLACK_CHANNEL_ID}}
file_path: 'app/build/outputs/apk/debug/app-debug.apk'
file_name: 'TeumTeum.apk'
file_type: 'apk'
initial_comment: '🎉 TeumTeum이 슬랙으로 들어왔습니다.'

- name: On Failed, Notify in Slack
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: '#ff0000'
SLACK_ICON: https://play-lh.googleusercontent.com/jUeDnP2wd29y48wolu5a8j08PX3Zt-wsftTVuSR8gYgHI00sq7Zsq2jWx1icTdsISw=w240-h480-rw
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_TITLE: 'TEUMTEUM/Android debug build Fail❌'
MSG_MINIMAL: true
SLACK_USERNAME: TEUMTEUM_ANDROID
SLACK_MESSAGE: 'APK 생성 중 에러가 발생했습니다. 에러를 확인해주세요'

#name: TeumTeum Push Builder
#
#on:
# push:
# branches: [ main ]
#
#defaults:
# run:
# shell: bash
# working-directory: .
#
#jobs:
# build:
# name: APK Builder When Push
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
#
# - name: Gradle cache
# uses: actions/cache@v2
# with:
# path: |
# ~/.gradle/caches
# ~/.gradle/wrapper
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
# restore-keys: |
# ${{ runner.os }}-gradle-
# - name: set up JDK 17
# uses: actions/setup-java@v1
# with:
# java-version: 17
#
# - name: Change gradlew permissions
# run: chmod +x ./gradlew
#
# - name: Create Local Properties
# run: touch local.properties
#
# - name: Access Local Properties
# env:
# base_url: ${{ secrets.BASE_URL }}
# image_url: ${{ secrets.IMAGE_URL }}
# kakao_redirect_url: ${{ secrets.KAKAO_REDIRECT_URL }}
# naver_redirect_url: ${{ secrets.KAKAO_REDIRECT_URL }}
# kakao_api_key: ${{ secrets.KAKAO_API_KEY }}
# naver_api_key: ${{ secrets.NAVER_API_KEY }}
# run: |
# echo base.url=\"$base_url\" >> local.properties
# echo image.url=\"$image_url\" >> local.properties
# echo kakao.redirect=\"$kakao_redirect_url\" >> local.properties
# echo naver.redirect=\"$naver_redirect_url\" >> local.properties
# echo kakao.key=\"$kakao_api_key\" >> local.properties
# echo naver.key=\"$naver_api_key\" >> local.properties
#
# - name: Access Firebase Service
# run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > ./app/google-services.json
#
# - name: Build debug APK
# run: ./gradlew assembleDebug --stacktrace
#
# - name: On Success
# if: ${{ success() }}
# uses: MeilCli/slack-upload-file@v1
# with:
# slack_token: ${{ secrets.SLACK_BOT_TOKEN}}
# channels: ${{ secrets.SLACK_CHANNEL_ID}}
# file_path: 'app/build/outputs/apk/debug/app-debug.apk'
# file_name: 'TeumTeum.apk'
# file_type: 'apk'
# initial_comment: '🎉 TeumTeum이 슬랙으로 들어왔습니다.'
#
# - name: On Failed, Notify in Slack
# if: ${{ failure() }}
# uses: rtCamp/action-slack-notify@v2
# env:
# SLACK_COLOR: '#ff0000'
# SLACK_ICON: https://play-lh.googleusercontent.com/jUeDnP2wd29y48wolu5a8j08PX3Zt-wsftTVuSR8gYgHI00sq7Zsq2jWx1icTdsISw=w240-h480-rw
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
# SLACK_TITLE: 'TEUMTEUM/Android debug build Fail❌'
# MSG_MINIMAL: true
# SLACK_USERNAME: TEUMTEUM_ANDROID
# SLACK_MESSAGE: 'APK 생성 중 에러가 발생했습니다. 에러를 확인해주세요'
#
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.util.Log
import androidx.core.app.NotificationCompat
import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage
Expand Down Expand Up @@ -54,28 +55,25 @@ class TeumMessagingService : FirebaseMessagingService() {
}
}

override fun onMessageReceived(message: RemoteMessage) {
super.onMessageReceived(message)
override fun handleIntent(intent: Intent?) {
super.handleIntent(intent)

if (dataStore.onNotification) {
if (dataStore.isLogin) {
val alertMessage = Message("", "", "")
if (message.data.isNotEmpty()) {
alertMessage.title = message.notification?.title.toString()
alertMessage.body = message.notification?.body.toString()
alertMessage.type = message.data["type"].toString()
intent?.let {
val alertMessage = Message("", "", "")
alertMessage.title = intent.getStringExtra("title").toString()
alertMessage.body = intent.getStringExtra("body").toString()
alertMessage.type = intent.getStringExtra("type").toString()
if (alertMessage.type == END_MEETING) {
alertMessage.meetingId = intent.getStringExtra("meetingId")?.toLong()
alertMessage.participants =
intent.getStringExtra("participants")?.split(",")?.map { it.toInt() }
val userId = userRepository.getUserInfo()?.id?.toInt()
if (alertMessage.participants?.contains(userId) == true && alertMessage.participants?.size!! > 2)
sendNotificationAlarm(alertMessage)
} else if (alertMessage.title.isNotEmpty()) sendNotificationAlarm(alertMessage)
}
if (alertMessage.type == END_MEETING) {
alertMessage.meetingId = message.data["meetingId"]?.toLong()
// Timber.tag("teum-alerts").d("data: ${message.data}")
// Timber.tag("teum-alerts").d("participants string: ${message.data["participants"]?.split(",").toString()}")
// Timber.tag("teum-alerts").d("participants size: ${message.data["participants"]?.split(",")?.size}")
alertMessage.participants = message.data["participants"]?.split(",")?.map { it.toInt() }
val userId = userRepository.getUserInfo()?.id?.toInt()
if (alertMessage.participants?.contains(userId) == true && alertMessage.participants?.size!! > 2)
sendNotificationAlarm(alertMessage)
}
else if (alertMessage.title.isNotEmpty()) sendNotificationAlarm(alertMessage)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ class MoimFragment :
ScreenState.Success -> {
context?.defaultToast("모임 생성이 완료되었습니다")
delay(2000)
viewModel.initializeState()
}
ScreenState.BookMarkSuccess -> {
context?.defaultToast("모임 저장을 성공했습니다")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class MoimViewModel @Inject constructor(

val characterList: HashMap<Int, Int> = hashMapOf(
0 to R.drawable.ic_ghost,
1 to R.drawable.ic_star,
1 to R.drawable.ic_star_character,
2 to R.drawable.ic_bear,
3 to R.drawable.ic_raccoon,
4 to R.drawable.ic_cat,
Expand Down Expand Up @@ -262,7 +262,6 @@ class MoimViewModel @Inject constructor(
if (isOverSizeImageFound) {
viewModelScope.launch {
_snackbarEvent.emit(SnackbarEvent.FILE_OVER_10MB)
Log.d("snackbarEvent", _snackbarEvent.toString())
}
}
_imageUri.value = currentList.take(5)
Expand Down Expand Up @@ -333,13 +332,12 @@ class MoimViewModel @Inject constructor(
var timeInput = _time.value

val isAfternoon = _isAfternoon.value == "오후"
val (hourString, minute) = timeInput.split(":")
val (hourString, minuteString) = timeInput.split(":")
var hour = hourString.toInt()
val minute = if (minuteString.length == 1) "0$minuteString" else minuteString

if (isAfternoon && hour < 12) { hour += 12 }
else if (!isAfternoon && hour == 12) {
hour = 0
}
else if (!isAfternoon && hour == 12) { hour = 0 }

timeInput = "$hour:$minute"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fun MoimAddress(viewModel: MoimViewModel, navController: NavController, onClick:
Column(
modifier = Modifier
.fillMaxSize()
.background(color = TmtmColorPalette.current.GreyWhite),
.background(color = TmtmColorPalette.current.color_background),
horizontalAlignment = Alignment.Start,
verticalArrangement = Arrangement.Top,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ fun MoimHostRow(viewModel: MoimViewModel) {
modifier = Modifier
.width(147.dp)
.height(40.dp)
.clickable { }
.padding(start = 20.dp),
verticalAlignment = Alignment.CenterVertically
) {
Expand Down Expand Up @@ -606,7 +607,7 @@ fun MoimHostBtn(
modifier = Modifier
.fillMaxWidth()
.height(80.dp)
.padding(horizontal = 20.dp, vertical = 12.dp),
.padding(horizontal = 20.dp, vertical = 10.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp)
) {
androidx.compose.material3.Button(
Expand Down Expand Up @@ -679,8 +680,7 @@ fun MoimCancelBtn(
androidx.compose.material3.Button(
modifier = Modifier
.fillMaxWidth()
.height(76.dp)
.padding(horizontal = 20.dp, vertical = 10.dp),
.height(76.dp),
onClick = {
viewModel.updateSheetEvent(ScreenState.Cancel)
},
Expand Down Expand Up @@ -729,11 +729,11 @@ fun MoimJoinBtn(
androidx.compose.material3.Button(
modifier = Modifier
.fillMaxWidth()
.height(76.dp)
.padding(horizontal = 20.dp, vertical = 10.dp),
.height(76.dp),
onClick = {
onJoinGroupClick(meetingsId)
},
enabled = moimJoinUsers.size < people,
colors = ButtonDefaults.buttonColors(containerColor = TmtmColorPalette.current.color_button_active),
shape = RoundedCornerShape(size = 4.dp)
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import com.teumteum.base.component.compose.theme.TmtmColorPalette
import com.teumteum.teumteum.presentation.moim.MoimViewModel
import com.teumteum.teumteum.presentation.moim.ScreenState
import com.teumteum.teumteum.presentation.moim.TopicType
import kotlinx.coroutines.delay

@Composable
fun MoimCreateTopic(viewModel: MoimViewModel, onClick: ()->Unit) {
Expand Down Expand Up @@ -93,6 +94,7 @@ fun MoimCreateBtn(
viewModel.createMoim()
} else if (screenState == ScreenState.Success) {
navController?.navigate(R.id.fragment_home)
viewModel.initializeState()
}
else {
viewModel.goToNextScreen() }}
Expand Down Expand Up @@ -141,7 +143,6 @@ fun CreateTopicContent(viewModel: MoimViewModel, topicIndex: MutableState<Int>)
onItemSelected = {
topicIndex.value = index
viewModel.updateTopic(topicType)
Log.d("moim_topic", topicType.toString())
}
)
TmMarginVerticalSpacer(size = 12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fun MoimDateTime(viewModel: MoimViewModel, onClick: ()->Unit) {
Column(
modifier = Modifier
.fillMaxSize()
.background(color = TmtmColorPalette.current.GreyWhite),
.background(color = TmtmColorPalette.current.color_background),
horizontalAlignment = Alignment.Start,
verticalArrangement = Arrangement.Top,
) {
Expand Down Expand Up @@ -185,7 +185,10 @@ fun MoimDateColumn(viewModel: MoimViewModel) {

private fun updateTimeIfComplete(hour: String, minute: String, viewModel: MoimViewModel) {
if (hour.isNotEmpty() && minute.isNotEmpty()) {
val time = "$hour:$minute"
val formattedHour = if (hour.length == 1) "0$hour" else hour
val formattedMinute = if (minute.length == 1) "0$minute" else minute

val time = "$formattedHour:$formattedMinute"
viewModel.updateTime(time)
}
}
Expand Down Expand Up @@ -259,7 +262,7 @@ fun MoimTimeColumn(viewModel: MoimViewModel) {
)
},
onValueChange = { newText ->
timeAText = newText.take(1)
timeAText = newText.take(2)
updateTimeIfComplete(timeAText, timeBText, viewModel)
},
singleLine = true,
Expand Down
Loading

0 comments on commit 016ce12

Please sign in to comment.