diff --git a/android/app/src/main/java/com/ddangddangddang/android/feature/detail/bidHistory/BidHistoryAdapter.kt b/android/app/src/main/java/com/ddangddangddang/android/feature/detail/bidHistory/BidHistoryAdapter.kt index 096d4e855..9f584a0f3 100644 --- a/android/app/src/main/java/com/ddangddangddang/android/feature/detail/bidHistory/BidHistoryAdapter.kt +++ b/android/app/src/main/java/com/ddangddangddang/android/feature/detail/bidHistory/BidHistoryAdapter.kt @@ -3,15 +3,11 @@ package com.ddangddangddang.android.feature.detail.bidHistory import android.view.ViewGroup import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.ListAdapter -import com.ddangddangddang.android.di.DefaultDateTimeFormatter import com.ddangddangddang.android.model.BidHistoryModel -import dagger.hilt.android.scopes.ActivityRetainedScoped import java.time.format.DateTimeFormatter -import javax.inject.Inject -@ActivityRetainedScoped -class BidHistoryAdapter @Inject constructor( - @DefaultDateTimeFormatter private val dateTimeFormatter: DateTimeFormatter, +class BidHistoryAdapter( + private val dateTimeFormatter: DateTimeFormatter, ) : ListAdapter(BidHistoryDiffUtil) { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BidHistoryViewHolder { return BidHistoryViewHolder.create(parent, dateTimeFormatter) diff --git a/android/app/src/main/java/com/ddangddangddang/android/feature/detail/bidHistory/BidHistoryFragment.kt b/android/app/src/main/java/com/ddangddangddang/android/feature/detail/bidHistory/BidHistoryFragment.kt index 7ea1fe63d..f94ac7345 100644 --- a/android/app/src/main/java/com/ddangddangddang/android/feature/detail/bidHistory/BidHistoryFragment.kt +++ b/android/app/src/main/java/com/ddangddangddang/android/feature/detail/bidHistory/BidHistoryFragment.kt @@ -8,10 +8,12 @@ import androidx.fragment.app.viewModels import androidx.recyclerview.widget.DividerItemDecoration import com.ddangddangddang.android.R import com.ddangddangddang.android.databinding.FragmentBidHistoryBinding +import com.ddangddangddang.android.di.DefaultDateTimeFormatter import com.ddangddangddang.android.feature.common.notifyFailureMessage import com.ddangddangddang.android.feature.detail.AuctionDetailViewModel import com.ddangddangddang.android.util.binding.BindingFragment import dagger.hilt.android.AndroidEntryPoint +import java.time.format.DateTimeFormatter import javax.inject.Inject @AndroidEntryPoint @@ -21,7 +23,12 @@ class BidHistoryFragment : private val viewModel: BidHistoryViewModel by viewModels() @Inject - lateinit var bidHistoryAdapter: BidHistoryAdapter + @DefaultDateTimeFormatter + lateinit var dateTimeFormatter: DateTimeFormatter + + private val bidHistoryAdapter: BidHistoryAdapter by lazy { + BidHistoryAdapter(dateTimeFormatter) + } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) diff --git a/android/app/src/main/java/com/ddangddangddang/android/feature/messageRoom/MessageAdapter.kt b/android/app/src/main/java/com/ddangddangddang/android/feature/messageRoom/MessageAdapter.kt index 4975dfd7d..3449f4681 100644 --- a/android/app/src/main/java/com/ddangddangddang/android/feature/messageRoom/MessageAdapter.kt +++ b/android/app/src/main/java/com/ddangddangddang/android/feature/messageRoom/MessageAdapter.kt @@ -3,16 +3,11 @@ package com.ddangddangddang.android.feature.messageRoom import android.view.ViewGroup import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.ListAdapter -import com.ddangddangddang.android.di.DateFormatter -import com.ddangddangddang.android.di.TimeFormatter -import dagger.hilt.android.scopes.ActivityRetainedScoped import java.time.format.DateTimeFormatter -import javax.inject.Inject -@ActivityRetainedScoped -class MessageAdapter @Inject constructor( - @DateFormatter private val dateFormatter: DateTimeFormatter, - @TimeFormatter private val timeFormatter: DateTimeFormatter, +class MessageAdapter( + private val dateFormatter: DateTimeFormatter, + private val timeFormatter: DateTimeFormatter, ) : ListAdapter(MessageDiffUtil) { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MessageViewHolder { return MessageViewHolder.of( diff --git a/android/app/src/main/java/com/ddangddangddang/android/feature/messageRoom/MessageRoomActivity.kt b/android/app/src/main/java/com/ddangddangddang/android/feature/messageRoom/MessageRoomActivity.kt index d421c28ed..5be8dbb3c 100644 --- a/android/app/src/main/java/com/ddangddangddang/android/feature/messageRoom/MessageRoomActivity.kt +++ b/android/app/src/main/java/com/ddangddangddang/android/feature/messageRoom/MessageRoomActivity.kt @@ -8,6 +8,8 @@ import androidx.recyclerview.widget.ConcatAdapter import androidx.recyclerview.widget.LinearLayoutManager import com.ddangddangddang.android.R import com.ddangddangddang.android.databinding.ActivityMessageRoomBinding +import com.ddangddangddang.android.di.DateFormatter +import com.ddangddangddang.android.di.TimeFormatter import com.ddangddangddang.android.feature.detail.AuctionDetailActivity import com.ddangddangddang.android.feature.messageRoom.review.UserReviewDialog import com.ddangddangddang.android.feature.report.ReportActivity @@ -21,6 +23,7 @@ import com.ddangddangddang.android.reciever.MessageReceiver import com.ddangddangddang.android.util.binding.BindingActivity import com.ddangddangddang.android.util.view.showSnackbar import dagger.hilt.android.AndroidEntryPoint +import java.time.format.DateTimeFormatter import javax.inject.Inject @AndroidEntryPoint @@ -31,7 +34,16 @@ class MessageRoomActivity : private val roomCreatedNotifyAdapter by lazy { RoomCreatedNotifyAdapter() } @Inject - lateinit var messageAdapter: MessageAdapter + @DateFormatter + lateinit var dateFormatter: DateTimeFormatter + + @Inject + @TimeFormatter + lateinit var timeFormatter: DateTimeFormatter + + private val messageAdapter: MessageAdapter by lazy { + MessageAdapter(dateFormatter, timeFormatter) + } private val adapter by lazy { ConcatAdapter(roomCreatedNotifyAdapter, messageAdapter) } diff --git a/android/app/src/main/java/com/ddangddangddang/android/model/SellerModel.kt b/android/app/src/main/java/com/ddangddangddang/android/model/SellerModel.kt index 27ec59546..323a897e7 100644 --- a/android/app/src/main/java/com/ddangddangddang/android/model/SellerModel.kt +++ b/android/app/src/main/java/com/ddangddangddang/android/model/SellerModel.kt @@ -5,4 +5,8 @@ data class SellerModel( val profileUrl: String, val nickname: String, val reliability: Float?, -) +) { + fun toProfileModel(): ProfileModel { + return ProfileModel(nickname, profileUrl, reliability) + } +} diff --git a/android/app/src/main/res/layout-land/activity_auction_detail.xml b/android/app/src/main/res/layout-land/activity_auction_detail.xml index eb889d4da..5c7293a5d 100644 --- a/android/app/src/main/res/layout-land/activity_auction_detail.xml +++ b/android/app/src/main/res/layout-land/activity_auction_detail.xml @@ -275,10 +275,10 @@ android:id="@+id/tb_detail_info" android:layout_width="match_parent" android:layout_height="48dp" - android:background="@color/grey_50" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tv_auctioneer_count" + app:tabBackground="@color/grey_50" app:tabGravity="fill" app:tabIndicatorFullWidth="true" app:tabMaxWidth="0dp" diff --git a/android/app/src/main/res/layout/activity_auction_detail.xml b/android/app/src/main/res/layout/activity_auction_detail.xml index 2650d35e9..2117e0a63 100644 --- a/android/app/src/main/res/layout/activity_auction_detail.xml +++ b/android/app/src/main/res/layout/activity_auction_detail.xml @@ -282,7 +282,7 @@ android:id="@+id/tb_detail_info" android:layout_width="match_parent" android:layout_height="48dp" - android:background="@color/grey_50" + app:tabBackground="@color/grey_50" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tv_auctioneer_count" diff --git a/android/app/src/main/res/layout/fragment_auction_info.xml b/android/app/src/main/res/layout/fragment_auction_info.xml index 64b1d757b..aef524cb2 100644 --- a/android/app/src/main/res/layout/fragment_auction_info.xml +++ b/android/app/src/main/res/layout/fragment_auction_info.xml @@ -82,72 +82,17 @@ app:layout_constraintTop_toBottomOf="@id/tv_direct_exchange_regions" tools:itemCount="3" /> - - - - - - + app:layout_constraintStart_toStartOf="@id/gl_begin" + app:layout_constraintTop_toBottomOf="@id/rv_direct_exchange_regions" + app:profile="@{activityViewModel.auctionDetailModel.sellerModel.toProfileModel()}" /> - - - - - diff --git a/android/app/src/main/res/layout/fragment_my_page.xml b/android/app/src/main/res/layout/fragment_my_page.xml index ea9cd99cb..867a7ecc5 100644 --- a/android/app/src/main/res/layout/fragment_my_page.xml +++ b/android/app/src/main/res/layout/fragment_my_page.xml @@ -24,11 +24,11 @@ app:layout_constraintTop_toTopOf="parent"> + android:text="@string/mypage" /> @@ -119,8 +120,8 @@ layout="@layout/view_my_page_feature_category" android:layout_width="match_parent" android:layout_height="wrap_content" - android:visibility="gone" android:onClick="@{() -> viewModel.navigateToAnnouncement()}" + android:visibility="gone" app:layout_constraintTop_toBottomOf="@id/tv_notification_settings_button" bind:categoryName="@{@string/mypage_announcement_button}" /> @@ -155,12 +156,12 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="16dp" + android:onClick="@{() -> viewModel.askWithdrawal()}" android:text="@string/mypage_delete_account_button" android:textColor="@color/grey_500" android:textSize="14sp" app:layout_constraintEnd_toEndOf="@id/gl_end" - app:layout_constraintTop_toBottomOf="@id/tv_logout_button" - android:onClick="@{() -> viewModel.askWithdrawal()}" /> + app:layout_constraintTop_toBottomOf="@id/tv_logout_button" /> diff --git a/android/app/src/main/res/layout/item_bid_history.xml b/android/app/src/main/res/layout/item_bid_history.xml index a494b065e..d1286340c 100644 --- a/android/app/src/main/res/layout/item_bid_history.xml +++ b/android/app/src/main/res/layout/item_bid_history.xml @@ -50,7 +50,8 @@ style="@style/Caption" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:maxLines="1" + android:gravity="center" + android:maxLines="2" android:text="@{item.bidDateTime.format(dateTimeFormatter)}" android:textColor="@color/grey_500" app:layout_constraintBottom_toBottomOf="@id/tv_bid_price" diff --git a/android/app/src/main/res/layout/view_profile.xml b/android/app/src/main/res/layout/view_profile.xml index c9158b8a4..78c3fa9cc 100644 --- a/android/app/src/main/res/layout/view_profile.xml +++ b/android/app/src/main/res/layout/view_profile.xml @@ -11,7 +11,7 @@ 최신 버전으로 업데이트가 필요합니다. yyyy년 M월 d일 h:mm a - yyyy-MM-dd HH:mm:ss + yyyy-MM-dd\nHH:mm:ss ( - ) \'뒤로\' 버튼을 한번 더 누르시면 종료됩니다 %,d 원