Skip to content

Commit

Permalink
[#44] UI 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
ayz1070 committed Apr 17, 2024
1 parent 8d5fcd1 commit e00c0b9
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ interface BoardRepository {
suspend fun getBoardData(boardIdx:Int):BoardModel?
suspend fun getBoardList():ArrayList<BoardModel>

suspend fun insertBoard(boardModel:BoardModel)
suspend fun insertBoardData(boardModel:BoardModel)

suspend fun deleteBoard(boardModel: BoardModel)
suspend fun deleteBoardData(boardModel: BoardModel)


suspend fun updateBoard(boardModel:BoardModel, isRemoveImage:Boolean)
suspend fun updateBoardData(boardModel:BoardModel, isRemoveImage:Boolean)

suspend fun getBoardImageUri(boardIdx:Int,imageFilePath: String):Uri?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,19 @@ class BoardRepositoryImpl() : BoardRepository {
return boardList
}

override suspend fun insertBoard(boardModel: BoardModel) {
boardStore.add(boardModel)
override suspend fun insertBoardData(boardModel: BoardModel) {
boardStore.document("${boardModel.boardIdx}")
.set(boardModel)
.addOnSuccessListener {
Log.d("FirebaseResult","Success Insert Board Data")
}
.addOnFailureListener {
Log.e("FirebaseResult", "Error Insert Board Data: ${it.message}")
}

}

override suspend fun updateBoard(boardModel: BoardModel, isRemoveImage: Boolean) {
override suspend fun updateBoardData(boardModel: BoardModel, isRemoveImage: Boolean) {
try{
val query = boardStore.whereEqualTo("boardIdx",boardModel.boardIdx).get().await()

Expand All @@ -81,7 +89,7 @@ class BoardRepositoryImpl() : BoardRepository {

}

override suspend fun deleteBoard(boardModel: BoardModel) {
override suspend fun deleteBoardData(boardModel: BoardModel) {
// 삭제가 아닌 BoardState 변경
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class DetailChatFragment : Fragment() {

// 백버튼 이벤트
setNavigationOnClickListener {
chatActivity.removeFragment(ChatFragmentName.DETAIL_CHAT_FRAGMENT)
chatActivity.finish()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import kr.co.lion.mungnolza.repository.user.UserRepositoryImpl
import kr.co.lion.mungnolza.ui.freeboard.AddBoardActivity
import kr.co.lion.mungnolza.ui.freeboard.BoardActivity
import kr.co.lion.mungnolza.ui.freeboard.viewmodel.AddBoardViewModel
import kr.co.lion.mungnolza.util.BoardFragmentName
import kr.co.lion.mungnolza.util.BoardUtil
import java.text.SimpleDateFormat
import java.util.Date
Expand Down Expand Up @@ -93,14 +94,14 @@ class AddBoardFragment : Fragment() {
val boardContent = addBoardViewModel.editTextContentAddBoard.value!!
val boardImagePathList = mutableListOf<String?>()
val boardWriterIdx = ""
val simpleDateFormat = SimpleDateFormat("yyyy-MM-dd-HH-mm")
val simpleDateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm")
val boardWriteDate = simpleDateFormat.format(Date())
val boardLikeNumber = 0
val boardState = 1

val boardModel = BoardModel(boardIdx,boardTitle,boardContent,boardImagePathList,boardWriterIdx,boardWriteDate,boardWriteDate,boardLikeNumber,boardState)

boardRepository.insertBoard(boardModel)
boardRepository.insertBoardData(boardModel)

val intent = Intent(requireContext(),BoardActivity::class.java)
intent.putExtra("boardData",boardModel)
Expand Down Expand Up @@ -128,6 +129,9 @@ class AddBoardFragment : Fragment() {
toolbarAddBoard.apply {

setNavigationIcon(R.drawable.ic_arrow_back_24)
setNavigationOnClickListener {
addBoardActivity.finish()
}

inflateMenu(R.menu.menu_add_board)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ class ShowDetailBoardFragment : Fragment() {

setNavigationIcon(R.drawable.ic_arrow_back_24)
setNavigationOnClickListener {
// 백버튼 클릭 이벤트
boardActivity.removeFragment(BoardFragmentName.SHOW_DETAIL_BOARD_FRAGMENT)
boardActivity.finish()
}

inflateMenu(R.menu.menu_show_detail_board)
Expand Down
11 changes: 7 additions & 4 deletions MungNolZa/app/src/main/res/layout/fragment_bottom_comment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/layout_padding"
android:transitionGroup="true">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerViewCommentBottomComment"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
app:layout_constraintBottom_toTopOf="@+id/scrollViewComment"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -38,15 +40,15 @@
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="56dp"
android:background="@color/main_color_yellow"
android:orientation="horizontal">

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/layout_margin_end"
android:layout_marginBottom="@dimen/layout_margin_bottom"
android:layout_weight="1"
android:hint="@string/hint_input_comment"
app:endIconMode="clear_text">
Expand All @@ -60,6 +62,7 @@
android:id="@+id/divider6"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="2dp"
android:layout_weight="1"
android:background="?android:attr/listDivider" />

Expand All @@ -69,7 +72,7 @@
android:id="@+id/imageViewSendDetailChat"
android:layout_width="@dimen/icon_width_send_bottom_comment"
android:layout_height="@dimen/icon_height_send_bottom_comment"
android:layout_marginTop="@dimen/resource_margin_top"
android:layout_marginTop="15dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
app:srcCompat="@drawable/ic_send_24px" />
Expand Down
10 changes: 5 additions & 5 deletions MungNolZa/app/src/main/res/layout/fragment_detail_chat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
android:layout_height="wrap_content"
android:fontFamily="@font/binggrae_bold"
android:gravity="center"
android:paddingRight="20dp"

android:layout_marginRight="20dp"
android:text="채팅"
android:textSize="@dimen/shared_toolbar_title_size"
android:textStyle="bold"
Expand All @@ -58,8 +59,7 @@
android:id="@+id/linearLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:background="@color/main_color_yellow"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -68,7 +68,7 @@
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/layout_margin_end"
android:layout_weight="1"
android:background="@color/transparent"
Expand All @@ -78,7 +78,7 @@
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/editTextChatDetailChat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="50dp"
android:background="@color/transparent" />

<View
Expand Down
6 changes: 4 additions & 2 deletions MungNolZa/app/src/main/res/layout/fragment_free_board.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
<com.google.android.material.search.SearchBar
android:id="@+id/searchBarMain"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
app:backgroundTint="@color/main_color_yellow" />



Expand All @@ -48,7 +49,8 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginRight="16dp"
android:layout_marginBottom="64dp"
android:layout_marginBottom="70dp"
app:backgroundTint="@color/main_color_yellow"
app:srcCompat="@drawable/ic_add_24px" />

<com.google.android.material.search.SearchView
Expand Down
2 changes: 1 addition & 1 deletion MungNolZa/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<!--bottom navigation menu item-->
<string name="menu_item_bottom_navigation_home">홈</string>
<string name="menu_item_bottom_navigation_chatting">채팅</string>
<string name="menu_item_bottom_navigation_freeboard">자유 게시판</string>
<string name="menu_item_bottom_navigation_freeboard">자유게시판</string>
<string name="menu_item_bottom_navigation_reservation">예약</string>
<string name="menu_item_bottom_navigation_profile">프로필</string>

Expand Down

0 comments on commit e00c0b9

Please sign in to comment.