Skip to content

Commit

Permalink
feat: 도서관 남은 좌석 UI 구현 (#391)
Browse files Browse the repository at this point in the history
* [추가] 도서관 feature 모듈 추가

* [수정] Manifest, gradle 파일 수정

* [추가] 구역별 좌석표시 컴포넌트

* [추가] 탑바, 바텀바, FAB 구현

* [추가] 도서관 좌석 화면 구현

* [추가] 도서관 좌석 네비게이션 추가

* [추가] FAB 애니메이션 추가

* [수정] 주석 수정

* Update feature/library/src/main/java/com/ku_stacks/ku_ring/library/compose/LibrarySeatScreen.kt

* [수정] 리뷰 기반 코드 수정

---------

Co-authored-by: HyunWoo Lee (Nunu Lee) <[email protected]>
  • Loading branch information
boiledeggg and l2hyunwoo authored Dec 21, 2024
1 parent 05508e9 commit 0d98dee
Show file tree
Hide file tree
Showing 20 changed files with 688 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ dependencies {
implementation(projects.feature.splash)
implementation(projects.feature.main)
implementation(projects.feature.kuringbot)
implementation(projects.feature.library)

implementation(libs.androidx.startup.runtime)
testImplementation(libs.kotlinx.coroutines.test)
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@
android:name=".kuringbot.KuringBotActivity"
android:exported="false"
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".library.LibrarySeatActivity"
android:exported="false"
android:windowSoftInputMode="adjustResize" />

<provider
android:name="androidx.startup.InitializationProvider"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.ku_stacks.ku_ring.edit_departments.EditDepartmentsActivity
import com.ku_stacks.ku_ring.edit_subscription.EditSubscriptionActivity
import com.ku_stacks.ku_ring.feedback.feedback.FeedbackActivity
import com.ku_stacks.ku_ring.kuringbot.KuringBotActivity
import com.ku_stacks.ku_ring.library.LibrarySeatActivity
import com.ku_stacks.ku_ring.main.MainActivity
import com.ku_stacks.ku_ring.main.search.SearchActivity
import com.ku_stacks.ku_ring.notice_detail.NoticeWebActivity
Expand Down Expand Up @@ -95,4 +96,8 @@ class KuringNavigatorImpl @Inject constructor() : KuringNavigator {
override fun navigateToKuringBot(context: Context) {
KuringBotActivity.start(context)
}

override fun navigateToLibrarySeat(activity: Activity) {
LibrarySeatActivity.start(activity)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.ku_stacks.ku_ring.designsystem.components.progress

import androidx.compose.material.CircularProgressIndicator
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.StrokeCap
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.ku_stacks.ku_ring.designsystem.components.LightAndDarkPreview
import com.ku_stacks.ku_ring.designsystem.kuringtheme.KuringTheme

@Composable
fun CircularProgressBar(
progress: Float,
strokeWidth: Dp,
modifier: Modifier = Modifier,
backgroundColor: Color = KuringTheme.colors.mainPrimary,
foregroundColor: Color = KuringTheme.colors.gray100,
strokeCap: StrokeCap = StrokeCap.Square,
) {
CircularProgressIndicator(
progress = progress,
color = foregroundColor,
backgroundColor = backgroundColor,
strokeWidth = strokeWidth,
strokeCap = strokeCap,
modifier = modifier,
)
}

@LightAndDarkPreview
@Composable
private fun CircularProgressBarPreview() {
KuringTheme{
CircularProgressBar(
progress = 0.5f,
strokeWidth = 5.dp
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.ku_stacks.ku_ring.designsystem.components.topbar

import androidx.annotation.DrawableRes
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.Icon
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.unit.dp
import com.ku_stacks.ku_ring.designsystem.R
import com.ku_stacks.ku_ring.designsystem.components.LightAndDarkPreview
import com.ku_stacks.ku_ring.designsystem.kuringtheme.KuringTheme

/**
* 뒤로 가기 버튼만 포함하는 탑바.
*
* @param navigationIconId 아이콘 아이디
* @param onNavigationIconClick 아이콘 버튼을 눌렀을 때 발생시킬 이벤트
* @param modifier 적용할 [Modifier]
*/
@Composable
fun NavigateUpTopBar(
@DrawableRes navigationIconId: Int,
onNavigationIconClick: () -> Unit,
modifier: Modifier = Modifier,
) {
Row(
modifier = modifier
.background(KuringTheme.colors.background)
.padding(start = 20.dp, top = 18.dp, bottom = 21.dp),
verticalAlignment = Alignment.CenterVertically,
) {
Icon(
imageVector = ImageVector.vectorResource(id = navigationIconId),
contentDescription = null,
tint = KuringTheme.colors.textBody,
modifier = Modifier.clickable { onNavigationIconClick() }
)

}
}

@LightAndDarkPreview
@Composable
private fun KuringIconTopBarPreview() {
KuringTheme {
NavigateUpTopBar(
onNavigationIconClick = {},
navigationIconId = R.drawable.ic_back_v2,
modifier = Modifier.fillMaxWidth(),
)
}
}
27 changes: 27 additions & 0 deletions core/designsystem/src/main/res/drawable/ic_refresh_v2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M21.167,5.333V10.333H16.167"
android:strokeLineJoin="round"
android:strokeWidth="1.25"
android:fillColor="#00000000"
android:strokeColor="#999999"
android:strokeLineCap="round"/>
<path
android:pathData="M2.833,18.667V13.667H7.833"
android:strokeLineJoin="round"
android:strokeWidth="1.25"
android:fillColor="#00000000"
android:strokeColor="#999999"
android:strokeLineCap="round"/>
<path
android:pathData="M4.925,9.5C5.347,8.306 6.066,7.238 7.013,6.396C7.96,5.555 9.104,4.966 10.34,4.687C11.576,4.407 12.862,4.445 14.079,4.797C15.296,5.149 16.404,5.804 17.3,6.7L21.166,10.333M2.833,13.667L6.7,17.3C7.595,18.196 8.703,18.851 9.92,19.203C11.137,19.555 12.424,19.593 13.659,19.313C14.895,19.034 16.04,18.445 16.987,17.604C17.934,16.762 18.652,15.694 19.075,14.5"
android:strokeLineJoin="round"
android:strokeWidth="1.25"
android:fillColor="#00000000"
android:strokeColor="#999999"
android:strokeLineCap="round"/>
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ interface KuringNavigator {
fun navigateToSplash(activity: Activity)
fun navigateToOssLicensesMenu(activity: Activity)
fun navigateToKuringBot(context: Context)
fun navigateToLibrarySeat(activity: Activity)
}
1 change: 1 addition & 0 deletions feature/library/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
20 changes: 20 additions & 0 deletions feature/library/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import com.ku_stacks.ku_ring.buildlogic.dsl.setNameSpace

plugins {
kuring("view")
kuring("compose")
}

android {
setNameSpace("feature.library")
}

dependencies {
implementation(projects.core.designsystem)
implementation(projects.core.util)
implementation(projects.data.domain)
implementation(projects.data.library)
testImplementation(projects.core.testUtil)

implementation(libs.bundles.compose.interop)
}
Empty file.
4 changes: 4 additions & 0 deletions feature/library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.ku_stacks.ku_ring.library

import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.ui.Modifier
import com.ku_stacks.ku_ring.designsystem.kuringtheme.KuringTheme
import com.ku_stacks.ku_ring.library.compose.LibrarySeatScreen
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class LibrarySeatActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()

setContent {
KuringTheme {
LibrarySeatScreen(
onBackButtonClick = ::finish,
onReservationButtonClick = {},
modifier = Modifier.fillMaxSize()
)
}
}
}

companion object {
fun start(context: Context) {
val intent = Intent(context, LibrarySeatActivity::class.java)
context.startActivity(intent)
}
}
}
Loading

0 comments on commit 0d98dee

Please sign in to comment.