消息页面UI修改
This commit is contained in:
@@ -59,6 +59,10 @@ android {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
viewBinding {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
exclude 'lib/armeabi-v7a/libagora-crypto.so'
|
||||
}
|
||||
|
@@ -575,7 +575,7 @@
|
||||
android:label="66星球"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateAlwaysHidden"></activity>
|
||||
android:windowSoftInputMode="adjustPan|stateAlwaysHidden"/>
|
||||
<activity
|
||||
android:name=".ui.keepalive.OnePiexlActivity"
|
||||
android:screenOrientation="portrait"
|
||||
|
@@ -32,5 +32,8 @@ abstract class BaseViewBindingFragment<T : ViewBinding> : BaseFragment() {
|
||||
_binding = null
|
||||
}
|
||||
|
||||
override fun initiate() {
|
||||
}
|
||||
|
||||
abstract fun init()
|
||||
}
|
@@ -1,113 +1,60 @@
|
||||
package com.yizhuan.erban.home.fragment;
|
||||
package com.yizhuan.erban.home.fragment
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.netease.nimlib.sdk.NIMClient;
|
||||
import com.netease.nimlib.sdk.msg.MsgService;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.base.BaseFragment;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
import com.yizhuan.erban.friend.action.AbstractSelectFriendAction;
|
||||
import com.yizhuan.erban.home.adapter.ContactsIndicatorAdapter;
|
||||
import com.yizhuan.erban.home.adapter.FragmentViewPagerAdapter;
|
||||
import com.yizhuan.erban.home.event.ContactTrashEvent;
|
||||
import com.yizhuan.erban.ui.im.friend.FriendListFragment;
|
||||
import com.yizhuan.erban.ui.im.recent.RecentListFragment;
|
||||
import com.yizhuan.erban.ui.pay.ChargeActivity;
|
||||
import com.yizhuan.erban.ui.relation.FansListFragment;
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.ViewPagerHelper;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
import com.yizhuan.xchat_android_core.UriProvider;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.netease.nimlib.sdk.NIMClient
|
||||
import com.netease.nimlib.sdk.msg.MsgService
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseViewBindingFragment
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager.AbsOkDialogListener
|
||||
import com.yizhuan.erban.databinding.FragmentContactListBinding
|
||||
import com.yizhuan.erban.home.event.ContactTrashEvent
|
||||
import com.yizhuan.erban.ui.im.recent.RecentListFragment
|
||||
import com.yizhuan.erban.ui.relation.AttentionListActivity
|
||||
import com.yizhuan.erban.ui.relation.FansListActivity
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
|
||||
/**
|
||||
* @author jack
|
||||
* @Description
|
||||
* @Date 2018/11/1
|
||||
*/
|
||||
public class ContactsListFragment extends BaseFragment implements ContactsIndicatorAdapter.OnItemSelectListener {
|
||||
public static final String TAG = "ContactsListFragment";
|
||||
private MagicIndicator indicator;
|
||||
private ViewPager viewpager;
|
||||
private ImageView ivContactTrash;
|
||||
class ContactsListFragment : BaseViewBindingFragment<FragmentContactListBinding>() {
|
||||
|
||||
public static Fragment newInstance() {
|
||||
return new ContactsListFragment();
|
||||
companion object {
|
||||
const val TAG = "ContactsListFragment"
|
||||
@JvmStatic
|
||||
fun newInstance(): Fragment {
|
||||
return ContactsListFragment()
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRootLayoutId() {
|
||||
return R.layout.fragment_contact_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFindViews() {
|
||||
super.onFindViews();
|
||||
indicator = getView().findViewById(R.id.indicator);
|
||||
viewpager = getView().findViewById(R.id.viewpager);
|
||||
ivContactTrash = getView().findViewById(R.id.iv_contact_trash);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiate() {
|
||||
List<String> tabInfoList = new ArrayList<>();
|
||||
tabInfoList.add(getString(R.string.message));
|
||||
tabInfoList.add(getString(R.string.friend));
|
||||
tabInfoList.add(getString(R.string.attention));
|
||||
tabInfoList.add(getString(R.string.fan));
|
||||
|
||||
List<Fragment> mTabs = new ArrayList<>();
|
||||
mTabs.add(RecentListFragment.newInstance(false));
|
||||
mTabs.add(new FriendListFragment());
|
||||
mTabs.add(AttentionFragment.newInstance(AbstractSelectFriendAction.TYPE_NORMAL));
|
||||
mTabs.add(FansListFragment.newInstance(Constants.FAN_MAIN_PAGE_TYPE));
|
||||
|
||||
ContactsIndicatorAdapter mMsgIndicatorAdapter = new ContactsIndicatorAdapter(mContext, tabInfoList, 0);
|
||||
mMsgIndicatorAdapter.setOnItemSelectListener(this);
|
||||
CommonNavigator commonNavigator = new CommonNavigator(getContext());
|
||||
commonNavigator.setAdjustMode(true);
|
||||
commonNavigator.setAdapter(mMsgIndicatorAdapter);
|
||||
indicator.setNavigator(commonNavigator);
|
||||
// must after setNavigator
|
||||
LinearLayout titleContainer = commonNavigator.getTitleContainer();
|
||||
titleContainer.setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE);
|
||||
|
||||
viewpager.setAdapter(new FragmentViewPagerAdapter(getChildFragmentManager(), mTabs));
|
||||
viewpager.setOffscreenPageLimit(3);
|
||||
ViewPagerHelper.bind(indicator, viewpager);
|
||||
|
||||
override fun init() {
|
||||
childFragmentManager.beginTransaction()
|
||||
.add(R.id.fcv, RecentListFragment.newInstance(false))
|
||||
.commitAllowingStateLoss()
|
||||
//标记已读消息
|
||||
ivContactTrash.setOnClickListener(v -> {
|
||||
if (NIMClient.getService(MsgService.class).getTotalUnreadCount() > 0){
|
||||
getDialogManager().showOkCancelDialog(getString(R.string.tips_clear_unread_count),
|
||||
getString(R.string.text_canle),getString(R.string.tips_ok_label_clear),
|
||||
new DialogManager.AbsOkDialogListener() {
|
||||
@Override
|
||||
public void onOk() {}
|
||||
@Override
|
||||
public void onCancel() {
|
||||
EventBus.getDefault().post(new ContactTrashEvent());
|
||||
binding.ivContactTrash.setOnClickListener {
|
||||
if (NIMClient.getService(MsgService::class.java).totalUnreadCount > 0) {
|
||||
dialogManager.showOkCancelDialog(getString(R.string.tips_clear_unread_count),
|
||||
getString(R.string.text_canle), getString(R.string.tips_ok_label_clear),
|
||||
object : AbsOkDialogListener() {
|
||||
override fun onOk() {}
|
||||
override fun onCancel() {
|
||||
EventBus.getDefault().post(ContactTrashEvent())
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
binding.tvFans.setOnClickListener {
|
||||
FansListActivity.start(requireContext(),FansListActivity.TYPE_FANS)
|
||||
}
|
||||
binding.tvAttention.setOnClickListener {
|
||||
AttentionListActivity.start(requireContext())
|
||||
}
|
||||
binding.tvFriend.setOnClickListener {
|
||||
FansListActivity.start(requireContext(),FansListActivity.TYPE_FRIEND)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onItemSelect(int position) {
|
||||
viewpager.setCurrentItem(position);
|
||||
}
|
||||
}
|
||||
}
|
@@ -293,7 +293,6 @@ public class MeFragment extends BaseMvpFragment<IMainFragmentView, MainFragmentP
|
||||
break;
|
||||
|
||||
case R.id.tv_user_fans:
|
||||
|
||||
case R.id.tv_user_fan_text:
|
||||
startActivity(new Intent(mContext, FansListActivity.class));
|
||||
break;
|
||||
|
@@ -181,7 +181,6 @@ public class RecentContactsFragment extends TFragment {
|
||||
adapter = new RecentContactAdapter(recyclerView, items);
|
||||
initCallBack();
|
||||
adapter.setCallback(callback);
|
||||
|
||||
// recyclerView
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
|
@@ -1,52 +1,68 @@
|
||||
package com.yizhuan.erban.ui.relation;
|
||||
package com.yizhuan.erban.ui.relation
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.netease.nim.uikit.StatusBarUtil;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.base.BaseActivity;
|
||||
import com.yizhuan.erban.home.fragment.AttentionFragment;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.netease.nim.uikit.StatusBarUtil
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseActivity
|
||||
import com.yizhuan.erban.home.fragment.AttentionFragment
|
||||
import com.yizhuan.erban.ui.im.friend.FriendListFragment
|
||||
import com.yizhuan.xchat_android_core.Constants
|
||||
|
||||
/**
|
||||
* 粉丝列表
|
||||
*/
|
||||
public class FansListActivity extends BaseActivity {
|
||||
class FansListActivity : BaseActivity() {
|
||||
|
||||
public static final String IS_ATTENT = "is_attent";
|
||||
companion object {
|
||||
private const val KEY_TYPE = "key_type"
|
||||
const val TYPE_FANS = "fans"
|
||||
const val TYPE_ATTENTION = "attention"
|
||||
const val TYPE_FRIEND = "Friend"
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_fans);
|
||||
|
||||
|
||||
if (getIntent().getBooleanExtra(IS_ATTENT, false)) {
|
||||
initTitleBar(getString(R.string.my_attention));
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.add(R.id.fragment_container, AttentionFragment.newInstance(
|
||||
Constants.FAN_NO_MAIN_PAGE_TYPE), AttentionFragment.class.getSimpleName())
|
||||
.commitAllowingStateLoss();
|
||||
return;
|
||||
@JvmStatic
|
||||
fun start(context: Context, type: String) {
|
||||
val starter = Intent(context, FansListActivity::class.java)
|
||||
starter.putExtra(KEY_TYPE, type)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
initTitleBar(getString(R.string.my_fan));
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.add(R.id.fragment_container, FansListFragment.newInstance(Constants.FAN_NO_MAIN_PAGE_TYPE),
|
||||
FansListFragment.class.getSimpleName())
|
||||
.commitAllowingStateLoss();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean needSteepStateBar() {
|
||||
return true;
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_fans)
|
||||
when (intent.getStringExtra(KEY_TYPE) ?: "") {
|
||||
TYPE_ATTENTION -> {
|
||||
initTitleBar(getString(R.string.my_attention))
|
||||
commitF(AttentionFragment.newInstance(Constants.FAN_NO_MAIN_PAGE_TYPE))
|
||||
}
|
||||
TYPE_FRIEND -> {
|
||||
initTitleBar(getString(R.string.friend))
|
||||
commitF(FriendListFragment.newInstance(false, 0))
|
||||
}
|
||||
else -> {
|
||||
initTitleBar(getString(R.string.fan))
|
||||
commitF(FansListFragment.newInstance(Constants.FAN_NO_MAIN_PAGE_TYPE))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setStatusBar() {
|
||||
super.setStatusBar();
|
||||
StatusBarUtil.transparencyBar(this);
|
||||
StatusBarUtil.StatusBarLightMode(this);
|
||||
private fun commitF(fragment: Fragment) {
|
||||
supportFragmentManager.beginTransaction()
|
||||
.add(R.id.fragment_container, fragment)
|
||||
.commitAllowingStateLoss()
|
||||
}
|
||||
}
|
||||
|
||||
override fun needSteepStateBar(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun setStatusBar() {
|
||||
super.setStatusBar()
|
||||
StatusBarUtil.transparencyBar(this)
|
||||
StatusBarUtil.StatusBarLightMode(this)
|
||||
}
|
||||
|
||||
}
|
@@ -1,939 +0,0 @@
|
||||
package com.yizhuan.erban.ui.user;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.load.engine.GlideException;
|
||||
import com.bumptech.glide.request.RequestListener;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.bumptech.glide.request.target.ViewTarget;
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
import com.netease.nim.uikit.impl.cache.NimUserInfoCache;
|
||||
import com.netease.nim.uikit.support.glide.GlideApp;
|
||||
import com.netease.nimlib.sdk.RequestCallbackWrapper;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomKickOutEvent;
|
||||
import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;
|
||||
import com.opensource.svgaplayer.SVGACallback;
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.UIHelper;
|
||||
import com.yizhuan.erban.audio.RecordingVoiceActivity;
|
||||
import com.yizhuan.erban.avroom.ButtonItemFactory;
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||
import com.yizhuan.erban.base.BaseBindingActivity;
|
||||
import com.yizhuan.erban.common.widget.dialog.CommonPopupDialog;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
import com.yizhuan.erban.community.user_dynamic.UserDynamicFrg;
|
||||
import com.yizhuan.erban.databinding.ActivityUserInfoOldBinding;
|
||||
import com.yizhuan.erban.family.view.activity.FamilyHomeActivity;
|
||||
import com.yizhuan.erban.family.view.activity.FamilyMemberListActivity;
|
||||
import com.yizhuan.erban.family.view.activity.FamilyMemberSearchActivity;
|
||||
import com.yizhuan.erban.ui.im.avtivity.NimFriendModel;
|
||||
import com.yizhuan.erban.ui.im.avtivity.NimP2PMessageActivity;
|
||||
import com.yizhuan.erban.ui.relation.FansListActivity;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.erban.ui.widget.ButtonItem;
|
||||
import com.yizhuan.erban.ui.widget.ObservableScrollView;
|
||||
import com.yizhuan.erban.ui.widget.UserMagicIndicator;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import com.yizhuan.erban.utils.AppBarStateChangeListener;
|
||||
import com.yizhuan.erban.utils.BlurTransformation;
|
||||
import com.yizhuan.erban.utils.RegexUtil;
|
||||
import com.yizhuan.xchat_android_constants.XChatConstants;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.decoration.headwear.bean.HeadWearInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.TabInfo;
|
||||
import com.yizhuan.xchat_android_core.im.friend.IMFriendModel;
|
||||
import com.yizhuan.xchat_android_core.level.UserLevelVo;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
import com.yizhuan.xchat_android_core.manager.RoomEvent;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleInfo;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleUtil;
|
||||
import com.yizhuan.xchat_android_core.praise.PraiseModel;
|
||||
import com.yizhuan.xchat_android_core.praise.event.IsLikedEvent;
|
||||
import com.yizhuan.xchat_android_core.praise.event.PraiseEvent;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel;
|
||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
||||
import com.yizhuan.xchat_android_core.user.UserInfoUiMgr;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserPhoto;
|
||||
import com.yizhuan.xchat_android_core.user.event.LoginUserInfoUpdateEvent;
|
||||
import com.yizhuan.xchat_android_core.utils.StarUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.net.BeanObserver;
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes;
|
||||
import com.yizhuan.xchat_android_library.utils.SizeUtils;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* create by lvzebiao on 2018/8/31
|
||||
*/
|
||||
|
||||
@ActLayoutRes(R.layout.activity_user_info_old)
|
||||
public class UserInfoOldActivity extends BaseBindingActivity<ActivityUserInfoOldBinding>
|
||||
implements UserPhotoAdapter.ImageClickListener, ObservableScrollView.ScrollViewListener,
|
||||
UserMagicIndicator.OnItemSelectListener {
|
||||
|
||||
public static final int REQUEST_CODE_UPDATE_VOICE = 1;
|
||||
|
||||
private int TAB_SIZE = 4;
|
||||
private int TAB_DYNAMIC = 0;
|
||||
private int TAB_INFORMATION = 1;
|
||||
private int TAB_GIFT = 2;
|
||||
private int TAB_CAR = 3;
|
||||
|
||||
@Override
|
||||
public void onItemSelect(int position) {
|
||||
Log.i("onItemselect", "position:" + position);
|
||||
mBinding.vpUserInfo.setCurrentItem(position);
|
||||
}
|
||||
|
||||
public interface IdentityState {
|
||||
int NON = 0; // 无法识别
|
||||
int OWN = 1; // 自己
|
||||
int OTHER = 2; // 其他人
|
||||
}
|
||||
|
||||
private int identityState = IdentityState.NON;
|
||||
|
||||
private UserInfoOldActivity mActivity;
|
||||
private long userId;
|
||||
private UserInfo userInfo;
|
||||
private SVGAParser mSVGAParser;
|
||||
Drawable mAttenDrawable;
|
||||
Drawable mAttenedDrawable;
|
||||
|
||||
private boolean mIslike = false;
|
||||
private RoomInfo mRoomInfo = null;
|
||||
private int flag = 0;
|
||||
private boolean isNoble;
|
||||
private LinearLayout bottomViewLayout = null;
|
||||
private TextView sendMsgLayout;
|
||||
private TextView attentionLayout;
|
||||
|
||||
private ImageView ivOfficialMask;
|
||||
private TextView tvOfficialMask;
|
||||
|
||||
UserInfoFragment mUserInfoFragment;
|
||||
UserInfoGiftGroupFrg mUserInfoGiftGroupFrg;
|
||||
UserInfoCarFragment mUserInfoCarFragment;
|
||||
UserDynamicFrg mUserDynamicFrg;
|
||||
|
||||
private void onSetListener() {
|
||||
mBinding.ivUserBack.setOnClickListener(this);
|
||||
mBinding.ivEdit.setOnClickListener(this);
|
||||
mBinding.llUserRoom.setOnClickListener(this);
|
||||
mBinding.llWhere.setOnClickListener(this);
|
||||
mBinding.imageView.setOnClickListener(this);
|
||||
|
||||
mBinding.ablUserInfo.addOnOffsetChangedListener(new AppBarStateChangeListener() {
|
||||
@Override
|
||||
public void onStateChanged(AppBarLayout appBarLayout, State state) {
|
||||
if (state == State.EXPANDED) {
|
||||
//展开状态
|
||||
setEditButton(identityState, true);
|
||||
setBackBottom(true);
|
||||
setTitleVisible(false);
|
||||
|
||||
} else if (state == State.COLLAPSED) {
|
||||
//折叠状态
|
||||
setEditButton(identityState, false);
|
||||
setBackBottom(false);
|
||||
setTitleVisible(true);
|
||||
|
||||
} else {
|
||||
//中间状态
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
mActivity = this;
|
||||
userId = getIntent().getLongExtra("userId", 0);
|
||||
UserInfoUiMgr.get().setUid(userId);
|
||||
|
||||
onFindViews();
|
||||
onSetListener();
|
||||
EventBus.getDefault().register(this);
|
||||
|
||||
mSVGAParser = new SVGAParser(this);
|
||||
UserModel.get().getUserInfoFromServer(userId)
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(new BeanObserver<UserInfo>() {
|
||||
@Override
|
||||
public void onErrorMsg(String error) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(UserInfo Info) {
|
||||
userInfo = Info;
|
||||
//这里座驾只显示一次
|
||||
if (userInfo.getCarInfo() != null && userInfo.getCarInfo().isUsing()) {
|
||||
try {
|
||||
mSVGAParser.parse(new URL(userInfo.getCarInfo().getEffect()), new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
public void onComplete(SVGAVideoEntity videoItem) {
|
||||
mBinding.userInfoSvgaCar.setVisibility(View.VISIBLE);
|
||||
mBinding.userInfoSvgaCar.setLoops(1);
|
||||
Drawable drawable = new SVGADrawable(videoItem);
|
||||
mBinding.userInfoSvgaCar.setImageDrawable(drawable);
|
||||
mBinding.userInfoSvgaCar.startAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
mBinding.userInfoSvgaCar.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
initData(userInfo);
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.userInfoSvgaCar.setCallback(new SVGACallback() {
|
||||
@Override
|
||||
public void onPause() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinished() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRepeat() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStep(int i, double v) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
mAttenDrawable = ContextCompat.getDrawable(this, R.drawable.icon_new_attention);
|
||||
mAttenedDrawable = ContextCompat.getDrawable(this, R.drawable.ic_attened);
|
||||
|
||||
mBinding.userInfoSvgaCar.clearAnimation();
|
||||
mBinding.userInfoSvgaCar.setVisibility(View.GONE);
|
||||
mSVGAParser = new SVGAParser(this);
|
||||
|
||||
if (AuthModel.get().getCurrentUid() == userId) {
|
||||
identityState = IdentityState.OWN;
|
||||
mBinding.tvAttentionCount.setOnClickListener(this);
|
||||
mBinding.tvUserAttentionText.setOnClickListener(this);
|
||||
mBinding.tvFansCount.setOnClickListener(this);
|
||||
mBinding.tvUserFanText.setOnClickListener(this);
|
||||
setWhereVisible(false);
|
||||
|
||||
if (bottomViewLayout != null)
|
||||
bottomViewLayout.setVisibility(View.GONE);
|
||||
} else {
|
||||
if (userId == XChatConstants.SECRETARY_UID || userId == XChatConstants.SYSTEM_MESSAGE_UID) {
|
||||
identityState = IdentityState.NON;
|
||||
} else {
|
||||
identityState = IdentityState.OTHER;
|
||||
}
|
||||
setWhereVisible(true);
|
||||
|
||||
if (bottomViewLayout == null) {
|
||||
View view = mBinding.vsBottomLayout.getViewStub().inflate();
|
||||
bottomViewLayout = view.findViewById(R.id.bottom_view_layout);
|
||||
sendMsgLayout = view.findViewById(R.id.send_msg_layout);
|
||||
attentionLayout = view.findViewById(R.id.attention_layout);
|
||||
sendMsgLayout.setOnClickListener(this);
|
||||
attentionLayout.setOnClickListener(this);
|
||||
}
|
||||
|
||||
bottomViewLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
setEditButton(identityState, true);
|
||||
setBackBottom(true);
|
||||
setTitleVisible(false);
|
||||
|
||||
mCompositeDisposable.add(IMNetEaseManager.get().getChatRoomEventObservable()
|
||||
.subscribe(roomEvent -> {
|
||||
if (roomEvent != null) {
|
||||
switch (roomEvent.getEvent()) {
|
||||
case RoomEvent.KICK_OUT_ROOM:
|
||||
ChatRoomKickOutEvent reason = roomEvent.getReason();
|
||||
if (reason != null) {
|
||||
ChatRoomKickOutEvent.ChatRoomKickOutReason kickOutReason = reason.getReason();
|
||||
if (kickOutReason == ChatRoomKickOutEvent.ChatRoomKickOutReason.CHAT_ROOM_INVALID) {
|
||||
setUserRoomVisible(false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
if (mBinding.inOfficialMask != null) {
|
||||
ivOfficialMask = mBinding.inOfficialMask.findViewById(R.id.iv_official_mask);
|
||||
tvOfficialMask = mBinding.inOfficialMask.findViewById(R.id.tv_official_mask);
|
||||
}
|
||||
}
|
||||
|
||||
private void setEditButton(int identityState, boolean isExpanded) {
|
||||
|
||||
if (identityState == IdentityState.OWN) {
|
||||
mBinding.ivEdit.setVisibility(View.VISIBLE);
|
||||
mBinding.ivEdit.setImageResource(isExpanded ? R.drawable.icon_user_info_edit : R.drawable.icon_edit_black);
|
||||
|
||||
} else if (identityState == IdentityState.OTHER) {
|
||||
mBinding.ivEdit.setVisibility(View.VISIBLE);
|
||||
mBinding.ivEdit.setImageResource(isExpanded ? R.drawable.icon_home_page_more : R.drawable.icon_home_page_more_black);
|
||||
|
||||
} else {
|
||||
mBinding.ivEdit.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void setBackBottom(boolean isExpanded) {
|
||||
mBinding.ivUserBack.setImageResource(isExpanded ? R.drawable.icon_user_back : R.drawable.icon_user_back_black);
|
||||
}
|
||||
|
||||
private void setTitleVisible(boolean visible) {
|
||||
mBinding.tvUserInfoTitle.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 找到TA, 主态不展示
|
||||
*/
|
||||
private void setWhereVisible(boolean visible) {
|
||||
mBinding.viewLineTwo.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
mBinding.llWhere.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
/**
|
||||
* TA的房间, 主态不展示
|
||||
*/
|
||||
private void setUserRoomVisible(boolean visible) {
|
||||
mBinding.viewLineThree.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
mBinding.llUserRoom.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
private void onFindViews() {
|
||||
mBinding.tbUserInfo.setTitle("");
|
||||
|
||||
List<TabInfo> tabInfoList = new ArrayList<>(TAB_SIZE);
|
||||
tabInfoList.add(new TabInfo(TAB_DYNAMIC, "动态"));
|
||||
tabInfoList.add(new TabInfo(TAB_INFORMATION, "资料"));
|
||||
tabInfoList.add(new TabInfo(TAB_GIFT, "礼物"));
|
||||
tabInfoList.add(new TabInfo(TAB_CAR, "座驾"));
|
||||
|
||||
CommonNavigator commonNavigator = new CommonNavigator(this);
|
||||
commonNavigator.setAdjustMode(true);
|
||||
UserMagicIndicator indicator = new UserMagicIndicator(this, tabInfoList, 0);
|
||||
indicator.setOnItemSelectListener(this);
|
||||
commonNavigator.setAdapter(indicator);
|
||||
mBinding.miUserInfo.setNavigator(commonNavigator);
|
||||
mBinding.vpUserInfo.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
mBinding.miUserInfo.onPageScrolled(position, positionOffset, positionOffsetPixels);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
mBinding.miUserInfo.onPageSelected(position);
|
||||
setStatistic(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
mBinding.miUserInfo.onPageScrollStateChanged(state);
|
||||
}
|
||||
});
|
||||
|
||||
mUserDynamicFrg = UserDynamicFrg.newInstance(userId);
|
||||
mUserInfoFragment = UserInfoFragment.newInstance(userId, getIntent().getIntExtra("from", 1));
|
||||
mUserInfoGiftGroupFrg = UserInfoGiftGroupFrg.newInstance();
|
||||
mUserInfoCarFragment = UserInfoCarFragment.newInstance();
|
||||
|
||||
mBinding.vpUserInfo.setOffscreenPageLimit(3);
|
||||
mBinding.vpUserInfo.setAdapter(new FragmentPagerAdapter(getSupportFragmentManager()) {
|
||||
@Override
|
||||
public int getCount() {
|
||||
return TAB_SIZE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
if (position == TAB_DYNAMIC) {
|
||||
return mUserDynamicFrg;
|
||||
} else if (position == TAB_INFORMATION) {
|
||||
return mUserInfoFragment;
|
||||
} else if (position == TAB_GIFT) {
|
||||
return mUserInfoGiftGroupFrg;
|
||||
} else if (position == TAB_CAR) {
|
||||
return mUserInfoCarFragment;
|
||||
}
|
||||
return mUserInfoFragment;
|
||||
}
|
||||
});
|
||||
mBinding.vpUserInfo.setCurrentItem(0);
|
||||
setStatistic(0);
|
||||
}
|
||||
|
||||
// 埋点
|
||||
private void setStatistic(int position) {
|
||||
String temp = AuthModel.get().getCurrentUid() == userId ? "主态" : "客态";
|
||||
switch (position) {
|
||||
case 0:
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_HOMEPAGE_MOMENT, "个人主页动态tab-" + temp);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_HOMEPAGE_DATA, "个人主页资料tab-" + temp);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_HOMEPAGE_GIFT, "个人主页礼物tab-" + temp);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_HOMEPAGE_CAR, "个人主页座驾tab-" + temp);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onCurrentUserInfoUpdate(LoginUserInfoUpdateEvent event) {
|
||||
if (UserModel.get().getCacheLoginUserInfo().getUid() == userId) {
|
||||
userInfo = UserModel.get().getCacheLoginUserInfo();
|
||||
initData(userInfo);
|
||||
}
|
||||
}
|
||||
|
||||
private void initData(UserInfo userInfo) {
|
||||
if (null != userInfo) {
|
||||
UserInfoUiMgr.get().setValue(userInfo);
|
||||
|
||||
ImageLoadUtils.loadBigAvatar(this, userInfo.getAvatar(), mBinding.imageView, false);
|
||||
|
||||
requestRoomInfo(userInfo);
|
||||
|
||||
String nick = RegexUtil.getPrintableString(userInfo.getNick());
|
||||
mBinding.tvNick.setText(nick);
|
||||
mBinding.tvUserInfoTitle.setText(nick);
|
||||
Drawable drawable = ContextCompat.getDrawable(this,
|
||||
(userInfo.getGender() == 1) ? R.drawable.ic_gender_male : R.drawable.ic_gender_female);
|
||||
mBinding.tvNick.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null);
|
||||
|
||||
mBinding.tvAttentionCount.setText(String.valueOf(userInfo.getFollowNum()));
|
||||
mBinding.tvFansCount.setText(String.valueOf(userInfo.getFansNum()));
|
||||
|
||||
//设置星座
|
||||
String star = StarUtils.getConstellation(new Date(userInfo.getBirth()));
|
||||
if (null == star) {
|
||||
mBinding.tvConstellation.setVisibility(View.GONE);
|
||||
} else {
|
||||
mBinding.tvConstellation.setText(star);
|
||||
mBinding.tvConstellation.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mBinding.tvErbanId.setText(getString(R.string.me_user_id, userInfo.getErbanNo()));
|
||||
setUserLevel(userInfo.getUserLevelVo());
|
||||
|
||||
if (userInfo.getNameplate() != null) {
|
||||
setOfficialMask(userInfo.getNameplate().getFixedWord(), userInfo.getNameplate().getIconPic());
|
||||
} else {
|
||||
setOfficialMask("", "");
|
||||
}
|
||||
|
||||
NobleInfo nobleInfo = userInfo.getNobleInfo();
|
||||
HeadWearInfo headWearInfo = userInfo.getUserHeadwear();
|
||||
if (!TextUtils.isEmpty(userInfo.getAttestationBackPic())) {
|
||||
ImageLoadUtils.loadImage(this, userInfo.getAttestationBackPic(), mBinding.avatarBg);
|
||||
|
||||
} else if (nobleInfo != null) {
|
||||
setBgByLevel(true);
|
||||
String zoneBg = nobleInfo.getZoneBg();
|
||||
if (TextUtils.isEmpty(zoneBg)) {
|
||||
ImageLoadUtils.loadImage(this, userInfo.getAvatar(), mBinding.avatarBg);
|
||||
} else {
|
||||
ImageLoadUtils.loadImage(this, zoneBg, mBinding.avatarBg);
|
||||
}
|
||||
NobleUtil.loadResource(
|
||||
NobleUtil.getBadgeByLevel(nobleInfo.getLevel()), mBinding.ivUserNobleLevel);
|
||||
} else {
|
||||
setBgByLevel(false);
|
||||
mBinding.ivUserNobleLevel.setImageDrawable(null);
|
||||
GlideApp.with(this)
|
||||
.load(userInfo.getAvatar())
|
||||
.dontAnimate()
|
||||
.centerInside()
|
||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||
.listener(new RequestListener<Drawable>() {
|
||||
@Override
|
||||
public boolean onLoadFailed(@Nullable GlideException e, Object o,
|
||||
Target<Drawable> target, boolean b) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onResourceReady(Drawable drawable, Object o,
|
||||
Target<Drawable> target, DataSource dataSource, boolean b) {
|
||||
drawable.setColorFilter(context.getResources().getColor(R.color.black_transparent_20), PorterDuff.Mode.DARKEN);
|
||||
ViewTarget<ImageView, Drawable> viewTarget = (ViewTarget<ImageView, Drawable>) target;
|
||||
viewTarget.getView().setImageDrawable(drawable);
|
||||
return true;
|
||||
}
|
||||
})
|
||||
// “23”:设置模糊度(在0.0到25.0之间),默认”25";"4":图片缩放比例,默认“1”。
|
||||
.transforms(new BlurTransformation(context, 10, 1))
|
||||
.into(mBinding.avatarBg);
|
||||
}
|
||||
setHeadWare(headWearInfo, nobleInfo);
|
||||
|
||||
//设置靓号
|
||||
boolean hasPrettyErbanNo = userInfo.isHasPrettyErbanNo();
|
||||
mBinding.ivGoodNumber.setVisibility(hasPrettyErbanNo ? View.VISIBLE : View.GONE);
|
||||
// 设置官字
|
||||
mBinding.ivUserOfficial.setVisibility(userInfo.isOfficial() ? View.VISIBLE : View.GONE);
|
||||
// 设置新字
|
||||
mBinding.ivUserNew.setVisibility(userInfo.isNewUser() ? View.VISIBLE : View.GONE);
|
||||
|
||||
if (null == star) {
|
||||
mBinding.tvConstellation.setVisibility(View.GONE);
|
||||
} else {
|
||||
mBinding.tvConstellation.setText(star);
|
||||
mBinding.tvConstellation.setVisibility(View.VISIBLE);
|
||||
}
|
||||
//设置地址
|
||||
String address = null;
|
||||
if (null != userInfo.getUserExpand() && userInfo.getUserExpand().isShowLocation()) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String province = userInfo.getUserExpand().getProvinceName();
|
||||
if (!TextUtils.isEmpty(province)) {
|
||||
sb.append(" ").append(province);
|
||||
}
|
||||
String city = userInfo.getUserExpand().getCityName();
|
||||
if (!TextUtils.isEmpty(city)) {
|
||||
sb.append(" ").append(city);
|
||||
}
|
||||
if (sb.length() != 0) {
|
||||
address = sb.toString();
|
||||
}
|
||||
}
|
||||
if (TextUtils.isEmpty(address)) {
|
||||
mBinding.tvAddress.setVisibility(View.GONE);
|
||||
} else {
|
||||
mBinding.tvAddress.setText(address);
|
||||
mBinding.tvAddress.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
if (AuthModel.get().getCurrentUid() != userInfo.getUid()) {
|
||||
PraiseModel.get().isPraised(AuthModel.get().getCurrentUid(), userInfo.getUid()).subscribe();
|
||||
}
|
||||
|
||||
mUserInfoFragment.onGetUserInfo(userInfo);
|
||||
}
|
||||
}
|
||||
|
||||
private void requestRoomInfo(UserInfo userInfo) {
|
||||
AvRoomModel.get().requestRoomInfoByUser(String.valueOf(userInfo.getUid()))
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(roomInfo -> onGetRoomInfo(roomInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 自选头饰 -> 贵族头饰 -> 无
|
||||
*/
|
||||
private void setHeadWare(HeadWearInfo headWearInfo, NobleInfo nobleInfo) {
|
||||
mBinding.ivAvatarHeadWear.setImageDrawable(null);
|
||||
mBinding.ivAvatarHeadWear.setVisibility(View.GONE);
|
||||
|
||||
if (headWearInfo != null) {
|
||||
mBinding.ivAvatarHeadWear.setVisibility(View.VISIBLE);
|
||||
NobleUtil.loadHeadWear(headWearInfo.getPic(), mBinding.ivAvatarHeadWear);
|
||||
return;
|
||||
}
|
||||
|
||||
if (nobleInfo != null) {
|
||||
mBinding.ivAvatarHeadWear.setVisibility(View.VISIBLE);
|
||||
NobleUtil.loadResource(nobleInfo.getHeadWear(), mBinding.ivAvatarHeadWear);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void setUserLevel(UserLevelVo userLevelVo) {
|
||||
mBinding.ivUserCharm.setVisibility(View.GONE);
|
||||
mBinding.ivUserLevel.setVisibility(View.GONE);
|
||||
if (userLevelVo != null) {
|
||||
String userLevelUrl = userLevelVo.getExperUrl();
|
||||
String userCharmUrl = userLevelVo.getCharmUrl();
|
||||
if (!TextUtils.isEmpty(userLevelUrl)) {
|
||||
mBinding.ivUserLevel.setVisibility(View.VISIBLE);
|
||||
ImageLoadUtils.loadImage(this, userLevelUrl, mBinding.ivUserLevel);
|
||||
}
|
||||
if (!TextUtils.isEmpty(userCharmUrl)) {
|
||||
mBinding.ivUserCharm.setVisibility(View.VISIBLE);
|
||||
ImageLoadUtils.loadImage(this, userCharmUrl, mBinding.ivUserCharm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setBgByLevel(boolean isNoble) {
|
||||
this.isNoble = isNoble;
|
||||
mBinding.ivUserNobleLevel.setVisibility(isNoble ? View.VISIBLE : View.INVISIBLE);
|
||||
|
||||
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) mBinding.ivUserNobleLevel.getLayoutParams();
|
||||
layoutParams.width = isNoble ? SizeUtils.dp2px(this, 17f) : 0;
|
||||
layoutParams.height = isNoble ? SizeUtils.dp2px(this, 17f) : 0;
|
||||
|
||||
int nobleTextColor = ContextCompat.getColor(this, R.color.white_op_30);
|
||||
mBinding.tvConstellation.setTextColor(isNoble ? nobleTextColor : Color.WHITE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScrollChanged(NestedScrollView view, int x, int y, int oldx, int oldy) {
|
||||
if (flag == 0 && oldy > 300) {
|
||||
flag = 1;
|
||||
boolean isNoble = (userInfo != null && userInfo.getNobleInfo() != null);
|
||||
mBinding.ivEdit.setImageResource(
|
||||
(isNoble) ? R.drawable.icon_user_info_edit : R.drawable.icon_edit_black);
|
||||
} else if (flag == 1 && oldy <= 300) {
|
||||
flag = 0;
|
||||
mBinding.ivEdit.setImageResource(R.drawable.icon_user_info_edit);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void click(int position, UserPhoto userPhoto, boolean isOwner) {
|
||||
if (isOwner) {
|
||||
if (position > 0) {
|
||||
showUserPhoto(position - 1);
|
||||
} else {
|
||||
UIHelper.showModifyPhotosAct(this, userId);
|
||||
}
|
||||
} else {
|
||||
//创建一个集合拿来做用户所有照片信息
|
||||
showUserPhoto(position);
|
||||
}
|
||||
}
|
||||
|
||||
private void showUserPhoto(int position) {
|
||||
//创建一个集合拿来做用户所有照片信息
|
||||
ArrayList<UserPhoto> userPhotos = new ArrayList<>();
|
||||
List<UserPhoto> realmList = userInfo.getPrivatePhoto();
|
||||
for (UserPhoto photo : realmList) {
|
||||
UserPhoto newPhoto = new UserPhoto();
|
||||
newPhoto.setPid(photo.getPid());
|
||||
newPhoto.setPhotoUrl(photo.getPhotoUrl());
|
||||
userPhotos.add(newPhoto);
|
||||
}
|
||||
Intent intent = new Intent(mActivity, ShowPhotoActivity.class);
|
||||
intent.putExtra("position", position);
|
||||
intent.putExtra("photoList", userPhotos);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
private void editClick(int identityState) {
|
||||
if (identityState == IdentityState.OWN) {
|
||||
UIHelper.showUserInfoModifyAct(this, REQUEST_CODE_UPDATE_VOICE, userId);
|
||||
} else if (identityState == IdentityState.OTHER) {
|
||||
if (userInfo != null) {
|
||||
String account = String.valueOf(userInfo.getUid());
|
||||
boolean inMyBlackList = NimFriendModel.get().isInMyBlackList(account);
|
||||
List<ButtonItem> buttonItems = new ArrayList<>();
|
||||
if (!inMyBlackList) {
|
||||
ButtonItem blackListItem = ButtonItemFactory.createAddToBlackListItem(
|
||||
getDialogManager(), account);
|
||||
buttonItems.add(blackListItem);
|
||||
}
|
||||
ButtonItem reportItem = ButtonItemFactory.createReportItem(context, userInfo.getUid(), XChatConstants.REPORT_TYPE_PERSONAL);
|
||||
buttonItems.add(reportItem);
|
||||
new CommonPopupDialog(this, "", buttonItems, "取消", false).show();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void avatarClick(int identityState) {
|
||||
if (identityState == IdentityState.OWN) {
|
||||
UIHelper.showUserInfoModifyAct(this, REQUEST_CODE_UPDATE_VOICE, userId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_user_back:
|
||||
finish();
|
||||
break;
|
||||
|
||||
case R.id.imageView:
|
||||
avatarClick(identityState);
|
||||
break;
|
||||
|
||||
case R.id.iv_edit:
|
||||
editClick(identityState);
|
||||
break;
|
||||
case R.id.tv_attention_count:
|
||||
case R.id.tv_user_attention_text:
|
||||
Intent intent = new Intent(mActivity, FansListActivity.class);
|
||||
intent.putExtra(FansListActivity.IS_ATTENT, true);
|
||||
startActivity(intent);
|
||||
break;
|
||||
|
||||
case R.id.tv_fans_count:
|
||||
case R.id.tv_user_fan_text:
|
||||
startActivity(new Intent(mActivity, FansListActivity.class));
|
||||
break;
|
||||
|
||||
case R.id.ll_user_room:
|
||||
if (mRoomInfo != null) {
|
||||
LogUtil.i(Companion.TAG, "进入的房间: " + mRoomInfo.getUid());
|
||||
AVRoomActivity.start(this, mRoomInfo.getUid(), mRoomInfo.getType());
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.send_msg_layout:
|
||||
NimUserInfo nimUserInfo = NimUserInfoCache.getInstance().getUserInfo(String.valueOf(userId));
|
||||
if (nimUserInfo != null) {
|
||||
NimP2PMessageActivity.start(this, String.valueOf(userId));
|
||||
} else {
|
||||
NimUserInfoCache.getInstance().getUserInfoFromRemote(String.valueOf(userId), new RequestCallbackWrapper<NimUserInfo>() {
|
||||
@Override
|
||||
public void onResult(int code, NimUserInfo result, Throwable exception) {
|
||||
if (code == 200) {
|
||||
NimP2PMessageActivity.start(mActivity, String.valueOf(userId));
|
||||
} else {
|
||||
toast("网络异常,请重试");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.attention_layout:
|
||||
if (userInfo == null) {
|
||||
toast("用户信息为空。");
|
||||
return;
|
||||
}
|
||||
|
||||
if (mIslike) {
|
||||
boolean isMyFriend = IMFriendModel.get().isMyFriend(String.valueOf(userInfo.getUid()));
|
||||
String tip = (isMyFriend) ? "取消关注将不再是好友关系,确定取消关注?" : "确定取消关注?";
|
||||
getDialogManager().showOkCancelDialog(tip, true, new DialogManager.OkCancelDialogListener() {
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
getDialogManager().dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOk() {
|
||||
getDialogManager().dismissDialog();
|
||||
getDialogManager().showProgressDialog(mActivity, getString(R.string.waiting_text));
|
||||
PraiseModel.get().praise(userInfo.getUid(), false).subscribe();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.guest_page_follow, "客态页-关注");
|
||||
getDialogManager().showProgressDialog(mActivity, getString(R.string.waiting_text));
|
||||
PraiseModel.get().praise(userInfo.getUid(), true).subscribe();
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.ll_where:
|
||||
getDialogManager().showProgressDialog(this, "请稍后...");
|
||||
AvRoomModel.get()
|
||||
.getUserRoom(userId)
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe((roomResult, throwable) -> {
|
||||
if (throwable != null) {
|
||||
onGetUserRoomFail(throwable.getMessage());
|
||||
} else if (roomResult != null && roomResult.isSuccess()) {
|
||||
onGetUserRoom(roomResult.getData());
|
||||
} else if (roomResult != null && !roomResult.isSuccess()) {
|
||||
onGetUserRoomFail(roomResult.getError());
|
||||
} else {
|
||||
onGetUserRoomFail("未知错误");
|
||||
}
|
||||
});
|
||||
// /**************** 测试代码 **************/
|
||||
// AVRoomActivity.start(this, 91, mRoomInfo!!.type)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onGetRoomInfo(RoomInfo roomInfo) {
|
||||
if (roomInfo == null) {
|
||||
//该用户还未开房间
|
||||
setUserRoomVisible(false);
|
||||
return;
|
||||
}
|
||||
//已经存在的activity
|
||||
if (mRoomInfo != null && mRoomInfo.getRoomId() == roomInfo.getRoomId()) {
|
||||
mRoomInfo = roomInfo;
|
||||
} else if (mRoomInfo == null) {
|
||||
//打开新的activity的时候
|
||||
mRoomInfo = roomInfo;
|
||||
}
|
||||
setUserRoomVisible(roomInfo.isValid() && identityState != IdentityState.OWN);
|
||||
}
|
||||
|
||||
public void onGetUserRoom(RoomInfo roomInfo) {
|
||||
getDialogManager().dismissDialog();
|
||||
RoomInfo current = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo != null && roomInfo.getUid() > 0) {
|
||||
if (current != null) {
|
||||
if (current.getUid() == roomInfo.getUid()) {
|
||||
toast("已经和对方在同一个房间");
|
||||
return;
|
||||
}
|
||||
}
|
||||
AVRoomActivity.start(this, roomInfo.getUid(), roomInfo.getType());
|
||||
} else {
|
||||
toast("对方不在房间内");
|
||||
}
|
||||
}
|
||||
|
||||
public void onGetUserRoomFail(String msg) {
|
||||
getDialogManager().dismissDialog();
|
||||
toast(msg);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onIsLiked(IsLikedEvent event) {
|
||||
setLikedText(event.isLiked);
|
||||
}
|
||||
|
||||
private void setLikedText(boolean isliked) {
|
||||
mIslike = isliked;
|
||||
attentionLayout.setCompoundDrawablesWithIntrinsicBounds(
|
||||
(!isliked) ? mAttenDrawable : mAttenedDrawable, null, null, null);
|
||||
attentionLayout.setCompoundDrawablePadding((isliked) ? 0 : SizeUtils.dp2px(this, 5f));
|
||||
attentionLayout.setText(getString((isliked) ? R.string.already_attention : R.string.attention));
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onPraise(PraiseEvent event) {
|
||||
if (event.getLikedUid() != userId ||
|
||||
userId == AuthModel.get().getCurrentUid()) {
|
||||
return;
|
||||
}
|
||||
if (event.isFailed()) {
|
||||
getDialogManager().dismissDialog();
|
||||
toast(event.getError());
|
||||
return;
|
||||
}
|
||||
getDialogManager().dismissDialog();
|
||||
toast(event.isPraise() ? R.string.fan_success : R.string.cancel_fan_success);
|
||||
setLikedText(event.isPraise());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
EventBus.getDefault().unregister(this);
|
||||
|
||||
if (mBinding.userInfoSvgaCar.isAnimating()) {
|
||||
mBinding.userInfoSvgaCar.clearAnimation();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (resultCode == RESULT_OK) {
|
||||
if (requestCode == REQUEST_CODE_UPDATE_VOICE) {
|
||||
String audioFileUrl = data.getStringExtra(RecordingVoiceActivity.AUDIO_FILE);
|
||||
int audioDuration = data.getIntExtra(RecordingVoiceActivity.AUDIO_DURA, 0);
|
||||
if (mUserInfoFragment != null) {
|
||||
mUserInfoFragment.refreshVoiceDataView(audioFileUrl, audioDuration);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setOfficialMask(String name, String icon) {
|
||||
if (!TextUtils.isEmpty(name) && !TextUtils.isEmpty(icon)) {
|
||||
mBinding.inOfficialMask.setVisibility(View.VISIBLE);
|
||||
|
||||
if (tvOfficialMask != null && ivOfficialMask != null) {
|
||||
tvOfficialMask.setText(name);
|
||||
NobleUtil.loadResource(icon, ivOfficialMask);
|
||||
}
|
||||
|
||||
} else {
|
||||
mBinding.inOfficialMask.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* static静态代码
|
||||
*/
|
||||
|
||||
public final static class Companion {
|
||||
public final static String TAG = UserInfoOldActivity.class.getSimpleName();
|
||||
|
||||
static final int FROM_TYPE_NORMAL = 1;
|
||||
static final int FROM_TYPE_FAMILY = 2;
|
||||
|
||||
public static void start(Context context, long userId) {
|
||||
Intent intent = new Intent(context, UserInfoOldActivity.class);
|
||||
intent.putExtra("userId", userId);
|
||||
int from = FROM_TYPE_NORMAL;
|
||||
if (context instanceof FamilyHomeActivity
|
||||
|| context instanceof FamilyMemberListActivity
|
||||
|| context instanceof FamilyMemberSearchActivity) {
|
||||
//这里限制循环访问, 例如:家族->个人主页->家族->个人主页->....
|
||||
from = FROM_TYPE_FAMILY;
|
||||
}
|
||||
intent.putExtra("from", from);
|
||||
context.startActivity(intent);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
BIN
app/src/main/res/drawable-xhdpi/ic_msg_attention.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_msg_attention.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_msg_fans.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_msg_fans.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_msg_friend.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_msg_friend.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 33 KiB |
@@ -1,473 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/abl_user_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true"
|
||||
app:elevation="0dp">
|
||||
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
app:contentScrim="@color/white"
|
||||
app:expandedTitleMarginEnd="64dp"
|
||||
app:expandedTitleMarginStart="48dp"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/avatar_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_collapseMode="parallax"
|
||||
app:layout_collapseParallaxMultiplier="0" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="256dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginTop="48dp"
|
||||
app:layout_collapseMode="parallax"
|
||||
app:layout_collapseParallaxMultiplier="0">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_avatar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="101.5dp"
|
||||
android:layout_centerHorizontal="true">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_duration"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="26dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:background="@drawable/bg_user_info_audio"
|
||||
android:gravity="center"
|
||||
android:minWidth="79dp"
|
||||
android:paddingEnd="3dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
tools:drawableLeft="@drawable/ic_user_info_play"
|
||||
tools:text="10”" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="88dp"
|
||||
android:layout_height="88dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginEnd="6.5dp"
|
||||
android:layout_marginBottom="6.5dp">
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="67dp"
|
||||
android:layout_height="67dp"
|
||||
android:layout_gravity="center"
|
||||
tools:src="@drawable/default_user_head" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_avatar_head_wear"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
tools:src="@mipmap/ic_user_avatar_level_king" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_nick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@+id/ll_id"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:drawablePadding="@dimen/space_normal"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
tools:drawableRight="@drawable/ic_gender_male"
|
||||
tools:text="King天地为asdasdasdasdsadsadsad" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_id"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@+id/ll_level"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_official"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:src="@mipmap/ic_user_official_13dp"
|
||||
android:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_new"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:src="@mipmap/ic_user_new_13dp"
|
||||
android:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_good_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:src="@mipmap/ic_pretty_account_13dp"
|
||||
android:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_erban_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingTop="1dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingBottom="1dp"
|
||||
android:textColor="@color/color_F5F5F5"
|
||||
android:textSize="13sp"
|
||||
tools:text="ID:7958626" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_address"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="8dp"
|
||||
android:drawableStart="@drawable/ic_user_info_address"
|
||||
android:textColor="#fff5f5f5"
|
||||
android:textSize="12sp"
|
||||
tools:text="广东 广州"
|
||||
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_level"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@+id/ll_fans_attention"
|
||||
android:layout_marginBottom="28dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_user_noble_level"
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="14dp"
|
||||
tools:src="@mipmap/ic_user_level_king" />
|
||||
|
||||
<include
|
||||
android:id="@+id/in_official_mask"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_17"
|
||||
layout="@layout/layout_official_mask"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="@dimen/dp_15"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:scaleType="fitXY"
|
||||
android:visibility="visible"
|
||||
tools:src="@mipmap/ic_user_level" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_charm"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="@dimen/dp_15"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:scaleType="fitXY"
|
||||
android:visibility="visible"
|
||||
tools:src="@drawable/ic_user_charm_level" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_constellation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="15dp"
|
||||
android:background="@drawable/shape_58559d"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
tools:text="金牛座" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_fans_attention"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@+id/v_bottom_divider"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="95dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_attention_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="19sp"
|
||||
tools:text="9" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_user_attention_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/attention"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/view_line_fan"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@color/white" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="95dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_fans_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="19sp"
|
||||
tools:text="19" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_user_fan_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:maxLines="1"
|
||||
android:text="@string/fan"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/view_line_two"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@color/white"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_where"
|
||||
android:layout_width="95dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:src="@drawable/icon_user_where_new" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="找到TA"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/view_line_three"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@color/white"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_user_room"
|
||||
android:layout_width="95dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:src="@drawable/icon_user_room_new" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="TA的房间"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/v_bottom_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="10dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@drawable/bg_view_half_radiu" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/tb_user_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:visibility="visible"
|
||||
app:contentInsetStart="0dp"
|
||||
app:layout_collapseMode="pin">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_user_back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@drawable/icon_user_back" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_user_info_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="16sp"
|
||||
android:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_edit"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@drawable/icon_home_page_more" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/scroll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/bottom_view_layout"
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/mi_user_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="36dp" />
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/vp_user_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</RelativeLayout>
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/vs_bottom_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="74dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout="@layout/user_info_bottom_layout"
|
||||
app:layout_behavior="com.yizhuan.erban.ui.user.ScrollAwareBehavior" />
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/user_info_svga_car"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="346dp"
|
||||
android:layout_marginTop="120dp"
|
||||
android:visibility="gone"
|
||||
app:autoPlay="true" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
</layout>
|
@@ -1,39 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="50dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="消息"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="21sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_contact_trash"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:scaleType="center"
|
||||
android:src="@mipmap/ic_contact_trash" />
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:background="@color/white"
|
||||
>
|
||||
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/indicator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_weight="1"
|
||||
android:paddingStart="23dp"
|
||||
android:paddingEnd="23dp"
|
||||
android:background="@color/white"/>
|
||||
android:layout_marginTop="22dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_contact_trash"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingEnd="@dimen/dp_15"
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
android:src="@mipmap/ic_contact_trash"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/tv_friend"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawableTop="@drawable/ic_msg_friend"
|
||||
android:gravity="center"
|
||||
android:text="好友"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_attention"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawableTop="@drawable/ic_msg_attention"
|
||||
android:gravity="center"
|
||||
android:text="关注"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_fans"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawableTop="@drawable/ic_msg_fans"
|
||||
android:gravity="center"
|
||||
android:text="粉丝"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/viewpager"
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/fcv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white" />
|
||||
android:layout_marginTop="30dp" />
|
||||
|
||||
</LinearLayout>
|
@@ -3,6 +3,8 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="71dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
|
@@ -3,6 +3,8 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="71dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="@drawable/bg_common_touch_while">
|
||||
|
||||
<!--<View-->
|
||||
|
Reference in New Issue
Block a user