Initial commit
This commit is contained in:
52
sources/com/ubt/jimu/message/JimuMessage.java
Normal file
52
sources/com/ubt/jimu/message/JimuMessage.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package com.ubt.jimu.message;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class JimuMessage {
|
||||
public static final String MSG_TYPE_COMMUNITY = "2";
|
||||
public static final String MSG_TYPE_INFO = "3";
|
||||
public static final String MSG_TYPE_USER = "1";
|
||||
public static final int NOT_READ = 0;
|
||||
public static final int READED = 1;
|
||||
public static final String TYPE_ACTIVITY = "activity";
|
||||
public static final String TYPE_FANS = "fans";
|
||||
public static final String TYPE_POST = "post";
|
||||
private String content;
|
||||
private long createTime;
|
||||
private String icon;
|
||||
private long id;
|
||||
private int isRead;
|
||||
private String link;
|
||||
private int type;
|
||||
|
||||
public String getContent() {
|
||||
return this.content;
|
||||
}
|
||||
|
||||
public long getCreateTime() {
|
||||
return this.createTime;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return this.icon;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public int getIsRead() {
|
||||
return this.isRead;
|
||||
}
|
||||
|
||||
public String getLink() {
|
||||
return this.link;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public void setIsRead(int i) {
|
||||
this.isRead = i;
|
||||
}
|
||||
}
|
34
sources/com/ubt/jimu/message/OfficalMsgBean.java
Normal file
34
sources/com/ubt/jimu/message/OfficalMsgBean.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package com.ubt.jimu.message;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class OfficalMsgBean {
|
||||
public static final String TYPE_CASE = "5";
|
||||
public static final String TYPE_NEW_MODEL = "1";
|
||||
public static final String TYPE_NEW_PACKAGE = "3";
|
||||
public static final String TYPE_OFFLINE = "7";
|
||||
public static final String TYPE_ONLINE = "6";
|
||||
public static final String TYPE_RECOMMEND = "2";
|
||||
public static final String TYPE_SKILL = "4";
|
||||
public int activityID;
|
||||
public String appType;
|
||||
public String createTime;
|
||||
public String deviceId;
|
||||
public int endNum;
|
||||
public String filePath;
|
||||
public String id;
|
||||
public String isRead;
|
||||
public String language;
|
||||
public String messageType;
|
||||
public String messageUrl;
|
||||
public String modelId;
|
||||
public int pageNum;
|
||||
public int pageSize;
|
||||
public String pushMessage;
|
||||
public String requestKey;
|
||||
public String requestTime;
|
||||
public String serviceVersion;
|
||||
public int startNum;
|
||||
public String systemLanguage;
|
||||
public String token;
|
||||
public int totalNum;
|
||||
}
|
121
sources/com/ubt/jimu/message/UserMessageBean.java
Normal file
121
sources/com/ubt/jimu/message/UserMessageBean.java
Normal file
@@ -0,0 +1,121 @@
|
||||
package com.ubt.jimu.message;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class UserMessageBean {
|
||||
private String filePath;
|
||||
private Long id;
|
||||
private String isRead;
|
||||
private String mesContent;
|
||||
private int mesId;
|
||||
private long mesTime;
|
||||
private String mesType;
|
||||
private String mesUserName;
|
||||
private int modelId;
|
||||
private String modelName;
|
||||
private int totalNum;
|
||||
|
||||
public UserMessageBean(Long l, int i, String str, String str2, String str3, int i2, String str4, String str5, String str6, int i3, long j) {
|
||||
this.id = l;
|
||||
this.totalNum = i;
|
||||
this.mesType = str;
|
||||
this.mesUserName = str2;
|
||||
this.modelName = str3;
|
||||
this.modelId = i2;
|
||||
this.filePath = str4;
|
||||
this.mesContent = str5;
|
||||
this.isRead = str6;
|
||||
this.mesId = i3;
|
||||
this.mesTime = j;
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return this.filePath;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public String getIsRead() {
|
||||
return this.isRead;
|
||||
}
|
||||
|
||||
public String getMesContent() {
|
||||
return this.mesContent;
|
||||
}
|
||||
|
||||
public int getMesId() {
|
||||
return this.mesId;
|
||||
}
|
||||
|
||||
public long getMesTime() {
|
||||
return this.mesTime;
|
||||
}
|
||||
|
||||
public String getMesType() {
|
||||
return this.mesType;
|
||||
}
|
||||
|
||||
public String getMesUserName() {
|
||||
return this.mesUserName;
|
||||
}
|
||||
|
||||
public int getModelId() {
|
||||
return this.modelId;
|
||||
}
|
||||
|
||||
public String getModelName() {
|
||||
return this.modelName;
|
||||
}
|
||||
|
||||
public int getTotalNum() {
|
||||
return this.totalNum;
|
||||
}
|
||||
|
||||
public void setFilePath(String str) {
|
||||
this.filePath = str;
|
||||
}
|
||||
|
||||
public void setId(Long l) {
|
||||
this.id = l;
|
||||
}
|
||||
|
||||
public void setIsRead(String str) {
|
||||
this.isRead = str;
|
||||
}
|
||||
|
||||
public void setMesContent(String str) {
|
||||
this.mesContent = str;
|
||||
}
|
||||
|
||||
public void setMesId(int i) {
|
||||
this.mesId = i;
|
||||
}
|
||||
|
||||
public void setMesTime(long j) {
|
||||
this.mesTime = j;
|
||||
}
|
||||
|
||||
public void setMesType(String str) {
|
||||
this.mesType = str;
|
||||
}
|
||||
|
||||
public void setMesUserName(String str) {
|
||||
this.mesUserName = str;
|
||||
}
|
||||
|
||||
public void setModelId(int i) {
|
||||
this.modelId = i;
|
||||
}
|
||||
|
||||
public void setModelName(String str) {
|
||||
this.modelName = str;
|
||||
}
|
||||
|
||||
public void setTotalNum(int i) {
|
||||
this.totalNum = i;
|
||||
}
|
||||
|
||||
public UserMessageBean() {
|
||||
}
|
||||
}
|
267
sources/com/ubt/jimu/message/view/MessageCenterActivity.java
Normal file
267
sources/com/ubt/jimu/message/view/MessageCenterActivity.java
Normal file
@@ -0,0 +1,267 @@
|
||||
package com.ubt.jimu.message.view;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import butterknife.ButterKnife;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.ubt.jimu.BaseActivity;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.ViewImpl;
|
||||
import com.ubt.jimu.base.cache.Cache;
|
||||
import com.ubt.jimu.base.http.ApiObserver;
|
||||
import com.ubt.jimu.base.http.manager.MsgCenterManager;
|
||||
import com.ubt.jimu.diy.view.adapter.FragmentViewPagerAdapter;
|
||||
import com.ubt.jimu.message.view.fragment.UserMessageFragment;
|
||||
import com.ubtech.utils.AndroidVersionCheckUtils;
|
||||
import com.ubtrobot.log.ALog;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class MessageCenterActivity extends BaseActivity implements ViewImpl, TabLayout.OnTabSelectedListener, ViewPager.OnPageChangeListener, UserMessageFragment.OnMsgFragmentInteractionListener {
|
||||
private TabLayout.Tab communityTab;
|
||||
protected ImageView imgBack;
|
||||
private UserMessageFragment infoMessageFragment;
|
||||
private TabLayout.Tab infoTab;
|
||||
private float lastX;
|
||||
private UserMessageFragment officialMessageFragment;
|
||||
private FragmentViewPagerAdapter pagerAdapter;
|
||||
protected TabLayout tabLayout;
|
||||
private UserMessageFragment userMessageFragment;
|
||||
private TabLayout.Tab userMsgTab;
|
||||
protected View view;
|
||||
protected ViewPager viewPager;
|
||||
private final String TAG = MessageCenterActivity.class.getSimpleName();
|
||||
private List<Fragment> fragmentList = new ArrayList();
|
||||
|
||||
private void animaToTarget(View view, float f, float f2) {
|
||||
if (view.getVisibility() != 0) {
|
||||
view.setVisibility(0);
|
||||
}
|
||||
ObjectAnimator ofFloat = ObjectAnimator.ofFloat(view, "translationX", f, f2);
|
||||
ofFloat.setDuration(100L);
|
||||
ofFloat.start();
|
||||
ofFloat.setAutoCancel(true);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void haveNewMsg(TabLayout.Tab tab, final boolean z) {
|
||||
final View findViewById;
|
||||
if (tab == null || (findViewById = tab.a().findViewById(R.id.flDot)) == null) {
|
||||
return;
|
||||
}
|
||||
findViewById.post(new Runnable() { // from class: com.ubt.jimu.message.view.b
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
View view = findViewById;
|
||||
boolean z2 = z;
|
||||
view.setVisibility(r1 ? 0 : 4);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
this.infoMessageFragment = UserMessageFragment.newInstance("3", "");
|
||||
this.infoMessageFragment.setListener(this);
|
||||
this.fragmentList.add(this.infoMessageFragment);
|
||||
this.pagerAdapter = new FragmentViewPagerAdapter(getSupportFragmentManager(), this.fragmentList);
|
||||
this.viewPager.setAdapter(this.pagerAdapter);
|
||||
this.viewPager.setOffscreenPageLimit(3);
|
||||
this.viewPager.setOnPageChangeListener(this);
|
||||
this.infoTab = newTag(this.tabLayout, R.string.title_msg_info, 0);
|
||||
this.tabLayout.a(this);
|
||||
if (Cache.getInstance().getUser() == null || TextUtils.isEmpty(Cache.getInstance().getUserId()) || Cache.getInstance().getUserId().equals("local")) {
|
||||
this.tabLayout.post(new Runnable() { // from class: com.ubt.jimu.message.view.a
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
MessageCenterActivity.this.D0();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
unReadMsgCount();
|
||||
}
|
||||
}
|
||||
|
||||
private TabLayout.Tab newTag(TabLayout tabLayout, int i, int i2) {
|
||||
TabLayout.Tab b = tabLayout.b();
|
||||
b.a(R.layout.tab_item_message);
|
||||
((TextView) b.a().findViewById(R.id.tvTitle)).setText(getString(i));
|
||||
tabLayout.a(b, i2);
|
||||
return b;
|
||||
}
|
||||
|
||||
private void setDotState(TabLayout.Tab tab, int i) {
|
||||
TextView textView = (TextView) tab.a().findViewById(R.id.tvDot);
|
||||
if (textView != null) {
|
||||
textView.setVisibility(i);
|
||||
}
|
||||
}
|
||||
|
||||
private void setTabTextColor(TextView textView, int i) {
|
||||
if (AndroidVersionCheckUtils.e()) {
|
||||
textView.setTextColor(getColor(i));
|
||||
} else {
|
||||
textView.setTextColor(getResources().getColor(i));
|
||||
}
|
||||
}
|
||||
|
||||
public static void start(Activity activity) {
|
||||
activity.startActivity(new Intent(activity, (Class<?>) MessageCenterActivity.class));
|
||||
}
|
||||
|
||||
public static void startForResult(Activity activity, int i) {
|
||||
activity.startActivityForResult(new Intent(activity, (Class<?>) MessageCenterActivity.class), i);
|
||||
}
|
||||
|
||||
private void unReadMsgCount() {
|
||||
MsgCenterManager.getInstance().getUnreadMsgCount(new ApiObserver<HashMap<String, Integer>>(null) { // from class: com.ubt.jimu.message.view.MessageCenterActivity.1
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
super.onComplete();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
super.onError(th);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onNext(HashMap<String, Integer> hashMap) {
|
||||
super.onNext((AnonymousClass1) hashMap);
|
||||
if (!hashMap.containsKey("3") || hashMap.get("3").intValue() <= 0) {
|
||||
return;
|
||||
}
|
||||
MessageCenterActivity messageCenterActivity = MessageCenterActivity.this;
|
||||
messageCenterActivity.haveNewMsg(messageCenterActivity.infoTab, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public /* synthetic */ void D0() {
|
||||
this.viewPager.setCurrentItem(0);
|
||||
this.tabLayout.b(0).h();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.ViewImpl
|
||||
public View getRootView() {
|
||||
return findViewById(R.id.flContainer);
|
||||
}
|
||||
|
||||
public int getUnreadMessage() {
|
||||
return ((TextView) this.infoTab.a().findViewById(R.id.tvDot)).getVisibility() == 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
protected void onBackClick(View view) {
|
||||
setResultOrNot();
|
||||
}
|
||||
|
||||
@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_message_center);
|
||||
ButterKnife.a(this);
|
||||
initView();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.BaseActivity, androidx.appcompat.app.AppCompatActivity, android.app.Activity, android.view.KeyEvent.Callback
|
||||
public boolean onKeyDown(int i, KeyEvent keyEvent) {
|
||||
if (i == 4) {
|
||||
setResultOrNot();
|
||||
}
|
||||
return super.onKeyDown(i, keyEvent);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.message.view.fragment.UserMessageFragment.OnMsgFragmentInteractionListener
|
||||
public void onNoNewMsg(String str) {
|
||||
if (((str.hashCode() == 51 && str.equals("3")) ? (char) 0 : (char) 65535) != 0) {
|
||||
return;
|
||||
}
|
||||
setDotState(this.infoTab, 4);
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
|
||||
public void onPageScrollStateChanged(int i) {
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
|
||||
public void onPageScrolled(int i, float f, int i2) {
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
|
||||
public void onPageSelected(int i) {
|
||||
TabLayout.Tab b;
|
||||
ALog.a(this.TAG).d("onPageSelected");
|
||||
TabLayout tabLayout = this.tabLayout;
|
||||
if (tabLayout == null || (b = tabLayout.b(i)) == null) {
|
||||
return;
|
||||
}
|
||||
b.h();
|
||||
}
|
||||
|
||||
@Override // com.google.android.material.tabs.TabLayout.BaseOnTabSelectedListener
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
TextView textView;
|
||||
if (tab == null || tab.a() == null || (textView = (TextView) tab.a().findViewById(R.id.tvTitle)) == null) {
|
||||
return;
|
||||
}
|
||||
setTabTextColor(textView, R.color.txt_00A9FF);
|
||||
}
|
||||
|
||||
@Override // com.google.android.material.tabs.TabLayout.BaseOnTabSelectedListener
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
TextView textView;
|
||||
ALog.a(this.TAG).d("onTabSelected");
|
||||
ViewPager viewPager = this.viewPager;
|
||||
if (viewPager != null) {
|
||||
viewPager.setCurrentItem(tab.c());
|
||||
}
|
||||
if (tab == null || tab.a() == null || (textView = (TextView) tab.a().findViewById(R.id.tvTitle)) == null) {
|
||||
return;
|
||||
}
|
||||
setTabTextColor(textView, R.color.bg_FFAD42);
|
||||
Rect rect = new Rect();
|
||||
if (textView.getGlobalVisibleRect(rect)) {
|
||||
float f = rect.left;
|
||||
float width = textView.getWidth();
|
||||
float dimension = getResources().getDimension(R.dimen.msg_tab_indicator_width);
|
||||
float f2 = width > dimension ? f + ((width - dimension) / 2.0f) : f - ((dimension - width) / 2.0f);
|
||||
if (this.lastX < 1.0f) {
|
||||
this.lastX = f2;
|
||||
}
|
||||
float f3 = this.lastX;
|
||||
this.lastX = f2;
|
||||
animaToTarget(this.view, f3, f2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.android.material.tabs.TabLayout.BaseOnTabSelectedListener
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
TextView textView;
|
||||
if (tab == null || tab.a() == null || (textView = (TextView) tab.a().findViewById(R.id.tvTitle)) == null) {
|
||||
return;
|
||||
}
|
||||
setTabTextColor(textView, R.color.txt_00A9FF);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.BaseActivity
|
||||
public void relayout() {
|
||||
}
|
||||
|
||||
public void setResultOrNot() {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("un_read_message_count", getUnreadMessage());
|
||||
setResult(-1, intent);
|
||||
finish();
|
||||
}
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
package com.ubt.jimu.message.view;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import butterknife.Unbinder;
|
||||
import butterknife.internal.DebouncingOnClickListener;
|
||||
import butterknife.internal.Utils;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.ubt.jimu.R;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class MessageCenterActivity_ViewBinding implements Unbinder {
|
||||
private MessageCenterActivity target;
|
||||
private View view7f090237;
|
||||
|
||||
public MessageCenterActivity_ViewBinding(MessageCenterActivity messageCenterActivity) {
|
||||
this(messageCenterActivity, messageCenterActivity.getWindow().getDecorView());
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
MessageCenterActivity messageCenterActivity = this.target;
|
||||
if (messageCenterActivity == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
messageCenterActivity.tabLayout = null;
|
||||
messageCenterActivity.imgBack = null;
|
||||
messageCenterActivity.viewPager = null;
|
||||
messageCenterActivity.view = null;
|
||||
this.view7f090237.setOnClickListener(null);
|
||||
this.view7f090237 = null;
|
||||
}
|
||||
|
||||
public MessageCenterActivity_ViewBinding(final MessageCenterActivity messageCenterActivity, View view) {
|
||||
this.target = messageCenterActivity;
|
||||
messageCenterActivity.tabLayout = (TabLayout) Utils.b(view, R.id.tabLayout, "field 'tabLayout'", TabLayout.class);
|
||||
View a = Utils.a(view, R.id.imgBack, "field 'imgBack' and method 'onBackClick'");
|
||||
messageCenterActivity.imgBack = (ImageView) Utils.a(a, R.id.imgBack, "field 'imgBack'", ImageView.class);
|
||||
this.view7f090237 = a;
|
||||
a.setOnClickListener(new DebouncingOnClickListener() { // from class: com.ubt.jimu.message.view.MessageCenterActivity_ViewBinding.1
|
||||
@Override // butterknife.internal.DebouncingOnClickListener
|
||||
public void doClick(View view2) {
|
||||
messageCenterActivity.onBackClick(view2);
|
||||
}
|
||||
});
|
||||
messageCenterActivity.viewPager = (ViewPager) Utils.b(view, R.id.viewPager, "field 'viewPager'", ViewPager.class);
|
||||
messageCenterActivity.view = Utils.a(view, R.id.indicator, "field 'view'");
|
||||
}
|
||||
}
|
@@ -0,0 +1,153 @@
|
||||
package com.ubt.jimu.message.view.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import butterknife.internal.Utils;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.RequestBuilder;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.daimajia.swipe.SwipeLayout;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.message.JimuMessage;
|
||||
import com.ubt.jimu.utils.TextUtils;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class UserMessageAdapter extends RecyclerView.Adapter<UserMsgViewHolder> {
|
||||
private Context context;
|
||||
private List<JimuMessage> data;
|
||||
private LayoutInflater inflater;
|
||||
private OnMessageInteractionListener listener;
|
||||
|
||||
public interface OnMessageInteractionListener {
|
||||
void onDeleteMsgClick(JimuMessage jimuMessage, int i);
|
||||
|
||||
void onMessageClick(JimuMessage jimuMessage, int i);
|
||||
}
|
||||
|
||||
public class UserMsgViewHolder extends RecyclerView.ViewHolder {
|
||||
protected FrameLayout flContent;
|
||||
protected ImageView imgDelete;
|
||||
protected ImageView imgMsgLogo;
|
||||
protected ImageView imgNewMsg;
|
||||
protected SwipeLayout swipeLayout;
|
||||
protected TextView tvContent;
|
||||
protected TextView tvMsgTime;
|
||||
|
||||
public UserMsgViewHolder(View view) {
|
||||
super(view);
|
||||
ButterKnife.a(this, view);
|
||||
}
|
||||
|
||||
public void initHolder(final JimuMessage jimuMessage, final int i) {
|
||||
if (i == 0) {
|
||||
ViewGroup.LayoutParams layoutParams = this.flContent.getLayoutParams();
|
||||
if (layoutParams instanceof ViewGroup.MarginLayoutParams) {
|
||||
((ViewGroup.MarginLayoutParams) layoutParams).topMargin = UserMessageAdapter.this.context.getResources().getDimensionPixelOffset(R.dimen.msg_item_content_margin_top);
|
||||
this.flContent.setLayoutParams(layoutParams);
|
||||
}
|
||||
}
|
||||
this.tvContent.setText(jimuMessage.getContent());
|
||||
this.tvMsgTime.setText(TextUtils.a(UserMessageAdapter.this.context, jimuMessage.getCreateTime()));
|
||||
if (jimuMessage.getIsRead() == 0) {
|
||||
this.imgNewMsg.setVisibility(0);
|
||||
} else {
|
||||
this.imgNewMsg.setVisibility(8);
|
||||
}
|
||||
RequestBuilder<Drawable> a = Glide.e(UserMessageAdapter.this.context).a(jimuMessage.getIcon());
|
||||
a.a(RequestOptions.O().b(R.drawable.default_photo).a(R.drawable.default_photo));
|
||||
a.a(this.imgMsgLogo);
|
||||
this.swipeLayout.setRightSwipeEnabled(false);
|
||||
View.OnClickListener onClickListener = new View.OnClickListener() { // from class: com.ubt.jimu.message.view.adapter.UserMessageAdapter.UserMsgViewHolder.1
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
if (UserMessageAdapter.this.listener == null) {
|
||||
return;
|
||||
}
|
||||
UserMessageAdapter.this.listener.onMessageClick(jimuMessage, i);
|
||||
}
|
||||
};
|
||||
this.tvContent.setOnClickListener(onClickListener);
|
||||
this.imgMsgLogo.setOnClickListener(onClickListener);
|
||||
this.tvMsgTime.setOnClickListener(onClickListener);
|
||||
this.imgDelete.setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.message.view.adapter.UserMessageAdapter.UserMsgViewHolder.2
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
if (UserMessageAdapter.this.listener == null) {
|
||||
return;
|
||||
}
|
||||
UserMessageAdapter.this.listener.onDeleteMsgClick(jimuMessage, i);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class UserMsgViewHolder_ViewBinding implements Unbinder {
|
||||
private UserMsgViewHolder target;
|
||||
|
||||
public UserMsgViewHolder_ViewBinding(UserMsgViewHolder userMsgViewHolder, View view) {
|
||||
this.target = userMsgViewHolder;
|
||||
userMsgViewHolder.imgNewMsg = (ImageView) Utils.b(view, R.id.imgNewMsg, "field 'imgNewMsg'", ImageView.class);
|
||||
userMsgViewHolder.flContent = (FrameLayout) Utils.b(view, R.id.flContent, "field 'flContent'", FrameLayout.class);
|
||||
userMsgViewHolder.swipeLayout = (SwipeLayout) Utils.b(view, R.id.swipeLayout, "field 'swipeLayout'", SwipeLayout.class);
|
||||
userMsgViewHolder.imgMsgLogo = (ImageView) Utils.b(view, R.id.imgMsgLogo, "field 'imgMsgLogo'", ImageView.class);
|
||||
userMsgViewHolder.tvContent = (TextView) Utils.b(view, R.id.tvContent, "field 'tvContent'", TextView.class);
|
||||
userMsgViewHolder.tvMsgTime = (TextView) Utils.b(view, R.id.tvMsgTime, "field 'tvMsgTime'", TextView.class);
|
||||
userMsgViewHolder.imgDelete = (ImageView) Utils.b(view, R.id.imgDelete, "field 'imgDelete'", ImageView.class);
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
UserMsgViewHolder userMsgViewHolder = this.target;
|
||||
if (userMsgViewHolder == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
userMsgViewHolder.imgNewMsg = null;
|
||||
userMsgViewHolder.flContent = null;
|
||||
userMsgViewHolder.swipeLayout = null;
|
||||
userMsgViewHolder.imgMsgLogo = null;
|
||||
userMsgViewHolder.tvContent = null;
|
||||
userMsgViewHolder.tvMsgTime = null;
|
||||
userMsgViewHolder.imgDelete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public UserMessageAdapter(Context context, List<JimuMessage> list) {
|
||||
this.context = context;
|
||||
this.inflater = LayoutInflater.from(context);
|
||||
this.data = list;
|
||||
}
|
||||
|
||||
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
|
||||
public int getItemCount() {
|
||||
List<JimuMessage> list = this.data;
|
||||
if (list == null) {
|
||||
return 0;
|
||||
}
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public void setInteractionListener(OnMessageInteractionListener onMessageInteractionListener) {
|
||||
this.listener = onMessageInteractionListener;
|
||||
}
|
||||
|
||||
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
|
||||
public void onBindViewHolder(UserMsgViewHolder userMsgViewHolder, int i) {
|
||||
userMsgViewHolder.initHolder(this.data.get(i), i);
|
||||
}
|
||||
|
||||
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
|
||||
public UserMsgViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
|
||||
return new UserMsgViewHolder(this.inflater.inflate(R.layout.recycler_item_user_msg, viewGroup, false));
|
||||
}
|
||||
}
|
@@ -0,0 +1,479 @@
|
||||
package com.ubt.jimu.message.view.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewStub;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import com.liulishuo.filedownloader.model.FileDownloadModel;
|
||||
import com.recyclelib.URecyclerView;
|
||||
import com.ubt.jimu.JimuApplication;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.cache.Cache;
|
||||
import com.ubt.jimu.base.entities.ApiRecord;
|
||||
import com.ubt.jimu.base.http.ApiObserver;
|
||||
import com.ubt.jimu.base.http.ApiResultException;
|
||||
import com.ubt.jimu.base.http.manager.MsgCenterManager;
|
||||
import com.ubt.jimu.message.JimuMessage;
|
||||
import com.ubt.jimu.message.view.adapter.UserMessageAdapter;
|
||||
import com.ubt.jimu.widgets.LoadingView;
|
||||
import com.ubtech.view.fragment.LazyLoadFragment;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class UserMessageFragment extends LazyLoadFragment implements URecyclerView.LoadingListener, UserMessageAdapter.OnMessageInteractionListener, LoadingView.RetryRequest {
|
||||
private static final String ARG_PARAM1 = "msgType";
|
||||
private static final String ARG_PARAM2 = "param2";
|
||||
private UserMessageAdapter adapter;
|
||||
protected ImageView imgNoMessage;
|
||||
protected LoadingView loadingView;
|
||||
private Unbinder mBind;
|
||||
private OnMsgFragmentInteractionListener mListener;
|
||||
private String mParam2;
|
||||
private String msgType;
|
||||
protected URecyclerView recyclerView;
|
||||
protected View stubView;
|
||||
protected TextView tvTips;
|
||||
protected ViewStub viewStub;
|
||||
private CompositeDisposable disposable = new CompositeDisposable();
|
||||
private List<JimuMessage> messages = new ArrayList();
|
||||
private final int PAGE_SIZE = 20;
|
||||
private int pageNum = 1;
|
||||
|
||||
public interface OnMsgFragmentInteractionListener {
|
||||
void onNoNewMsg(String str);
|
||||
}
|
||||
|
||||
static /* synthetic */ int access$108(UserMessageFragment userMessageFragment) {
|
||||
int i = userMessageFragment.pageNum;
|
||||
userMessageFragment.pageNum = i + 1;
|
||||
return i;
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
this.adapter = new UserMessageAdapter(getContext(), this.messages);
|
||||
this.adapter.setInteractionListener(this);
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
|
||||
linearLayoutManager.k(1);
|
||||
this.recyclerView.setLayoutManager(linearLayoutManager);
|
||||
this.recyclerView.setAdapter(this.adapter);
|
||||
this.recyclerView.setLoadingListener(this);
|
||||
this.recyclerView.setLoadingMoreEnabled(true);
|
||||
this.loadingView.setOnRetryListener(this);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
/* JADX WARN: Removed duplicated region for block: B:23:0x0074 */
|
||||
/* JADX WARN: Removed duplicated region for block: B:37:0x00ae A[Catch: Exception -> 0x00bf, TryCatch #0 {Exception -> 0x00bf, blocks: (B:13:0x003a, B:27:0x0079, B:29:0x007c, B:32:0x009d, B:34:0x00a0, B:37:0x00ae, B:39:0x00b1, B:42:0x0052, B:45:0x005c, B:48:0x0066), top: B:12:0x003a }] */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public void jump(com.ubt.jimu.message.JimuMessage r6, int r7) {
|
||||
/*
|
||||
r5 = this;
|
||||
if (r6 == 0) goto Lc3
|
||||
java.lang.String r7 = r6.getLink()
|
||||
boolean r7 = android.text.TextUtils.isEmpty(r7)
|
||||
if (r7 == 0) goto Le
|
||||
goto Lc3
|
||||
Le:
|
||||
java.lang.String r7 = r6.getLink()
|
||||
java.lang.String r0 = "http"
|
||||
boolean r7 = r7.startsWith(r0)
|
||||
if (r7 == 0) goto L2b
|
||||
androidx.fragment.app.FragmentActivity r7 = r5.getActivity()
|
||||
java.lang.String r6 = r6.getLink()
|
||||
r0 = 2131099967(0x7f06013f, float:1.7812302E38)
|
||||
java.lang.String r1 = ""
|
||||
com.ubt.jimu.base.HelpActivity.start(r7, r6, r1, r0)
|
||||
return
|
||||
L2b:
|
||||
java.lang.String r6 = r6.getLink()
|
||||
java.lang.String r7 = "/"
|
||||
java.lang.String[] r6 = r6.split(r7)
|
||||
int r7 = r6.length
|
||||
r0 = 1
|
||||
if (r7 != r0) goto L3a
|
||||
return
|
||||
L3a:
|
||||
r7 = r6[r0] // Catch: java.lang.Exception -> Lbf
|
||||
r1 = -1
|
||||
int r2 = r7.hashCode() // Catch: java.lang.Exception -> Lbf
|
||||
r3 = -1655966961(0xffffffff9d4bf30f, float:-2.6992485E-21)
|
||||
r4 = 2
|
||||
if (r2 == r3) goto L66
|
||||
r3 = 3135424(0x2fd7c0, float:4.393665E-39)
|
||||
if (r2 == r3) goto L5c
|
||||
r3 = 3446944(0x3498a0, float:4.830197E-39)
|
||||
if (r2 == r3) goto L52
|
||||
goto L70
|
||||
L52:
|
||||
java.lang.String r2 = "post"
|
||||
boolean r7 = r7.equals(r2) // Catch: java.lang.Exception -> Lbf
|
||||
if (r7 == 0) goto L70
|
||||
r7 = 1
|
||||
goto L71
|
||||
L5c:
|
||||
java.lang.String r2 = "fans"
|
||||
boolean r7 = r7.equals(r2) // Catch: java.lang.Exception -> Lbf
|
||||
if (r7 == 0) goto L70
|
||||
r7 = 2
|
||||
goto L71
|
||||
L66:
|
||||
java.lang.String r2 = "activity"
|
||||
boolean r7 = r7.equals(r2) // Catch: java.lang.Exception -> Lbf
|
||||
if (r7 == 0) goto L70
|
||||
r7 = 0
|
||||
goto L71
|
||||
L70:
|
||||
r7 = -1
|
||||
L71:
|
||||
r1 = 3
|
||||
if (r7 == 0) goto Lae
|
||||
if (r7 == r0) goto L9d
|
||||
if (r7 == r4) goto L79
|
||||
goto Lc3
|
||||
L79:
|
||||
int r6 = r6.length // Catch: java.lang.Exception -> Lbf
|
||||
if (r6 < r1) goto Lc3
|
||||
android.os.Bundle r6 = new android.os.Bundle // Catch: java.lang.Exception -> Lbf
|
||||
r6.<init>() // Catch: java.lang.Exception -> Lbf
|
||||
java.lang.String r7 = "view_user_id"
|
||||
com.ubt.jimu.base.cache.Cache r1 = com.ubt.jimu.base.cache.Cache.getInstance() // Catch: java.lang.Exception -> Lbf
|
||||
long r1 = r1.getLoginUserIntId() // Catch: java.lang.Exception -> Lbf
|
||||
r6.putLong(r7, r1) // Catch: java.lang.Exception -> Lbf
|
||||
java.lang.String r7 = "page_index"
|
||||
r6.putInt(r7, r0) // Catch: java.lang.Exception -> Lbf
|
||||
androidx.fragment.app.FragmentActivity r7 = r5.getActivity() // Catch: java.lang.Exception -> Lbf
|
||||
com.ubt.jimu.BaseActivity r7 = (com.ubt.jimu.BaseActivity) r7 // Catch: java.lang.Exception -> Lbf
|
||||
com.ubt.jimu.user.view.InterestFansActivity.a(r7, r6) // Catch: java.lang.Exception -> Lbf
|
||||
goto Lc3
|
||||
L9d:
|
||||
int r7 = r6.length // Catch: java.lang.Exception -> Lbf
|
||||
if (r7 < r1) goto Lc3
|
||||
androidx.fragment.app.FragmentActivity r7 = r5.getActivity() // Catch: java.lang.Exception -> Lbf
|
||||
r6 = r6[r4] // Catch: java.lang.Exception -> Lbf
|
||||
int r6 = java.lang.Integer.parseInt(r6) // Catch: java.lang.Exception -> Lbf
|
||||
com.ubt.jimu.community.view.PublishDetailActivity.start(r7, r6) // Catch: java.lang.Exception -> Lbf
|
||||
goto Lc3
|
||||
Lae:
|
||||
int r7 = r6.length // Catch: java.lang.Exception -> Lbf
|
||||
if (r7 < r1) goto Lc3
|
||||
androidx.fragment.app.FragmentActivity r7 = r5.getActivity() // Catch: java.lang.Exception -> Lbf
|
||||
r6 = r6[r4] // Catch: java.lang.Exception -> Lbf
|
||||
int r6 = java.lang.Integer.parseInt(r6) // Catch: java.lang.Exception -> Lbf
|
||||
com.ubt.jimu.community.activity.JimuActActivity.start(r7, r6) // Catch: java.lang.Exception -> Lbf
|
||||
goto Lc3
|
||||
Lbf:
|
||||
r6 = move-exception
|
||||
r6.printStackTrace()
|
||||
Lc3:
|
||||
return
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.ubt.jimu.message.view.fragment.UserMessageFragment.jump(com.ubt.jimu.message.JimuMessage, int):void");
|
||||
}
|
||||
|
||||
private void loadMessage(int i) {
|
||||
if ("3".equals(TextUtils.isEmpty(this.msgType) ? "1" : this.msgType)) {
|
||||
loadNews(i);
|
||||
} else if (Cache.getInstance().getUser() == null) {
|
||||
showNoMsgTips();
|
||||
} else {
|
||||
loadUserMsg(i);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadNews(final int i) {
|
||||
ApiObserver<ApiRecord<JimuMessage>> apiObserver = new ApiObserver<ApiRecord<JimuMessage>>(this.loadingView) { // from class: com.ubt.jimu.message.view.fragment.UserMessageFragment.3
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
super.onComplete();
|
||||
UserMessageFragment.this.recyclerView.y();
|
||||
UserMessageFragment.this.recyclerView.z();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
super.onSubscribe(disposable);
|
||||
UserMessageFragment.this.disposable.b(disposable);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onNext(ApiRecord<JimuMessage> apiRecord) {
|
||||
if (apiRecord == null || apiRecord.getRecords() == null) {
|
||||
if (UserMessageFragment.this.pageNum == 1) {
|
||||
UserMessageFragment.this.showNoMsgTips();
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (apiRecord.getRecords().size() == 0) {
|
||||
if (i == 1) {
|
||||
UserMessageFragment.this.showNoMsgTips();
|
||||
} else {
|
||||
UserMessageFragment.this.recyclerView.setNoMore(true);
|
||||
}
|
||||
}
|
||||
if (UserMessageFragment.this.pageNum == 1) {
|
||||
UserMessageFragment.this.messages.clear();
|
||||
}
|
||||
UserMessageFragment.this.messages.addAll(apiRecord.getRecords());
|
||||
UserMessageFragment.this.adapter.notifyDataSetChanged();
|
||||
UserMessageFragment.access$108(UserMessageFragment.this);
|
||||
}
|
||||
};
|
||||
apiObserver.setApiErrorListener(new ApiObserver.ApiErrorListener() { // from class: com.ubt.jimu.message.view.fragment.UserMessageFragment.4
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver.ApiErrorListener
|
||||
public void onError(ApiResultException apiResultException) {
|
||||
UserMessageFragment.this.recyclerView.y();
|
||||
UserMessageFragment.this.recyclerView.z();
|
||||
if (apiResultException.getCode() > 399) {
|
||||
UserMessageFragment.this.showNoMsgTips();
|
||||
}
|
||||
}
|
||||
});
|
||||
MsgCenterManager.getInstance().news(i, 20, JimuApplication.l().g(), apiObserver);
|
||||
}
|
||||
|
||||
private void loadUserMsg(int i) {
|
||||
ApiObserver<ApiRecord<JimuMessage>> apiObserver = new ApiObserver<ApiRecord<JimuMessage>>(this.loadingView) { // from class: com.ubt.jimu.message.view.fragment.UserMessageFragment.1
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
super.onComplete();
|
||||
UserMessageFragment.this.recyclerView.y();
|
||||
UserMessageFragment.this.recyclerView.z();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
super.onSubscribe(disposable);
|
||||
UserMessageFragment.this.disposable.b(disposable);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onNext(ApiRecord<JimuMessage> apiRecord) {
|
||||
if (apiRecord == null || apiRecord.getRecords() == null) {
|
||||
if (UserMessageFragment.this.pageNum == 1) {
|
||||
UserMessageFragment.this.showNoMsgTips();
|
||||
}
|
||||
} else {
|
||||
if (apiRecord.getRecords().size() == 0) {
|
||||
if (UserMessageFragment.this.pageNum == 1) {
|
||||
UserMessageFragment.this.showNoMsgTips();
|
||||
return;
|
||||
} else {
|
||||
UserMessageFragment.this.recyclerView.setNoMore(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (UserMessageFragment.this.pageNum == 1) {
|
||||
UserMessageFragment.this.messages.clear();
|
||||
}
|
||||
UserMessageFragment.this.messages.addAll(apiRecord.getRecords());
|
||||
UserMessageFragment.this.adapter.notifyDataSetChanged();
|
||||
UserMessageFragment.access$108(UserMessageFragment.this);
|
||||
}
|
||||
}
|
||||
};
|
||||
apiObserver.setApiErrorListener(new ApiObserver.ApiErrorListener() { // from class: com.ubt.jimu.message.view.fragment.UserMessageFragment.2
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver.ApiErrorListener
|
||||
public void onError(ApiResultException apiResultException) {
|
||||
UserMessageFragment.this.recyclerView.y();
|
||||
UserMessageFragment.this.recyclerView.z();
|
||||
if (apiResultException.getCode() > 399) {
|
||||
UserMessageFragment.this.showNoMsgTips();
|
||||
}
|
||||
}
|
||||
});
|
||||
MsgCenterManager.getInstance().list(i, 20, this.msgType, apiObserver);
|
||||
}
|
||||
|
||||
public static UserMessageFragment newInstance(String str, String str2) {
|
||||
UserMessageFragment userMessageFragment = new UserMessageFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(ARG_PARAM1, str);
|
||||
bundle.putString(ARG_PARAM2, str2);
|
||||
userMessageFragment.setArguments(bundle);
|
||||
return userMessageFragment;
|
||||
}
|
||||
|
||||
private void setMsgRead(final JimuMessage jimuMessage, final int i) {
|
||||
if (1 == jimuMessage.getIsRead()) {
|
||||
jump(jimuMessage, i);
|
||||
} else {
|
||||
MsgCenterManager.getInstance().setMsgState(jimuMessage.getId(), new ApiObserver<Map<String, Boolean>>(null) { // from class: com.ubt.jimu.message.view.fragment.UserMessageFragment.5
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
super.onComplete();
|
||||
UserMessageFragment.this.adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
super.onError(th);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
super.onSubscribe(disposable);
|
||||
UserMessageFragment.this.disposable.b(disposable);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onNext(Map<String, Boolean> map) {
|
||||
super.onNext((AnonymousClass5) map);
|
||||
if (map == null) {
|
||||
return;
|
||||
}
|
||||
if (map.containsKey(FileDownloadModel.STATUS) && map.get(FileDownloadModel.STATUS).booleanValue()) {
|
||||
jimuMessage.setIsRead(1);
|
||||
UserMessageFragment.this.adapter.notifyDataSetChanged();
|
||||
int i2 = 0;
|
||||
Iterator it = UserMessageFragment.this.messages.iterator();
|
||||
while (it.hasNext() && ((JimuMessage) it.next()).getIsRead() != 0) {
|
||||
i2++;
|
||||
}
|
||||
if (i2 == UserMessageFragment.this.messages.size() && UserMessageFragment.this.mListener != null) {
|
||||
UserMessageFragment.this.mListener.onNoNewMsg(UserMessageFragment.this.msgType);
|
||||
}
|
||||
}
|
||||
UserMessageFragment.this.jump(jimuMessage, i);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void showNoMsgTips() {
|
||||
String str;
|
||||
if (isDetached() || isRemoving()) {
|
||||
return;
|
||||
}
|
||||
this.loadingView.setVisibility(8);
|
||||
this.recyclerView.setVisibility(8);
|
||||
if (this.stubView == null) {
|
||||
this.stubView = this.viewStub.inflate();
|
||||
this.viewStub.setVisibility(0);
|
||||
this.imgNoMessage = (ImageView) this.stubView.findViewById(R.id.imgNoMessage);
|
||||
this.tvTips = (TextView) this.stubView.findViewById(R.id.tvTips);
|
||||
}
|
||||
if (Cache.getInstance().getUser() != null) {
|
||||
this.imgNoMessage.setImageResource(R.mipmap.no_message);
|
||||
} else if ("3".equals(this.msgType)) {
|
||||
this.imgNoMessage.setImageResource(R.mipmap.no_message);
|
||||
} else {
|
||||
this.imgNoMessage.setImageResource(R.drawable.icon_no_login);
|
||||
}
|
||||
if (this.tvTips != null) {
|
||||
String userId = Cache.getInstance().getUserId();
|
||||
if (this.mActivity != null) {
|
||||
str = "local".equals(userId) ? this.mActivity.getString(R.string.favourite_no_login) : this.mActivity.getString(R.string.msg_center_no_message);
|
||||
if ("3".equals(this.msgType)) {
|
||||
str = this.mActivity.getString(R.string.msg_center_no_message);
|
||||
}
|
||||
} else {
|
||||
str = "";
|
||||
}
|
||||
this.tvTips.setText(str);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.widgets.LoadingView.RetryRequest
|
||||
public void OnRetryListener() {
|
||||
loadData();
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.LazyLoadFragment
|
||||
protected void loadData() {
|
||||
loadMessage(1);
|
||||
}
|
||||
|
||||
@Override // com.ubtech.view.fragment.LazyLoadFragment, androidx.fragment.app.Fragment
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
if (getArguments() != null) {
|
||||
this.msgType = getArguments().getString(ARG_PARAM1);
|
||||
this.mParam2 = getArguments().getString(ARG_PARAM2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
View inflate = layoutInflater.inflate(R.layout.fragment_user_message, viewGroup, false);
|
||||
this.mBind = ButterKnife.a(this, inflate);
|
||||
initView();
|
||||
return inflate;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.message.view.adapter.UserMessageAdapter.OnMessageInteractionListener
|
||||
public void onDeleteMsgClick(JimuMessage jimuMessage, int i) {
|
||||
Toast.makeText(getContext(), "删除:" + i, 0).show();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
this.disposable.dispose();
|
||||
this.disposable.a();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroyView() {
|
||||
this.mBind.unbind();
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
}
|
||||
|
||||
@Override // com.recyclelib.URecyclerView.LoadingListener
|
||||
public void onLoadingMore() {
|
||||
if (isDetached() || isRemoving()) {
|
||||
return;
|
||||
}
|
||||
this.loadingView.setIsRefresh(true);
|
||||
loadMessage(this.pageNum + 1);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.message.view.adapter.UserMessageAdapter.OnMessageInteractionListener
|
||||
public void onMessageClick(JimuMessage jimuMessage, int i) {
|
||||
setMsgRead(jimuMessage, i);
|
||||
}
|
||||
|
||||
@Override // com.recyclelib.URecyclerView.LoadingListener
|
||||
public void onRefreshing() {
|
||||
if (isDetached() || isRemoving()) {
|
||||
return;
|
||||
}
|
||||
this.loadingView.setVisibility(0);
|
||||
this.recyclerView.setNoMore(false);
|
||||
this.loadingView.setIsRefresh(true);
|
||||
this.pageNum = 1;
|
||||
loadMessage(this.pageNum);
|
||||
}
|
||||
|
||||
public void setListener(OnMsgFragmentInteractionListener onMsgFragmentInteractionListener) {
|
||||
this.mListener = onMsgFragmentInteractionListener;
|
||||
}
|
||||
}
|
@@ -0,0 +1,33 @@
|
||||
package com.ubt.jimu.message.view.fragment;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewStub;
|
||||
import butterknife.Unbinder;
|
||||
import butterknife.internal.Utils;
|
||||
import com.recyclelib.URecyclerView;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.widgets.LoadingView;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class UserMessageFragment_ViewBinding implements Unbinder {
|
||||
private UserMessageFragment target;
|
||||
|
||||
public UserMessageFragment_ViewBinding(UserMessageFragment userMessageFragment, View view) {
|
||||
this.target = userMessageFragment;
|
||||
userMessageFragment.recyclerView = (URecyclerView) Utils.b(view, R.id.recycleView, "field 'recyclerView'", URecyclerView.class);
|
||||
userMessageFragment.loadingView = (LoadingView) Utils.b(view, R.id.loadingView, "field 'loadingView'", LoadingView.class);
|
||||
userMessageFragment.viewStub = (ViewStub) Utils.b(view, R.id.viewStup, "field 'viewStub'", ViewStub.class);
|
||||
}
|
||||
|
||||
@Override // butterknife.Unbinder
|
||||
public void unbind() {
|
||||
UserMessageFragment userMessageFragment = this.target;
|
||||
if (userMessageFragment == null) {
|
||||
throw new IllegalStateException("Bindings already cleared.");
|
||||
}
|
||||
this.target = null;
|
||||
userMessageFragment.recyclerView = null;
|
||||
userMessageFragment.loadingView = null;
|
||||
userMessageFragment.viewStub = null;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user