Merge remote-tracking branch 'origin/dev_6.5.5_语聊' into dev_6.5.5_语聊
This commit is contained in:
commit
05f598fd22
@ -148,7 +148,7 @@
|
||||
|
||||
<meta-data
|
||||
android:name="SERVER_HOST"
|
||||
android:value="${serverHost}" />
|
||||
android:value="https://ceshi.yyouou.com" />
|
||||
<meta-data
|
||||
android:name="com.facebook.sdk.ApplicationId"
|
||||
android:value="@string/facebook_app_id" />
|
||||
|
@ -96,8 +96,10 @@ public class AppContext extends CommonAppContext {
|
||||
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
||||
@Override
|
||||
public boolean onReceived(Message message, int left, boolean hasPackage, boolean offline) {
|
||||
TextMessage content = (TextMessage) message.getContent();
|
||||
ToastUtil.show("收到:" + content.getContent());
|
||||
if (message.getContent() instanceof TextMessage) {
|
||||
TextMessage content = (TextMessage) message.getContent();
|
||||
ToastUtil.show("收到:" + content.getContent());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.shayu.onetoone.activity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
@ -12,6 +14,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
|
||||
/**
|
||||
* Activity基类
|
||||
@ -19,6 +22,16 @@ import com.shayu.onetoone.R;
|
||||
public abstract class AbsOTOActivity extends AppCompatActivity {
|
||||
public Context mContext;
|
||||
|
||||
@Override
|
||||
public Resources getResources() {
|
||||
Resources res = super.getResources();
|
||||
Configuration config = new Configuration();
|
||||
config.setToDefaults();
|
||||
config.locale = IMLoginManager.get(this).getLocaleLanguage();
|
||||
res.updateConfiguration(config, res.getDisplayMetrics());
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -1,7 +1,5 @@
|
||||
package com.shayu.onetoone.activity;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_cn;
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_us;
|
||||
import static com.yunbao.common.CommonAppContext.sInstance;
|
||||
|
||||
import android.content.Context;
|
||||
@ -19,7 +17,6 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
|
||||
@ -28,9 +25,6 @@ import androidx.core.app.NotificationManagerCompat;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.DeviceUtils;
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.lzy.okgo.model.Response;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.login.EntryActivity;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
@ -43,24 +37,17 @@ import com.tencent.rtmp.TXLivePlayer;
|
||||
import com.tencent.rtmp.ui.TXCloudVideoView;
|
||||
import com.tencent.ugc.TXUGCBase;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.AdBean;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.custom.CircleProgress;
|
||||
import com.yunbao.common.event.DataUserInfoEvent;
|
||||
import com.yunbao.common.event.UpdateTablePointMe;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpConsts;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.http.JsonBean;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.NoviceInstructorManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.DownloadUtil;
|
||||
import com.yunbao.common.utils.L;
|
||||
@ -73,32 +60,8 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import com.linecorp.linesdk.Scope;
|
||||
import com.linecorp.linesdk.auth.LineAuthenticationParams;
|
||||
import com.linecorp.linesdk.auth.LineLoginApi;
|
||||
import com.linecorp.linesdk.auth.LineLoginResult;
|
||||
import com.twitter.sdk.android.core.Callback;
|
||||
import com.twitter.sdk.android.core.DefaultLogger;
|
||||
import com.twitter.sdk.android.core.Result;
|
||||
import com.twitter.sdk.android.core.Twitter;
|
||||
import com.twitter.sdk.android.core.TwitterAuthConfig;
|
||||
import com.twitter.sdk.android.core.TwitterAuthToken;
|
||||
import com.twitter.sdk.android.core.TwitterConfig;
|
||||
import com.twitter.sdk.android.core.TwitterException;
|
||||
import com.twitter.sdk.android.core.TwitterSession;
|
||||
import com.twitter.sdk.android.core.identity.TwitterLoginButton;
|
||||
import com.facebook.AccessToken;
|
||||
import com.facebook.CallbackManager;
|
||||
import com.facebook.FacebookCallback;
|
||||
import com.facebook.FacebookException;
|
||||
import com.facebook.Profile;
|
||||
import com.facebook.ProfileTracker;
|
||||
import com.facebook.login.LoginManager;
|
||||
import com.facebook.login.LoginResult;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -129,15 +92,6 @@ public class LauncherActivity extends AbsOTOActivity implements View.OnClickList
|
||||
private int mVideoLastProgress;
|
||||
private boolean mForward;
|
||||
|
||||
@Override
|
||||
public Resources getResources() {
|
||||
Resources res = super.getResources();
|
||||
Configuration config = new Configuration();
|
||||
config.setToDefaults();
|
||||
config.locale = IMLoginManager.get(this).getLocaleLanguage();
|
||||
res.updateConfiguration(config, res.getDisplayMetrics());
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@ -246,7 +200,7 @@ public class LauncherActivity extends AbsOTOActivity implements View.OnClickList
|
||||
playAD(obj.getIntValue("type") == 0);
|
||||
} else {
|
||||
releaseVideo();
|
||||
LauncherActivity.this.startActivity(new Intent(LauncherActivity.this, EntryActivity.class));
|
||||
RouteManager.forwardEntryActivity();
|
||||
LauncherActivity.this.finish();
|
||||
}
|
||||
} else {
|
||||
@ -287,7 +241,7 @@ public class LauncherActivity extends AbsOTOActivity implements View.OnClickList
|
||||
IMLoginManager.get(this).upDataUserInfo();
|
||||
} else {
|
||||
releaseVideo();
|
||||
this.startActivity(new Intent(this, EntryActivity.class));
|
||||
RouteManager.forwardEntryActivity();
|
||||
this.finish();
|
||||
}
|
||||
|
||||
@ -599,7 +553,7 @@ public class LauncherActivity extends AbsOTOActivity implements View.OnClickList
|
||||
forwardMainActivity();
|
||||
} else {
|
||||
releaseVideo();
|
||||
this.startActivity(new Intent(this, EntryActivity.class));
|
||||
RouteManager.forwardEntryActivity();
|
||||
this.finish();
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.shayu.onetoone.activity;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
@ -20,6 +21,8 @@ import com.shayu.onetoone.activity.fragments.MessageFragment;
|
||||
import com.shayu.onetoone.activity.fragments.MyFragment;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
@ -27,7 +30,9 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.RongIM;
|
||||
import io.rong.imkit.userinfo.RongUserInfoManager;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.UserInfo;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.functions.Function4;
|
||||
@ -82,6 +87,9 @@ public class MainActivity extends AbsOTOActivity {
|
||||
}
|
||||
});
|
||||
RongcloudIMManager.connectIM(mContext);
|
||||
IMLoginModel userInfo = IMLoginManager.get(this).getUserInfo();
|
||||
UserInfo info = new UserInfo(userInfo.getId() + "", userInfo.getUserNicename(), Uri.parse(userInfo.getAvatar()));
|
||||
RongUserInfoManager.getInstance().refreshUserInfoCache(info);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,7 +46,7 @@ public class MessageFragment extends BaseFragment implements View.OnClickListene
|
||||
DslTabLayout tabLayout = itemView.findViewById(R.id.dslTabLayout);
|
||||
more = itemView.findViewById(R.id.more);
|
||||
more.setOnClickListener(this);
|
||||
moreXPopup = new XPopup.Builder(getContext()).watchView(more);
|
||||
moreXPopup = new XPopup.Builder(getContext()).atView(more);
|
||||
viewPager2.setUserInputEnabled(false);
|
||||
//绑定ViewPager2到tabLayout
|
||||
ViewPager2Delegate.Companion.install(viewPager2, tabLayout, false);
|
||||
@ -74,6 +74,7 @@ public class MessageFragment extends BaseFragment implements View.OnClickListene
|
||||
public Boolean invoke(View itemView, Integer index, Boolean select, Boolean fromUse) {
|
||||
if (select) {//设置选择的Fragment
|
||||
viewPager2.setCurrentItem(index);
|
||||
more.setVisibility(index == 0 ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -1,14 +1,20 @@
|
||||
package com.shayu.onetoone.activity.fragments.message;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.SpannableString;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@ -17,42 +23,60 @@ import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.fragments.BaseFragment;
|
||||
import com.shayu.onetoone.adapter.MsgMessageRecyclerViewAdapter;
|
||||
import com.shayu.onetoone.bean.MsgMessageBean;
|
||||
import com.shayu.onetoone.event.MessageMsgBusEvent;
|
||||
import com.yanzhenjie.recyclerview.OnItemMenuClickListener;
|
||||
import com.yanzhenjie.recyclerview.OnItemMenuStateListener;
|
||||
import com.yanzhenjie.recyclerview.SwipeMenuBridge;
|
||||
import com.yanzhenjie.recyclerview.SwipeMenuCreator;
|
||||
import com.yanzhenjie.recyclerview.SwipeMenuItem;
|
||||
import com.yanzhenjie.recyclerview.SwipeRecyclerView;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.RandomUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.common.RLog;
|
||||
import io.rong.imkit.GlideKitImageEngine;
|
||||
import io.rong.imkit.IMCenter;
|
||||
import io.rong.imkit.config.ConversationListBehaviorListener;
|
||||
import io.rong.imkit.config.RongConfigCenter;
|
||||
import io.rong.imkit.conversationlist.ConversationListAdapter;
|
||||
import io.rong.imkit.conversationlist.model.BaseUiConversation;
|
||||
import io.rong.imkit.conversationlist.model.GatheredConversation;
|
||||
import io.rong.imkit.conversationlist.model.SingleConversation;
|
||||
import io.rong.imkit.conversationlist.viewmodel.ConversationListViewModel;
|
||||
import io.rong.imkit.event.Event;
|
||||
import io.rong.imkit.model.NoticeContent;
|
||||
import io.rong.imkit.userinfo.RongUserInfoManager;
|
||||
import io.rong.imkit.utils.RouteUtils;
|
||||
import io.rong.imkit.widget.FixedLinearLayoutManager;
|
||||
import io.rong.imkit.widget.adapter.BaseAdapter;
|
||||
import io.rong.imkit.widget.adapter.ViewHolder;
|
||||
import io.rong.imkit.widget.dialog.OptionsPopupDialog;
|
||||
import io.rong.imkit.widget.refresh.SmartRefreshLayout;
|
||||
import io.rong.imkit.widget.refresh.api.RefreshLayout;
|
||||
import io.rong.imkit.widget.refresh.constant.RefreshState;
|
||||
import io.rong.imkit.widget.refresh.listener.OnLoadMoreListener;
|
||||
import io.rong.imkit.widget.refresh.listener.OnRefreshListener;
|
||||
import io.rong.imkit.widget.refresh.wrapper.RongRefreshHeader;
|
||||
import io.rong.imlib.IRongCoreCallback;
|
||||
import io.rong.imlib.IRongCoreEnum;
|
||||
import io.rong.imlib.RongCoreClient;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.UserInfo;
|
||||
|
||||
/**
|
||||
* 消息-消息
|
||||
@ -72,40 +96,204 @@ public class MsgMessageFragment extends BaseFragment implements BaseAdapter.OnIt
|
||||
protected Handler mHandler = new Handler(Looper.getMainLooper());
|
||||
protected boolean delayRefresh = false;
|
||||
|
||||
View notification, interaction, system;
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
Bus.getOff(this);
|
||||
}
|
||||
|
||||
private class SwipeRunnable {
|
||||
private int menuPosition;
|
||||
private int adapterPosition;
|
||||
|
||||
public SwipeRunnable(int menuPosition, int adapterPosition) {
|
||||
this.menuPosition = menuPosition;
|
||||
this.adapterPosition = adapterPosition;
|
||||
}
|
||||
}
|
||||
|
||||
private SwipeRunnable swipeRunnable = null;
|
||||
|
||||
@Override
|
||||
public void initView(View itemView) {
|
||||
Bus.getOn(this);
|
||||
mList = itemView.findViewById(R.id.recyclerView);
|
||||
mRefreshLayout = itemView.findViewById(R.id.swipeRefreshLayout);
|
||||
mAdapter = new MsgMessageRecyclerViewAdapter();
|
||||
list = new ArrayList<>();
|
||||
initData();
|
||||
mList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
mList.setSwipeMenuCreator(initSwipeMenuCreator());
|
||||
initMoreListener();
|
||||
mList.setOnItemMenuClickListener(new OnItemMenuClickListener() {
|
||||
@Override
|
||||
public void onItemClick(SwipeMenuBridge menuBridge, int adapterPosition) {
|
||||
swipeRunnable = new SwipeRunnable(menuBridge.getPosition(), adapterPosition);
|
||||
menuBridge.closeMenu();
|
||||
if (menuBridge.getPosition() == 0) {
|
||||
BaseUiConversation conversation = mAdapter.getData().get(adapterPosition);
|
||||
IMCenter.getInstance().setConversationToTop(Conversation.ConversationType.PRIVATE, conversation.mCore.getTargetId(), !conversation.mCore.isTop(), true, new RongIMClient.ResultCallback<Boolean>() {
|
||||
@Override
|
||||
public void onSuccess(Boolean aBoolean) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
}
|
||||
});
|
||||
mList.setOnItemMenuStateListener(new OnItemMenuStateListener() {
|
||||
|
||||
@Override
|
||||
public void onMenuState(RecyclerView.ViewHolder viewHolder, int menuState) {
|
||||
if (menuState == CLOSED && swipeRunnable != null) {
|
||||
mHandler.postDelayed(() -> {
|
||||
BaseUiConversation conversation = mAdapter.getData().get(swipeRunnable.adapterPosition);
|
||||
if (swipeRunnable.menuPosition == 0) {
|
||||
topItem(conversation, swipeRunnable.adapterPosition);
|
||||
// ToastUtil.showDebug("置顶:" + mAdapter.getList().get(adapterPosition).getNickname());
|
||||
} else {
|
||||
removeItem(conversation, swipeRunnable.adapterPosition);
|
||||
// ToastUtil.showDebug("删除:" + mAdapter.getList().get(adapterPosition).getNickname());
|
||||
//mAdapter.getData().remove(adapterPosition);
|
||||
//mAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
// ToastUtil.showDebug("置顶:" + mAdapter.getList().get(adapterPosition).getNickname());
|
||||
} else {
|
||||
// ToastUtil.showDebug("删除:" + mAdapter.getList().get(adapterPosition).getNickname());
|
||||
mAdapter.getData().remove(adapterPosition);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
swipeRunnable = null;
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
});
|
||||
initListTop();
|
||||
initUserInfo(0);
|
||||
initRongConfig();
|
||||
}
|
||||
|
||||
private void initRongConfig() {
|
||||
RongConfigCenter.featureConfig().setKitImageEngine(new GlideKitImageEngine() {
|
||||
@Override
|
||||
public void loadConversationListPortrait(@NonNull Context context, @NonNull String url, @NonNull ImageView imageView, Conversation conversation) {
|
||||
super.loadConversationListPortrait(context, url, imageView, conversation);
|
||||
ImgLoader.displayAvatarForCircleCrop(context, url, imageView);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initUserInfo(long timer) {
|
||||
RongIMClient.getInstance().getConversationListByPage(new RongIMClient.ResultCallback<List<Conversation>>() {
|
||||
@Override
|
||||
public void onSuccess(List<Conversation> conversations) {
|
||||
long destructTime = 0;
|
||||
for (Conversation conversation : conversations) {
|
||||
String targetId = conversation.getTargetId();
|
||||
Log.i(TAG, "targetId = " + targetId);
|
||||
UserInfo info = new UserInfo(targetId, "用户名" + targetId, Uri.parse("https://downs.yaoulive.com/avatar/12.jpg"));
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("sex", RandomUtil.nextInt(20) % 2);
|
||||
json.put("age", RandomUtil.nextInt(40));
|
||||
info.setExtra(json.toJSONString());
|
||||
RongUserInfoManager.getInstance().refreshUserInfoCache(info);
|
||||
if (conversations.size() < 10) {
|
||||
destructTime = conversation.getSentTime();
|
||||
}
|
||||
}
|
||||
if (destructTime > 0) {
|
||||
initUserInfo(destructTime);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
|
||||
}
|
||||
}, timer, 10, Conversation.ConversationType.PRIVATE);
|
||||
}
|
||||
|
||||
|
||||
private void initListTop() {
|
||||
|
||||
mAdapter.add(setTopData("官方通知", "测试", "12:00", null, 5), 0);
|
||||
mAdapter.add(setTopData("互动消息", "测试2", "13:00", null, 0), 1);
|
||||
mAdapter.add(setTopData("系统消息", "测试3", "14:00", null, 15), 2);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private SingleConversation setTopData(String title, String content, String time, String avatar, int num) {
|
||||
SingleConversation conversation = new SingleConversation(getContext(), new Conversation());
|
||||
conversation.mCore.setConversationType(Conversation.ConversationType.PRIVATE);
|
||||
conversation.mCore.setSenderUserName(title);
|
||||
conversation.mCore.setConversationTitle(title + "?");
|
||||
conversation.mConversationContent = new SpannableString(content);
|
||||
conversation.mCore.setSentTime(System.currentTimeMillis());
|
||||
conversation.mCore.setUnreadMessageCount(num);
|
||||
conversation.mCore.setTargetId("10000");
|
||||
return conversation;
|
||||
}
|
||||
|
||||
private void clearTopData() {
|
||||
|
||||
}
|
||||
|
||||
public void allRead() {
|
||||
clearTopData();
|
||||
RongCoreClient.getInstance().getUnreadConversationList(new IRongCoreCallback.ResultCallback<List<Conversation>>() {
|
||||
@Override
|
||||
public void onSuccess(List<Conversation> conversations) {
|
||||
for (Conversation conversation : conversations) {
|
||||
if (conversation.getConversationType() != Conversation.ConversationType.PRIVATE) {
|
||||
continue;
|
||||
}
|
||||
IMCenter.getInstance().clearMessagesUnreadStatus(conversation.getConversationType(),
|
||||
conversation.getTargetId(),
|
||||
new RongIMClient.ResultCallback<Boolean>() {
|
||||
@Override
|
||||
public void onSuccess(Boolean aBoolean) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
System.out.println("标记失败:" + e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(IRongCoreEnum.CoreErrorCode e) {
|
||||
System.err.println(e.getMessage() + "|" + e.code);
|
||||
}
|
||||
}, Conversation.ConversationType.PRIVATE);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 置顶会话
|
||||
*/
|
||||
private void topItem(BaseUiConversation conversation, int adapterPosition) {
|
||||
IMCenter.getInstance().setConversationToTop(conversation.getConversationIdentifier(), !conversation.mCore.isTop(), false, new RongIMClient.ResultCallback<Boolean>() {
|
||||
@Override
|
||||
public void onSuccess(Boolean aBoolean) {
|
||||
Log.i(TAG, "置顶 onSuccess: " + aBoolean);
|
||||
mList.requestLayout();
|
||||
mList.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
Log.e(TAG, "置顶 onError: " + e.code + "|" + e.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会话
|
||||
*/
|
||||
private void removeItem(BaseUiConversation conversation, int adapterPosition) {
|
||||
Conversation.ConversationType conversationType = conversation.mCore.getConversationType();
|
||||
String targetId = conversation.mCore.getTargetId();
|
||||
IMCenter.getInstance().removeConversation(conversationType, targetId, new RongIMClient.ResultCallback<Boolean>() {
|
||||
@Override
|
||||
public void onSuccess(Boolean aBoolean) {
|
||||
Log.i(TAG, "删除 onSuccess: " + aBoolean);
|
||||
//mRefreshLayout.postInvalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
Log.e(TAG, "删除 onError: " + e.code + "|" + e.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -204,13 +392,13 @@ public class MsgMessageFragment extends BaseFragment implements BaseAdapter.OnIt
|
||||
if (MsgMessageFragment.this.mRefreshLayout != null) {
|
||||
MsgMessageFragment.this.mRefreshLayout.finishLoadMore();
|
||||
} else {
|
||||
RLog.d(MsgMessageFragment.this.TAG, "onChanged finishLoadMore error");
|
||||
RLog.d(TAG, "onChanged finishLoadMore error");
|
||||
}
|
||||
} else if (refreshEvent.state.equals(RefreshState.RefreshFinish)) {
|
||||
if (MsgMessageFragment.this.mRefreshLayout != null) {
|
||||
MsgMessageFragment.this.mRefreshLayout.finishRefresh();
|
||||
} else {
|
||||
RLog.d(MsgMessageFragment.this.TAG, "onChanged finishRefresh error");
|
||||
RLog.d(TAG, "onChanged finishRefresh error");
|
||||
}
|
||||
}
|
||||
|
||||
@ -253,7 +441,7 @@ public class MsgMessageFragment extends BaseFragment implements BaseAdapter.OnIt
|
||||
BaseUiConversation baseUiConversation = (BaseUiConversation) this.mAdapter.getItem(position);
|
||||
ConversationListBehaviorListener listBehaviorListener = RongConfigCenter.conversationListConfig().getListener();
|
||||
if (listBehaviorListener != null && listBehaviorListener.onConversationClick(view.getContext(), view, baseUiConversation)) {
|
||||
RLog.d(this.TAG, "ConversationList item click event has been intercepted by App.");
|
||||
RLog.d(TAG, "ConversationList item click event has been intercepted by App.");
|
||||
} else {
|
||||
if (baseUiConversation != null && baseUiConversation.mCore != null) {
|
||||
if (baseUiConversation instanceof GatheredConversation) {
|
||||
@ -262,7 +450,7 @@ public class MsgMessageFragment extends BaseFragment implements BaseAdapter.OnIt
|
||||
RouteUtils.routeToConversationActivity(view.getContext(), baseUiConversation.getConversationIdentifier());
|
||||
}
|
||||
} else {
|
||||
RLog.e(this.TAG, "invalid conversation.");
|
||||
RLog.e(TAG, "invalid conversation.");
|
||||
}
|
||||
|
||||
}
|
||||
@ -295,41 +483,10 @@ public class MsgMessageFragment extends BaseFragment implements BaseAdapter.OnIt
|
||||
return creator;
|
||||
}
|
||||
|
||||
private void initMoreListener() {
|
||||
SwipeRecyclerView.LoadMoreListener moreListener = new SwipeRecyclerView.LoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
List<MsgMessageBean> tmp =
|
||||
new ArrayList<>(list);
|
||||
initData();
|
||||
tmp.addAll(list);
|
||||
// mAdapter.setDataCollection(tmp);
|
||||
list = new ArrayList<>(tmp);
|
||||
mList.loadMoreFinish(false, true);
|
||||
}
|
||||
};
|
||||
mList.setLoadMoreListener(moreListener);
|
||||
}
|
||||
|
||||
|
||||
private void initData() {
|
||||
list = new ArrayList<>();
|
||||
for (int i = 0; i < 20; i++) {
|
||||
MsgMessageBean bean = new MsgMessageBean();
|
||||
bean.setId(i);
|
||||
bean.setNickname("名字" + i);
|
||||
bean.setContent("内容" + i);
|
||||
bean.setTime("时间:" + i);
|
||||
if (i % 5 == 0) {
|
||||
bean.setNotRead(true);
|
||||
bean.setNotReadNum(i);
|
||||
}
|
||||
if (i % 2 == 0) {
|
||||
bean.setAvatar("https://downs.yaoulive.com/%E4%BA%A4%E5%8F%89%2015%403x.png");
|
||||
} else {
|
||||
bean.setAvatar("https://downs.yaoulive.com/%E4%BA%A4%E5%8F%89%2014%403x.png");
|
||||
}
|
||||
list.add(bean);
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void busEvent(MessageMsgBusEvent event) {
|
||||
if (event.getType() == MessageMsgBusEvent.TYPE_ALL_READ) {
|
||||
allRead();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,15 +4,12 @@ import static com.yunbao.common.CommonAppContext.home_zdy_img_cn;
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_us;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.Signature;
|
||||
import android.graphics.Paint;
|
||||
import android.media.MediaPlayer;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@ -26,10 +23,8 @@ import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.VideoView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@ -58,7 +53,11 @@ import com.linecorp.linesdk.auth.LineAuthenticationParams;
|
||||
import com.linecorp.linesdk.auth.LineLoginApi;
|
||||
import com.linecorp.linesdk.auth.LineLoginResult;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.utils.MainHttpUtil;
|
||||
import com.shayu.onetoone.activity.AbsOTOActivity;
|
||||
import com.shayu.onetoone.bean.JoinAnchorBean;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.twitter.sdk.android.core.Callback;
|
||||
import com.twitter.sdk.android.core.DefaultLogger;
|
||||
import com.twitter.sdk.android.core.Result;
|
||||
@ -74,13 +73,12 @@ import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.HtmlConfig;
|
||||
import com.yunbao.common.activity.WebViewActivity;
|
||||
import com.yunbao.common.bean.FaceBookUpModel;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.LoginData;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.main.MainNetManager;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
@ -89,6 +87,7 @@ import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
@ -105,21 +104,19 @@ import java.util.TimerTask;
|
||||
/**
|
||||
* 入口
|
||||
*/
|
||||
@Route(path = RouteUtil.PATH_ENTRY)
|
||||
public class EntryActivity extends AppCompatActivity {
|
||||
@Route(path = RouteManager.ACTIVITY_ENTRY)
|
||||
public class EntryActivity extends AbsOTOActivity {
|
||||
|
||||
private ImageView btn_phone, btn_line;
|
||||
private TextView btn_tip, btn_tip1, tv_customer;
|
||||
private TwitterLoginButton tt_login_button;
|
||||
private LinearLayout btn_google;
|
||||
public static Activity activity;
|
||||
private static String mLoginType = Constants.MOB_PHONE;//登录方式
|
||||
public String mPromoCode = "", UserID = "";//推广码
|
||||
|
||||
private String mUuidDevice = "";//手机唯一标识符
|
||||
private static boolean mFirstLogin;//是否是第一次登录
|
||||
private static boolean mShowInvite;//显示邀请码弹窗
|
||||
private static Context Contexts;
|
||||
private GoogleSignInClient mGoogleSignInClient;
|
||||
private LinearLayout lt_btn_twitter, lt_btn_facebook, lt_customer;
|
||||
private String kefuUrl = "";
|
||||
@ -146,11 +143,16 @@ public class EntryActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_entry;
|
||||
}
|
||||
|
||||
|
||||
public void Get_hash_key() {
|
||||
PackageInfo info;
|
||||
try {
|
||||
info = getPackageManager().getPackageInfo("com.pdlive.shayu", PackageManager.GET_SIGNATURES);
|
||||
info = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);
|
||||
for (Signature signature : info.signatures) {
|
||||
MessageDigest md;
|
||||
md = MessageDigest.getInstance("SHA");
|
||||
@ -169,16 +171,12 @@ public class EntryActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_entry);
|
||||
protected void main(Bundle savedInstanceState) {
|
||||
if (getIntent().getBooleanExtra("forwardEntry", false)) {
|
||||
IMLoginManager.get(this).logout(this);
|
||||
ToastUtil.show(R.string.login_invalid);
|
||||
}
|
||||
Get_hash_key();
|
||||
activity = this;
|
||||
Contexts = this;
|
||||
setStatusBar();
|
||||
lt_btn_facebook = findViewById(R.id.lt_btn_facebook);
|
||||
lt_btn_twitter = findViewById(R.id.lt_btn_twitter);
|
||||
@ -208,21 +206,19 @@ public class EntryActivity extends AppCompatActivity {
|
||||
btn_tip1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
WebViewActivity.forward(EntryActivity.this, HtmlConfig.LOGIN_PRIVCAY,false);
|
||||
WebViewActivity.forward(EntryActivity.this, HtmlConfig.LOGIN_PRIVCAY, false);
|
||||
}
|
||||
});
|
||||
|
||||
btn_tip.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
WebViewActivity.forward(EntryActivity.this, HtmlConfig.LOGIN_PRIVCAY1,false);
|
||||
WebViewActivity.forward(EntryActivity.this, HtmlConfig.LOGIN_PRIVCAY1, false);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
EventBus.getDefault().register(this);
|
||||
|
||||
getPromoCode();
|
||||
@ -237,13 +233,13 @@ public class EntryActivity extends AppCompatActivity {
|
||||
}
|
||||
timerOutBtn(view);
|
||||
MainNetManager.get(EntryActivity.this)
|
||||
.FaceBookUp(new com.yunbao.common.http.base.HttpCallback<FaceBookUpModel>() {
|
||||
.FaceBookUp(new HttpCallback<FaceBookUpModel>() {
|
||||
@Override
|
||||
public void onSuccess(FaceBookUpModel data) {
|
||||
if (data.getType().equals("0")) {
|
||||
LoginManager.getInstance().logInWithReadPermissions(EntryActivity.this, Arrays.asList("public_profile"));
|
||||
} else {
|
||||
WebViewActivity.forward(EntryActivity.this, data.getLink() + "?",false);
|
||||
WebViewActivity.forward(EntryActivity.this, data.getLink() + "?", false);
|
||||
}
|
||||
|
||||
}
|
||||
@ -362,23 +358,25 @@ public class EntryActivity extends AppCompatActivity {
|
||||
public void onClick(View v) {
|
||||
if (!"".equals(kefuUrl)) {
|
||||
Constants.LoginKefu = true;
|
||||
WebViewActivity.forward(EntryActivity.this, kefuUrl,false);
|
||||
WebViewActivity.forward(EntryActivity.this, kefuUrl, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getUrl() {
|
||||
MainHttpUtil.getCustomerService(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (info != null) {
|
||||
if (info.length > 0) {
|
||||
kefuUrl = info[0];
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getCustomerService(new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
kefuUrl = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void twitterLoginSet() {
|
||||
@ -558,9 +556,9 @@ public class EntryActivity extends AppCompatActivity {
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
public static void ToLogin() {
|
||||
activity.startActivity(new Intent(activity, LoginActivity.class));
|
||||
activity.finish();
|
||||
public void ToLogin() {
|
||||
RouteManager.forwardLoginActivity();
|
||||
finish();
|
||||
}
|
||||
|
||||
private static final String EMAIL = "email";
|
||||
@ -573,39 +571,36 @@ public class EntryActivity extends AppCompatActivity {
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == true) {
|
||||
mPromoCode = "";
|
||||
}
|
||||
MainHttpUtil.loginByThird(UserID, data.getOpenID(), mPromoCode, mUuidDevice, data.getNickName(), data.getAvatar(), data.getType(), new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
onLoginSuccess(code, msg, info);
|
||||
}
|
||||
});
|
||||
OTONetManager.getInstance(mContext)
|
||||
.userLoginByThird(UserID, data.getOpenID(), mPromoCode, mUuidDevice, data.getNickName(), data.getAvatar(), data.getType(),
|
||||
new HttpCallback<IMLoginModel>() {
|
||||
@Override
|
||||
public void onSuccess(IMLoginModel data) {
|
||||
onLoginSuccess(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
//登录成功!
|
||||
private void onLoginSuccess(int code, String msg, String[] info) {
|
||||
Log.e("他", code + "code" + info.toString());
|
||||
if (code == 0 && info.length > 0) {
|
||||
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
String uid = obj.getString("id");
|
||||
String token = obj.getString("token");
|
||||
if (obj.containsKey("need_bind") && obj.getString("need_bind").equals("0")) {
|
||||
mFirstLogin = obj.getIntValue("first_login") == 1;
|
||||
mShowInvite = obj.getIntValue("isagent") == 1;
|
||||
CommonAppConfig.getInstance().setLoginInfo(uid, token, true);
|
||||
//设置登录信息
|
||||
IMLoginModel model = GsonUtils.fromJson(info[0], IMLoginModel.class);
|
||||
IMLoginManager.get(activity).setupLoginUser(model);
|
||||
//融云连接服务器
|
||||
RongcloudIMManager.connectIM(activity);
|
||||
getBaseUserInfo();
|
||||
|
||||
} else {
|
||||
// Contexts.startActivity(new Intent(Contexts, BindUserActivity.class).putExtra("uid", uid).putExtra("token", token));
|
||||
}
|
||||
} else {
|
||||
ToastUtil.show(msg + "11212");
|
||||
private void onLoginSuccess(IMLoginModel data) {
|
||||
String uid = data.getId() + "";
|
||||
String token = data.getToken();
|
||||
if (data.getNeedBind() == 0) {
|
||||
mFirstLogin = data.getFirstLogin() == 1;
|
||||
mShowInvite = data.getIsagent() == 1;
|
||||
CommonAppConfig.getInstance().setLoginInfo(uid, token, true);
|
||||
//设置登录信息
|
||||
IMLoginManager.get(mContext).setupLoginUser(data);
|
||||
//融云连接服务器
|
||||
RongcloudIMManager.connectIM(mContext);
|
||||
getBaseUserInfo();
|
||||
}
|
||||
}
|
||||
|
||||
@ -613,78 +608,52 @@ public class EntryActivity extends AppCompatActivity {
|
||||
* 获取用户信息
|
||||
*/
|
||||
private void getBaseUserInfo() {
|
||||
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
|
||||
@Override
|
||||
public void callback(UserBean bean) {
|
||||
|
||||
if (mFirstLogin) {
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == true) {
|
||||
// EntryActivity.this.startActivity(new Intent(EntryActivity.this, OneLoginActivity.class));
|
||||
} else {
|
||||
HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor")
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (info[0] != null) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
IMLoginManager.get(EntryActivity.this).setNewUserGif(true);
|
||||
IMLoginManager.get(EntryActivity.this).setisNewUserOne(true);
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getBaseInfos(true,new HttpCallback<UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(UserBean data) {
|
||||
if (mFirstLogin) {
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY) {
|
||||
RouteManager.forwardMainActivity();
|
||||
} else {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getRandJoinAnchor(new HttpCallback<JoinAnchorBean>() {
|
||||
@Override
|
||||
public void onSuccess(JoinAnchorBean data) {
|
||||
IMLoginManager.get(EntryActivity.this).setNewUserGif(true);
|
||||
IMLoginManager.get(EntryActivity.this).setisNewUserOne(true);
|
||||
// MainActivity.forward(EntryActivity.this, false);
|
||||
gotoLive(obj.getString("anchor_id"));
|
||||
if (obj.containsKey("home_zdy_img_us")) {
|
||||
home_zdy_img_us = obj.getString("home_zdy_img_us");
|
||||
home_zdy_img_cn = obj.getString("home_zdy_img_cn");
|
||||
}
|
||||
if (obj.containsKey("home_zdy_pop")) {
|
||||
NoviceInstructorManager.get(activity).setHomeZdyPop(obj.getString(
|
||||
"home_zdy_pop"));
|
||||
if (!StringUtil.isEmpty(data.getHome_zdy_img_us())) {
|
||||
home_zdy_img_us = data.getHome_zdy_img_us();
|
||||
home_zdy_img_cn = data.getHome_zdy_img_cn();
|
||||
}
|
||||
if (!StringUtil.isEmpty(data.getHome_zdy_pop())) {
|
||||
NoviceInstructorManager.get(mContext).setHomeZdyPop(data.getHome_zdy_pop());
|
||||
}
|
||||
RouteManager.forwardMainActivity();
|
||||
}
|
||||
|
||||
} else {
|
||||
// MainActivity.forward(EntryActivity.this, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
RouteManager.forwardMainActivity();
|
||||
}
|
||||
finish();
|
||||
}
|
||||
} else {
|
||||
// MainActivity.forward(EntryActivity.this, false);
|
||||
}
|
||||
EntryActivity.activity.finish();
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void gotoLive(final String live_id) {
|
||||
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
new LiveRoomCheckLivePresenter(activity, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
NoviceInstructorManager.get(activity).setFrist(false);
|
||||
|
||||
|
||||
} else {
|
||||
// MainActivity.forward(EntryActivity.this, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void timerOutBtn(View btn) {
|
||||
if (mBtnClick) {
|
||||
return;
|
||||
|
@ -7,6 +7,7 @@ import android.animation.ObjectAnimator;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
@ -28,7 +29,11 @@ import com.fm.openinstall.listener.AppInstallAdapter;
|
||||
import com.fm.openinstall.model.AppData;
|
||||
import com.lzy.okgo.model.Response;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.AbsOTOActivity;
|
||||
import com.shayu.onetoone.activity.MainActivity;
|
||||
import com.shayu.onetoone.bean.JoinAnchorBean;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.utils.MainHttpUtil;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
@ -55,6 +60,7 @@ import com.yunbao.common.manager.NoviceInstructorManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
@ -67,8 +73,8 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
/**
|
||||
* Created by cxf on 2018/9/17.
|
||||
*/
|
||||
@Route(path = RouteUtil.PATH_LOGIN)
|
||||
public class LoginActivity extends AbsActivity {
|
||||
@Route(path = RouteManager.ACTIVITY_LOGIN)
|
||||
public class LoginActivity extends AbsOTOActivity {
|
||||
|
||||
private View mRoot;
|
||||
// private ImageView mBg;
|
||||
@ -94,6 +100,7 @@ public class LoginActivity extends AbsActivity {
|
||||
return R.layout.activity_login;
|
||||
}
|
||||
|
||||
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
// public void onRegSuccessEvent(RegSuccessEvent e) {
|
||||
// if (!isFinishing()) {
|
||||
@ -102,7 +109,7 @@ public class LoginActivity extends AbsActivity {
|
||||
// }
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
protected void main(Bundle savedInstanceState) {
|
||||
EventBus.getDefault().register(this);
|
||||
initUserArea();
|
||||
mRoot = findViewById(R.id.root);
|
||||
@ -176,13 +183,6 @@ public class LoginActivity extends AbsActivity {
|
||||
}
|
||||
|
||||
|
||||
public static void forward() {
|
||||
Intent intent = new Intent(CommonAppContext.sInstance, LoginActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
CommonAppContext.sInstance.startActivity(intent);
|
||||
}
|
||||
|
||||
|
||||
public void loginClick(View v) {
|
||||
ViewClicksAntiShake.clicksAntiShake(v, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
@ -235,12 +235,19 @@ public class LoginActivity extends AbsActivity {
|
||||
loadingDialog = new LoadingDialog();
|
||||
loadingDialog.show(getSupportFragmentManager(), "LoadingDialog");
|
||||
loadingDialog.setShowText(getString(R.string.login_ing));
|
||||
MainHttpUtil.login(phoneNum, pwd, uuid, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
onLoginSuccess(code, msg, info);
|
||||
}
|
||||
});
|
||||
OTONetManager.getInstance(mContext)
|
||||
.login(phoneNum, pwd, uuid, new com.yunbao.common.http.base.HttpCallback<IMLoginModel>() {
|
||||
@Override
|
||||
public void onSuccess(IMLoginModel data) {
|
||||
onLoginSuccess(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
loadingDialog.dismiss();
|
||||
}
|
||||
});
|
||||
hideKeyboard(mEditPwd);
|
||||
}
|
||||
|
||||
@ -256,102 +263,66 @@ public class LoginActivity extends AbsActivity {
|
||||
|
||||
//登录即代表同意服务和隐私条款
|
||||
private void forwardTip() {
|
||||
WebViewActivity.forward(mContext, HtmlConfig.LOGIN_PRIVCAY,false);
|
||||
WebViewActivity.forward(mContext, HtmlConfig.LOGIN_PRIVCAY, false);
|
||||
}
|
||||
|
||||
|
||||
private void gotoLive(final String live_id) {
|
||||
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
NoviceInstructorManager.get(activity).setFrist(false);
|
||||
|
||||
} else {
|
||||
// MainActivity.forward(LoginActivity.this, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//登录成功!
|
||||
private void onLoginSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
String uid = obj.getString("id");
|
||||
String token = obj.getString("token");
|
||||
mFirstLogin = obj.getIntValue("first_login") == 1;
|
||||
mShowInvite = obj.getIntValue("isagent") == 1;
|
||||
CommonAppConfig.getInstance().setLoginInfo(uid, token, true);
|
||||
//设置登录信息
|
||||
IMLoginModel model = GsonUtils.fromJson(info[0], IMLoginModel.class);
|
||||
IMLoginManager.get(activity).setupLoginUser(model);
|
||||
getBaseUserInfo();
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
loadingDialog.dismiss();
|
||||
}
|
||||
private void onLoginSuccess(IMLoginModel data) {
|
||||
String uid = data.getId() + "";
|
||||
String token = data.getToken();
|
||||
mFirstLogin = data.getFirstLogin() == 1;
|
||||
mShowInvite = data.getIsagent() == 1;
|
||||
CommonAppConfig.getInstance().setLoginInfo(uid, token, true);
|
||||
//设置登录信息
|
||||
IMLoginManager.get(activity).setupLoginUser(data);
|
||||
getBaseUserInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*/
|
||||
private void getBaseUserInfo() {
|
||||
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
|
||||
@Override
|
||||
public void callback(UserBean bean) {
|
||||
//融云连接服务器
|
||||
RongcloudIMManager.connectIM(activity);
|
||||
HttpClient.getInstance().post("Home.getRandJoinAnchor", "Home.getRandJoinAnchor")
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (info != null && info.length > 0 && info[0] != null && mFirstLogin) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
if (obj.containsKey("home_zdy_img_us")) {
|
||||
home_zdy_img_us = obj.getString("home_zdy_img_us");
|
||||
home_zdy_img_cn = obj.getString("home_zdy_img_cn");
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getBaseInfos(true, new com.yunbao.common.http.base.HttpCallback<com.shayu.onetoone.bean.UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(com.shayu.onetoone.bean.UserBean data) {
|
||||
RongcloudIMManager.connectIM(mContext);
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getRandJoinAnchor(new com.yunbao.common.http.base.HttpCallback<JoinAnchorBean>() {
|
||||
@Override
|
||||
public void onSuccess(JoinAnchorBean data) {
|
||||
if (mFirstLogin) {
|
||||
IMLoginManager.get(mContext).setNewUserGif(true);
|
||||
IMLoginManager.get(mContext).setisNewUserOne(true);
|
||||
// MainActivity.forward(EntryActivity.this, false);
|
||||
if (!StringUtil.isEmpty(data.getHome_zdy_img_us())) {
|
||||
home_zdy_img_us = data.getHome_zdy_img_us();
|
||||
home_zdy_img_cn = data.getHome_zdy_img_cn();
|
||||
}
|
||||
if (!StringUtil.isEmpty(data.getHome_zdy_pop())) {
|
||||
NoviceInstructorManager.get(mContext).setHomeZdyPop(data.getHome_zdy_pop());
|
||||
}
|
||||
IMLoginManager.get(mContext).setisNewUserOne(true);
|
||||
IMLoginManager.get(mContext).setNewUserGif(true);
|
||||
}
|
||||
loadingDialog.dismiss();
|
||||
RouteManager.forwardMainActivity();
|
||||
finish();
|
||||
}
|
||||
startActivity(new Intent(LoginActivity.this,MainActivity.class));
|
||||
gotoLive(obj.getString("anchor_id"));
|
||||
IMLoginManager.get(mContext).setisNewUserOne(true);
|
||||
IMLoginManager.get(mContext).setNewUserGif(true);
|
||||
if (obj.containsKey("home_zdy_pop")) {
|
||||
NoviceInstructorManager.get(mContext).setHomeZdyPop(obj.getString("home_zdy_pop"));
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
} else {
|
||||
startActivity(new Intent(LoginActivity.this,MainActivity.class));
|
||||
}
|
||||
loadingDialog.dismiss();
|
||||
finish();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
@Override
|
||||
public void onError(Response<JsonBean> response) {
|
||||
super.onError(response);
|
||||
String message = response.message();
|
||||
System.out.println(">>>>>" + message);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,21 +1,14 @@
|
||||
package com.shayu.onetoone.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.SpannableString;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.MsgMessageBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.rong.imkit.conversationlist.ConversationListAdapter;
|
||||
import io.rong.imkit.conversationlist.model.BaseUiConversation;
|
||||
@ -27,19 +20,43 @@ import io.rong.imlib.model.Conversation;
|
||||
* 聊天列表适配器
|
||||
*/
|
||||
public class MsgMessageRecyclerViewAdapter extends ConversationListAdapter {
|
||||
List<BaseUiConversation> conversationList = null;
|
||||
Map<BaseUiConversation, Integer> map = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
BaseUiConversation uiConversation = mDataList.get(position);
|
||||
if (uiConversation.mCore.getConversationType() == Conversation.ConversationType.PRIVATE) {
|
||||
SingleConversation conversation = (SingleConversation) uiConversation;
|
||||
if (conversation.mConversationContent.length() >= 6) {
|
||||
conversation.mConversationContent = new SpannableString(conversation.mConversationContent.toString().substring(0, 6) + "...·");
|
||||
} else {
|
||||
conversation.mConversationContent = new SpannableString(conversation.mConversationContent.toString() + " ·");
|
||||
}
|
||||
} else if (uiConversation.mCore.getConversationType() == Conversation.ConversationType.GROUP) {
|
||||
mDataList.remove(position);
|
||||
}
|
||||
|
||||
super.onBindViewHolder(holder, position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDataCollection(List<BaseUiConversation> data) {
|
||||
List<BaseUiConversation> tmp = new ArrayList<>();
|
||||
if(conversationList!=null) {
|
||||
tmp.addAll(conversationList);
|
||||
}
|
||||
for (BaseUiConversation datum : data) {
|
||||
if (datum.mCore.getConversationType() == Conversation.ConversationType.PRIVATE) {
|
||||
SingleConversation conversation = (SingleConversation) datum;
|
||||
if (conversation.mConversationContent.length() >= 6) {
|
||||
conversation.mConversationContent = new SpannableString(conversation.mConversationContent.toString().substring(0, 6) + "...·");
|
||||
} else {
|
||||
conversation.mConversationContent = new SpannableString(conversation.mConversationContent.toString() + "·");
|
||||
}
|
||||
tmp.add(datum);
|
||||
}
|
||||
}
|
||||
for (BaseUiConversation conversation : map.keySet()) {
|
||||
if ( map.get(conversation) >= tmp.size()) {
|
||||
tmp.add(conversation);
|
||||
}else{
|
||||
tmp.add(map.get(conversation),conversation);
|
||||
}
|
||||
}
|
||||
super.setDataCollection(tmp);
|
||||
}
|
||||
|
||||
public void add(SingleConversation item, int position) {
|
||||
map.put(item, position);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,54 @@
|
||||
package com.shayu.onetoone.bean;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class JoinAnchorBean extends BaseModel {
|
||||
private String anchor_id;
|
||||
private String anchor_stream;
|
||||
private String home_zdy_img_us;
|
||||
private String home_zdy_img_cn;
|
||||
private String home_zdy_pop;
|
||||
|
||||
public JoinAnchorBean() {
|
||||
}
|
||||
|
||||
public String getAnchor_id() {
|
||||
return anchor_id;
|
||||
}
|
||||
|
||||
public void setAnchor_id(String anchor_id) {
|
||||
this.anchor_id = anchor_id;
|
||||
}
|
||||
|
||||
public String getAnchor_stream() {
|
||||
return anchor_stream;
|
||||
}
|
||||
|
||||
public void setAnchor_stream(String anchor_stream) {
|
||||
this.anchor_stream = anchor_stream;
|
||||
}
|
||||
|
||||
public String getHome_zdy_img_us() {
|
||||
return home_zdy_img_us;
|
||||
}
|
||||
|
||||
public void setHome_zdy_img_us(String home_zdy_img_us) {
|
||||
this.home_zdy_img_us = home_zdy_img_us;
|
||||
}
|
||||
|
||||
public String getHome_zdy_img_cn() {
|
||||
return home_zdy_img_cn;
|
||||
}
|
||||
|
||||
public void setHome_zdy_img_cn(String home_zdy_img_cn) {
|
||||
this.home_zdy_img_cn = home_zdy_img_cn;
|
||||
}
|
||||
|
||||
public String getHome_zdy_pop() {
|
||||
return home_zdy_pop;
|
||||
}
|
||||
|
||||
public void setHome_zdy_pop(String home_zdy_pop) {
|
||||
this.home_zdy_pop = home_zdy_pop;
|
||||
}
|
||||
}
|
428
OneToOne/src/main/java/com/shayu/onetoone/bean/UserBean.java
Normal file
428
OneToOne/src/main/java/com/shayu/onetoone/bean/UserBean.java
Normal file
@ -0,0 +1,428 @@
|
||||
package com.shayu.onetoone.bean;
|
||||
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
|
||||
public class UserBean extends BaseModel {
|
||||
IMLoginModel user;
|
||||
UserInfo info;
|
||||
UserLevel level;
|
||||
|
||||
public UserBean() {
|
||||
}
|
||||
|
||||
public IMLoginModel getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(IMLoginModel user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public UserInfo getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
public void setInfo(UserInfo info) {
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public UserLevel getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(UserLevel level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public static class UserInfo{
|
||||
private int id;
|
||||
private String label_id;
|
||||
private String cn_label;
|
||||
private String en_label;
|
||||
private int first_mate;
|
||||
private long create_time;
|
||||
private long update_time;
|
||||
private int sex;
|
||||
private int b_y;
|
||||
private int b_ym;
|
||||
private int b_ymd;
|
||||
private int name_auth;
|
||||
private long name_auth_time;
|
||||
private String auth_front;
|
||||
private String auth_back;
|
||||
private String auth_remark;
|
||||
private int sage_auth;
|
||||
private long sage_auth_time;
|
||||
private int is_hot;
|
||||
private String vodie_price;
|
||||
private String price;
|
||||
private int star;
|
||||
private String area;
|
||||
private int is_hello;
|
||||
private String star_name;
|
||||
|
||||
public UserInfo() {
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getLabel_id() {
|
||||
return label_id;
|
||||
}
|
||||
|
||||
public void setLabel_id(String label_id) {
|
||||
this.label_id = label_id;
|
||||
}
|
||||
|
||||
public String getCn_label() {
|
||||
return cn_label;
|
||||
}
|
||||
|
||||
public void setCn_label(String cn_label) {
|
||||
this.cn_label = cn_label;
|
||||
}
|
||||
|
||||
public String getEn_label() {
|
||||
return en_label;
|
||||
}
|
||||
|
||||
public void setEn_label(String en_label) {
|
||||
this.en_label = en_label;
|
||||
}
|
||||
|
||||
public int getFirst_mate() {
|
||||
return first_mate;
|
||||
}
|
||||
|
||||
public void setFirst_mate(int first_mate) {
|
||||
this.first_mate = first_mate;
|
||||
}
|
||||
|
||||
public long getCreate_time() {
|
||||
return create_time;
|
||||
}
|
||||
|
||||
public void setCreate_time(long create_time) {
|
||||
this.create_time = create_time;
|
||||
}
|
||||
|
||||
public long getUpdate_time() {
|
||||
return update_time;
|
||||
}
|
||||
|
||||
public void setUpdate_time(long update_time) {
|
||||
this.update_time = update_time;
|
||||
}
|
||||
|
||||
public int getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(int sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public int getB_y() {
|
||||
return b_y;
|
||||
}
|
||||
|
||||
public void setB_y(int b_y) {
|
||||
this.b_y = b_y;
|
||||
}
|
||||
|
||||
public int getB_ym() {
|
||||
return b_ym;
|
||||
}
|
||||
|
||||
public void setB_ym(int b_ym) {
|
||||
this.b_ym = b_ym;
|
||||
}
|
||||
|
||||
public int getB_ymd() {
|
||||
return b_ymd;
|
||||
}
|
||||
|
||||
public void setB_ymd(int b_ymd) {
|
||||
this.b_ymd = b_ymd;
|
||||
}
|
||||
|
||||
public int getName_auth() {
|
||||
return name_auth;
|
||||
}
|
||||
|
||||
public void setName_auth(int name_auth) {
|
||||
this.name_auth = name_auth;
|
||||
}
|
||||
|
||||
public long getName_auth_time() {
|
||||
return name_auth_time;
|
||||
}
|
||||
|
||||
public void setName_auth_time(long name_auth_time) {
|
||||
this.name_auth_time = name_auth_time;
|
||||
}
|
||||
|
||||
public String getAuth_front() {
|
||||
return auth_front;
|
||||
}
|
||||
|
||||
public void setAuth_front(String auth_front) {
|
||||
this.auth_front = auth_front;
|
||||
}
|
||||
|
||||
public String getAuth_back() {
|
||||
return auth_back;
|
||||
}
|
||||
|
||||
public void setAuth_back(String auth_back) {
|
||||
this.auth_back = auth_back;
|
||||
}
|
||||
|
||||
public String getAuth_remark() {
|
||||
return auth_remark;
|
||||
}
|
||||
|
||||
public void setAuth_remark(String auth_remark) {
|
||||
this.auth_remark = auth_remark;
|
||||
}
|
||||
|
||||
public int getSage_auth() {
|
||||
return sage_auth;
|
||||
}
|
||||
|
||||
public void setSage_auth(int sage_auth) {
|
||||
this.sage_auth = sage_auth;
|
||||
}
|
||||
|
||||
public long getSage_auth_time() {
|
||||
return sage_auth_time;
|
||||
}
|
||||
|
||||
public void setSage_auth_time(long sage_auth_time) {
|
||||
this.sage_auth_time = sage_auth_time;
|
||||
}
|
||||
|
||||
public int getIs_hot() {
|
||||
return is_hot;
|
||||
}
|
||||
|
||||
public void setIs_hot(int is_hot) {
|
||||
this.is_hot = is_hot;
|
||||
}
|
||||
|
||||
public String getVodie_price() {
|
||||
return vodie_price;
|
||||
}
|
||||
|
||||
public void setVodie_price(String vodie_price) {
|
||||
this.vodie_price = vodie_price;
|
||||
}
|
||||
|
||||
public String getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(String price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public int getStar() {
|
||||
return star;
|
||||
}
|
||||
|
||||
public void setStar(int star) {
|
||||
this.star = star;
|
||||
}
|
||||
|
||||
public String getArea() {
|
||||
return area;
|
||||
}
|
||||
|
||||
public void setArea(String area) {
|
||||
this.area = area;
|
||||
}
|
||||
|
||||
public int getIs_hello() {
|
||||
return is_hello;
|
||||
}
|
||||
|
||||
public void setIs_hello(int is_hello) {
|
||||
this.is_hello = is_hello;
|
||||
}
|
||||
|
||||
public String getStar_name() {
|
||||
return star_name;
|
||||
}
|
||||
|
||||
public void setStar_name(String star_name) {
|
||||
this.star_name = star_name;
|
||||
}
|
||||
}
|
||||
|
||||
public static class UserLevel{
|
||||
private int id;
|
||||
private int wealth;
|
||||
private int wealth_level;
|
||||
private int charm;
|
||||
private int charm_level;
|
||||
private int level;
|
||||
private int exp;
|
||||
private long wealth_update;
|
||||
private long wealth_level_update;
|
||||
private long charm_update;
|
||||
private long charm_level_update;
|
||||
private long exp_update;
|
||||
private long level_update;
|
||||
private long create_time;
|
||||
private String icon;
|
||||
private String charm_icon;
|
||||
private String wealth_icon;
|
||||
|
||||
public UserLevel() {
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getWealth() {
|
||||
return wealth;
|
||||
}
|
||||
|
||||
public void setWealth(int wealth) {
|
||||
this.wealth = wealth;
|
||||
}
|
||||
|
||||
public int getWealth_level() {
|
||||
return wealth_level;
|
||||
}
|
||||
|
||||
public void setWealth_level(int wealth_level) {
|
||||
this.wealth_level = wealth_level;
|
||||
}
|
||||
|
||||
public int getCharm() {
|
||||
return charm;
|
||||
}
|
||||
|
||||
public void setCharm(int charm) {
|
||||
this.charm = charm;
|
||||
}
|
||||
|
||||
public int getCharm_level() {
|
||||
return charm_level;
|
||||
}
|
||||
|
||||
public void setCharm_level(int charm_level) {
|
||||
this.charm_level = charm_level;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public int getExp() {
|
||||
return exp;
|
||||
}
|
||||
|
||||
public void setExp(int exp) {
|
||||
this.exp = exp;
|
||||
}
|
||||
|
||||
public long getWealth_update() {
|
||||
return wealth_update;
|
||||
}
|
||||
|
||||
public void setWealth_update(long wealth_update) {
|
||||
this.wealth_update = wealth_update;
|
||||
}
|
||||
|
||||
public long getWealth_level_update() {
|
||||
return wealth_level_update;
|
||||
}
|
||||
|
||||
public void setWealth_level_update(long wealth_level_update) {
|
||||
this.wealth_level_update = wealth_level_update;
|
||||
}
|
||||
|
||||
public long getCharm_update() {
|
||||
return charm_update;
|
||||
}
|
||||
|
||||
public void setCharm_update(long charm_update) {
|
||||
this.charm_update = charm_update;
|
||||
}
|
||||
|
||||
public long getCharm_level_update() {
|
||||
return charm_level_update;
|
||||
}
|
||||
|
||||
public void setCharm_level_update(long charm_level_update) {
|
||||
this.charm_level_update = charm_level_update;
|
||||
}
|
||||
|
||||
public long getExp_update() {
|
||||
return exp_update;
|
||||
}
|
||||
|
||||
public void setExp_update(long exp_update) {
|
||||
this.exp_update = exp_update;
|
||||
}
|
||||
|
||||
public long getLevel_update() {
|
||||
return level_update;
|
||||
}
|
||||
|
||||
public void setLevel_update(long level_update) {
|
||||
this.level_update = level_update;
|
||||
}
|
||||
|
||||
public long getCreate_time() {
|
||||
return create_time;
|
||||
}
|
||||
|
||||
public void setCreate_time(long create_time) {
|
||||
this.create_time = create_time;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public String getCharm_icon() {
|
||||
return charm_icon;
|
||||
}
|
||||
|
||||
public void setCharm_icon(String charm_icon) {
|
||||
this.charm_icon = charm_icon;
|
||||
}
|
||||
|
||||
public String getWealth_icon() {
|
||||
return wealth_icon;
|
||||
}
|
||||
|
||||
public void setWealth_icon(String wealth_icon) {
|
||||
this.wealth_icon = wealth_icon;
|
||||
}
|
||||
}
|
||||
}
|
@ -7,7 +7,9 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.AttachPopupView;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.event.MessageMsgBusEvent;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
|
||||
/**
|
||||
* 消息右上角更多菜单
|
||||
@ -39,7 +41,7 @@ public class MsgMoreDialog extends AttachPopupView implements View.OnClickListen
|
||||
if (id == R.id.ll_config) {
|
||||
RouteManager.forwardMsgMoreConfigActivity();
|
||||
} else if (id == R.id.ll_read) {
|
||||
|
||||
Bus.get().post(new MessageMsgBusEvent(MessageMsgBusEvent.TYPE_ALL_READ));
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
@ -0,0 +1,26 @@
|
||||
package com.shayu.onetoone.event;
|
||||
|
||||
public abstract class AbsBusEvent {
|
||||
private int type;
|
||||
private String content;
|
||||
|
||||
public AbsBusEvent(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.shayu.onetoone.event;
|
||||
|
||||
public class MessageMsgBusEvent extends AbsBusEvent {
|
||||
public static final int TYPE_ALL_READ = 0;
|
||||
|
||||
public MessageMsgBusEvent(int type) {
|
||||
super(type);
|
||||
}
|
||||
}
|
@ -1,11 +1,20 @@
|
||||
package com.shayu.onetoone.manager;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.yunbao.common.bean.GiftNamingInfoModel;
|
||||
import com.yunbao.common.http.API;
|
||||
import com.shayu.onetoone.bean.JoinAnchorBean;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.shayu.onetoone.network.API;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.utils.MD5Util;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.functions.Consumer;
|
||||
@ -15,9 +24,13 @@ import io.reactivex.schedulers.Schedulers;
|
||||
* 网络管理类 使用参考{@link com.yunbao.common.http.live.LiveNetManager}
|
||||
*/
|
||||
public class OTONetManager {
|
||||
private static final String TAG = "网络请求";
|
||||
private static final String SALT = "76576076c1f5f657b634e966c8836a06";
|
||||
private static final String DEVICE = "android";
|
||||
private Context mContext;
|
||||
private static OTONetManager mInstance;
|
||||
|
||||
|
||||
private OTONetManager(Context context) {
|
||||
this.mContext = context;
|
||||
}
|
||||
@ -28,29 +41,141 @@ public class OTONetManager {
|
||||
}
|
||||
return mInstance;
|
||||
}
|
||||
//示例
|
||||
/*
|
||||
public void getGiftNamingInfo(String giftId, HttpCallback<GiftNamingInfoModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getGiftNamingInfo(giftId)
|
||||
|
||||
/**
|
||||
* 手机号登录
|
||||
*/
|
||||
public void login(String phoneNum, String pwd, String uuid, HttpCallback<IMLoginModel> callback) {
|
||||
API.get().otoApi(mContext).loginByManager(phoneNum, pwd, uuid, "", "Android")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<GiftNamingInfoModel>>() {
|
||||
.subscribe(new Consumer<ResponseModel<IMLoginModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<GiftNamingInfoModel> liveGiftBeanResponseModel) throws Exception {
|
||||
if (callback!=null){
|
||||
public void accept(ResponseModel<IMLoginModel> imLoginModelResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
IMLoginModel model = imLoginModelResponseModel.getData().getInfo();
|
||||
callback.onSuccess(model);
|
||||
}
|
||||
}
|
||||
}, throwable -> {
|
||||
Log.e(TAG, "accept: ", throwable);
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getBaseInfos(boolean isLogin, HttpCallback<UserBean> callback) {
|
||||
API.get().otoApi(mContext)
|
||||
.getBaseInfos(isLogin ? 1 : 0)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<UserBean>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<UserBean> liveGiftBeanResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(liveGiftBeanResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
Log.e(TAG, "accept: ", throwable);
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
*/
|
||||
|
||||
public void getRandJoinAnchor(HttpCallback<JoinAnchorBean> callback) {
|
||||
API.get().otoApi(mContext)
|
||||
.getRandJoinAnchor()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<JoinAnchorBean>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<JoinAnchorBean>> model) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(model.getData().getInfo().get(0));
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
Log.e(TAG, "accept: ", throwable);
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getCustomerService(HttpCallback<String> callback) {
|
||||
API.get().otoApi(mContext)
|
||||
.getCustomerService()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<String>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<String>> model) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(model.getData().getInfo().get(0));
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
Log.e(TAG, "accept: ", throwable);
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void userLoginByThird(String uid,
|
||||
String openId,
|
||||
String promCode,
|
||||
String uuid,
|
||||
String nickName,
|
||||
String avatar,
|
||||
String type,
|
||||
HttpCallback<IMLoginModel> callback) {
|
||||
String sign = MD5Util.getMD5("openid=" + openId + "&" + SALT);
|
||||
API.get().otoApi(mContext)
|
||||
.userLoginByThird(uid,
|
||||
openId,
|
||||
promCode,
|
||||
uuid,
|
||||
nickName,
|
||||
avatar,
|
||||
CommonAppConfig.IS_GOOGLE_PLAY ? "1" : "3",
|
||||
DEVICE,
|
||||
sign,
|
||||
"Android",
|
||||
type,
|
||||
""
|
||||
)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<IMLoginModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<IMLoginModel> model) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(model.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
Log.e(TAG, "accept: ", throwable);
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -9,7 +9,8 @@ public class RouteManager {
|
||||
public static final String ACTIVITY_MAIN = "/activity/MainActivity"; //主页
|
||||
public static final String ACTIVITY_MSG_MORE_CONFIG_ACTIVITY = "/activity/MsgMoreConfigActivity";//打招呼页面
|
||||
public static final String ACTIVITY_MSG_CHAT = "/activity/ChatActivity";//聊天页面
|
||||
|
||||
public static final String ACTIVITY_ENTRY = "/activity/EntryActivity";
|
||||
public static final String ACTIVITY_LOGIN = "/activity/LoginActivity";
|
||||
|
||||
public static void forwardMainActivity() {
|
||||
ARouter.getInstance().build(ACTIVITY_MAIN)
|
||||
@ -25,4 +26,13 @@ public class RouteManager {
|
||||
ARouter.getInstance().build(ACTIVITY_MSG_CHAT)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
public static void forwardEntryActivity() {
|
||||
ARouter.getInstance().build(ACTIVITY_ENTRY)
|
||||
.navigation();
|
||||
}
|
||||
public static void forwardLoginActivity() {
|
||||
ARouter.getInstance().build(ACTIVITY_LOGIN)
|
||||
.navigation();
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.shayu.onetoone.network;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.shayu.onetoone.bean.JoinAnchorBean;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
@ -75,6 +77,68 @@ import retrofit2.http.QueryMap;
|
||||
* 1v1网络接口访问 参考 {@link com.yunbao.common.http.PDLiveApi}
|
||||
*/
|
||||
public interface OneToOneApi {
|
||||
/**
|
||||
* 用户手机号登录
|
||||
*
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/api/public/?service=Login.userLogin")
|
||||
Observable<ResponseModel<IMLoginModel>> loginByManager(
|
||||
@Field("user_login") String userName,
|
||||
@Field("user_pass") String passWord,
|
||||
@Field("uuid_Device") String uuidDevice,
|
||||
@Field("pushid") String pushid,
|
||||
@Field("lastlogindevice") String lastlogindevice
|
||||
);
|
||||
|
||||
/**
|
||||
* 用户手机号登录
|
||||
*/
|
||||
@GET("/api/public/?service=Friendappinfos.getInfo")
|
||||
Observable<ResponseModel<UserBean>> getBaseInfos(@Query("login")int login);
|
||||
|
||||
@GET("/api/public/?service=Home.getRandJoinAnchor")
|
||||
Observable<ResponseModel<List<JoinAnchorBean>>> getRandJoinAnchor();
|
||||
@GET("/api/public/?service=Home.getCustomerService")
|
||||
Observable<ResponseModel<List<String>>> getCustomerService();
|
||||
@GET("/api/public/?service=Login.userLoginByThird")
|
||||
Observable<ResponseModel<IMLoginModel>> userLoginByThird(@Query("user_id")String uid,
|
||||
@Query("openid") String openId,
|
||||
@Query("admin_id") String promCode,
|
||||
@Query("uuid_Device") String uuid,
|
||||
@Query("nicename") String nickName,
|
||||
@Query("avatar") String avatar,
|
||||
@Query("app_source")String source,
|
||||
@Query("source")String devices,
|
||||
@Query("sign")String sign,
|
||||
@Query("lastlogindevice")String lastlogindevice,
|
||||
@Query("type") String type,
|
||||
@Query("pushid")String pushid
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,12 +1,19 @@
|
||||
package com.shayu.onetoone.provider;
|
||||
|
||||
import android.text.SpannableString;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.shayu.onetoone.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.conversationlist.model.BaseUiConversation;
|
||||
import io.rong.imkit.conversationlist.provider.BaseConversationProvider;
|
||||
import io.rong.imkit.userinfo.RongUserInfoManager;
|
||||
import io.rong.imkit.widget.adapter.IViewProviderListener;
|
||||
import io.rong.imkit.widget.adapter.ViewHolder;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.UserInfo;
|
||||
|
||||
public class CustomConversationProvider extends BaseConversationProvider {
|
||||
@Override
|
||||
@ -16,8 +23,17 @@ public class CustomConversationProvider extends BaseConversationProvider {
|
||||
|
||||
@Override
|
||||
public void bindViewHolder(ViewHolder holder, BaseUiConversation uiConversation, int position, List<BaseUiConversation> list, IViewProviderListener<BaseUiConversation> listener) {
|
||||
String targetId = uiConversation.mCore.getTargetId();
|
||||
UserInfo userInfo = RongUserInfoManager.getInstance().getUserInfo(targetId);
|
||||
if(userInfo!=null){
|
||||
JSONObject json=JSONObject.parseObject(userInfo.getExtra());
|
||||
if(json.getInteger("sex")==0){
|
||||
holder.setImageResource(R.id.sex,R.mipmap.ic_message_tab_woman);
|
||||
}else{
|
||||
holder.setImageResource(R.id.sex,R.mipmap.ic_message_tab_man);
|
||||
}
|
||||
}
|
||||
super.bindViewHolder(holder, uiConversation, position, list, listener);
|
||||
BaseUiConversation conversation = list.get(position);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.shayu.onetoone.provider;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
|
@ -46,7 +46,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="10sp"
|
||||
android:gravity="center"
|
||||
android:text="TextView1" />
|
||||
android:text="交友" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@ -66,7 +66,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="10sp"
|
||||
android:gravity="center"
|
||||
android:text="TextView1" />
|
||||
android:text="动态" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@ -86,7 +86,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="10sp"
|
||||
android:gravity="center"
|
||||
android:text="TextView1" />
|
||||
android:text="消息" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@ -106,7 +106,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="10sp"
|
||||
android:gravity="center"
|
||||
android:text="TextView1" />
|
||||
android:text="我的" />
|
||||
</LinearLayout>
|
||||
</com.angcyo.tablayout.DslTabLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -4,19 +4,40 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="#F7F7F7"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_conversation_portrait"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_oval="true"
|
||||
tools:src="@tools:sample/avatars" />
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/rc_conversation_portrait"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/m_chu_xia"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sex"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:srcCompat="@mipmap/ic_message_tab_woman" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_title"
|
||||
@ -27,8 +48,8 @@
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/rc_conversation_content"
|
||||
app:layout_constraintStart_toEndOf="@+id/rc_conversation_portrait"
|
||||
app:layout_constraintTop_toTopOf="@+id/rc_conversation_portrait"
|
||||
app:layout_constraintStart_toEndOf="@+id/constraintLayout"
|
||||
app:layout_constraintTop_toTopOf="@+id/constraintLayout"
|
||||
tools:text="@tools:sample/full_names" />
|
||||
|
||||
<TextView
|
||||
@ -36,14 +57,15 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/rc_conversation_portrait"
|
||||
app:layout_constraintStart_toEndOf="@+id/rc_conversation_portrait"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/constraintLayout"
|
||||
app:layout_constraintStart_toEndOf="@+id/constraintLayout"
|
||||
tools:text="@tools:sample/lorem[4:10]" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="5dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/rc_conversation_content"
|
||||
tools:text="@tools:sample/date/hhmm" />
|
||||
@ -52,7 +74,6 @@
|
||||
android:id="@+id/rc_conversation_unread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
@ -32,7 +32,8 @@
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toStartOf="@+id/input_panel_emoji_btn"
|
||||
app:layout_constraintStart_toEndOf="@+id/input_panel_voice_toggle"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/press_to_speech_btn"
|
||||
@ -50,7 +51,8 @@
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toStartOf="@+id/input_panel_emoji_btn"
|
||||
app:layout_constraintStart_toEndOf="@+id/input_panel_voice_toggle"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/input_panel_emoji_btn"
|
||||
@ -102,12 +104,13 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/edit_btn">
|
||||
app:layout_constraintTop_toBottomOf="@+id/input_panel_add_or_send">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/input_panel_image_btn"
|
||||
|
28
OneToOne/src/main/res/layout/view_msg_chat_list_top.xml
Normal file
28
OneToOne/src/main/res/layout/view_msg_chat_list_top.xml
Normal file
@ -0,0 +1,28 @@
|
||||
<?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="wrap_content">
|
||||
|
||||
<include
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:id="@+id/notification"
|
||||
layout="@layout/rc_conversationlist_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<include
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:id="@+id/interaction"
|
||||
layout="@layout/rc_conversationlist_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<include
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:id="@+id/system"
|
||||
layout="@layout/rc_conversationlist_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_message_tab_man.png
Normal file
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_message_tab_man.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
4
OneToOne/src/main/res/values/colors.xml
Normal file
4
OneToOne/src/main/res/values/colors.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="rc_white_color">#F7F7F7</color>
|
||||
</resources>
|
@ -67,6 +67,7 @@ repositories {
|
||||
dependencies {
|
||||
api fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
api files('libs/jcc-bate-0.7.3.jar')
|
||||
api files('libs/OpenInstall_v2.3.0.jar')
|
||||
compileOnly fileTree(dir: '../libs', include: ['*.aar'])
|
||||
api rootProject.ext.dependencies["appcompat-androidx"]
|
||||
api rootProject.ext.dependencies["recyclerview-androidx"]
|
||||
@ -199,7 +200,7 @@ dependencies {
|
||||
api 'com.makeramen:roundedimageview:2.3.0'
|
||||
api 'com.google.android.gms:play-services-auth:15.0.0'
|
||||
api 'com.google.android.material:material:1.4.0'
|
||||
api files('libs/OpenInstall_v2.3.0.jar')
|
||||
|
||||
// api files('libs/svgaplayer-release-v1.2.1.aar')
|
||||
|
||||
}
|
||||
|
BIN
common/libs/OpenInstall_v2.3.0.jar
Normal file
BIN
common/libs/OpenInstall_v2.3.0.jar
Normal file
Binary file not shown.
@ -255,6 +255,16 @@ public class IMLoginModel extends BaseModel {
|
||||
|
||||
@SerializedName("guard_type")
|
||||
private String guardType = "";
|
||||
@SerializedName("need_bind")
|
||||
int needBind;
|
||||
|
||||
public int getNeedBind() {
|
||||
return needBind;
|
||||
}
|
||||
|
||||
public void setNeedBind(int needBind) {
|
||||
this.needBind = needBind;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
|
@ -12,6 +12,7 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.RequestBuilder;
|
||||
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.bumptech.glide.request.target.CustomTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
@ -171,6 +172,13 @@ public class ImgLoader {
|
||||
|
||||
}
|
||||
|
||||
public static void displayAvatarForCircleCrop(Context context, String url, ImageView imageView) {
|
||||
Glide.with(context).load(url)
|
||||
.apply(RequestOptions.bitmapTransform(new CircleCrop()))
|
||||
.error(R.mipmap.icon_avatar_placeholder)
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
public static void display(Context context, File file, ImageView imageView) {
|
||||
if (!contextIsExist(context)) {
|
||||
return;
|
||||
|
@ -14,6 +14,7 @@ import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
Loading…
x
Reference in New Issue
Block a user