Commit 58b1ac72 by 王佳洋

合并修改昵称

parent c48beb55
......@@ -7,6 +7,7 @@ import android.text.style.ForegroundColorSpan
import android.view.View
import android.view.animation.Animation
import android.view.animation.AnimationUtils
import android.widget.ImageView
import android.widget.TextView
import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.ydlcommon.base.BaseActivity
......@@ -14,6 +15,8 @@ import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.view.DeleteEditTextView
import com.ydl.ydlcommon.view.TitleBar
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.api.service.IImService
import com.yidianling.user.R
......@@ -29,8 +32,8 @@ import io.reactivex.schedulers.Schedulers
* 昵称修改
* 简介修改
*/
const val nickName = 1
const val introduction = 2
const val NICKNAME = 1
const val INTRODUCTION = 2
class ModifyInfoActivity : BaseActivity() {
override fun getStatusViewOptions(): StatusBarOptions {
......@@ -43,29 +46,37 @@ class ModifyInfoActivity : BaseActivity() {
private lateinit var det_set_info: DeleteEditTextView
private lateinit var tv_tip1: TextView
private lateinit var tv_tip2: TextView
private lateinit var tb_title_bar: TitleBar
private lateinit var iv_warn: ImageView
override fun layoutResId(): Int = R.layout.user_mine_activity_set_info
private fun findView() {
det_set_info = findViewById(R.id.det_set_info)
tv_tip1 = findViewById(R.id.tv_tip1)
tv_tip2 = findViewById(R.id.tv_tip2)
tb_title_bar = findViewById(R.id.tb_title_bar)
iv_warn = findViewById(R.id.iv_warn)
}
@SuppressLint("SetTextI18n")
override fun initDataAndEvent() {
findView()
val from = intent.getIntExtra("from", 0)
if (INTRODUCTION == from) {
det_set_info.layoutParams.height = RxImageTool.dp2px(180f)
}
val userInfo = findRouteService(IUserService::class.java).getUserInfo()
det_set_info.setText(userInfo?.nick_name)
mDisposable.add(
UserHttpImpl.getInstance().getUserAuditInfo(ModifyBaseInfo(null, 101))
getInstance().getUserAuditInfo(ModifyBaseInfo(null, if (NICKNAME == from) 101 else 103))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe { response: BaseAPIResponse<UserModifyAuditRespDto> ->
if (response.code == "200") {
if (response.code != "200") return@subscribe
val (_, auditStatus, _, _, _, _, _, last7Day, modifyAfter) = response.data
if (NICKNAME == from) {
if (last7Day) { // 7天内
tv_tip1.text = "抱歉,七天内只能修改一次昵称"
tv_tip1.visibility = View.VISIBLE
......@@ -137,6 +148,8 @@ class ModifyInfoActivity : BaseActivity() {
}
}
}
} else if (INTRODUCTION == from) {
}
})
}
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp"/>
<solid android:color="@android:color/white"/>
</shape>
\ No newline at end of file
......@@ -31,7 +31,7 @@
<com.ydl.ydlcommon.view.DeleteEditTextView
android:id="@+id/det_set_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="55dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:background="@drawable/bg_corner_8_white"
......
......@@ -131,5 +131,6 @@
<color name="color_EFEFF1">#EFEFF1</color>
<color name="color_FAFAFF">#FAFAFF</color>
<color name="color_242424">#242424</color>
<color name="color_9d9ea7">#9D9EA7</color>
</resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment