Skip to content

Commit

Permalink
feat: 댓글방 참여자 목록 Drawer Layout UI 구현 (#136)
Browse files Browse the repository at this point in the history
* feat: 참여자 목록 drawer에 필요한 리소스 파일 추가

* refactor: 채팅 text gravity 수정

* feat: 댓글방 참여자 목록 Drawer Layout UI 구현

* style: ktlint 적용

* refactor: drawer early return 하는 방식으로 변경

* refactor: ivMore -> ivMoreOptions으로 네이밍 변경

* feat: 공구 참여자 item view 및 댓글방 view 사용자 친화적으로 수정
  • Loading branch information
chaehyuns authored Jul 30, 2024
1 parent 0c59f41 commit a36190b
Show file tree
Hide file tree
Showing 8 changed files with 414 additions and 262 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.content.Intent
import android.os.Bundle
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.GravityCompat
import androidx.core.view.doOnPreDraw
import androidx.databinding.DataBindingUtil
import androidx.recyclerview.widget.LinearLayoutManager
Expand Down Expand Up @@ -45,21 +46,27 @@ class CommentDetailActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
initBinding()
setupDrawerToggle()
initAdapter()
setUpCommentsObserve()
}

override fun onDestroy() {
super.onDestroy()
_binding = null
}

private fun initBinding() {
_binding = DataBindingUtil.setContentView(this, R.layout.activity_comment_detail)
binding.vm = viewModel
binding.lifecycleOwner = this
}

private fun setupDrawerToggle() {
binding.ivMoreOptions.setOnClickListener {
if (binding.drawerLayout.isDrawerOpen(GravityCompat.END)) {
binding.drawerLayout.closeDrawer(GravityCompat.END)
return@setOnClickListener
}
binding.drawerLayout.openDrawer(GravityCompat.END)
}
}

private fun initAdapter() {
binding.rvComments.apply {
adapter = commentAdapter
Expand All @@ -80,6 +87,11 @@ class CommentDetailActivity : AppCompatActivity() {
}
}

override fun onDestroy() {
super.onDestroy()
_binding = null
}

companion object {
private const val EXTRA_DEFAULT_VALUE = 1L
private const val EXTRA_OFFERING_ID_KEY = "offering_id_key"
Expand Down
13 changes: 13 additions & 0 deletions android/app/src/main/res/drawable/btn_exit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<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="M15,4.001H5V18.001C5,18.531 5.211,19.04 5.586,19.415C5.961,19.79 6.47,20.001 7,20.001H15M16,15.001L19,12.001M19,12.001L16,9.001M19,12.001H9"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#606060"
android:strokeLineCap="round"/>
</vector>
583 changes: 327 additions & 256 deletions android/app/src/main/res/layout/activity_comment_detail.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion android/app/src/main/res/layout/item_my_comment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
android:background="@drawable/bg_comment_main_color"
android:ellipsize="end"
android:fontFamily="@font/suit_medium"
android:gravity="right"
android:gravity="left"
android:maxLines="10"
android:paddingStart="@dimen/size_10"
android:paddingTop="@dimen/size_7"
Expand Down
44 changes: 44 additions & 0 deletions android/app/src/main/res/layout/item_offering_member.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<data>

<variable
name="commentRoom"
type="com.zzang.chongdae.domain.model.CommentRoom" />

<variable
name="onCommentRoomClickListener"
type="com.zzang.chongdae.presentation.view.comment.adapter.OnCommentRoomClickListener" />
</data>


<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<ImageView
android:id="@+id/iv_profile"
android:layout_width="@dimen/size_30"
android:layout_height="@dimen/size_30"
android:layout_marginStart="@dimen/margin_20"
android:layout_marginTop="@dimen/size_10"
android:layout_marginBottom="@dimen/size_10"
android:src="@drawable/img_profile"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/tv_offering_title"
style="@style/Theme.AppCompat.TextView.Normal.Gray900.Size17"
android:layout_marginStart="13dp"
app:layout_constraintBottom_toBottomOf="@+id/iv_profile"
app:layout_constraintStart_toEndOf="@id/iv_profile"
app:layout_constraintTop_toTopOf="@+id/iv_profile"
tools:text="참여자1" />

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
3 changes: 3 additions & 0 deletions android/app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
<dimen name="size_100">100dp</dimen>
<dimen name="size_120">120dp</dimen>
<dimen name="size_150">150dp</dimen>
<dimen name="size_200">200dp</dimen>
<dimen name="size_250">250dp</dimen>
<dimen name="size_300">300dp</dimen>

<!-- font size -->
<dimen name="font_size_72">72sp</dimen>
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<string name="schedule_confirm">일정확정</string>
<string name="purchase_confirm">구매확정</string>
<string name="deal_confirm">거래확정</string>
<string name="offering_members">참여자 목록</string>

<!-- offering_write-->
<string name="write_information_message">공동 구매할 물품에 대한 정보를 \n입력해주세요.</string>
Expand Down
8 changes: 8 additions & 0 deletions android/app/src/main/res/values/style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,12 @@
<item name="android:fontFamily">@font/suit_medium</item>
</style>

<style name="Theme.AppCompat.TextView.Normal.Gray900.Size17" parent="@style/Widget.AppCompat.TextView">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textSize">@dimen/size_17</item>
<item name="fontFamily">@font/suit_medium</item>
<item name="android:textColor">@color/gray_900</item>
</style>

</resources>

0 comments on commit a36190b

Please sign in to comment.