크리에이터 프로필 수정 시 팬심M 및 X URL 등록 기능 추가
크리에이터 프로필 수정 화면에서 팬심M과 X(구 트위터)의 URL을 입력하고 저장할 수 있도록 기능을 개선했습니다. - ProfileUpdateRequest 및 ProfileResponse에 관련 필드 추가 - ProfileUpdateViewModel에 URL 관리 및 업데이트 로직 추가 - UI 레이아웃에 팬심M, X 입력 필드 추가 및 다국어 리소스 반영 - ProfileUpdateActivity에서 입력 필드 연동 및 초기값 설정
This commit is contained in:
@@ -17,6 +17,8 @@ data class ProfileResponse(
|
||||
@SerializedName("instagramUrl") val instagramUrl: String?,
|
||||
@SerializedName("blogUrl") val blogUrl: String?,
|
||||
@SerializedName("websiteUrl") val websiteUrl: String?,
|
||||
@SerializedName("fancimmUrl") val fancimmUrl: String?,
|
||||
@SerializedName("xUrl") val xUrl: String?,
|
||||
@SerializedName("introduce") val introduce: String,
|
||||
@SerializedName("tags") val tags: List<String>
|
||||
)
|
||||
|
||||
@@ -85,6 +85,26 @@ class ProfileUpdateActivity : BaseActivity<ActivityProfileUpdateBinding>(
|
||||
}
|
||||
)
|
||||
|
||||
compositeDisposable.add(
|
||||
binding.etFancimm.textChanges().skip(1)
|
||||
.debounce(500, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe {
|
||||
viewModel.fancimmUrl = it.toString()
|
||||
}
|
||||
)
|
||||
|
||||
compositeDisposable.add(
|
||||
binding.etX.textChanges().skip(1)
|
||||
.debounce(500, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe {
|
||||
viewModel.xUrl = it.toString()
|
||||
}
|
||||
)
|
||||
|
||||
compositeDisposable.add(
|
||||
binding.etWebsite.textChanges().skip(1)
|
||||
.debounce(500, TimeUnit.MILLISECONDS)
|
||||
@@ -142,6 +162,8 @@ class ProfileUpdateActivity : BaseActivity<ActivityProfileUpdateBinding>(
|
||||
it.instagramUrl?.let { url -> binding.etInstagram.setText(url) }
|
||||
it.websiteUrl?.let { url -> binding.etWebsite.setText(url) }
|
||||
it.blogUrl?.let { url -> binding.etBlog.setText(url) }
|
||||
it.fancimmUrl?.let { url -> binding.etFancimm.setText(url) }
|
||||
it.xUrl?.let { url -> binding.etX.setText(url) }
|
||||
binding.etIntroduce.setText(it.introduce)
|
||||
|
||||
SharedPreferenceManager.nickname = it.nickname
|
||||
|
||||
@@ -19,6 +19,8 @@ data class ProfileUpdateRequest(
|
||||
@SerializedName("instagramUrl") val instagramUrl: String? = null,
|
||||
@SerializedName("websiteUrl") val websiteUrl: String? = null,
|
||||
@SerializedName("blogUrl") val blogUrl: String? = null,
|
||||
@SerializedName("fancimmUrl") val fancimmUrl: String? = null,
|
||||
@SerializedName("xUrl") val xUrl: String? = null,
|
||||
@SerializedName("isVisibleDonationRank") val isVisibleDonationRank: Boolean? = null,
|
||||
@SerializedName("donationRankingPeriod") val donationRankingPeriod: DonationRankingPeriod? = null,
|
||||
@SerializedName("container") val container: String = "aos"
|
||||
|
||||
@@ -22,6 +22,8 @@ class ProfileUpdateViewModel(private val repository: UserRepository) : BaseViewM
|
||||
var instagramUrl = ""
|
||||
var websiteUrl = ""
|
||||
var blogUrl = ""
|
||||
var fancimmUrl = ""
|
||||
var xUrl = ""
|
||||
var introduce = ""
|
||||
|
||||
var currentPassword = ""
|
||||
@@ -63,6 +65,13 @@ class ProfileUpdateViewModel(private val repository: UserRepository) : BaseViewM
|
||||
{
|
||||
if (it.success && it.data != null) {
|
||||
profileResponse = it.data
|
||||
youtubeUrl = profileResponse.youtubeUrl ?: ""
|
||||
instagramUrl = profileResponse.instagramUrl ?: ""
|
||||
websiteUrl = profileResponse.websiteUrl ?: ""
|
||||
blogUrl = profileResponse.blogUrl ?: ""
|
||||
fancimmUrl = profileResponse.fancimmUrl ?: ""
|
||||
xUrl = profileResponse.xUrl ?: ""
|
||||
introduce = profileResponse.introduce
|
||||
tags.addAll(profileResponse.tags)
|
||||
_selectedTagLiveData.postValue(profileResponse.tags)
|
||||
_genderLiveData.postValue(profileResponse.gender)
|
||||
@@ -127,6 +136,8 @@ class ProfileUpdateViewModel(private val repository: UserRepository) : BaseViewM
|
||||
profileResponse.instagramUrl != instagramUrl ||
|
||||
profileResponse.blogUrl != blogUrl ||
|
||||
profileResponse.websiteUrl != websiteUrl ||
|
||||
profileResponse.fancimmUrl != fancimmUrl ||
|
||||
profileResponse.xUrl != xUrl ||
|
||||
profileResponse.gender != _genderLiveData.value ||
|
||||
insertTags.isNotEmpty() ||
|
||||
removeTags.isNotEmpty() ||
|
||||
@@ -155,6 +166,16 @@ class ProfileUpdateViewModel(private val repository: UserRepository) : BaseViewM
|
||||
} else {
|
||||
null
|
||||
},
|
||||
fancimmUrl = if (profileResponse.fancimmUrl != fancimmUrl) {
|
||||
fancimmUrl
|
||||
} else {
|
||||
null
|
||||
},
|
||||
xUrl = if (profileResponse.xUrl != xUrl) {
|
||||
xUrl
|
||||
} else {
|
||||
null
|
||||
},
|
||||
gender = if (profileResponse.gender != _genderLiveData.value) {
|
||||
_genderLiveData.value
|
||||
} else {
|
||||
|
||||
@@ -421,6 +421,72 @@
|
||||
android:theme="@style/EditTextStyle"
|
||||
tools:ignore="LabelFor" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="18dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="6.7dp"
|
||||
android:fontFamily="@font/medium"
|
||||
android:text="@string/screen_profile_update_fancimm_label"
|
||||
android:textColor="@color/color_eeeeee"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_fancimm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/edittext_underline"
|
||||
android:fontFamily="@font/medium"
|
||||
android:hint="@string/screen_profile_update_fancimm_hint"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="textWebEditText"
|
||||
android:paddingHorizontal="6.7dp"
|
||||
android:textColor="@color/color_eeeeee"
|
||||
android:textColorHint="@color/color_777777"
|
||||
android:textCursorDrawable="@drawable/edit_text_cursor"
|
||||
android:textSize="13.3sp"
|
||||
android:theme="@style/EditTextStyle"
|
||||
tools:ignore="LabelFor" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="18dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="6.7dp"
|
||||
android:fontFamily="@font/medium"
|
||||
android:text="@string/screen_profile_update_x_label"
|
||||
android:textColor="@color/color_eeeeee"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_x"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/edittext_underline"
|
||||
android:fontFamily="@font/medium"
|
||||
android:hint="@string/screen_profile_update_x_hint"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="textWebEditText"
|
||||
android:paddingHorizontal="6.7dp"
|
||||
android:textColor="@color/color_eeeeee"
|
||||
android:textColorHint="@color/color_777777"
|
||||
android:textCursorDrawable="@drawable/edit_text_cursor"
|
||||
android:textSize="13.3sp"
|
||||
android:theme="@style/EditTextStyle"
|
||||
tools:ignore="LabelFor" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
||||
@@ -663,6 +663,10 @@
|
||||
<string name="screen_profile_update_website_hint">Website URL</string>
|
||||
<string name="screen_profile_update_blog_label">Blog</string>
|
||||
<string name="screen_profile_update_blog_hint">Blog URL</string>
|
||||
<string name="screen_profile_update_fancimm_label">FancimM</string>
|
||||
<string name="screen_profile_update_fancimm_hint">FancimM URL</string>
|
||||
<string name="screen_profile_update_x_label">X</string>
|
||||
<string name="screen_profile_update_x_hint">X URL</string>
|
||||
<string name="screen_profile_update_interest_title">Interests</string>
|
||||
<string name="screen_profile_update_interest_select">Select interests</string>
|
||||
<string name="screen_profile_update_introduce_label">Bio</string>
|
||||
|
||||
@@ -663,6 +663,10 @@
|
||||
<string name="screen_profile_update_website_hint">ウェブサイト URL</string>
|
||||
<string name="screen_profile_update_blog_label">ブログ</string>
|
||||
<string name="screen_profile_update_blog_hint">ブログ URL</string>
|
||||
<string name="screen_profile_update_fancimm_label">FancimM</string>
|
||||
<string name="screen_profile_update_fancimm_hint">FancimM URL</string>
|
||||
<string name="screen_profile_update_x_label">X</string>
|
||||
<string name="screen_profile_update_x_hint">X URL</string>
|
||||
<string name="screen_profile_update_interest_title">興味・関心</string>
|
||||
<string name="screen_profile_update_interest_select">関心タグ選択</string>
|
||||
<string name="screen_profile_update_introduce_label">紹介文</string>
|
||||
|
||||
@@ -662,6 +662,10 @@
|
||||
<string name="screen_profile_update_website_hint">웹사이트 URL</string>
|
||||
<string name="screen_profile_update_blog_label">블로그</string>
|
||||
<string name="screen_profile_update_blog_hint">블로그 URL</string>
|
||||
<string name="screen_profile_update_fancimm_label">팬심M</string>
|
||||
<string name="screen_profile_update_fancimm_hint">팬심M URL</string>
|
||||
<string name="screen_profile_update_x_label">X</string>
|
||||
<string name="screen_profile_update_x_hint">X URL</string>
|
||||
<string name="screen_profile_update_interest_title">관심사</string>
|
||||
<string name="screen_profile_update_interest_select">관심사 선택</string>
|
||||
<string name="screen_profile_update_introduce_label">소개글</string>
|
||||
|
||||
Reference in New Issue
Block a user