Skip to content

Commit

Permalink
Merge pull request #160 from PawWithU/feature/inter_management
Browse files Browse the repository at this point in the history
feature/inter_management: 봉사 관리 화면 수정
  • Loading branch information
kang9366 authored May 26, 2024
2 parents f31ca84 + 2fac064 commit 8ca28ef
Show file tree
Hide file tree
Showing 232 changed files with 971 additions and 236 deletions.
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ dependencies {
implementation(project(":feature:intermediator"))

implementation(libs.androidx.core.splashscreen)
implementation(libs.google.playintegrity)

kapt(libs.hilt.compiler)
implementation(libs.hilt.android)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ object Configuration {
const val compileSdk = 34
const val targetSdk = 34
const val minSdk = 30
const val versionCode = 1
const val versionCode = 15
const val majorVersion = 1
const val minorVersion = 0
const val patchVersion = 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.kusitms.connectdog.core.data.api

import com.kusitms.connectdog.core.data.api.model.FcmTokenRequestBody
import com.kusitms.connectdog.core.data.api.model.IsDuplicatePhoneNumberBody
import com.kusitms.connectdog.core.data.api.model.IsDuplicatePhoneNumberResponse
import com.kusitms.connectdog.core.data.api.model.Response
import com.kusitms.connectdog.core.data.api.model.ReviewResponseItem
import com.kusitms.connectdog.core.data.api.model.VolunteerResponse
import com.kusitms.connectdog.core.data.api.model.intermediator.InterAnnouncementDetailResponse
import com.kusitms.connectdog.core.data.api.model.intermediator.InterApplicationCompletedResponseItem
import com.kusitms.connectdog.core.data.api.model.intermediator.InterApplicationInProgressResponseItem
import com.kusitms.connectdog.core.data.api.model.intermediator.InterApplicationRecruitingResponseItem
Expand Down Expand Up @@ -92,6 +94,11 @@ internal interface InterApiService {
@Path("reviewId") reviewId: Long
): ReviewDetailResponse

@GET("/intermediaries/posts/{postId}")
suspend fun getAnnouncementDetail(
@Path("postId") postId: Long
): InterAnnouncementDetailResponse

/**
* 이동봉사 모집자 프로필
* */
Expand All @@ -109,4 +116,14 @@ internal interface InterApiService {
@Query("page") page: Int?,
@Query("size") size: Int?
): List<InterProfileFindingResponseItem>

@DELETE("/intermediaries/posts/{postId}")
suspend fun deleteAnnouncement(
@Path("postId") postId: Long
)

@POST("/intermediaries/fcm")
suspend fun postFcmToken(
@Body fcmToken: FcmTokenRequestBody
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.kusitms.connectdog.core.data.api.model.intermediator

import com.kusitms.connectdog.core.data.api.model.volunteer.NoticeDetailResponseItem

data class InterAnnouncementDetailResponse(
val arrivalLoc: String,
val content: String,
val departureLoc: String,
val dogName: String,
val dogSize: String,
val endDate: String,
val images: List<String>,
val intermediaryId: Int,
val intermediaryName: String,
val intermediaryProfileImage: String,
val isKennel: Boolean,
val mainImage: String,
val pickUpTime: String,
val postId: Int,
val postStatus: String,
val specifics: String?,
val startDate: String
) {
fun toData() = NoticeDetailResponseItem(
arrivalLoc, content, departureLoc, dogName, dogSize, endDate, images, intermediaryId, intermediaryName, intermediaryProfileImage, isBookmark = false, isKennel, mainImage, pickUpTime, postId, postStatus, specifics, startDate
)
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.kusitms.connectdog.core.data.repository

import com.kusitms.connectdog.core.data.api.model.FcmTokenRequestBody
import com.kusitms.connectdog.core.data.api.model.intermediator.IntermediatorProfileInfoResponseItem
import com.kusitms.connectdog.core.data.api.model.volunteer.NoticeDetailResponseItem
import com.kusitms.connectdog.core.data.api.model.volunteer.ReviewDetailResponse
import com.kusitms.connectdog.core.model.ConnectDogResult
import com.kusitms.connectdog.core.model.InterApplication
Expand All @@ -17,4 +19,7 @@ interface InterManagementRepository {
suspend fun rejectApplicationVolunteer(applicationId: Long): ConnectDogResult
suspend fun completeApplication(applicationId: Long): ConnectDogResult
suspend fun getReviewDetail(reviewId: Long): ReviewDetailResponse
suspend fun getAnnouncementDetail(postId: Long): NoticeDetailResponseItem
suspend fun postFcmToken(fcmToken: FcmTokenRequestBody)
suspend fun deleteAnnouncement(postId: Long)
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.kusitms.connectdog.core.data.repository

import com.kusitms.connectdog.core.data.api.InterApiService
import com.kusitms.connectdog.core.data.api.model.FcmTokenRequestBody
import com.kusitms.connectdog.core.data.api.model.intermediator.IntermediatorProfileInfoResponseItem
import com.kusitms.connectdog.core.data.api.model.volunteer.NoticeDetailResponseItem
import com.kusitms.connectdog.core.data.api.model.volunteer.ReviewDetailResponse
import com.kusitms.connectdog.core.data.mapper.intermediator.toData
import com.kusitms.connectdog.core.data.mapper.toData
Expand Down Expand Up @@ -52,4 +54,16 @@ internal class InterManagementRepositoryImpl @Inject constructor(
override suspend fun getReviewDetail(reviewId: Long): ReviewDetailResponse {
return api.getReviewDetail(reviewId)
}

override suspend fun getAnnouncementDetail(postId: Long): NoticeDetailResponseItem {
return api.getAnnouncementDetail(postId).toData()
}

override suspend fun postFcmToken(fcmToken: FcmTokenRequestBody) {
api.postFcmToken(fcmToken)
}

override suspend fun deleteAnnouncement(postId: Long) {
api.deleteAnnouncement(postId)
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
,
+
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
٭
��
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
25
28
0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
j
t
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private fun Content(
Column(
modifier = Modifier.wrapContentSize()
) {
TopAppBar(titleRes = titleRes) { onDismissRequest() }
BottomSheetTopAppBar(titleRes = titleRes) { onDismissRequest() }
Column(
modifier = Modifier.padding(20.dp)
) {
Expand All @@ -114,7 +114,7 @@ private fun Content(
}

@Composable
private fun TopAppBar(
private fun BottomSheetTopAppBar(
@StringRes titleRes: Int,
onBackClick: () -> Unit
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.kusitms.connectdog.core.designsystem.R
import com.kusitms.connectdog.core.designsystem.component.text.TextWithIcon
import com.kusitms.connectdog.core.designsystem.theme.Gray1
import com.kusitms.connectdog.core.designsystem.theme.Gray2
import com.kusitms.connectdog.core.designsystem.theme.Gray3
Expand Down Expand Up @@ -321,7 +322,7 @@ private fun IntermediatorInfo(
.padding(horizontal = 20.dp)
) {
NetworkImage(
imageUrl = "",
imageUrl = review.postMainImage,
modifier = Modifier.size(50.dp)
)
Spacer(modifier = Modifier.width(12.dp))
Expand Down Expand Up @@ -364,9 +365,18 @@ private fun IntermediatorInfo(
Row(
verticalAlignment = Alignment.CenterVertically
) {
Icon(painter = painterResource(id = R.drawable.ic_clock), contentDescription = null, tint = Gray2)
Icon(
painter = painterResource(id = R.drawable.ic_clock),
contentDescription = null,
tint = Gray2
)
Spacer(modifier = Modifier.width(6.dp))
Text(text = "text", fontSize = 12.sp, fontWeight = FontWeight.Medium, color = Gray2)
Text(
text = review.date,
fontSize = 12.sp,
fontWeight = FontWeight.Medium,
color = Gray2
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.kusitms.connectdog.core.designsystem.R
import com.kusitms.connectdog.core.designsystem.theme.ConnectDogTheme
import com.kusitms.connectdog.core.designsystem.theme.Red1

@Composable
fun ConnectDogTopAppBar(
Expand Down Expand Up @@ -151,6 +152,63 @@ fun ConnectDogIntermediatorTopAppBar(
}
}

@Composable
fun ConnectDogDetailTopAppBar(
onBackClick: () -> Unit,
onShareClick: () -> Unit
) {
ConnectDogTopAppBar(
titleRes = null,
navigationType = TopAppBarNavigationType.BACK,
navigationIconContentDescription = "Navigation icon home",
onNavigationClick = onBackClick,
actionButtons = {
IconButton(onClick = onShareClick) {
Icon(
painter = painterResource(id = R.drawable.ic_share),
contentDescription = "Navigate to Search"
)
}
}
)
}

@Composable
fun ConnectDogDetailTopAppBar(
onBackClick: () -> Unit,
onShareClick: () -> Unit,
onDeleteClick: () -> Unit,
onEditClick: () -> Unit
) {
ConnectDogTopAppBar(
titleRes = null,
navigationType = TopAppBarNavigationType.BACK,
navigationIconContentDescription = "Navigation icon home",
onNavigationClick = onBackClick,
actionButtons = {
IconButton(onClick = onShareClick) {
Icon(
painter = painterResource(id = R.drawable.ic_share),
contentDescription = "Navigate to Search"
)
}
IconButton(onClick = onEditClick) {
Icon(
painter = painterResource(id = R.drawable.ic_edit),
contentDescription = "Navigate to Search"
)
}
IconButton(onClick = onDeleteClick) {
Icon(
painter = painterResource(id = R.drawable.ic_delete),
contentDescription = "Navigate to Search",
tint = Red1
)
}
}
)
}

@Composable
private fun HomeIcon(
modifier: Modifier = Modifier,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package com.kusitms.connectdog.core.designsystem.component.button

import android.util.Log
import androidx.compose.foundation.Image
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import com.kusitms.connectdog.core.designsystem.R
import com.kusitms.connectdog.core.designsystem.theme.Gray2
import com.kusitms.connectdog.core.designsystem.theme.Gray5
import com.kusitms.connectdog.core.designsystem.theme.PetOrange

@Composable
fun BookmarkButton(
isBookmark: Boolean,
onSaveClick: () -> Unit,
onDeleteClick: () -> Unit
) {
var isActive by remember { mutableStateOf(isBookmark) }
val shape = RoundedCornerShape(12.dp)
val (imageResource, setImageResource) = remember { mutableIntStateOf(if (isActive) R.drawable.ic_bookmark_filled else R.drawable.ic_bookmark) }
val (borderColor, setBorderColor) = remember { mutableStateOf(if (isActive) PetOrange else Gray5) }
val imagePainter: Painter = painterResource(id = imageResource)

Button(
onClick = {
isActive = !isActive
setImageResource(if (isActive) R.drawable.ic_bookmark_filled else R.drawable.ic_bookmark)
setBorderColor(if (isActive) PetOrange else Gray5)
Log.d("testsss", isActive.toString())
if (isActive) {
onSaveClick()
} else {
onDeleteClick()
}
},
contentPadding = PaddingValues(vertical = 16.dp),
shape = shape,
modifier = Modifier
.width(56.dp)
.height(56.dp)
.border(
width = 1.dp,
color = borderColor,
shape = shape
),
colors = ButtonDefaults.buttonColors(containerColor = Color.White, contentColor = Gray2)
) {
Image(
painter = imagePainter,
contentDescription = null
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.kusitms.connectdog.core.designsystem.component.button

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.kusitms.connectdog.core.designsystem.R
import com.kusitms.connectdog.core.designsystem.theme.Gray2
import com.kusitms.connectdog.core.designsystem.theme.Gray5

@Composable
fun ProfileButton(onClick: () -> Unit, modifier: Modifier) {
val shape = RoundedCornerShape(8.dp)
Button(
onClick = onClick,
shape = shape,
modifier = modifier,
colors = ButtonDefaults.outlinedButtonColors(
contentColor = Gray2
),
border = BorderStroke(1.dp, Gray5),
contentPadding = PaddingValues(all = 8.dp)
) {
Text(
text = stringResource(id = R.string.profile_button),
fontSize = 12.sp,
fontWeight = FontWeight.SemiBold,
color = Gray2
)
}
}
Loading

0 comments on commit 8ca28ef

Please sign in to comment.