-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from FakeDevelopers/feature/BDBD-166
Feature/BDBD-166 글쓰기 화면 만들기
- Loading branch information
Showing
28 changed files
with
757 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...c/main/kotlin/com/fakedevelopers/bidderbidder/ui/product_registration/PriceTextWatcher.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.fakedevelopers.bidderbidder.ui.product_registration | ||
|
||
import android.text.Editable | ||
import android.text.Selection | ||
import android.text.TextUtils | ||
import android.text.TextWatcher | ||
import android.widget.EditText | ||
import com.fakedevelopers.bidderbidder.api.data.Constants.Companion.dec | ||
|
||
class PriceTextWatcher( | ||
private val editText: EditText, | ||
private val checkCondition: () -> Unit | ||
) : TextWatcher { | ||
|
||
private var strAmount = "" | ||
|
||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { | ||
// 안해! | ||
} | ||
|
||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { | ||
if (!TextUtils.isEmpty(s.toString()) && s.toString() != strAmount) { | ||
strAmount = makeComma(s.toString()) | ||
editText.setText(strAmount) | ||
Selection.setSelection(editText.text, strAmount.length) | ||
} | ||
} | ||
|
||
override fun afterTextChanged(s: Editable?) { | ||
checkCondition() | ||
} | ||
|
||
private fun makeComma(price: String): String { | ||
price.replace(",", "").toLongOrNull()?.let { | ||
return dec.format(it) | ||
} | ||
return "" | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
.../kotlin/com/fakedevelopers/bidderbidder/ui/product_registration/ProductRegistrationDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.fakedevelopers.bidderbidder.ui.product_registration | ||
|
||
import android.os.Parcelable | ||
import kotlinx.parcelize.Parcelize | ||
|
||
@Parcelize | ||
data class ProductRegistrationDto( | ||
var urlList: List<String>, | ||
val title: String, | ||
val hopePrice: String, | ||
val openingBid: String, | ||
val tick: String, | ||
val expiration: String, | ||
val content: String | ||
) : Parcelable |
Oops, something went wrong.