[Modify]声音签名用户主页功能修改

This commit is contained in:
wushaocheng
2023-01-06 20:32:55 +08:00
parent 5bea6dad8a
commit c1aa4e0ff9
14 changed files with 450 additions and 518 deletions

View File

@@ -2,6 +2,7 @@ package com.yizhuan.erban.audio
import com.netease.nim.uikit.StatusBarUtil
import com.yizhuan.erban.R
import com.yizhuan.erban.audio.helper.AudioPlayerHelper
import com.yizhuan.erban.base.BaseViewBindingActivity
import com.yizhuan.erban.databinding.ActivitySoundSignatureBinding
@@ -11,7 +12,16 @@ import com.yizhuan.erban.databinding.ActivitySoundSignatureBinding
*/
class SoundSignatureActivity : BaseViewBindingActivity<ActivitySoundSignatureBinding>() {
companion object{
const val EXTRA_VOICE_ID = "voice_id"
const val AUDIO_FILE = "AUDIO_FILE"
const val AUDIO_DURA = "AUDIO_DURA"
const val MIN_RECORD_VOICE_DURATION = 5 // 最少5秒
const val MAX_RECORD_VOICE_DURATION = 60 //最多60s
}
override fun init() {
AudioPlayerHelper.get().onCreate()
initWhiteTitleBar(getString(R.string.sound_signature))
}

View File

@@ -0,0 +1,15 @@
package com.yizhuan.erban.audio.viewmodel
import com.yizhuan.erban.base.BaseViewModel
/**
* @author wushaocheng
* 声音签名
*/
class SoundViewModel : BaseViewModel() {
init {
}
}

View File

@@ -44,7 +44,6 @@ import com.yizhuan.erban.ui.user.adapter.SelfPhotoAdapter;
import com.yizhuan.erban.ui.user.adapter.UserInfoIndicatorAdapter;
import com.yizhuan.erban.ui.user.adapter.UserInfoPagerAdapter;
import com.yizhuan.erban.ui.user.adapter.UserInfoPhotoAdapter;
import com.yizhuan.erban.ui.user.view.UserInfoDynamicFragment;
import com.yizhuan.erban.ui.user.view.UserInfoGiftWallFragment;
import com.yizhuan.erban.ui.user.view.UserInfoInfoFragment;
import com.yizhuan.erban.ui.user.viewmodel.UserInfoViewModel;
@@ -132,7 +131,6 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
onSetListener();
EventBus.getDefault().register(this);
initUserInfoDetailObserver();
getUserInfo();
initAttentionView();
initNestScrollView();
setEditButton(identityState, true);
@@ -141,22 +139,25 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
if (userId != AuthModel.get().getCurrentUid()) {
UserModel.get().visitUserDetail(userId).subscribe();
}
viewModel.getUserInfoData().observe(this, infoBean -> {
userInfo = infoBean;
initData(userInfo);
});
}
@Override
protected void onResume() {
super.onResume();
viewModel.getUserInfo();
viewModel.getUserInfoDetail();
viewModel.getUserHallAndClan();
viewModel.getUserSkillData(viewModel.getUserId());
}
private void initAttentionView() {
if (AuthModel.get().getCurrentUid() == userId) {
identityState = OWN;
mBinding.tvFansCount.setOnClickListener(this);
mBinding.ivWhere.setVisibility(View.GONE);
mBinding.groupLive.setVisibility(View.GONE);
if (bottomViewLayout != null)
bottomViewLayout.setVisibility(View.GONE);
} else {
@@ -182,43 +183,23 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
mBinding.ivUserBack.setOnClickListener(this);
mBinding.ivEdit.setOnClickListener(this);
mBinding.tvEdit.setOnClickListener(this);
mBinding.ivWhere.setOnClickListener(this);
mBinding.viewLive.setOnClickListener(this);
}
/**
* 找到TA, 主态不展示
*/
private void setWhereVisible() {
mBinding.ivWhere.setVisibility(viewModel.getMRoomUid() != 0 ? View.VISIBLE : View.GONE);
}
private void getUserInfo() {
UserModel.get().getUserInfoFromServer(userId)
.compose(bindToLifecycle())
.subscribe(new BeanObserver<UserInfo>() {
@Override
public void onErrorMsg(String error) {
toast(error);
}
@Override
public void onSuccess(UserInfo Info) {
userInfo = Info;
initData(userInfo);
}
});
mBinding.groupLive.setVisibility(viewModel.getMRoomUid() != 0 ? View.VISIBLE : View.GONE);
}
private void initViewPager() {
List<Fragment> fragmentList = new ArrayList<>(3);
List<Fragment> fragmentList = new ArrayList<>(2);
fragmentList.add(new UserInfoInfoFragment());
fragmentList.add(new UserInfoDynamicFragment());
fragmentList.add(new UserInfoGiftWallFragment());
/* fragmentList.add(UserInfoCpFragment.Companion.newInstance(userId));*/
pagerAdapter = new UserInfoPagerAdapter(getSupportFragmentManager(), fragmentList);
final List<String> tagList = new ArrayList<>(3);
final List<String> tagList = new ArrayList<>(2);
tagList.add(getString(R.string.me_data));
tagList.add(getString(R.string.me_dynamic));
tagList.add(getString(R.string.me_gift_wall));
CommonNavigator commonNavigator = new CommonNavigator(context);
commonNavigator.setTitleWrapContent(true);
@@ -229,7 +210,7 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
commonNavigator.setAdapter(magicIndicatorAdapter);
mBinding.magicIndicator.setNavigator(commonNavigator);
commonNavigator.getTitleContainer().setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE);
mBinding.viewPager.setOffscreenPageLimit(3);
mBinding.viewPager.setOffscreenPageLimit(2);
mBinding.viewPager.setAdapter(pagerAdapter);
ViewPagerHelper.bind(mBinding.magicIndicator, mBinding.viewPager);
mBinding.viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@@ -548,7 +529,7 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
PraiseModel.get().praise(userInfo.getUid(), true).subscribe();
}
break;
case R.id.iv_where:
case R.id.viewLive:
if (userInfo == null) {
toast(getString(R.string.me_user_information_is_empty));
return;

View File

@@ -1,112 +1,96 @@
package com.yizhuan.erban.ui.user.view
import android.annotation.SuppressLint
import android.graphics.Color
import android.graphics.drawable.GradientDrawable
import android.view.Gravity
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.core.view.isVisible
import androidx.fragment.app.activityViewModels
import androidx.recyclerview.widget.LinearLayoutManager
import com.netease.nim.uikit.support.glide.GlideApp
import com.netease.nim.uikit.common.util.sys.TimeUtil
import com.trello.rxlifecycle3.android.FragmentEvent
import com.yizhuan.erban.R
import com.yizhuan.erban.UIHelper
import com.yizhuan.erban.avroom.ButtonItemFactory
import com.yizhuan.erban.base.BaseViewBindingFragment
import com.yizhuan.erban.common.widget.dialog.DialogManager
import com.yizhuan.erban.community.helper.ShareDynamicHelper
import com.yizhuan.erban.databinding.FragmentUserinfoUserinfoBinding
import com.yizhuan.erban.module_hall.HallDataManager
import com.yizhuan.erban.module_hall.hall.activity.ModuleClanActivity
import com.yizhuan.erban.module_hall.hall.activity.ModuleHallActivity
import com.yizhuan.erban.skill.activity.SkillHomeActivity
import com.yizhuan.erban.skill.activity.SkillHomeActivity.Companion.PAGE_TYPE_CUSTOM
import com.yizhuan.erban.skill.activity.SkillHomeActivity.Companion.PAGE_TYPE_SELF
import com.yizhuan.erban.ui.user.UserInfoActivity
import com.yizhuan.erban.ui.user.adapter.SkillCardAdapter
import com.yizhuan.erban.ui.user.decorationsend.UserInfoSkillDecoration
import com.yizhuan.erban.ui.user.adapter.UserInfoDynamicAdapter
import com.yizhuan.erban.ui.user.viewmodel.UserInfoViewModel
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil
import com.yizhuan.erban.ui.widget.ButtonItem
import com.yizhuan.xchat_android_constants.XChatConstants
import com.yizhuan.xchat_android_core.auth.AuthModel
import com.yizhuan.xchat_android_core.module_hall.hall.HallModel
import com.yizhuan.xchat_android_core.community.bean.WorldDynamicBean
import com.yizhuan.xchat_android_core.community.dynamic.DynamicModel
import com.yizhuan.xchat_android_core.community.event.DynamicRefreshEvent
import com.yizhuan.xchat_android_core.module_hall.hall.bean.ClanAndHallInfo
import com.yizhuan.xchat_android_core.module_hall.hall.bean.ClanInfo
import com.yizhuan.xchat_android_core.module_hall.hall.bean.HallInfo
import com.yizhuan.xchat_android_core.user.bean.UserInfoSkillEntity
import com.yizhuan.xchat_android_core.statistic.StatisticManager
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol
import com.yizhuan.xchat_android_core.user.UserModel
import com.yizhuan.xchat_android_core.user.bean.UserInfo
import com.yizhuan.xchat_android_core.utils.StarUtils
import com.yizhuan.xchat_android_core.utils.net.BeanObserver
import com.yizhuan.xchat_android_core.utils.net.RxHelper
import com.yizhuan.xchat_android_core.utils.net.DontWarnObserver
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
import com.yizhuan.xchat_android_library.utils.ResUtil
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import java.util.*
@ActLayoutRes(R.layout.fragment_userinfo_userinfo)
class UserInfoInfoFragment : BaseViewBindingFragment<FragmentUserinfoUserinfoBinding>() {
private var skillAdapter: SkillCardAdapter? = null
private val vm: UserInfoViewModel by activityViewModels()
private var dynamicAdapter: UserInfoDynamicAdapter? = null
override fun init() {
EventBus.getDefault().register(this)
vm.userInfoData.observe(this) {
initInfoData(it)
}
vm.hallData.observe(this) {
initClanAndHall(it)
initPersonalData(it)
}
vm.userInfoSkillData.observe(this) {
initSkillCardList(it)
vm.userInfoDetailData.observe(this) {
initDynamicList(it.dynamicInfo)
}
}
@SuppressLint("SetTextI18n")
private fun initClanAndHall(clanAndHallInfo: ClanAndHallInfo) {
private fun initInfoData(userInfo: UserInfo) {
//设置星座
val star = StarUtils.getConstellation(Date(userInfo.birth))
if (null == star) {
binding.tvConstellation.visibility = View.GONE
} else {
binding.tvConstellation.text = star
binding.tvConstellation.visibility = View.VISIBLE
}
val birth = TimeUtil.getDateTimeString(userInfo.birth, "yyyy-MM-dd")
binding.tvBirth.text = birth
}
private fun initPersonalData(clanAndHallInfo: ClanAndHallInfo) {
val hallInfo: HallInfo? = clanAndHallInfo.hall
val clanInfo: ClanInfo? = clanAndHallInfo.clan
val showApply =
AuthModel.get().currentUid != vm.userId && HallDataManager.get().hallId <= 0
if (hallInfo != null && hallInfo.hallId > 0) {
binding.llModuleHall.visibility = View.VISIBLE
binding.llNoAssociation.visibility = View.GONE
binding.tvHallId.text = getString(R.string.me_roomid) + hallInfo.hallId.toString()
binding.tvHallName.text = hallInfo.hallName
binding.tvHallMemberNum.text =
getString(R.string.me_room_number_people) + hallInfo.memberCount
binding.tvHallErbanId.text = getString(R.string.me_peko_number) + hallInfo.ownerErbanNo
GlideApp.with(this)
.load(hallInfo.ownerAvatar)
.placeholder(R.drawable.default_avatar)
.into(binding.ivHallAvatar)
binding.tvRoom.text = hallInfo.hallName
} else {
binding.llHall.isVisible = false
binding.ivClanArrow.isVisible = false
binding.tvHallDetail.text = getString(R.string.me_association)
binding.llRoom.visibility = View.GONE
}
if (clanInfo != null && clanInfo.id > 0) {
binding.llModuleHall.visibility = View.VISIBLE
binding.llNoAssociation.visibility = View.GONE
binding.llClan.visibility = View.VISIBLE
binding.tvClanId.text = getString(R.string.me_association_id) + clanInfo.id
binding.tvClanName.text = clanInfo.name
binding.tvClanMemberNum.text =
getString(R.string.me_association_number) + clanInfo.clanMemberNum
binding.tvClanHallNum.text = getString(R.string.me_room_number) + clanInfo.clanHallNum
GlideApp.with(this)
.load(clanInfo.avatar)
.placeholder(R.drawable.default_cover)
.into(binding.ivClanAvatar)
GlideApp.with(this)
.load(clanInfo.levelIcon)
.placeholder(R.drawable.default_cover)
.into(binding.ivClanLevel)
if (hallInfo != null && hallInfo.hallId > 0) {
binding.tvHallDetail.text = getString(R.string.me_association_room)
}
binding.tvAssociation.text = clanInfo.name
} else {
binding.llClan.visibility = View.GONE
if (hallInfo == null || hallInfo.hallId <= 0) {
binding.llModuleHall.visibility = View.GONE
binding.llNoAssociation.visibility = View.VISIBLE
} else {
binding.llHall.isVisible = true
binding.tvHallDetail.text = getString(R.string.me_room)
}
binding.llAssociation.visibility = View.GONE
}
binding.ivHallAvatar.setOnClickListener {
binding.tvRoom.setOnClickListener {
if (hallInfo != null && hallInfo.hallId != 0L) {
ModuleHallActivity.start(
context,
@@ -116,77 +100,143 @@ class UserInfoInfoFragment : BaseViewBindingFragment<FragmentUserinfoUserinfoBin
}
}
binding.ivClanAvatar.setOnClickListener {
binding.tvAssociation.setOnClickListener {
ModuleClanActivity.start(context, vm.userId)
}
binding.ivClanArrow.setOnClickListener {
binding.ivClanArrow.animate()
.rotationBy(180f)
.setDuration(200)
.start()
binding.llHall.isVisible = !binding.llHall.isVisible
}
}
/**
* 技能卡
* 动态列表
*
* @param worldDynamicList
*/
private fun initSkillCardList(list: List<UserInfoSkillEntity>) {
val audio = list.find { it.cardId == 8 }
var newList: MutableList<UserInfoSkillEntity> = list.toMutableList()
if (audio != null) {
(activity as? UserInfoActivity)?.initVoiceShow(audio)
newList.remove(audio)
}
if (skillAdapter == null) {
skillAdapter = SkillCardAdapter(mContext)
skillAdapter?.setHeaderAndEmpty(true)
skillAdapter?.setOnItemClickListener { _, _, _ ->
val type =
if (vm.userId == AuthModel.get().currentUid) PAGE_TYPE_SELF else PAGE_TYPE_CUSTOM
SkillHomeActivity.start(mContext, type, vm.userId)
private fun initDynamicList(worldDynamicList: List<WorldDynamicBean>) {
if (dynamicAdapter == null) {
dynamicAdapter = UserInfoDynamicAdapter(mContext)
dynamicAdapter?.setEnableLoadMore(false)
dynamicAdapter?.setOnItemChildClickListener { _, view: View, pos: Int ->
val bean: WorldDynamicBean =
dynamicAdapter?.getItem(pos) ?: return@setOnItemChildClickListener
if (view.id == R.id.iv_more) {
val list: MutableList<ButtonItem> = ArrayList()
if (!UserModel.get().isMyseft(bean.uid)) {
val item = ButtonItem(
getString(R.string.me_shield_dynamic)
) {
UserModel.get().addReport(bean.dynamicId, 0)
.subscribe(object : BeanObserver<String?>() {
override fun onErrorMsg(error: String) {
dialogManager.dismissDialog()
toast(error)
}
override fun onSuccess(s: String) {
dialogManager.dismissDialog()
toast(ResUtil.getString(R.string.me_shield_success))
if (pos < (dynamicAdapter?.data?.size ?: 0)) {
if (bean == dynamicAdapter?.getItem(pos)) {
dynamicAdapter?.remove(pos)
}
}
}
})
}
list.add(item)
}
if (!UserModel.get().isMyseft(bean.uid)) {
val blackListItem = ButtonItemFactory.createAddToBlackListItem(
dialogManager, bean.uid.toString()
)
list.add(blackListItem)
}
if (!UserModel.get().isMyseft(bean.uid)) {
val item = ButtonItem(
getString(R.string.me_report_dynamic)
) {
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_WORLD_REPORT_MOMENTS,
getString(R.string.me_report_the_dynamic)
)
UIHelper.showReportPage(
mContext, bean.uid,
XChatConstants.REPORT_TYPE_DYNAMIC_SQUARE
)
}
list.add(item)
}
if (UserModel.get().isMyseft(bean.uid) ||
isThisWorldOwner(bean)
) {
val item = ButtonItem(
getString(R.string.me_delete)
) { deleteDynamic(pos, dynamicAdapter) }
list.add(item)
}
dialogManager.showCommonPopupDialog(list, getString(R.string.cancel))
} else if (view.id == R.id.ll_share) {
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_WORLD_SHARE_MOMENTS,
getString(R.string.me_share_dynamic)
)
ShareDynamicHelper(activity).share(bean)
}
}
binding.recyclerSkill.addItemDecoration(UserInfoSkillDecoration(mContext, 8))
binding.recyclerSkill.layoutManager =
LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false)
binding.recyclerSkill.adapter = skillAdapter
binding.mRecyclerView.adapter = dynamicAdapter
}
if (newList.isEmpty()) {
skillAdapter?.emptyView = createSkillEmptyView()
}
skillAdapter?.setNewData(newList)
dynamicAdapter?.setNewData(worldDynamicList)
}
private fun applyJoinHall(hallId: Long) {
HallModel.get().applyJoinHall(hallId)
.compose(RxHelper.bindFragment(this))
.subscribe(object : BeanObserver<String?>() {
override fun onErrorMsg(error: String) {
toast(error)
}
override fun onSuccess(s: String) {
toast(s)
}
private fun deleteDynamic(pos: Int, adapter: UserInfoDynamicAdapter?) {
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_WORLD_DELETE_MOMENTS,
getString(R.string.me_delete_the_dynamic)
)
dialogManager.showOkCancelWithTitleDialog(getString(R.string.me_cannot_be_restored),
DialogManager.OkCancelDialogListener {
val bean = adapter?.getItem(pos) ?: return@OkCancelDialogListener
DynamicModel.get().delete(bean.worldId, bean.dynamicId)
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
.doOnSubscribe { dialogManager.showProgressDialog(mContext) }
.subscribe(object : DontWarnObserver<String?>() {
override fun accept(s: String?, error: String?) {
super.accept(s, error)
dialogManager.dismissDialog()
if (error != null) {
toast(error)
} else {
toast(getString(R.string.me_successfully_delete))
if (pos < adapter.data.size) {
if (bean == adapter.getItem(pos)) {
adapter.remove(pos)
}
}
}
}
})
})
}
private fun createSkillEmptyView(): View {
val textView = TextView(mContext)
val textViewHeight = UIUtil.dip2px(mContext, 47.0)
textView.layoutParams =
ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, textViewHeight)
textView.gravity = Gravity.CENTER
textView.setTextColor(mContext.resources.getColor(R.color.color_666666))
textView.text = getString(R.string.me_no_skill_card_added_yet)
textView.textSize = 12.0f
val conner = UIUtil.dip2px(mContext, 8.0)
val drawable = GradientDrawable()
drawable.cornerRadius = conner.toFloat()
drawable.setColor(Color.parseColor("#F4F7FF"))
textView.background = drawable
return textView
/**
* 判断自己是不是该世界的创始人
*/
private fun isThisWorldOwner(bean: WorldDynamicBean?): Boolean {
return bean != null && bean.worldUid == AuthModel.get().currentUid
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun onDynamicRefreshEvent(event: DynamicRefreshEvent?) {
if (isResumed) {
vm.userInfoDetailData.observe(this) {
initDynamicList(it.dynamicInfo)
}
}
}
override fun onDestroyView() {
EventBus.getDefault().unregister(this)
super.onDestroyView()
}
}

View File

@@ -4,13 +4,12 @@ import android.annotation.SuppressLint
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.yizhuan.erban.skill.repository.SkillModel
import com.yizhuan.xchat_android_core.module_hall.hall.HallModel
import com.yizhuan.xchat_android_core.module_hall.hall.bean.ClanAndHallInfo
import com.yizhuan.xchat_android_core.user.UserInfoUiMgr
import com.yizhuan.xchat_android_core.user.UserModel
import com.yizhuan.xchat_android_core.user.bean.UserDetailInfo
import com.yizhuan.xchat_android_core.user.bean.UserInfoSkillEntity
import com.yizhuan.xchat_android_core.user.bean.UserInfo
import com.yizhuan.xchat_android_core.utils.net.BeanObserver
import com.yizhuan.xchat_android_core.utils.toast
import io.reactivex.disposables.CompositeDisposable
@@ -23,12 +22,12 @@ class UserInfoViewModel : ViewModel() {
var mRoomUid: Long = 0
private val _userInfoData = MutableLiveData<UserInfo>()
val userInfoData: LiveData<UserInfo> = _userInfoData
private val _userInfoDetailData = MutableLiveData<UserDetailInfo.DataBean>()
val userInfoDetailData: LiveData<UserDetailInfo.DataBean> = _userInfoDetailData
private val _userInfoSkillData = MutableLiveData<List<UserInfoSkillEntity>>()
val userInfoSkillData: LiveData<List<UserInfoSkillEntity>> = _userInfoSkillData
private val _hallData = MutableLiveData<ClanAndHallInfo>()
val hallData: LiveData<ClanAndHallInfo> = _hallData
@@ -37,6 +36,18 @@ class UserInfoViewModel : ViewModel() {
CompositeDisposable()
}
fun getUserInfo() {
UserModel.get().getUserInfoFromServer(userId)
.subscribe(object : BeanObserver<UserInfo?>() {
override fun onErrorMsg(error: String) { error.toast() }
override fun onSuccess(info: UserInfo) {
_userInfoData.value = info
}
override fun onSubscribe(d: Disposable) { disposable.add(d) }
})
}
fun getUserInfoDetail() {
UserModel.get().getUserInfoDetail(userId)
.subscribe(object : BeanObserver<UserDetailInfo?>() {
@@ -65,17 +76,6 @@ class UserInfoViewModel : ViewModel() {
disposable.add(subscribe)
}
@SuppressLint("CheckResult")
fun getUserSkillData(userId: Long) {
val subscribe = SkillModel.instance.getUserInfoSkillList(userId)
.toFlowable()
.subscribe({ _userInfoSkillData.value = it }, { th ->
th.printStackTrace()
th.message?.toast()
})
disposable.add(subscribe)
}
override fun onCleared() {
super.onCleared()
disposable.dispose()

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 734 B

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="180"
android:endColor="#19EBFF"
android:startColor="#ED66FF"
android:type="linear"
android:useLevel="true" />
</shape>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="#D3ACFE" android:endColor="#A486FF"/>
<corners android:radius="@dimen/dp_7"/>
</shape>

View File

@@ -9,9 +9,9 @@
<RelativeLayout
android:background="@color/color_F3F5FA"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="@color/color_F3F5FA">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/coordinator_layout"
@@ -47,7 +47,7 @@
android:id="@+id/roll_view"
android:layout_width="match_parent"
android:layout_height="245dp"
app:rollviewpager_play_delay="5000" >
app:rollviewpager_play_delay="5000">
<View
android:layout_width="match_parent"
@@ -62,81 +62,82 @@
android:layout_gravity="end|bottom"
android:layout_marginEnd="@dimen/dp_15"
android:layout_marginBottom="60dp"
android:paddingStart="@dimen/dp_10"
android:paddingEnd="@dimen/dp_10"
android:paddingTop="@dimen/dp_2"
android:paddingBottom="@dimen/dp_2"
android:background="@drawable/shape_66000000_100dp"
android:gravity="center"
android:includeFontPadding="false"
android:paddingStart="@dimen/dp_10"
android:paddingTop="@dimen/dp_2"
android:paddingEnd="@dimen/dp_10"
android:paddingBottom="@dimen/dp_2"
android:text="1/1"
android:textColor="@color/white"
android:textSize="@dimen/sp_10" />
<LinearLayout
android:id="@+id/ll_audio"
android:layout_width="63dp"
android:layout_height="@dimen/dp_25"
android:background="@drawable/bg_userinfo_skill_audio"
android:gravity="center_vertical"
android:orientation="horizontal"
android:layout_gravity="end|center_vertical"
android:visibility="gone"
tools:visibility="visible">
<ImageView
android:id="@+id/iv_audio_control"
android:layout_width="@dimen/dp_15"
android:layout_height="@dimen/dp_15"
android:layout_marginLeft="@dimen/dp_8"
android:src="@drawable/ic_skill_pause" />
<com.yizhuan.erban.ui.widget.LivingIconView
android:id="@+id/liv_user"
android:layout_width="60dp"
android:layout_height="20dp"
android:layout_marginLeft="@dimen/dp_6"
android:background="@color/transparent"
android:scaleType="fitXY"
app:cus_dp_height="20dp"
app:cus_dp_width="60dp"
app:cus_drawable="@drawable/skill_audio_animation" />
</LinearLayout>
</FrameLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginTop="-50dp"
android:layout_marginStart="@dimen/dp_15"
android:layout_marginTop="-50dp"
android:layout_marginEnd="@dimen/dp_15"
android:background="@drawable/shape_white_12dp_round"
android:clipChildren="false"
android:clipToPadding="false"
android:paddingStart="@dimen/dp_15"
android:paddingTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_15"
android:paddingEnd="0dp">
android:paddingEnd="0dp"
android:paddingBottom="@dimen/dp_15">
<com.yizhuan.erban.common.widget.CircleImageView
android:id="@+id/iv_user_head"
android:layout_width="88dp"
android:layout_height="88dp"
android:src="@drawable/default_avatar"
app:layout_constraintStart_toStartOf="parent"
app:cborder_color="@color/white"
app:cborder_width="1dp"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/viewLive"
android:layout_width="0dp"
android:layout_height="@dimen/dp_22"
android:layout_marginStart="7dp"
android:layout_marginEnd="7dp"
android:background="@drawable/ic_live_bottom"
app:layout_constraintBottom_toBottomOf="@+id/iv_user_head"
app:layout_constraintEnd_toEndOf="@+id/iv_user_head"
app:layout_constraintStart_toStartOf="@+id/iv_user_head" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvLive"
android:text="@string/me_in_live"
android:textSize="@dimen/sp_11"
android:textColor="@color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@+id/viewLive"
app:layout_constraintBottom_toBottomOf="@+id/viewLive"
app:layout_constraintStart_toStartOf="@+id/viewLive"
app:layout_constraintEnd_toEndOf="@+id/viewLive"/>
<androidx.constraintlayout.widget.Group
android:id="@+id/groupLive"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="viewLive,tvLive" />
<ImageView
android:id="@+id/iv_vip_icon"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_marginStart="@dimen/dp_12"
android:adjustViewBounds="true"
android:visibility="gone"
android:layout_marginStart="@dimen/dp_12"
app:layout_constraintBottom_toBottomOf="@id/tv_nick"
app:layout_constraintStart_toEndOf="@+id/iv_user_head"
app:layout_constraintTop_toTopOf="@id/tv_nick"
@@ -168,12 +169,12 @@
android:id="@+id/ll_id"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_8"
android:gravity="center_vertical"
android:orientation="horizontal"
android:layout_marginStart="@dimen/dp_12"
app:layout_constraintStart_toEndOf="@+id/iv_user_head"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_user_head"
app:layout_constraintTop_toBottomOf="@id/tv_nick">
<TextView
@@ -198,8 +199,8 @@
<View
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
android:layout_weight="1" />
<LinearLayout
android:layout_width="wrap_content"
@@ -313,24 +314,36 @@
android:layout_weight="1"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/iv_where"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_in_live_gradient"
android:gravity="center"
android:includeFontPadding="false"
android:paddingStart="@dimen/dp_7"
android:paddingTop="@dimen/dp_5"
android:paddingEnd="@dimen/dp_7"
android:paddingBottom="@dimen/dp_5"
android:drawablePadding="@dimen/dp_6"
android:text="@string/me_in_live"
android:textColor="@color/white"
android:textSize="@dimen/sp_12"
<LinearLayout
android:id="@+id/ll_audio"
android:layout_width="63dp"
android:layout_height="@dimen/dp_25"
android:layout_gravity="end|center_vertical"
android:background="@drawable/bg_userinfo_skill_audio"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone"
tools:visibility="visible"
app:drawableStartCompat="@drawable/icon_in_live" />
tools:visibility="visible">
<ImageView
android:id="@+id/iv_audio_control"
android:layout_width="@dimen/dp_15"
android:layout_height="@dimen/dp_15"
android:layout_marginStart="@dimen/dp_8"
android:src="@drawable/ic_skill_pause" />
<com.yizhuan.erban.ui.widget.LivingIconView
android:id="@+id/liv_user"
android:layout_width="60dp"
android:layout_height="20dp"
android:layout_marginStart="@dimen/dp_6"
android:background="@color/transparent"
android:scaleType="fitXY"
app:cus_dp_height="20dp"
app:cus_dp_width="60dp"
app:cus_drawable="@drawable/skill_audio_animation" />
</LinearLayout>
</LinearLayout>
@@ -338,11 +351,11 @@
android:id="@+id/tv_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:ellipsize="end"
android:maxLines="2"
android:textColor="@color/color_B3B3C3"
android:textSize="@dimen/sp_13"
android:layout_marginTop="@dimen/dp_10"
app:layout_constraintTop_toBottomOf="@id/ll_level"
tools:text="@string/layout_activity_user_info_04" />
@@ -395,9 +408,9 @@
android:id="@+id/tv_edit"
android:layout_width="@dimen/dp_30"
android:layout_height="@dimen/dp_30"
android:src="@drawable/icon_home_page_compile"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/icon_home_page_compile"
android:visibility="gone" />
</RelativeLayout>
@@ -430,8 +443,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/dp_15"
android:layout_marginEnd="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_60"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />

View File

@@ -10,303 +10,143 @@
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/ll_skill"
android:id="@+id/ll_personal_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_ffffff_8"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_20"
android:paddingTop="@dimen/dp_18"
android:paddingRight="@dimen/dp_20"
android:paddingBottom="@dimen/dp_12"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/me_skill_card"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp_14"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_skill"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:layout_marginBottom="8dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_module_hall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_ffffff_8"
android:orientation="vertical"
android:paddingStart="20dp"
android:paddingTop="18dp"
android:paddingEnd="5dp"
android:paddingBottom="20dp"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/ll_skill"
android:padding="@dimen/dp_12"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible">
<TextView
android:id="@+id/tv_hall_detail"
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_hall_detail1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/me_association_room"
android:textColor="@color/text_normal_c6c6e9"
android:text="@string/personal_data"
android:textColor="@color/text_title_color"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:visibility="visible" />
<LinearLayout
android:id="@+id/ll_clan"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginBottom="10dp"
android:visibility="gone"
tools:visibility="visible">
android:layout_marginTop="@dimen/dp_12"
android:orientation="horizontal">
<com.yizhuan.erban.common.widget.RectRoundImageView
android:id="@+id/iv_clan_avatar"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginEnd="@dimen/dp_10"
android:src="@drawable/default_cover"
app:borderRadius="8dp"
app:type="round" />
<LinearLayout
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical"
android:paddingStart="0dp"
android:paddingEnd="10dp">
<TextView
android:id="@+id/tv_clan_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:fontFamily="sans-serif-medium"
android:includeFontPadding="false"
android:lines="1"
android:maxLength="9"
android:textColor="@color/text_title_color"
android:textSize="@dimen/sp_12"
tools:text="@string/layout_fragment_userinfo_userinfo_01" />
<TextView
android:id="@+id/tv_clan_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_3"
android:ellipsize="end"
android:lines="1"
android:textColor="@color/color_999999"
android:textSize="@dimen/sp_12"
android:visibility="gone"
tools:text="@string/layout_fragment_userinfo_userinfo_02" />
<TextView
android:id="@+id/tv_clan_member_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:ellipsize="end"
android:lines="1"
android:textColor="@color/color_666666"
android:textSize="@dimen/sp_12"
android:visibility="gone"
tools:text="@string/layout_fragment_userinfo_userinfo_03" />
<TextView
android:id="@+id/tv_clan_hall_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:ellipsize="end"
android:lines="1"
android:textColor="@color/text_normal_c6c6e9"
android:textSize="@dimen/sp_12"
android:visibility="gone"
tools:text="@string/layout_fragment_userinfo_userinfo_04" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_clan_level"
android:layout_width="70dp"
android:layout_height="65dp"
android:layout_marginEnd="24dp"
android:src="@drawable/default_cover"
android:visibility="gone" />
<ImageView
android:id="@+id/iv_clan_arrow"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="10dp"
android:rotation="90"
android:scaleType="center"
android:src="@drawable/arrow_right" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_hall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="15dp"
android:background="@drawable/top_line"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingTop="7dp"
android:visibility="gone"
tools:visibility="visible">
<com.yizhuan.erban.common.widget.RectRoundImageView
android:id="@+id/iv_hall_avatar"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="@dimen/dp_10"
android:src="@drawable/default_cover"
app:borderRadius="8dp"
app:type="round" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="0dp"
android:paddingEnd="10dp">
<TextView
android:id="@+id/tv_hall_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:fontFamily="sans-serif-medium"
android:hint="@string/me_not_joining_the_room"
android:includeFontPadding="false"
android:lines="1"
android:maxLength="9"
android:textColor="@color/text_title_color"
android:textColorHint="@color/color_999999"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_hall_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:ellipsize="end"
android:lines="1"
android:textColor="@color/text_normal_c6c6e9"
android:textSize="@dimen/sp_12"
android:visibility="gone"
tools:text="@string/layout_fragment_userinfo_userinfo_05" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:orientation="horizontal"
android:visibility="gone">
<TextView
android:id="@+id/tv_hall_erban_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:lines="1"
android:textColor="@color/color_999999"
android:textSize="@dimen/sp_12"
tools:text="@string/layout_fragment_userinfo_userinfo_06" />
<TextView
android:id="@+id/tv_hall_member_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:ellipsize="end"
android:lines="1"
android:textColor="@color/color_999999"
android:textSize="@dimen/sp_12"
tools:text="@string/layout_fragment_userinfo_userinfo_07" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
android:text="@string/user_constellation"
android:textColor="@color/text_title_color"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_apply_hall"
android:layout_width="80dp"
android:layout_height="@dimen/dp_28"
android:layout_gravity="center"
android:layout_marginEnd="15dp"
android:background="@drawable/bg_gradient_cc66ff_9cb3ff_30"
android:id="@+id/tv_constellation"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_13"
android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/dp_10"
android:background="@drawable/shape_gradient_d3acfe_a486ff"
android:gravity="center"
android:includeFontPadding="false"
android:text="@string/me_apply_to_join"
android:textColor="@color/color_9168FA"
android:textSize="14sp"
android:visibility="gone"
tools:visibility="visible" />
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:textColor="@color/white"
android:textSize="@dimen/sp_10"
tools:text="@string/layout_activity_user_info_03" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_6"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/user_birthday"
android:textColor="@color/text_title_color"
android:textSize="@dimen/sp_12" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvBirth"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_10"
android:textColor="@color/text_title_color"
android:textSize="@dimen/sp_12"
tools:text="1999-10-21" />
</LinearLayout>
<LinearLayout
android:id="@+id/llRoom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_6"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/user_room"
android:textColor="@color/text_title_color"
android:textSize="@dimen/sp_12" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvRoom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_10"
android:drawableEnd="@drawable/ic_room_yellow_arrow"
android:gravity="center"
android:textColor="@color/color_ffbc51"
android:textSize="@dimen/sp_12"
tools:text="QX家族" />
</LinearLayout>
<LinearLayout
android:id="@+id/llAssociation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_6"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/user_association"
android:textColor="@color/text_title_color"
android:textSize="@dimen/sp_12" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvAssociation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_10"
android:drawableEnd="@drawable/ic_room_yellow_arrow"
android:textColor="@color/color_ffbc51"
android:textSize="@dimen/sp_12"
tools:text="無憂傳媒" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_no_association"
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/mRecyclerView"
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_height="0dp"
android:layout_marginTop="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_14"
android:background="@drawable/bg_ffffff_8"
android:orientation="vertical"
android:paddingStart="20dp"
android:paddingTop="18dp"
android:paddingEnd="5dp"
android:paddingBottom="20dp"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/ll_module_hall"
tools:visibility="visible">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/me_association_room"
android:textColor="@color/text_normal_c6c6e9"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:visibility="visible" />
<TextView
android:text="@string/not_yet_joined_guild"
android:textSize="@dimen/sp_14"
android:textColor="@color/color_b3b3b3"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintTop_toBottomOf="@+id/ll_personal_data" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -5041,5 +5041,10 @@
<string name="delete_sound">刪除聲音</string>
<string name="sure_to_delete_sound">確定要刪除這段聲音嗎?</string>
<string name="sound_audit_in_progress">聲音審核中,審核通過即可展示~</string>
<string name="personal_data">個人資料</string>
<string name="user_constellation">星座:</string>
<string name="user_birthday">生日:</string>
<string name="user_room">房間:</string>
<string name="user_association">公會:</string>
</resources>

View File

@@ -4,7 +4,6 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_ffffff_8"
android:orientation="vertical">
<TextView
@@ -18,7 +17,7 @@
android:textColor="@color/text_secondary_4f516a"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="@dimen/dp_15"
android:textSize="@dimen/dp_11"
android:textSize="@dimen/sp_10"
tools:text="@string/layout_item_userinfo_dynamic_01" />
<com.yizhuan.erban.community.widget.ExpandableTextView
@@ -123,7 +122,7 @@
android:id="@+id/rl_option"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_30"
android:layout_marginBottom="@dimen/dp_11"
android:layout_marginBottom="@dimen/dp_10"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:layout_marginStart="@dimen/dp_15"
@@ -220,11 +219,11 @@
<View
android:id="@+id/line_bottom"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginStart="15dp"
android:layout_height="1dp"
android:layout_marginStart="@dimen/dp_12"
android:layout_marginTop="10dp"
android:layout_marginEnd="15dp"
android:background="@color/line_353548"
android:layout_marginEnd="@dimen/dp_12"
android:background="@color/color_F7F7F7"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rl_option" />