Skip to content

Commit

Permalink
v6.0.1 릴리즈
Browse files Browse the repository at this point in the history
v6.0.1 릴리즈
  • Loading branch information
ippnsj authored Oct 24, 2023
2 parents 1ef3c31 + bab9100 commit 336290e
Show file tree
Hide file tree
Showing 480 changed files with 13,916 additions and 3,098 deletions.
7 changes: 5 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ android {
minSdk 28
targetSdk 33

versionCode 12
versionName "5.1.2"
versionCode 14
versionName "6.0.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down Expand Up @@ -110,6 +110,9 @@ dependencies {

// app update manager
implementation 'com.google.android.play:app-update-ktx:2.1.0'

// photo view 확대 가능 이미지뷰 라이브러리
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
}
kapt {
correctErrorTypes true
Expand Down
7 changes: 6 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
android:theme="@style/Theme.DdangDdangDdang"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name=".feature.onboarding.OnBoardingActivity"
android:exported="false" />
<activity
android:name=".feature.imageDetail.ImageDetailActivity"
android:exported="false" />
Expand Down Expand Up @@ -68,7 +71,9 @@
<activity
android:name=".feature.main.MainActivity"
android:exported="false"
android:windowSoftInputMode="adjustPan" />
android:windowSoftInputMode="adjustPan"
android:taskAffinity=""
android:excludeFromRecents="true" />
<activity
android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
android:exported="true">
Expand Down
Binary file modified android/app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ annotation class DateFormatter
@Qualifier
@Retention(AnnotationRetention.BINARY)
annotation class TimeFormatter

@Qualifier
@Retention(AnnotationRetention.BINARY)
annotation class DefaultDateTimeFormatter
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,14 @@ object FormatterModule {
Locale.KOREAN,
)
}

@DefaultDateTimeFormatter
@Singleton
@Provides
fun provideDefaultDateTimeFormatter(@ApplicationContext context: Context): DateTimeFormatter {
return DateTimeFormatter.ofPattern(
context.getString(R.string.all_date_time_format),
Locale.KOREAN,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,8 @@ fun Chip.onCloseClick(onCloseClick: () -> Unit) {
fun TextView.setTextOrEmpty(text: String?) {
this.text = text ?: ""
}

@BindingAdapter("isSelected")
fun View.isSelected(isSelected: Boolean) {
this.isSelected = isSelected
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,50 @@
package com.ddangddangddang.android.feature.common

import android.app.Activity
import android.view.View
import androidx.annotation.StringRes
import androidx.fragment.app.Fragment
import com.ddangddangddang.android.util.view.Toaster
import com.ddangddangddang.android.util.view.showSnackbar

fun Activity.notifyFailureMessage(errorType: ErrorType, @StringRes defaultMessageId: Int) {
val defaultMessage = getString(defaultMessageId)
Toaster.showShort(this, errorType.message ?: defaultMessage)
}

fun Fragment.notifyFailureMessage(errorType: ErrorType, @StringRes defaultMessageId: Int) {
val defaultMessage = getString(defaultMessageId)
Toaster.showShort(requireContext(), errorType.message ?: defaultMessage)
}

fun Activity.notifyFailureSnackBar(
anchorView: View,
errorType: ErrorType,
@StringRes defaultMessageId: Int,
@StringRes actionMessageId: Int,
action: () -> Unit = {},
) {
val defaultMessage = getString(defaultMessageId)
val actionMessage = getString(actionMessageId)
anchorView.showSnackbar(
message = errorType.message ?: defaultMessage,
actionMessage = actionMessage,
action,
)
}

fun Fragment.notifyFailureSnackBar(
anchorView: View,
errorType: ErrorType,
@StringRes defaultMessageId: Int,
@StringRes actionMessageId: Int,
action: () -> Unit = {},
) {
val defaultMessage = getString(defaultMessageId)
val actionMessage = getString(actionMessageId)
anchorView.showSnackbar(
message = errorType.message ?: defaultMessage,
actionMessage = actionMessage,
action,
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.ddangddangddang.android.feature.common

import android.text.Editable
import android.text.TextWatcher

class PriceTextWatcher(private val onAfterChanged: (String) -> Unit) : TextWatcher {
private var cursorPositionFromEnd: Int = 0

override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}

override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
s?.let { str ->
cursorPositionFromEnd = str.length - (start + count)
moveCursorIfOnlyCommaRemoved(str, before)
}
}

private fun moveCursorIfOnlyCommaRemoved(str: CharSequence, before: Int) {
val strOnlyNumber = str.filter { it.isDigit() }
val expectedCommaCount = (strOnlyNumber.length - 1) / 3

// 쉼표의 개수가 적고 지워진 문자가 1개인 경우 커서를 앞으로 1 움직입니다.
val actualCommaCount = str.count { it == ',' }
if (actualCommaCount < expectedCommaCount && before == 1) {
cursorPositionFromEnd++
}
}

override fun afterTextChanged(s: Editable?) {
s?.let { onAfterChanged(s.toString()) }
}

fun getCursorPosition(
textLength: Int,
defaultCursorPositionFromEnd: Int,
): Int {
cursorPositionFromEnd =
if (cursorPositionFromEnd > 0) cursorPositionFromEnd else defaultCursorPositionFromEnd
val cursorPosition = textLength - cursorPositionFromEnd
return if (cursorPosition > 0) cursorPosition else 0
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import com.ddangddangddang.android.feature.detail.bid.AuctionBidDialog
import com.ddangddangddang.android.feature.imageDetail.ImageDetailActivity
import com.ddangddangddang.android.feature.messageRoom.MessageRoomActivity
import com.ddangddangddang.android.feature.report.ReportActivity
import com.ddangddangddang.android.model.ReportType
import com.ddangddangddang.android.notification.NotificationType
import com.ddangddangddang.android.model.ReportInfo
import com.ddangddangddang.android.notification.cancelActiveNotification
import com.ddangddangddang.android.util.binding.BindingActivity
import com.ddangddangddang.android.util.view.Toaster
Expand All @@ -31,11 +30,18 @@ class AuctionDetailActivity :
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.viewModel = viewModel
setupDetailView()
setupViewModel()

if (savedInstanceState == null) viewModel.loadAuctionDetail(auctionId)
}

private fun setupDetailView() {
binding.vpDetailInfo.adapter = DetailFragmentAdapter(supportFragmentManager, lifecycle)
TabLayoutMediator(binding.tbDetailInfo, binding.vpDetailInfo) { tab, position ->
tab.text = getString(DetailFragmentType.getTypeFrom(position).nameId)
}.attach()
}

private fun setupViewModel() {
observeLoadingWithDialog(
this,
Expand Down Expand Up @@ -91,7 +97,7 @@ class AuctionDetailActivity :
}

private fun navigateToReport(auctionId: Long) {
startActivity(ReportActivity.getIntent(this, ReportType.ArticleReport.ordinal, auctionId))
startActivity(ReportActivity.getIntent(this, ReportInfo.ArticleReportInfo(auctionId)))
}

private fun navigateToImageDetail(images: List<String>, focusPosition: Int) {
Expand Down Expand Up @@ -147,7 +153,7 @@ class AuctionDetailActivity :
}

private fun cancelNotification() {
cancelActiveNotification(NotificationType.BID.name, auctionId.toInt())
cancelActiveNotification(auctionId.toInt())
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ enum class AuctionDetailBottomButtonStatus(
EnterAuctionChatRoom(R.string.detail_auction_chat_room_entrance, true),

MyAuction(R.string.detail_auction_my_auction, false),

AlreadyLastBidder(R.string.detail_auction_already_last_bidder, false),
;

companion object {
Expand All @@ -26,10 +28,18 @@ enum class AuctionDetailBottomButtonStatus(
val isOwner = auctionDetailModel.isOwner
val auctionStatus = auctionDetailModel.auctionDetailStatusModel
val chatStatus = auctionDetailModel.chatAuctionDetailModel
val isLastBidder = auctionDetailModel.isLastBidder

return when {
canEnterMessageRoom(chatStatus) -> EnterAuctionChatRoom
canBidAuction(auctionStatus, isOwner) -> BidAuction
canBidAuction(auctionStatus, isOwner) -> {
if (isLastBidder) {
AlreadyLastBidder
} else {
BidAuction
}
}

isOwner -> MyAuction
else -> FinishAuction
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ object AuctionDetailFormatter {
val minutes = (differenceInMills / (60 * 1000L)) % 60

return buildString {
if (days > 0L) append("${days}")
if (hours > 0L) append(" ${hours}시간")
if (minutes > 0L) append(" ${minutes}")
if (days > 0L) append("${days}")
append(" ${String.format("%02d:%02d", hours, minutes)}")
}.trim()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ class AuctionDetailViewModel @Inject constructor(
when (it) {
AuctionDetailBottomButtonStatus.BidAuction -> popupAuctionBidEvent()
AuctionDetailBottomButtonStatus.EnterAuctionChatRoom -> enterChatRoomEvent()
AuctionDetailBottomButtonStatus.FinishAuction -> {}
AuctionDetailBottomButtonStatus.AlreadyLastBidder -> {}
AuctionDetailBottomButtonStatus.MyAuction -> {}
AuctionDetailBottomButtonStatus.FinishAuction -> {}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.ddangddangddang.android.feature.detail

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
import androidx.viewpager2.adapter.FragmentStateAdapter

class DetailFragmentAdapter(fragmentManager: FragmentManager, lifeCycle: Lifecycle) :
FragmentStateAdapter(fragmentManager, lifeCycle) {
override fun getItemCount(): Int = DetailFragmentType.values().size
override fun createFragment(position: Int): Fragment {
return DetailFragmentType.getTypeFrom(position).create()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.ddangddangddang.android.feature.detail

import androidx.annotation.StringRes
import androidx.fragment.app.Fragment
import com.ddangddangddang.android.R
import com.ddangddangddang.android.feature.detail.bidHistory.BidHistoryFragment
import com.ddangddangddang.android.feature.detail.info.AuctionInfoFragment
import com.ddangddangddang.android.feature.detail.qna.QnaFragment

enum class DetailFragmentType(val tag: String, @StringRes val nameId: Int) {
AUCTION_INFO("auction_info", R.string.detail_auction_info_title) {
override fun create(): Fragment {
return AuctionInfoFragment()
}
},

QNA("qna_tag", R.string.detail_auction_qna_title) {
override fun create(): Fragment {
return QnaFragment()
}
},
BID_HISTORY("bid_history_tag", R.string.detail_auction_bid_history) {
override fun create(): Fragment {
return BidHistoryFragment()
}
},
;

abstract fun create(): Fragment

companion object {
fun getTypeFrom(position: Int): DetailFragmentType {
return values()[position]
}
}
}
Loading

0 comments on commit 336290e

Please sign in to comment.