Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
78398331
Commit
78398331
authored
Aug 11, 2022
by
王佳洋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并修改昵称
parent
baf849fe
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
179 additions
and
121 deletions
+179
-121
AndroidManifest.xml
m-user/src/main/AndroidManifest.xml
+1
-1
UserHttpImpl.kt
m-user/src/main/java/com/yidianling/user/http/UserHttpImpl.kt
+19
-0
ModifyInfoActivity.kt
m-user/src/main/java/com/yidianling/user/mine/ModifyInfoActivity.kt
+147
-0
PersonalInfoActivity.java
m-user/src/main/java/com/yidianling/user/mine/PersonalInfoActivity.java
+7
-21
SetInfoActivity.java
m-user/src/main/java/com/yidianling/user/mine/SetInfoActivity.java
+0
-99
BaseActivity.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/base/BaseActivity.kt
+5
-0
No files found.
m-user/src/main/AndroidManifest.xml
View file @
78398331
...
...
@@ -138,7 +138,7 @@
android:screenOrientation=
"portrait"
android:theme=
"@style/platform_NoTitleTheme"
/>
<activity
android:name=
".mine.
Set
InfoActivity"
android:name=
".mine.
Modify
InfoActivity"
android:screenOrientation=
"portrait"
android:theme=
"@style/platform_NoTitleTheme"
/>
<activity
...
...
m-user/src/main/java/com/yidianling/user/http/UserHttpImpl.kt
View file @
78398331
...
...
@@ -117,6 +117,25 @@ class UserHttpImpl private constructor() : UserHttp {
.
flatMap
{
getUserApi
().
setUserInfo
(
it
)
}
}
override
fun
modifyUserBaseInfo
(
param
:
ModifyBaseInfo
):
Observable
<
BaseAPIResponse
<
Boolean
>>
{
UserHelper
.
getUserInfo
()
?.
let
{
param
.
uid
=
it
.
uid
.
orEmpty
()
param
.
accessToken
=
it
.
accessToken
.
orEmpty
()
}
return
RxUtils
.
mapObservable
(
param
)
.
flatMap
{
getUserApi
().
modifyUserBaseInfo
(
it
)
}
}
override
fun
getUserAuditInfo
(
param
:
ModifyBaseInfo
):
Observable
<
BaseAPIResponse
<
UserModifyAuditRespDto
>>
{
UserHelper
.
getUserInfo
()
?.
let
{
param
.
uid
=
it
.
uid
.
orEmpty
()
param
.
accessToken
=
it
.
accessToken
.
orEmpty
()
}
return
RxUtils
.
mapObservable
(
param
)
.
flatMap
{
getUserApi
().
getUserAuditInfo
(
it
)
}
}
//验证账号密码
override
fun
checkPhonePass
(
cmd
:
CheckPhonePassBean
):
Observable
<
BaseResponse
<
CheckPassword
>>
{
return
RxUtils
.
mapObservable
(
cmd
)
...
...
m-user/src/main/java/com/yidianling/user/mine/ModifyInfoActivity.kt
0 → 100644
View file @
78398331
package
com.yidianling.user.mine
import
android.annotation.SuppressLint
import
android.text.Spannable
import
android.text.SpannableString
import
android.text.style.ForegroundColorSpan
import
android.view.View
import
android.view.animation.Animation
import
android.view.animation.AnimationUtils
import
com.alibaba.android.arouter.launcher.ARouter
import
com.ydl.ydlcommon.base.BaseActivity
import
com.ydl.ydlcommon.bean.StatusBarOptions
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlcommon.modular.findRouteService
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.im.api.service.IImService
import
com.yidianling.user.R
import
com.yidianling.user.api.service.IUserService
import
com.yidianling.user.http.UserHttpImpl
import
com.yidianling.user.http.UserHttpImpl.Companion.getInstance
import
com.yidianling.user.http.request.ModifyBaseInfo
import
com.yidianling.user.http.request.UserModifyAuditRespDto
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
kotlinx.android.synthetic.main.user_mine_activity_set_info.*
/**
* 昵称修改
* 简介修改
*/
const
val
nickName
=
1
const
val
introduction
=
2
class
ModifyInfoActivity
:
BaseActivity
()
{
override
fun
getStatusViewOptions
():
StatusBarOptions
{
return
StatusBarOptions
(
isAddStatusView
=
true
,
statusBarDarkMode
=
true
)
}
private
val
mShake
:
Animation
by
lazy
{
AnimationUtils
.
loadAnimation
(
this
,
R
.
anim
.
user_mine_shake
)
}
override
fun
layoutResId
():
Int
=
R
.
layout
.
user_mine_activity_set_info
@SuppressLint
(
"SetTextI18n"
)
override
fun
initDataAndEvent
()
{
val
from
=
intent
.
getIntExtra
(
"from"
,
0
)
val
userInfo
=
findRouteService
(
IUserService
::
class
.
java
).
getUserInfo
()
det_set_info
.
setText
(
userInfo
?.
nick_name
)
mDisposable
.
add
(
UserHttpImpl
.
getInstance
().
getUserAuditInfo
(
ModifyBaseInfo
(
null
,
101
))
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
{
response
:
BaseAPIResponse
<
UserModifyAuditRespDto
>
->
if
(
response
.
code
==
"200"
)
{
val
(
_
,
auditStatus
,
_
,
_
,
_
,
_
,
_
,
last7Day
,
modifyAfter
)
=
response
.
data
if
(
last7Day
)
{
// 7天内
tv_tip1
.
text
=
"抱歉,七天内只能修改一次昵称"
tv_tip1
.
visibility
=
View
.
VISIBLE
tb_title_bar
.
setRightTextEnable
(
false
)
tb_title_bar
.
setRightTextColor
(
resources
.
getColor
(
R
.
color
.
color_9d9ea7
))
det_set_info
.
setTextColor
(
resources
.
getColor
(
R
.
color
.
color_9d9ea7
))
when
(
auditStatus
)
{
1
->
{
// 审核中
det_set_info
.
keyListener
=
null
det_set_info
.
setOnClickListener
{
ToastUtil
.
toastShort
(
"昵称审核中,预计24小时内审核完成"
)
}
det_set_info
.
setText
(
modifyAfter
)
tv_tip2
.
visibility
=
View
.
VISIBLE
tv_tip2
.
text
=
"昵称审核中,预计24小时内审核完成,暂无法修改。"
}
2
->
{
// 审核失败
det_set_info
.
isEnabled
=
false
tv_tip2
.
visibility
=
View
.
VISIBLE
iv_warn
.
visibility
=
View
.
VISIBLE
val
ss
=
SpannableString
(
"审核失败 ,昵称中含有违规文字。如有疑问联系客服小壹"
)
ss
.
setSpan
(
ForegroundColorSpan
(
resources
.
getColor
(
R
.
color
.
color_1DA1F2
)),
22
,
ss
.
length
,
Spannable
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
tv_tip2
.
text
=
ss
tv_tip2
.
setOnClickListener
{
ARouter
.
getInstance
().
navigation
(
IImService
::
class
.
java
).
startKefuChat
(
this
,
""
,
0
,
0
)
}
}
else
->
{
// 3: 审核成功
det_set_info
.
keyListener
=
null
det_set_info
.
setOnClickListener
{
ToastUtil
.
toastShort
(
"抱歉,七天内只能修改一次"
)
}
det_set_info
.
setText
(
modifyAfter
)
tv_tip2
.
visibility
=
View
.
GONE
userInfo
?.
nick_name
=
modifyAfter
}
}
}
else
{
tv_tip1
.
text
=
"七天内可修改一次昵称"
tb_title_bar
.
setRightTextColor
(
resources
.
getColor
(
R
.
color
.
color_1DA1F2
))
tb_title_bar
.
setOnRightTextClick
{
_
:
View
?,
_
:
Boolean
->
if
(
checkInput
())
{
mDisposable
.
add
(
getInstance
().
modifyUserBaseInfo
(
ModifyBaseInfo
(
det_set_info
.
text
.
toString
(),
101
)
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
{
ToastUtil
.
toastShort
(
"提交成功,昵称审核中,预计24小时内审核完成"
)
setResult
(
RESULT_OK
,
intent
)
finish
()
}
)
}
}
}
}
})
}
private
fun
checkInput
():
Boolean
{
if
(
det_set_info
.
text
.
isEmpty
())
{
ToastUtil
.
toastShort
(
"请输入昵称"
)
det_set_info
.
startAnimation
(
mShake
)
return
false
}
if
(
det_set_info
.
text
.
length
>
6
)
{
ToastUtil
.
toastShort
(
"昵称最多6个字哦"
)
det_set_info
.
startAnimation
(
mShake
)
return
false
}
return
true
}
}
\ No newline at end of file
m-user/src/main/java/com/yidianling/user/mine/PersonalInfoActivity.java
View file @
78398331
...
...
@@ -64,13 +64,8 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
@Route
(
path
=
"/user/personInfo"
)
public
class
PersonalInfoActivity
extends
BaseActivity
implements
View
.
OnClickListener
{
public
static
final
int
REQUEST_NAME
=
1
;
UserResponseBean
.
UserInfo
userInfoData
;
private
static
final
int
REQUEST_IMAGE
=
2
;
TitleBar
tb_title
;
ImageView
persion_head_iv
;
ImageView
person_head_hint_iv
;
...
...
@@ -240,9 +235,7 @@ public class PersonalInfoActivity extends BaseActivity implements View.OnClickLi
}
});
}
else
if
(
id
==
R
.
id
.
jtv_nick
)
{
//昵称
Intent
intent
=
new
Intent
(
this
,
SetInfoActivity
.
class
);
intent
.
putExtra
(
"mOldString"
,
jtv_nick
.
getRightText
());
intent
.
putExtra
(
"mTitle"
,
"修改昵称"
);
Intent
intent
=
new
Intent
(
this
,
ModifyInfoActivity
.
class
);
startActivityForResult
(
intent
,
REQUEST_NAME
);
}
else
if
(
id
==
R
.
id
.
jtv_sex
)
{
//性别
List
<
String
>
sexs
=
new
ArrayList
<
String
>();
...
...
@@ -449,7 +442,9 @@ public class PersonalInfoActivity extends BaseActivity implements View.OnClickLi
break
;
case
REQUEST_NAME:
{
updateInfo
(
"nickName"
,
SetInfoActivity
.
getInput
(
data
));
jtv_nick
.
setRightText
(
value
);
userInfo
.
setNick_name
(
value
);
ModularServiceManager
.
INSTANCE
.
provide
(
IImService
.
class
).
updateUserName
(
value
);
// 更新用户昵称到云信
break
;
}
}
...
...
@@ -526,14 +521,6 @@ public class PersonalInfoActivity extends BaseActivity implements View.OnClickLi
break
;
}
break
;
case
"nickName"
:
jtv_nick
.
setRightText
(
value
);
userInfo
.
setNick_name
(
value
);
//更新用户昵称到云信
try
{
ModularServiceManager
.
INSTANCE
.
provide
(
IImService
.
class
).
updateUserName
(
value
);
}
catch
(
Exception
e
)
{}
break
;
case
"profession"
:
setCareer
(
Integer
.
valueOf
(
value
));
userInfo
.
setProfession
(
Integer
.
valueOf
(
value
));
...
...
@@ -550,10 +537,9 @@ public class PersonalInfoActivity extends BaseActivity implements View.OnClickLi
//封面背景
userInfo
.
setHome_bg
(
value
);
break
;
case
"home_desc"
:
//简介
userInfo
.
setDescription
(
value
);
break
;
// case "home_desc": // 简介
// userInfo.setDescription(value);
// break;
}
EventBus
.
getDefault
().
post
(
userInfoData
);
},
new
ThrowableConsumer
()
{
...
...
m-user/src/main/java/com/yidianling/user/mine/SetInfoActivity.java
deleted
100644 → 0
View file @
baf849fe
package
com
.
yidianling
.
user
.
mine
;
import
android.content.Intent
;
import
android.view.View
;
import
android.view.animation.Animation
;
import
android.view.animation.AnimationUtils
;
import
com.ydl.ydlcommon.base.BaseActivity
;
import
com.ydl.ydlcommon.bean.StatusBarOptions
;
import
com.ydl.ydlcommon.view.DeleteEditTextView
;
import
com.ydl.ydlcommon.view.TitleBar
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.user.R
;
import
org.jetbrains.annotations.NotNull
;
/**
* 短信息填写
* Created by softrice on 15/9/29.
*/
public
class
SetInfoActivity
extends
BaseActivity
{
public
static
final
String
INPUT
=
"INPUT"
;
@NotNull
@Override
public
StatusBarOptions
getStatusViewOptions
()
{
return
new
StatusBarOptions
(
true
,
true
);
}
public
static
Intent
getIntent
(
String
input
)
{
Intent
intent
=
new
Intent
();
intent
.
putExtra
(
INPUT
,
input
);
return
intent
;
}
public
static
String
getInput
(
Intent
intent
)
{
if
(
intent
==
null
)
{
return
null
;
}
return
intent
.
getStringExtra
(
INPUT
);
}
String
mTitle
;
String
mOldString
;
DeleteEditTextView
det_set_info
;
TitleBar
tb_title_bar
;
Animation
shake
;
@Override
protected
int
layoutResId
()
{
return
R
.
layout
.
user_mine_activity_set_info
;
}
@Override
protected
void
initDataAndEvent
()
{
det_set_info
=
findViewById
(
R
.
id
.
det_set_info
);
tb_title_bar
=
findViewById
(
R
.
id
.
tb_title_bar
);
mTitle
=
getIntent
().
getStringExtra
(
"mTitle"
);
mOldString
=
getIntent
().
getStringExtra
(
"mOldString"
);
init
();
}
void
init
()
{
shake
=
AnimationUtils
.
loadAnimation
(
getApplicationContext
(),
R
.
anim
.
user_mine_shake
);
tb_title_bar
.
setTitle
(
mTitle
);
det_set_info
.
setText
(
mOldString
);
tb_title_bar
.
setOnRightTextClick
(
new
TitleBar
.
OnTitleBarTextClick
()
{
@Override
public
void
onClick
(
View
view
,
boolean
isActive
)
{
if
(
checkInput
())
{
ToastUtil
.
toastShort
(
"保存成功"
);
setResult
(
RESULT_OK
,
getIntent
(
det_set_info
.
getText
().
toString
()));
finish
();
}
}
});
}
boolean
checkInput
()
{
if
(
det_set_info
.
getText
().
length
()
==
0
)
{
ToastUtil
.
toastShort
(
"请输入昵称"
);
det_set_info
.
startAnimation
(
shake
);
return
false
;
}
if
(
det_set_info
.
getText
().
length
()
>
6
)
{
ToastUtil
.
toastShort
(
"昵称最多6个字哦"
);
det_set_info
.
startAnimation
(
shake
);
return
false
;
}
return
true
;
}
}
ydl-platform/src/main/java/com/ydl/ydlcommon/base/BaseActivity.kt
View file @
78398331
...
...
@@ -20,6 +20,7 @@ import com.ydl.ydlcommon.utils.ActivityManager
import
com.ydl.ydlcommon.utils.AndroidSystemHelper
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.statusBar.StatusBarUtil
import
io.reactivex.disposables.CompositeDisposable
import
io.reactivex.subjects.BehaviorSubject
import
io.reactivex.subjects.Subject
import
kotlin.properties.Delegates
...
...
@@ -37,6 +38,9 @@ abstract class BaseActivity : AppCompatActivity(), IActivityLifecycleable {
var
statusView
:
View
?
=
null
private
var
loadingDialogFragment
:
LoadingDialogFragment
?
=
null
@JvmField
val
mDisposable
=
CompositeDisposable
()
override
fun
provideLifecycleSubject
():
Subject
<
ActivityEvent
>
{
return
mLifecycleSubject
;
}
...
...
@@ -157,6 +161,7 @@ abstract class BaseActivity : AppCompatActivity(), IActivityLifecycleable {
override
fun
onDestroy
()
{
super
.
onDestroy
()
mDisposable
.
takeIf
{
!
it
.
isDisposed
}
?.
dispose
()
ActivityManager
.
getInstance
().
removeStack
(
this
)
AndroidSystemHelper
.
fixInputMethodManagerLeak
(
this
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment