616 lines
22 KiB
Java
616 lines
22 KiB
Java
package com.ubt.jimu.user.view;
|
|
|
|
import android.app.Activity;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.graphics.Rect;
|
|
import android.graphics.drawable.ColorDrawable;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.os.Bundle;
|
|
import android.text.TextUtils;
|
|
import android.view.View;
|
|
import android.widget.Button;
|
|
import android.widget.FrameLayout;
|
|
import android.widget.ImageView;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.ProgressBar;
|
|
import android.widget.TextView;
|
|
import androidx.fragment.app.FragmentActivity;
|
|
import androidx.recyclerview.widget.GridLayoutManager;
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
import butterknife.ButterKnife;
|
|
import butterknife.Unbinder;
|
|
import com.alibaba.android.arouter.launcher.ARouter;
|
|
import com.bumptech.glide.Glide;
|
|
import com.bumptech.glide.RequestBuilder;
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
import com.recyclelib.URecyclerView;
|
|
import com.ubt.jimu.BaseActivity;
|
|
import com.ubt.jimu.JimuApplication;
|
|
import com.ubt.jimu.R;
|
|
import com.ubt.jimu.ViewImpl;
|
|
import com.ubt.jimu.base.UbtActivityStack;
|
|
import com.ubt.jimu.base.cache.Cache;
|
|
import com.ubt.jimu.base.db.diy.DiyDBModel;
|
|
import com.ubt.jimu.base.db.user.UserDbHandler;
|
|
import com.ubt.jimu.base.entities.Constant;
|
|
import com.ubt.jimu.base.entities.DraftsListBean;
|
|
import com.ubt.jimu.base.entities.FollowEntities;
|
|
import com.ubt.jimu.base.entities.User;
|
|
import com.ubt.jimu.base.entities.UserExtraInfo;
|
|
import com.ubt.jimu.base.event.MessageEvent;
|
|
import com.ubt.jimu.base.http.ApiObserver;
|
|
import com.ubt.jimu.base.http.manager.CommunityManager;
|
|
import com.ubt.jimu.base.util.FileUtil;
|
|
import com.ubt.jimu.community.view.MyDraftsActivity;
|
|
import com.ubt.jimu.community.view.MyIssueActivity;
|
|
import com.ubt.jimu.community.view.PublishCommunityActivity;
|
|
import com.ubt.jimu.diy.DiyRobotDbHandler;
|
|
import com.ubt.jimu.diy.DiyRobotFile;
|
|
import com.ubt.jimu.unity.ModelType;
|
|
import com.ubt.jimu.user.contract.UserInfoContract$Presenter;
|
|
import com.ubt.jimu.user.contract.UserInfoContract$View;
|
|
import com.ubt.jimu.user.presenter.UserInfoPresenter;
|
|
import com.ubt.jimu.user.setting.view.CommonSettingActivity;
|
|
import com.ubt.jimu.user.view.adapter.PostAndDiyAdapter;
|
|
import com.ubt.jimu.utils.AnimUtils;
|
|
import com.ubt.jimu.utils.LogUtils;
|
|
import com.ubt.jimu.utils.SPUtils;
|
|
import com.ubt.jimu.widgets.NavigationBarView;
|
|
import com.ubtech.utils.DensityUtils;
|
|
import com.ubtech.utils.XLog;
|
|
import java.io.File;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import org.greenrobot.eventbus.EventBus;
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
import org.greenrobot.eventbus.ThreadMode;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class UserCenterActivity extends BaseActivity implements UserInfoContract$View, ViewImpl, PostAndDiyAdapter.IPostOrDiyListener {
|
|
private static final String m = UserCenterActivity.class.getSimpleName();
|
|
private Unbinder a;
|
|
private UserInfoContract$Presenter b;
|
|
ImageView backImageView;
|
|
Button btnLogin;
|
|
TextView collectTextView;
|
|
private User e;
|
|
ImageView editImageView;
|
|
private long f;
|
|
TextView fansTextView;
|
|
private GridLayoutManager h;
|
|
private PostAndDiyAdapter i;
|
|
ImageView imgCollect;
|
|
ImageView imgFans;
|
|
ImageView imgInterest;
|
|
ImageView imgNotLogin;
|
|
ImageView imgPraise;
|
|
TextView interestTextView;
|
|
ImageView iv_follow;
|
|
private List<ViewHolderItem> k;
|
|
private ViewHolderItem l;
|
|
LinearLayout leftBottomLayout;
|
|
LinearLayout leftLayout;
|
|
LinearLayout levelParent;
|
|
ProgressBar levelProgressBar;
|
|
TextView levelTextView;
|
|
NavigationBarView navBarView;
|
|
TextView nicknameTextView;
|
|
TextView percentTextView;
|
|
ImageView portraitImageView;
|
|
TextView praiseTextView;
|
|
TextView rankTextView;
|
|
TextView rateTextView;
|
|
URecyclerView recyclerView;
|
|
View rootView;
|
|
FrameLayout unLoginLayout;
|
|
TextView userTitleTextView;
|
|
boolean c = false;
|
|
boolean d = false;
|
|
private long g = -1;
|
|
private List<ViewHolderItem> j = new ArrayList();
|
|
|
|
public class GridItemDecoration extends RecyclerView.ItemDecoration {
|
|
private int a;
|
|
private int b;
|
|
|
|
public GridItemDecoration(UserCenterActivity userCenterActivity, int i, int i2) {
|
|
new ColorDrawable();
|
|
this.a = i;
|
|
this.b = i2;
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.ItemDecoration
|
|
public void getItemOffsets(Rect rect, View view, RecyclerView recyclerView, RecyclerView.State state) {
|
|
GridLayoutManager gridLayoutManager = (GridLayoutManager) recyclerView.getLayoutManager();
|
|
GridLayoutManager.LayoutParams layoutParams = (GridLayoutManager.LayoutParams) view.getLayoutParams();
|
|
recyclerView.e(view);
|
|
recyclerView.getChildCount();
|
|
gridLayoutManager.N();
|
|
layoutParams.f();
|
|
int e = layoutParams.e();
|
|
if (gridLayoutManager.K() == 1) {
|
|
if (e % 2 == 0) {
|
|
rect.left = this.b;
|
|
int i = this.a;
|
|
rect.right = i;
|
|
rect.top = i;
|
|
return;
|
|
}
|
|
int i2 = this.a;
|
|
rect.left = i2;
|
|
rect.right = this.b;
|
|
rect.top = i2;
|
|
}
|
|
}
|
|
}
|
|
|
|
public UserCenterActivity() {
|
|
new ArrayList();
|
|
this.k = new ArrayList();
|
|
}
|
|
|
|
private void D0() {
|
|
if (JimuApplication.l().i()) {
|
|
this.imgInterest.setImageResource(R.mipmap.ic_interest_pad);
|
|
this.imgFans.setImageResource(R.mipmap.ic_fans_pad);
|
|
this.imgCollect.setImageResource(R.mipmap.ic_collection_pad);
|
|
this.imgPraise.setImageResource(R.mipmap.ic_praise_pad);
|
|
}
|
|
}
|
|
|
|
private void E0() {
|
|
this.h = new GridLayoutManager(this, 2);
|
|
this.i = new PostAndDiyAdapter(this, this.j, this);
|
|
this.j.add(new ViewHolderItem(DiyRobotFile.TYPE_MODEL, getString(R.string.title_user_diy), ""));
|
|
int dimensionPixelSize = getResources().getDimensionPixelSize(R.dimen.user_center_right_padding_left_right);
|
|
this.recyclerView.a(new GridItemDecoration(this, getResources().getDimensionPixelSize(R.dimen.user_center_right_item_center), dimensionPixelSize));
|
|
this.recyclerView.setHasFixedSize(true);
|
|
this.recyclerView.setAdapter(this.i);
|
|
this.recyclerView.setPullRefreshEnabled(false);
|
|
this.recyclerView.setLoadingMoreEnabled(false);
|
|
this.h.a(new GridLayoutManager.SpanSizeLookup() { // from class: com.ubt.jimu.user.view.UserCenterActivity.3
|
|
@Override // androidx.recyclerview.widget.GridLayoutManager.SpanSizeLookup
|
|
public int getSpanSize(int i) {
|
|
if (i == 0) {
|
|
return 1;
|
|
}
|
|
int i2 = i - 1;
|
|
if (((ViewHolderItem) UserCenterActivity.this.j.get(i2)).a == 261 || ((ViewHolderItem) UserCenterActivity.this.j.get(i2)).a == 259) {
|
|
return 1;
|
|
}
|
|
return UserCenterActivity.this.h.N();
|
|
}
|
|
});
|
|
this.recyclerView.setLayoutManager(this.h);
|
|
}
|
|
|
|
private void F0() {
|
|
this.f = getIntent().getLongExtra("view_user_id", 0L);
|
|
this.e = UserDbHandler.getUser();
|
|
User user = this.e;
|
|
if (user != null) {
|
|
this.g = user.getUserId();
|
|
}
|
|
boolean z = true;
|
|
this.d = this.g > 0;
|
|
long j = this.g;
|
|
if ((j <= 0 || j != this.f) && this.f > 0) {
|
|
z = false;
|
|
}
|
|
this.c = z;
|
|
e(this.e);
|
|
}
|
|
|
|
private void G0() {
|
|
boolean z = this.d || this.f > 0;
|
|
this.unLoginLayout.setVisibility(z ? 8 : 0);
|
|
this.leftLayout.setVisibility(z ? 0 : 8);
|
|
boolean z2 = this.d;
|
|
boolean z3 = !z2 || (z2 && !this.c);
|
|
this.iv_follow.setVisibility((this.c || !this.d) ? 8 : 0);
|
|
this.editImageView.setVisibility(z3 ? 8 : 0);
|
|
if (z) {
|
|
return;
|
|
}
|
|
List<Activity> activityTask = UbtActivityStack.getInstance().getActivityTask(JimuApplication.l());
|
|
boolean z4 = false;
|
|
for (int i = 0; i < activityTask.size(); i++) {
|
|
if (activityTask.get(i).getClass().getSimpleName().equals(LoginActivity.class.getSimpleName())) {
|
|
z4 = true;
|
|
}
|
|
}
|
|
if (z4) {
|
|
return;
|
|
}
|
|
LoginActivity.start(this, FileUtil.ZIP_BUFFER_SIZE);
|
|
}
|
|
|
|
private void f(User user) {
|
|
if (user != null) {
|
|
this.g = user.getUserId();
|
|
F0();
|
|
G0();
|
|
relayout();
|
|
e(user);
|
|
this.b.subscribe();
|
|
}
|
|
}
|
|
|
|
private void initView() {
|
|
F0();
|
|
LogUtils.c("initView~~~~~~~~~~~~~~~~");
|
|
G0();
|
|
this.navBarView.setRightIcon(R.mipmap.setting);
|
|
this.navBarView.setListener(new NavigationBarView.OnActionClickListener.Stub() { // from class: com.ubt.jimu.user.view.UserCenterActivity.1
|
|
@Override // com.ubt.jimu.widgets.NavigationBarView.OnActionClickListener.Stub
|
|
public void onRightClick(View view) {
|
|
UserCenterActivity.this.startActivity(new Intent(UserCenterActivity.this, (Class<?>) CommonSettingActivity.class));
|
|
}
|
|
});
|
|
if (JimuApplication.l().i()) {
|
|
this.imgNotLogin.setImageResource(R.drawable.icon_no_login);
|
|
}
|
|
D0();
|
|
}
|
|
|
|
public static void start(Activity activity) {
|
|
a(activity, 0L);
|
|
}
|
|
|
|
@Override // com.ubt.jimu.user.contract.UserInfoContract$View
|
|
public void E() {
|
|
this.j.remove(this.l);
|
|
this.j.removeAll(this.k);
|
|
this.k.clear();
|
|
this.l = new ViewHolderItem(260, "", "");
|
|
ViewHolderItem viewHolderItem = this.l;
|
|
viewHolderItem.f = this.c;
|
|
this.j.add(viewHolderItem);
|
|
this.i.notifyDataSetChanged();
|
|
}
|
|
|
|
@Override // com.ubt.jimu.user.contract.UserInfoContract$View
|
|
public long S() {
|
|
long j = this.g;
|
|
if (j == -1) {
|
|
return 0L;
|
|
}
|
|
return j;
|
|
}
|
|
|
|
@Override // com.ubt.jimu.ViewImpl
|
|
public View getRootView() {
|
|
return this.rootView;
|
|
}
|
|
|
|
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
|
protected void onActivityResult(int i, int i2, Intent intent) {
|
|
super.onActivityResult(i, i2, intent);
|
|
LogUtils.c("用户中心返回:" + i);
|
|
if (i == 4096) {
|
|
if (intent == null) {
|
|
finish();
|
|
return;
|
|
}
|
|
User user = (User) intent.getSerializableExtra("user");
|
|
if (user == null) {
|
|
finish();
|
|
} else {
|
|
f(user);
|
|
LogUtils.c("onActivityResult~~~~~~~~~~~~~~~~~~~");
|
|
}
|
|
}
|
|
}
|
|
|
|
public void onBackAction(View view) {
|
|
finish();
|
|
}
|
|
|
|
public void onCollectAction(View view) {
|
|
CollectionActivity.a(this, d());
|
|
}
|
|
|
|
@Override // com.ubt.jimu.BaseActivity, com.ubt.jimu.ScreenRotationManageActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
|
protected void onCreate(Bundle bundle) {
|
|
super.onCreate(bundle);
|
|
setContentView(R.layout.activity_user_center);
|
|
this.a = ButterKnife.a(this);
|
|
initView();
|
|
E0();
|
|
new UserInfoPresenter(this, this);
|
|
EventBus.b().c(this);
|
|
if (this.d || this.f > 0) {
|
|
this.b.subscribe();
|
|
}
|
|
}
|
|
|
|
@Override // com.ubt.jimu.BaseActivity, com.ubt.jimu.ScreenRotationManageActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
|
|
protected void onDestroy() {
|
|
UserInfoContract$Presenter userInfoContract$Presenter = this.b;
|
|
if (userInfoContract$Presenter != null) {
|
|
userInfoContract$Presenter.unSubscribe();
|
|
}
|
|
ProgressBar progressBar = this.levelProgressBar;
|
|
if (progressBar != null) {
|
|
progressBar.clearAnimation();
|
|
}
|
|
Unbinder unbinder = this.a;
|
|
if (unbinder != null) {
|
|
unbinder.unbind();
|
|
this.a = null;
|
|
}
|
|
super.onDestroy();
|
|
EventBus.b().d(this);
|
|
}
|
|
|
|
public void onFansAction(View view) {
|
|
Bundle bundle = new Bundle();
|
|
bundle.putLong("view_user_id", d());
|
|
bundle.putInt("page_index", 1);
|
|
InterestFansActivity.a(this, bundle);
|
|
}
|
|
|
|
public void onInterestAction(View view) {
|
|
Bundle bundle = new Bundle();
|
|
bundle.putInt("page_index", 0);
|
|
bundle.putLong("view_user_id", d());
|
|
InterestFansActivity.a(this, bundle);
|
|
}
|
|
|
|
public void onIvFollow(View view) {
|
|
CommunityManager.create().subscriptionAdd((int) d(), new ApiObserver<FollowEntities>(null) { // from class: com.ubt.jimu.user.view.UserCenterActivity.2
|
|
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
|
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
|
public void onNext(FollowEntities followEntities) {
|
|
super.onNext(followEntities);
|
|
UserCenterActivity.this.b.a(UserCenterActivity.this.g, UserCenterActivity.this.f);
|
|
}
|
|
});
|
|
}
|
|
|
|
public void onLoginAction(View view) {
|
|
this.g = 10L;
|
|
LoginActivity.start(this, FileUtil.ZIP_BUFFER_SIZE);
|
|
}
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
public void onLoginOrLogoutMessageEvent(MessageEvent messageEvent) {
|
|
XLog.c(m, "onLoginOrLogoutMessageEvent:" + messageEvent.getType());
|
|
int type = messageEvent.getType();
|
|
if (type != 0) {
|
|
if (type == 1) {
|
|
this.g = 0L;
|
|
this.e = null;
|
|
this.d = false;
|
|
this.c = false;
|
|
LogUtils.c("onLoginOrLogoutMessageEvent~~~~~~~");
|
|
G0();
|
|
relayout();
|
|
return;
|
|
}
|
|
if (type == 4) {
|
|
finish();
|
|
return;
|
|
} else if (type == 6) {
|
|
e(UserDbHandler.getUser());
|
|
return;
|
|
} else if (type != 7) {
|
|
return;
|
|
}
|
|
}
|
|
initView();
|
|
this.b.subscribe();
|
|
}
|
|
|
|
@Override // com.ubt.jimu.user.view.adapter.PostAndDiyAdapter.IPostOrDiyListener
|
|
public void onNewDiy(View view) {
|
|
if (this.c) {
|
|
ARouter.b().a("/diy/usercreatives").t();
|
|
}
|
|
}
|
|
|
|
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
|
protected void onNewIntent(Intent intent) {
|
|
super.onNewIntent(intent);
|
|
LogUtils.c("onNewIntent~~~~~~~~~~~~~~~");
|
|
UbtActivityStack.getInstance().getActivityTask(getApplication());
|
|
this.f = intent.getLongExtra("view_user_id", 0L);
|
|
this.e = UserDbHandler.getUser();
|
|
User user = this.e;
|
|
if (user != null) {
|
|
this.g = user.getUserId();
|
|
}
|
|
boolean z = true;
|
|
this.d = this.g > 0;
|
|
long j = this.g;
|
|
if ((j <= 0 || j != this.f) && this.f > 0) {
|
|
z = false;
|
|
}
|
|
this.c = z;
|
|
e(this.e);
|
|
G0();
|
|
relayout();
|
|
if (this.d || this.f > 0) {
|
|
this.b.subscribe();
|
|
}
|
|
}
|
|
|
|
@Override // com.ubt.jimu.user.view.adapter.PostAndDiyAdapter.IPostOrDiyListener
|
|
public void onNewPost(View view) {
|
|
DraftsListBean draftsListBean = (DraftsListBean) SPUtils.b(Constant.Publish.DRAFTS, Constant.Publish.DRAFTS_KEY + Cache.getInstance().getUserId());
|
|
startActivity((draftsListBean == null || draftsListBean.getLinkedHashMap().size() == 0) ? new Intent(this, (Class<?>) PublishCommunityActivity.class) : new Intent(this, (Class<?>) MyDraftsActivity.class));
|
|
}
|
|
|
|
public void onPraiseAction(View view) {
|
|
Bundle bundle = new Bundle();
|
|
bundle.putInt("page_index", 1);
|
|
bundle.putLong("view_user_id", d());
|
|
PraiseActivity.a(this, bundle);
|
|
}
|
|
|
|
public void onRankAction(View view) {
|
|
}
|
|
|
|
@Override // com.ubt.jimu.BaseActivity, com.ubt.jimu.ScreenRotationManageActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
|
|
protected void onResume() {
|
|
super.onResume();
|
|
}
|
|
|
|
@Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
|
|
protected void onStart() {
|
|
super.onStart();
|
|
}
|
|
|
|
public void onUserPortraitAction(View view) {
|
|
if (this.d && this.c) {
|
|
if (this.g > 0) {
|
|
UserDetailInfoActivity.start(this);
|
|
} else {
|
|
LoginActivity.start(this, FileUtil.ZIP_BUFFER_SIZE);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // com.ubt.jimu.user.contract.UserInfoContract$View
|
|
public void r(List<DiyDBModel> list) {
|
|
this.j.remove(this.l);
|
|
this.j.removeAll(this.k);
|
|
this.k.clear();
|
|
if (list == null || list.size() == 0) {
|
|
this.l = new ViewHolderItem(260, "", "");
|
|
ViewHolderItem viewHolderItem = this.l;
|
|
viewHolderItem.f = this.c;
|
|
this.j.add(viewHolderItem);
|
|
} else {
|
|
int i = 0;
|
|
for (int i2 = 0; i2 < list.size() && i <= 3; i2++) {
|
|
DiyDBModel diyDBModel = list.get(i2);
|
|
String logPath = DiyRobotDbHandler.getLogPath(ModelType.PLAYER_DATA, diyDBModel.getCustomModelId());
|
|
File file = new File(logPath);
|
|
if (TextUtils.isEmpty(logPath) || !file.exists()) {
|
|
if (!TextUtils.isEmpty(diyDBModel.getCompressImagePath())) {
|
|
logPath = diyDBModel.getCompressImagePath();
|
|
}
|
|
}
|
|
i++;
|
|
ViewHolderItem viewHolderItem2 = new ViewHolderItem(261, "", logPath);
|
|
diyDBModel.getCustomModelId();
|
|
this.k.add(viewHolderItem2);
|
|
}
|
|
this.j.addAll(this.k);
|
|
}
|
|
this.i.notifyDataSetChanged();
|
|
}
|
|
|
|
@Override // com.ubt.jimu.BaseActivity
|
|
public void relayout() {
|
|
}
|
|
|
|
public static void a(Context context, long j) {
|
|
Intent intent = new Intent(context, (Class<?>) UserCenterActivity.class);
|
|
intent.putExtra("view_user_id", j);
|
|
context.startActivity(intent);
|
|
}
|
|
|
|
private void b(UserExtraInfo userExtraInfo) {
|
|
String str;
|
|
if (userExtraInfo == null) {
|
|
return;
|
|
}
|
|
this.userTitleTextView.setText(userExtraInfo.getTitle());
|
|
this.interestTextView.setText(String.valueOf(userExtraInfo.getSubscriptionNum()));
|
|
this.fansTextView.setText(String.valueOf(userExtraInfo.getFansNum()));
|
|
this.collectTextView.setText(String.valueOf(userExtraInfo.getCollectNum()));
|
|
this.praiseTextView.setText(String.valueOf(userExtraInfo.getPraiseNum()));
|
|
this.levelTextView.setText(String.valueOf("LV" + userExtraInfo.getLevel()));
|
|
if (TextUtils.isEmpty(userExtraInfo.getRate())) {
|
|
str = "0";
|
|
} else {
|
|
str = userExtraInfo.getRate() + "%";
|
|
}
|
|
boolean z = false;
|
|
String format = String.format(getString(R.string.rate_format), str);
|
|
this.rateTextView.setText(com.ubt.jimu.utils.TextUtils.a(format, str, format.indexOf(str), getResources().getColor(R.color.txt_E21463)));
|
|
this.rankTextView.setText(String.valueOf(userExtraInfo.getRank()));
|
|
this.nicknameTextView.setText(userExtraInfo.getNickName());
|
|
DensityUtils.a(this, 100);
|
|
RequestBuilder<Drawable> a = Glide.a((FragmentActivity) this).a(userExtraInfo.getUserImage());
|
|
a.a(RequestOptions.N().b(R.drawable.community_img_official).a(R.drawable.community_img_official));
|
|
a.a(this.portraitImageView);
|
|
this.percentTextView.setText(userExtraInfo.getCurExp() + "/" + userExtraInfo.getExpLength());
|
|
if (userExtraInfo.getCurExp() > 0 && userExtraInfo.getExpLength() > 0) {
|
|
int curExp = (int) ((userExtraInfo.getCurExp() * 100) / (userExtraInfo.getExpLength() * 1.0f));
|
|
this.levelProgressBar.setProgress(curExp);
|
|
AnimUtils.a(this.levelProgressBar, curExp);
|
|
}
|
|
if (!this.c && this.d) {
|
|
z = true;
|
|
}
|
|
if (z) {
|
|
this.iv_follow.setImageResource(userExtraInfo.getIsSubscribed() == 1 ? R.mipmap.ic_interest : R.mipmap.ic_have_not_interest);
|
|
}
|
|
}
|
|
|
|
private void e(User user) {
|
|
if (user == null) {
|
|
return;
|
|
}
|
|
boolean z = this.d;
|
|
if (!z || (z && !this.c)) {
|
|
return;
|
|
}
|
|
this.nicknameTextView.setText(user.getNickName());
|
|
this.portraitImageView.setBackgroundResource(R.drawable.user_center_protrait_bg);
|
|
RequestBuilder<Drawable> a = Glide.a((FragmentActivity) this).a(user.getUserImage());
|
|
a.a(RequestOptions.N().b(R.drawable.community_img_official).a(R.drawable.community_img_official));
|
|
a.a(this.portraitImageView);
|
|
}
|
|
|
|
@Override // com.ubt.jimu.user.contract.UserInfoContract$View
|
|
public long d() {
|
|
long j = this.f;
|
|
return j == 0 ? this.g : j;
|
|
}
|
|
|
|
public static class ViewHolderItem {
|
|
public int a;
|
|
public String b;
|
|
public String c;
|
|
public boolean d = false;
|
|
public boolean e = true;
|
|
public boolean f = true;
|
|
|
|
public ViewHolderItem() {
|
|
}
|
|
|
|
public ViewHolderItem(int i, String str, String str2) {
|
|
this.a = i;
|
|
this.b = str;
|
|
this.c = str2;
|
|
}
|
|
}
|
|
|
|
@Override // com.ubtech.view.BaseView
|
|
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
|
public void setPresenter(UserInfoContract$Presenter userInfoContract$Presenter) {
|
|
this.b = userInfoContract$Presenter;
|
|
}
|
|
|
|
@Override // com.ubt.jimu.user.contract.UserInfoContract$View
|
|
public void a(UserExtraInfo userExtraInfo) {
|
|
XLog.c(m, userExtraInfo.toString());
|
|
b(userExtraInfo);
|
|
}
|
|
|
|
@Override // com.ubt.jimu.user.view.adapter.PostAndDiyAdapter.IPostOrDiyListener
|
|
public void a(ViewHolderItem viewHolderItem) {
|
|
ARouter.b().a("/diy/usercreatives").t();
|
|
}
|
|
|
|
@Override // com.ubt.jimu.user.view.adapter.PostAndDiyAdapter.IPostOrDiyListener
|
|
public void b(ViewHolderItem viewHolderItem) {
|
|
MyIssueActivity.start(this, d() + "");
|
|
}
|
|
}
|