Compare commits
27 Commits
8_26修改首页
...
新潘多拉6.8.1_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0445ab4132 | ||
|
|
380381c3fe | ||
|
|
6322c36906 | ||
|
|
1f09d1a0c4 | ||
|
|
2d5f23519d | ||
|
|
39dc287623 | ||
|
|
eb594fcfce | ||
|
|
4d6e38734d | ||
|
|
55b53fb955 | ||
|
|
c4a24be6f7 | ||
|
|
94a06b9cf2 | ||
|
|
410aa45b1c | ||
|
|
e0c1e9c64f | ||
|
|
b56a0bcce4 | ||
|
|
9c117e2752 | ||
|
|
0e69ea1732 | ||
|
|
b4574f730d | ||
|
|
08480af796 | ||
|
|
02387a7321 | ||
|
|
c7f4c1276f | ||
|
|
f463557bc4 | ||
|
|
114a6472fb | ||
|
|
ba47239e12 | ||
|
|
6abe02390e | ||
|
|
7fb4a10425 | ||
|
|
b6f9545fe8 | ||
|
|
af6398354c |
@@ -4,7 +4,7 @@
|
||||
>
|
||||
|
||||
<queries>
|
||||
<package android:name="com.pandora.cs"/>
|
||||
<package android:name="${applicationId}"/>
|
||||
<package android:name="com.facebook.orca"/>
|
||||
|
||||
<package
|
||||
|
||||
@@ -297,8 +297,7 @@ android {
|
||||
|
||||
|
||||
defaultConfig {
|
||||
// applicationId "myname.pdlive.shayu"
|
||||
applicationId "com.pandora.cs"
|
||||
applicationId "com.newpandora.yo"
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
//版本在这里修改
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
|
||||
@@ -1,57 +1,73 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "867032862719",
|
||||
"project_id": "pdlnew",
|
||||
"storage_bucket": "pdlnew.appspot.com"
|
||||
"project_number": "671943160079",
|
||||
"project_id": "pdlnews",
|
||||
"storage_bucket": "pdlnews.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:867032862719:android:841a73fdfb6c37453ae1ca",
|
||||
"mobilesdk_app_id": "1:671943160079:android:e3116655ea962750fb8e7a",
|
||||
"android_client_info": {
|
||||
"package_name": "com.pandora.cs"
|
||||
"package_name": "com.newpandora.yo"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "867032862719-af2dnojobjd8s6ekdr1is1vev8nk36sv.apps.googleusercontent.com",
|
||||
"client_id": "671943160079-9olh3lsv7mo2mrjr16u0cqtlmde8r4ps.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pandora.cs",
|
||||
"certificate_hash": "38cc19306c9facee36a9224e9a4070bc0be15c7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "867032862719-ohaa1f18e186qpasvgt7qkk1i1pivniq.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pandora.cs",
|
||||
"certificate_hash": "b66dc8d21cfcf6c729577ddcf0c312b2a31ed872"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "867032862719-snpbqruvqcc9fsifjnmm1h3dcgtr8am4.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pandora.cs",
|
||||
"package_name": "com.newpandora.yo",
|
||||
"certificate_hash": "15fc5e70cf238323bf7111c8c627803985478e87"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "867032862719-ep4r92lpjmn7gs9tg0r7q0l75a4gm9mt.apps.googleusercontent.com",
|
||||
"client_id": "671943160079-evu2q1gur12tb34cimc9g14t9vffb9sm.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.newpandora.yo",
|
||||
"certificate_hash": "38cc19306c9facee36a9224e9a4070bc0be15c7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "671943160079-gd4v6mr8t330ik8a00po6psdsn6p7b9k.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.newpandora.yo",
|
||||
"certificate_hash": "89f318e9603ae92835b6dab299a45afc59485b9e"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "671943160079-gs1mv4vpdjgofj541cuqkfhija98rna0.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.newpandora.yo",
|
||||
"certificate_hash": "b55235e71e9e1d2f8f7120ddc4224db85125e085"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "671943160079-pdtdv5k1s4mamo7obssuo99rtghkd503.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.newpandora.yo",
|
||||
"certificate_hash": "b66dc8d21cfcf6c729577ddcf0c312b2a31ed872"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "671943160079-9259s527l99jlrfikv6hd4ljcieup34u.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyAnlY2aBEGyg7QpghHo7EaMRkM89dVNgq8"
|
||||
"current_key": "AIzaSyCf7-JJ44TD09I34Yt4DVzcAO7VCDCa424"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "867032862719-ep4r92lpjmn7gs9tg0r7q0l75a4gm9mt.apps.googleusercontent.com",
|
||||
"client_id": "671943160079-9259s527l99jlrfikv6hd4ljcieup34u.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||
<uses-permission android:name="android.permission.NETWORK_PROVIDER" />
|
||||
|
||||
@@ -292,7 +292,6 @@ public class AppContext extends CommonAppContext {
|
||||
MessageChatNotifyManager.getInstance().addShieldClass(LoginActivity.class);
|
||||
MessageChatNotifyManager.getInstance().addShieldClass(RegisterActivity.class);
|
||||
MessageChatNotifyManager.getInstance().addShieldClass(UCropActivity.class);
|
||||
MessageChatNotifyManager.getInstance().addShieldClass(MainActivity.class);
|
||||
|
||||
|
||||
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
||||
|
||||
|
Before Width: | Height: | Size: 5.6 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 8.2 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 15 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 22 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 169 KiB |
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">PandoraLive</string>
|
||||
<string name="app_name">FeelWe</string>
|
||||
</resources>
|
||||
@@ -86,6 +86,7 @@ dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
api files('libs/jcc-bate-0.7.3.jar')
|
||||
compileOnly fileTree(dir: '../libs', include: ['*.aar'])
|
||||
api 'androidx.activity:activity:1.9.1'
|
||||
api rootProject.ext.dependencies["appcompat-androidx"]
|
||||
api rootProject.ext.dependencies["recyclerview-androidx"]
|
||||
api rootProject.ext.dependencies["cardview-androidx"]
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="com.pandora.cs.fileprovider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
|
||||
@@ -13,7 +13,6 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.bean.FansMedalBean;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.bean.NewCommunityType;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.bean.UserItemBean;
|
||||
@@ -538,32 +537,38 @@ public class CommonAppConfig {
|
||||
* 个人中心功能列表
|
||||
*/
|
||||
public List<UserItemBean> getUserItemList() {
|
||||
if (mUserItemList == null || mUserItemList.size() == 0) {
|
||||
String userBeanJson = SpUtil.getInstance().getStringValue(SpUtil.USER_INFO);
|
||||
if (!TextUtils.isEmpty(userBeanJson)) {
|
||||
JSONObject obj = JSON.parseObject(userBeanJson);
|
||||
if (obj != null) {
|
||||
setUserItemList(obj.getString("pdl_list"));
|
||||
setUserItemList(obj.getString("list"));
|
||||
}
|
||||
}
|
||||
return mUserItemList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 个人中心功能列表 新
|
||||
*/
|
||||
public List<UserItemBean> getUserItemNewList() {
|
||||
String userBeanJson = SpUtil.getInstance().getStringValue(SpUtil.USER_INFO);
|
||||
if (!TextUtils.isEmpty(userBeanJson)) {
|
||||
JSONObject obj = JSON.parseObject(userBeanJson);
|
||||
if (obj != null) {
|
||||
setUserItemList(obj.getString("pdl_settings"));
|
||||
}
|
||||
}
|
||||
return mUserItemList;
|
||||
}
|
||||
|
||||
|
||||
public void setUserItemList(String listString) {
|
||||
mUserItemList = JSON.parseArray(listString, UserItemBean.class);
|
||||
UserItemBean[][] arr = JSON.parseObject(listString, UserItemBean[][].class);
|
||||
if (arr != null && arr.length > 0) {
|
||||
List<UserItemBean> newList = new ArrayList<>();
|
||||
for (int i = 0, length1 = arr.length; i < length1; i++) {
|
||||
for (int j = 0, length2 = arr[i].length; j < length2; j++) {
|
||||
UserItemBean bean = arr[i][j];
|
||||
if (j == length2 - 1) {
|
||||
if (i < length1 - 1) {
|
||||
bean.setGroupLast(true);
|
||||
} else {
|
||||
bean.setAllLast(true);
|
||||
}
|
||||
}
|
||||
newList.add(bean);
|
||||
}
|
||||
}
|
||||
mUserItemList = newList;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ package com.yunbao.common;
|
||||
public class HtmlConfig {
|
||||
|
||||
//登录即代表同意服务和隐私条款
|
||||
public static final String LOGIN_PRIVCAY = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=68";
|
||||
public static final String LOGIN_PRIVCAY1 = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=67";
|
||||
public static final String LOGIN_PRIVCAY = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=717";//隱私條款
|
||||
public static final String LOGIN_PRIVCAY1 = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=716";//用戶協議
|
||||
|
||||
//注册用户协议
|
||||
public static final String REG_PRIVCAY1 = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=2";
|
||||
|
||||
@@ -12,8 +12,10 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.google.android.exoplayer2.C;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.OnRecyclerListRefreshListener;
|
||||
@@ -23,16 +25,21 @@ import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.ChatMsgTypeUtils;
|
||||
import com.yunbao.common.utils.DateFormatUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.UiConversationCodeUtil;
|
||||
import com.yunbao.common.utils.ViewUtils;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import org.spongycastle.jcajce.provider.asymmetric.rsa.ISOSignatureSpi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import io.rong.imkit.IMCenter;
|
||||
import io.rong.imkit.RongIM;
|
||||
import io.rong.imkit.conversationlist.ConversationListAdapter;
|
||||
import io.rong.imkit.conversationlist.model.BaseUiConversation;
|
||||
import io.rong.imkit.conversationlist.model.SingleConversation;
|
||||
@@ -52,18 +59,43 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
public static final int TYPE_SEARCH_USER = 510;
|
||||
public static final int TYPE_SEARCH_CHAT = 520;
|
||||
private List<BaseUiConversation> srcList;
|
||||
private List<BaseUiConversation> allDataList;
|
||||
private Context mContext;
|
||||
private boolean isChat = true;
|
||||
private OnRecyclerListRefreshListener<List<BaseUiConversation>> onRefreshListener;
|
||||
private Map<String, Integer> timerMap = new HashMap<>();
|
||||
|
||||
|
||||
public static final int FILTER_OFFLINE = 0;
|
||||
public static final int FILTER_ONLINE = 1;
|
||||
public static final int FILTER_UNREAD = 2;
|
||||
public static final int FILTER_READ = 4;
|
||||
public static final int FILTER_ALL = 7;
|
||||
private int mFilter = FILTER_ALL;
|
||||
|
||||
public int getFilter() {
|
||||
return mFilter;
|
||||
}
|
||||
|
||||
public void setFilter(int mFilter) {
|
||||
if (this.mFilter == mFilter)
|
||||
return;
|
||||
this.mFilter = mFilter;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public MainConversationListAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
public void setSrcList(List<BaseUiConversation> srcList) {
|
||||
this.srcList = srcList;
|
||||
notifyDataSetChanged();
|
||||
if (mFilter== FILTER_OFFLINE || mFilter == FILTER_ONLINE) {
|
||||
super.setDataCollection(UiConversationCodeUtil.FilterData(mFilter, allDataList));
|
||||
}else {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void setOnRefreshListener(OnRecyclerListRefreshListener<List<BaseUiConversation>> onRefreshListener) {
|
||||
@@ -87,7 +119,7 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_main_msg_search_chat, parent, false);
|
||||
holder = ViewHolder.createViewHolder(parent.getContext(), view);
|
||||
} else if (viewType != -200) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.rc_conversationlist_item, parent, false);
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.rc_conversationlist_item2, parent, false);
|
||||
holder = ViewHolder.createViewHolder(parent.getContext(), view);
|
||||
} else {
|
||||
holder = super.onCreateViewHolder(parent, viewType);
|
||||
@@ -100,11 +132,13 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
int type = super.getItemViewType(position);
|
||||
if (mDataList.size() > position) {
|
||||
String objectName = mDataList.get(position).mCore.getObjectName();
|
||||
Log.i("聊天数据源发现","objectName::"+objectName);
|
||||
if (!StringUtil.isEmpty(objectName) && objectName.startsWith("SEARCH_USER")) {
|
||||
type = TYPE_SEARCH_USER;
|
||||
} else if (!StringUtil.isEmpty(objectName) && objectName.startsWith("SEARCH_CHAT")) {
|
||||
type = TYPE_SEARCH_CHAT;
|
||||
} else if (!StringUtil.isEmpty(objectName) && objectName.startsWith("SEARCH_TITLE")) {
|
||||
Log.i("聊天数据源发现 ","getItemViewTypeSEARCH_TITLE");
|
||||
type = TYPE_SEARCH_TITLE;
|
||||
}
|
||||
} else if (mDataList.isEmpty() || isEmpty() || srcList.isEmpty()) {
|
||||
@@ -124,15 +158,76 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
} else if (getItemViewType(position) == TYPE_SEARCH_CHAT) {
|
||||
bindChat(holder, position);
|
||||
} else if (getItemViewType(position) == TYPE_SEARCH_TITLE) {
|
||||
Log.i("聊天数据源设置标题头","SEARCH_TITLE::"+position);
|
||||
bindTitle(holder, position);
|
||||
return;
|
||||
} else if (getItemViewType(position) != -200) {
|
||||
bindChatNew(holder, position);
|
||||
super.onBindViewHolder(holder, position);
|
||||
return;
|
||||
}
|
||||
if (getItemViewType(position) != -200) {
|
||||
bindDefault(holder, position);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void bindChatNew(ViewHolder holder, int position) {
|
||||
BaseUiConversation conversation = mDataList.get(position);
|
||||
ImgLoader.display(holder.getContext(), conversation.mCore.getPortraitUrl(), holder.getView(R.id.rc_conversation_portrait));
|
||||
holder.setText(R.id.rc_conversation_title, conversation.mCore.getConversationTitle());
|
||||
((TextView) holder.getView(R.id.rc_conversation_content)).setText(ChatMsgTypeUtils.getMsg(conversation.mConversationContent.toString()));
|
||||
if (conversation.mCore.getSentTime() != -1 && holder.getView(R.id.rc_conversation_date) != null) {
|
||||
holder.setText(R.id.rc_conversation_date, DateFormatUtil.getDateTimeString(conversation.mCore.getSentTime(), true, holder.getContext()));
|
||||
holder.getView(R.id.rc_conversation_date).setVisibility(View.VISIBLE);
|
||||
} else if (holder.getView(R.id.rc_conversation_date) != null) {
|
||||
holder.getView(R.id.rc_conversation_date).setVisibility(View.GONE);
|
||||
}
|
||||
holder.setVisible(R.id.rc_conversation_live_online, "0".equals(conversation.mCore.getDraft()));
|
||||
int unReadCount = conversation.mCore.getUnreadMessageCount();
|
||||
|
||||
if (unReadCount > 0) {
|
||||
holder.setVisible(R.id.rc_conversation_unread_count, true);
|
||||
holder.setText(R.id.rc_conversation_unread_count, String.valueOf(unReadCount));
|
||||
} else {
|
||||
holder.setVisible(R.id.rc_conversation_unread_count, false);
|
||||
}
|
||||
|
||||
|
||||
Message message = conversation.mCore.getMessage();
|
||||
if (message != null && message.getMessageDirection() == Message.MessageDirection.SEND) {
|
||||
holder.setVisible(R.id.rc_conversation_unread_tv, true);
|
||||
if (conversation.mCore.getSentStatus() == Message.SentStatus.READ) {
|
||||
holder.setTextColor(R.id.rc_conversation_unread_tv, ContextCompat.getColor(holder.itemView.getContext(), R.color.rc_secondary_color));
|
||||
holder.setText(R.id.rc_conversation_unread_tv, WordUtil.getNewString(R.string.message_chat_msg_read_tip));
|
||||
} else {
|
||||
holder.setTextColor(R.id.rc_conversation_unread_tv, ContextCompat.getColor(holder.itemView.getContext(), R.color.red));
|
||||
holder.setText(R.id.rc_conversation_unread_tv, WordUtil.getNewString(R.string.message_chat_msg_unread_tip));
|
||||
}
|
||||
} else {
|
||||
holder.setVisible(R.id.rc_conversation_unread_tv, false);
|
||||
}
|
||||
|
||||
|
||||
if (holder.getView(R.id.rc_conversation_live_status) == null || IMLoginManager.get(holder.getContext()).getAnchorB() != 1) {
|
||||
return;
|
||||
}
|
||||
Integer timer = timerMap.get(mDataList.get(position).mCore.getTargetId());
|
||||
if (timer == null) {
|
||||
holder.getView(R.id.rc_conversation_live_status).setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
if (timer >= 10) {
|
||||
holder.setText(R.id.rc_conversation_live_status,
|
||||
String.format(WordUtil.getNewString(R.string.message_chat_msg_look_live), timer)
|
||||
);
|
||||
holder.getView(R.id.rc_conversation_live_status).setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
holder.getView(R.id.rc_conversation_live_status).setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void bindDefault(ViewHolder holder, int position) {
|
||||
BaseUiConversation conversation = mDataList.get(position);
|
||||
Log.i("列表", "bindDefault: 用户头像:" + conversation.mCore.getPortraitUrl());
|
||||
@@ -171,7 +266,9 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void bindEmpty(ViewHolder holder, int position) {
|
||||
Log.i("聊天数据源", "bindEmpty: ");
|
||||
if (isChat) {
|
||||
ViewUtils.findViewById(holder.itemView, R.id.imageView, ImageView.class).setImageResource(R.mipmap.ic_message_not_chat_list);
|
||||
ViewUtils.findViewById(holder.itemView, R.id.textView, TextView.class).setText(R.string.not_data_message_chat_list);
|
||||
@@ -183,18 +280,19 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
|
||||
public void onFinish() {
|
||||
if (onRefreshListener != null) {
|
||||
Log.i("聊天数据源", "设置数据源: " + mDataList.size());
|
||||
onRefreshListener.onFinish(mDataList);
|
||||
Log.i("聊天数据源", "设置数据源: " + allDataList.size());
|
||||
onRefreshListener.onFinish(allDataList);
|
||||
}
|
||||
}
|
||||
|
||||
private int listHashCode = 0;
|
||||
@Override
|
||||
public synchronized void setDataCollection(List<BaseUiConversation> data) {
|
||||
|
||||
public synchronized void setDataCollectionV2(List<BaseUiConversation> data, boolean isSearch) {
|
||||
if (data.hashCode() == listHashCode) return;
|
||||
listHashCode = data.hashCode();
|
||||
List<BaseUiConversation> tmp = new ArrayList<>();
|
||||
Log.i("聊天数据源", "setDataCollection: " + data.hashCode());
|
||||
Log.i("聊天数据源", "size()" + data.size() + " setDataCollection: " + data.hashCode());
|
||||
|
||||
List<String> urls = new ArrayList<>();
|
||||
if (srcList == null) {
|
||||
srcList = new ArrayList<>();
|
||||
@@ -203,7 +301,8 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
if (mContext == null)
|
||||
mContext = AppManager.getInstance().getLastActivity();
|
||||
for (BaseUiConversation item : data) {
|
||||
if (urls.contains(item.mCore.getTargetId())) continue;
|
||||
if (urls.contains(item.mCore.getTargetId()) && item.mCore.getTargetId()!=null) continue;
|
||||
// if ( item.mCore.getConversationTitle()==null || item.mCore.getTargetId()==null) continue;
|
||||
if (item.mConversationContent != null && item.mConversationContent.toString().contains("_method_")) {
|
||||
IMCenter.getInstance().deleteMessages(Conversation.ConversationType.PRIVATE,
|
||||
item.mCore.getTargetId(),
|
||||
@@ -222,7 +321,8 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
IMCenter.getInstance().clearMessagesUnreadStatus(Conversation.ConversationType.PRIVATE, item.mCore.getTargetId(), null);
|
||||
}
|
||||
urls.add(item.mCore.getTargetId());
|
||||
Log.i("聊天数据源", item.mCore.getConversationTitle() + "|" + item.mCore.getPortraitUrl() + "|" + item.mCore.getTargetId());
|
||||
Log.i("聊天数据源", item.mCore.getConversationTitle() + "|" + item.mCore.getPortraitUrl() + "|" + item.mCore.getTargetId() +"|"+item.mCore.getObjectName());
|
||||
|
||||
if (!tmpUids.contains(item.mCore.getTargetId())) {
|
||||
BaseUiConversation cn = new SingleConversation(mContext, item.mCore);
|
||||
srcList.add(cn);
|
||||
@@ -236,13 +336,37 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
}
|
||||
tmp.add(item);
|
||||
}
|
||||
// ToastUtil.showDebug("消息数:"+data.size());
|
||||
super.setDataCollection(tmp);
|
||||
List<BaseUiConversation> showData = null;
|
||||
if (isSearch) {
|
||||
// Log.i("聊天数据源", "FilterData isSearch");
|
||||
showData = tmp ;//UiConversationCodeUtil.FilterData(mFilter, tmp, allDataList);
|
||||
} else {
|
||||
allDataList = tmp;
|
||||
if (mFilter != FILTER_OFFLINE && mFilter != FILTER_ONLINE )
|
||||
{
|
||||
// Log.i("聊天数据源", "FilterData notSearch");
|
||||
showData = UiConversationCodeUtil.FilterData(mFilter, allDataList);
|
||||
}
|
||||
}
|
||||
if (showData != null && !UiConversationCodeUtil.checkIsSame(showData, mDataList)) {
|
||||
// Log.i("聊天数据源", "数据源有变化" + showData.size());
|
||||
super.setDataCollection(showData);
|
||||
} else {
|
||||
// Log.i("聊天数据源", "数据源无变化");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setDataCollection(List<BaseUiConversation> data) {
|
||||
setDataCollectionV2(data, false);
|
||||
}
|
||||
|
||||
|
||||
private List<String> tmpUids = new ArrayList<>();
|
||||
|
||||
public void clear() {
|
||||
Log.i("聊天数据源", "clear: " + mDataList.size());
|
||||
mDataList.clear();
|
||||
if (srcList != null) {
|
||||
srcList.clear();
|
||||
@@ -349,15 +473,15 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
BaseUiConversation conversation = mDataList.get(id);
|
||||
conversation.mCore.setSentTime(bean.getSentTime());
|
||||
conversation.mCore.setUnreadMessageCount(integer);
|
||||
if(bean.getContent() instanceof SightMessage){
|
||||
conversation.mConversationContent = new SpannableString(WordUtil.isNewZh()?"[小視頻]":"[Video]");
|
||||
}else if(bean.getContent() instanceof HQVoiceMessage){
|
||||
conversation.mConversationContent = new SpannableString(WordUtil.isNewZh()?"[語音]":"[Voice]");
|
||||
} else if(bean.getContent() instanceof ImageMessage){
|
||||
conversation.mConversationContent = new SpannableString(WordUtil.isNewZh()?"[圖片]":"[picture]");
|
||||
}else if(bean.getContent() instanceof MessageChatCardContent){
|
||||
conversation.mConversationContent = new SpannableString(WordUtil.isNewZh()?"[站內分享]":"[In-app sharing]");
|
||||
} else{
|
||||
if (bean.getContent() instanceof SightMessage) {
|
||||
conversation.mConversationContent = new SpannableString(WordUtil.isNewZh() ? "[小視頻]" : "[Video]");
|
||||
} else if (bean.getContent() instanceof HQVoiceMessage) {
|
||||
conversation.mConversationContent = new SpannableString(WordUtil.isNewZh() ? "[語音]" : "[Voice]");
|
||||
} else if (bean.getContent() instanceof ImageMessage) {
|
||||
conversation.mConversationContent = new SpannableString(WordUtil.isNewZh() ? "[圖片]" : "[picture]");
|
||||
} else if (bean.getContent() instanceof MessageChatCardContent) {
|
||||
conversation.mConversationContent = new SpannableString(WordUtil.isNewZh() ? "[站內分享]" : "[In-app sharing]");
|
||||
} else {
|
||||
conversation.mConversationContent = new SpannableString(((TextMessage) bean.getContent()).getContent());
|
||||
}
|
||||
mDataList.set(id, conversation);
|
||||
@@ -375,4 +499,6 @@ public class MainConversationListAdapter extends ConversationListAdapter {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
Bus.getOff(this);
|
||||
// Bus.getOff(this);
|
||||
super.dismiss();
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
Bus.getOn(this);
|
||||
// Bus.getOn(this);
|
||||
editSearch = findViewById(R.id.edit_search);
|
||||
// listHistory = findViewById(R.id.list_history);
|
||||
listRoom = findViewById(R.id.list_room);
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.yunbao.common.fragment;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import com.facebook.all.All;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.utils.UiConversationCodeUtil;
|
||||
|
||||
public class ChatViewModel extends ViewModel {
|
||||
|
||||
private int mChatFilter = UiConversationCodeUtil.FILTER_ALL;
|
||||
|
||||
public int getChatFilter() {
|
||||
return mChatFilter;
|
||||
}
|
||||
|
||||
public void setChatFilter(int mChatFilter) {
|
||||
this.mChatFilter = mChatFilter;
|
||||
}
|
||||
|
||||
// public static final int FILTER_OFFLINE = 0;
|
||||
// public static final int FILTER_ONLINE = 1;
|
||||
// public static final int FILTER_UNREAD = 2;
|
||||
// public static final int FILTER_READ = 4;
|
||||
// public static final int FILTER_ALL = 7;
|
||||
// <string name="all_chats">All Chats</string>
|
||||
// <string name="online_only">Show Online </string>
|
||||
// <string name="offline_only">Show Offline </string>
|
||||
// <string name="read_only">Show Read </string>
|
||||
// <string name="unread_only">Show Unread </string>
|
||||
|
||||
public int getTitleTextId() {
|
||||
int id = R.string.all_chats;
|
||||
switch (mChatFilter) {
|
||||
case UiConversationCodeUtil.FILTER_ALL:
|
||||
id = R.string.all_chats;
|
||||
break;
|
||||
case UiConversationCodeUtil.FILTER_ONLINE:
|
||||
id = R.string.online_only;
|
||||
break;
|
||||
case UiConversationCodeUtil.FILTER_OFFLINE:
|
||||
id = R.string.offline_only;
|
||||
break;
|
||||
case UiConversationCodeUtil.FILTER_READ:
|
||||
id = R.string.read_only;
|
||||
break;
|
||||
case UiConversationCodeUtil.FILTER_UNREAD:
|
||||
id = R.string.unread_only;
|
||||
break;
|
||||
}
|
||||
return id;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.yunbao.common.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -9,11 +11,13 @@ import android.view.ViewGroup;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.MainConversationListAdapter;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.UiConversationCodeUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -26,16 +30,20 @@ import io.rong.imkit.conversationlist.model.SingleConversation;
|
||||
import io.rong.imkit.event.Event;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.imlib.model.MessageContent;
|
||||
import io.rong.imlib.model.SearchConversationResult;
|
||||
|
||||
public class MainMessageChatFragment extends ConversationListFragment {
|
||||
|
||||
private static final String TAG = "融云列表";
|
||||
int listHashCode = 0;
|
||||
// ChatViewModel chatViewModel;
|
||||
|
||||
@Nullable
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
Log.i(TAG, "onCreateView: 创建融云");
|
||||
// chatViewModel = (ChatViewModel)(new ViewModelProvider(requireActivity())).get(ChatViewModel.class);
|
||||
return inflater.inflate(R.layout.rc_conversationlist_fragment, container, false);
|
||||
}
|
||||
|
||||
@@ -46,10 +54,13 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
mConversationListViewModel.getConversationListLiveData().observe(this.getViewLifecycleOwner(), new Observer<List<BaseUiConversation>>() {
|
||||
@Override
|
||||
public void onChanged(List<BaseUiConversation> uiConversations) {
|
||||
if (listHashCode != uiConversations.hashCode()) {
|
||||
listHashCode = uiConversations.hashCode();
|
||||
int hashCode = uiConversations.hashCode();
|
||||
if (listHashCode != hashCode) {
|
||||
Log.i("nwq", "刷新数据");
|
||||
listHashCode = hashCode;
|
||||
((MainConversationListAdapter) mAdapter).onFinish();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
mConversationListViewModel.getRefreshEventLiveData().observe(this.getViewLifecycleOwner(), new Observer<Event.RefreshEvent>() {
|
||||
@@ -58,7 +69,6 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
listHashCode = 0;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void setEmptyView(int viewLayoutMsgId) {
|
||||
@@ -70,7 +80,16 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
}
|
||||
|
||||
|
||||
public void refreshData() {
|
||||
mRefreshLayout.autoRefresh();
|
||||
//onConversationListRefresh(mRefreshLayout)
|
||||
}
|
||||
|
||||
public void search(String search) {
|
||||
if (TextUtils.isEmpty(search)){
|
||||
mRefreshLayout.autoRefresh();
|
||||
return;
|
||||
}
|
||||
((MainConversationListAdapter) mAdapter).setSearch();
|
||||
getContactsList(search);
|
||||
}
|
||||
@@ -84,10 +103,11 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
List<String> uidList = new ArrayList<>();
|
||||
|
||||
BaseUiConversation conversation = new SingleConversation(getContext(), new Conversation());
|
||||
conversation.mCore.setMessage(new Message());
|
||||
conversation.mCore.setObjectName("SEARCH_TITLE" + WordUtil.getNewString(R.string.activity_msg_list_title_contacts));
|
||||
Log.i("聊天数据源设置数据", "聊天数据源: " + conversation.mCore.getObjectName());
|
||||
conversation.mCore.setConversationType(Conversation.ConversationType.PRIVATE);
|
||||
list.add(conversation);
|
||||
|
||||
List<BaseUiConversation> data = new ArrayList<>();
|
||||
System.err.println(" ----------------------->" + mAdapter.getData().size());
|
||||
for (BaseUiConversation cn : ((MainConversationListAdapter) mAdapter).getSrcList()) {
|
||||
@@ -126,7 +146,9 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
@Override
|
||||
public void onSuccess(List<SearchConversationResult> searchConversationResults) {
|
||||
BaseUiConversation conversation = new SingleConversation(getContext(), new Conversation());
|
||||
conversation.mCore.setMessage(new Message());
|
||||
conversation.mCore.setObjectName("SEARCH_TITLE" + WordUtil.getNewString(R.string.activity_msg_list_title_chat_records));
|
||||
Log.i("聊天数据源设置数据", "聊天数据源: " + conversation.mCore.getObjectName());
|
||||
conversation.mCore.setConversationType(Conversation.ConversationType.PRIVATE);
|
||||
list.add(conversation);
|
||||
List<BaseUiConversation> data = new ArrayList<>();
|
||||
@@ -144,7 +166,10 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
list.remove(list.size() - 1);
|
||||
}
|
||||
list.addAll(data);
|
||||
mAdapter.setDataCollection(list);
|
||||
for (BaseUiConversation cn : list){
|
||||
Log.i("聊天数据源搜索前的", cn.mCore.getConversationTitle() + "|" + cn.mCore.getPortraitUrl() + "|" + cn.mCore.getTargetId());
|
||||
}
|
||||
((MainConversationListAdapter) mAdapter).setDataCollectionV2(list,true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -156,17 +181,19 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
}
|
||||
|
||||
public void onChatList() {
|
||||
if(mConversationListViewModel==null)return;
|
||||
if (mConversationListViewModel == null) return;
|
||||
((MainConversationListAdapter) mAdapter).setChat();
|
||||
((MainConversationListAdapter) mAdapter).clear();
|
||||
System.out.println(">!>!>!>!!>"+mConversationListViewModel);
|
||||
System.out.println(">!>!>!>!!>" + mConversationListViewModel);
|
||||
subscribeUi();
|
||||
|
||||
mRefreshLayout.autoRefresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ConversationListAdapter onResolveAdapter() {
|
||||
this.mAdapter = new MainConversationListAdapter(getContext());
|
||||
MainConversationListAdapter adapter = new MainConversationListAdapter(getContext());
|
||||
// adapter.setFilter(chatViewModel.getChatFilter());
|
||||
this.mAdapter = adapter;
|
||||
return this.mAdapter;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
@@ -49,7 +50,7 @@ public class MainMessageChatListFragment extends AbsMainMessageChatListFragment
|
||||
public MainMessageChatListFragment(Context mContext) {
|
||||
this.mContext =mContext;
|
||||
}
|
||||
|
||||
ChatViewModel chatViewModel;
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
@@ -62,8 +63,10 @@ public class MainMessageChatListFragment extends AbsMainMessageChatListFragment
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
chatViewModel = (new ViewModelProvider(requireActivity())).get(ChatViewModel.class);
|
||||
conversationListFragment = new MainMessageChatFragment();
|
||||
setAdapter(conversationListFragment.getAdapter());
|
||||
mAdapter.setFilter(chatViewModel.getChatFilter());
|
||||
FragmentManager manager = getChildFragmentManager();
|
||||
FragmentTransaction transaction = manager.beginTransaction();
|
||||
transaction.replace(R.id.container, conversationListFragment);
|
||||
@@ -165,6 +168,16 @@ public class MainMessageChatListFragment extends AbsMainMessageChatListFragment
|
||||
|
||||
}
|
||||
|
||||
public int getFilter() {
|
||||
return mAdapter.getFilter();
|
||||
}
|
||||
|
||||
public void setFilter(int mFilter) {
|
||||
mAdapter.setFilter(mFilter);
|
||||
chatViewModel.setChatFilter(mFilter);
|
||||
conversationListFragment.refreshData();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
|
||||
@@ -20,7 +20,7 @@ public class CommonHttpConsts {
|
||||
public static final String DOWNLOAD_GIF = "downloadGif";
|
||||
public static final String GET_BALANCE = "getBalance";
|
||||
public static final String CHECK_TOKEN_INVALID = "checkTokenInvalid";
|
||||
public static final String NOTIFY_GOOGLE = "Charge.google_pay";
|
||||
public static final String NOTIFY_GOOGLE = "Charge.goole_validate_panduola";
|
||||
public static final String COMMUNITY_SETREPORT = "Community.setReport";
|
||||
|
||||
public static final String GET_USER_HOME = "getUserHome";
|
||||
|
||||
@@ -417,18 +417,15 @@ public class CommonHttpUtil {
|
||||
.params("purchaseToken", purchaseToken)
|
||||
.params("productId", productId)
|
||||
.params("orderno", orderno)
|
||||
.params("package_name", "com.pandora.cs")
|
||||
.params("package_name", CommonAppContext.sInstance.getPackageName())
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
public static void notifyGoogle(String purchaseToken, String orderNo, String tradeNo, String allData, String gps_adid, HttpCallback callback) {
|
||||
public static void notifyGoogle(String purchaseToken, String productId, HttpCallback callback) {
|
||||
HttpClient.getInstance().get(CommonHttpConsts.NOTIFY_GOOGLE, CommonHttpConsts.NOTIFY_GOOGLE)
|
||||
.params("purchaseToken", purchaseToken)
|
||||
.params("orderno", orderNo)
|
||||
.params("trade_no", tradeNo)
|
||||
.params("allData", allData)
|
||||
.params("gps_adid", gps_adid)
|
||||
.params("package_name", "com.pandora.cs")
|
||||
.params("productId", productId)
|
||||
.params("package_name", CommonAppContext.sInstance.getPackageName())
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -437,7 +434,7 @@ public class CommonHttpUtil {
|
||||
.params("purchaseToken", purchaseToken)
|
||||
.params("orderno", orderNo)
|
||||
.params("trade_no", tradeNo)
|
||||
.params("package_name", "com.pandora.cs")
|
||||
.params("package_name", CommonAppContext.sInstance.getPackageName())
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
|
||||
@@ -1295,7 +1295,7 @@ public interface PDLiveApi {
|
||||
@Query("open_off") int status
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Pdlmsg.sendBefore")
|
||||
@GET("/api/public/?service=Pdlmsg.sendBefore&new_pop=1")
|
||||
Observable<ResponseModel<MessageSayHiBean>> getMessageSayHiTimer(
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,297 @@
|
||||
package com.yunbao.common.pay.google;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.billingclient.api.BillingClient;
|
||||
import com.android.billingclient.api.BillingClientStateListener;
|
||||
import com.android.billingclient.api.BillingFlowParams;
|
||||
import com.android.billingclient.api.BillingResult;
|
||||
import com.android.billingclient.api.ConsumeParams;
|
||||
import com.android.billingclient.api.ProductDetails;
|
||||
import com.android.billingclient.api.Purchase;
|
||||
import com.android.billingclient.api.PurchasesUpdatedListener;
|
||||
import com.android.billingclient.api.QueryProductDetailsParams;
|
||||
import com.android.billingclient.api.QueryPurchasesParams;
|
||||
import com.google.android.gms.ads.identifier.AdvertisingIdClient;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.GoogleApiAvailability;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
//谷歌支付
|
||||
public class GooglePlay implements PurchasesUpdatedListener {
|
||||
|
||||
private String TAG = "mLog";
|
||||
private BillingClient billingClient;
|
||||
private GoogleBillingListener billingListener;
|
||||
|
||||
private GooglePlay() {
|
||||
init();
|
||||
}
|
||||
|
||||
private boolean init() {
|
||||
if (getGoogleService() && billingClient == null) {
|
||||
billingClient = BillingClient.newBuilder(CommonAppContext.sInstance)
|
||||
.setListener(this)
|
||||
.enablePendingPurchases()
|
||||
.build();
|
||||
startConnection();
|
||||
return true;
|
||||
}
|
||||
if (billingClient != null && !billingClient.isReady()) {//没有连接的话去连接
|
||||
startConnection();
|
||||
}
|
||||
if (billingClient == null)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
private void startConnection() {
|
||||
if (!billingClient.isReady()) {
|
||||
//请求连接到GooglePay
|
||||
billingClient.startConnection(new BillingClientStateListener() {
|
||||
@Override
|
||||
public void onBillingSetupFinished(@NonNull BillingResult billingResult) {
|
||||
int code = billingResult.getResponseCode();
|
||||
if (code != BillingClient.BillingResponseCode.OK) {
|
||||
String msg = billingResult.getDebugMessage();
|
||||
Log.e(TAG, "连接到GooglePay失败 code = " + code + " msg = " + msg);
|
||||
return;
|
||||
}
|
||||
Log.e(TAG, "连接到GooglePay成功");
|
||||
}
|
||||
|
||||
//连接失败
|
||||
@Override
|
||||
public void onBillingServiceDisconnected() {
|
||||
Log.e(TAG, "连接到GooglePay失败,请重试");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//点击商品,先查询商品 然后出来支付界面,调用下单
|
||||
public void purchase(Activity activity, String orderNumber, String id) {
|
||||
if (!init()) {
|
||||
return;
|
||||
}
|
||||
ImmutableList<QueryProductDetailsParams.Product> productList = ImmutableList.of(QueryProductDetailsParams.Product.newBuilder()
|
||||
.setProductId(id)
|
||||
.setProductType(BillingClient.ProductType.INAPP)
|
||||
.build());
|
||||
QueryProductDetailsParams queryProductDetailsParams =
|
||||
QueryProductDetailsParams.newBuilder()
|
||||
.setProductList(productList)
|
||||
.build();
|
||||
billingClient.queryProductDetailsAsync(
|
||||
queryProductDetailsParams,
|
||||
(billingResult, list) -> {
|
||||
//查询商品成功
|
||||
int code = billingResult.getResponseCode();
|
||||
if (code != BillingClient.BillingResponseCode.OK || list == null || list.isEmpty()) {
|
||||
String msg = billingResult.getDebugMessage();
|
||||
Log.e(TAG, "查询商品失败 code = " + code + " msg = " + msg);
|
||||
return;
|
||||
}
|
||||
Log.e(TAG, "查询商品成功");
|
||||
buyIt(activity, orderNumber, list.get(0));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
//开始下单,准备生成订单了
|
||||
private void buyIt(Activity activity, String orderNumber, ProductDetails productDetails) {
|
||||
List<BillingFlowParams.ProductDetailsParams> productDetailsParamsList = new ArrayList<>();
|
||||
productDetailsParamsList.add(BillingFlowParams.ProductDetailsParams.newBuilder()
|
||||
// retrieve a value for "productDetails" by calling queryProductDetailsAsync()
|
||||
.setProductDetails(productDetails)
|
||||
// For one-time products, "setOfferToken" method shouldn't be called.
|
||||
// For subscriptions, to get an offer token, call
|
||||
// ProductDetails.subscriptionOfferDetails() for a list of offers
|
||||
// that are available to the user.
|
||||
//一次性商品不需要传token
|
||||
// .setOfferToken(selectedOfferToken)
|
||||
.build());
|
||||
|
||||
BillingFlowParams billingFlowParams = BillingFlowParams.newBuilder()
|
||||
.setProductDetailsParamsList(productDetailsParamsList)
|
||||
.setObfuscatedAccountId(orderNumber)//好像是账号id
|
||||
.build();
|
||||
|
||||
BillingResult billingResult = billingClient.launchBillingFlow(activity, billingFlowParams);
|
||||
int code = billingResult.getResponseCode();
|
||||
if (code != BillingClient.BillingResponseCode.OK) {
|
||||
String msg = billingResult.getDebugMessage();
|
||||
Log.e(TAG, "购买商品失败 code = " + code + " msg = " + msg);
|
||||
// ToastUtil.show(getString(R.string.pay_suc));
|
||||
return;
|
||||
}
|
||||
Log.e(TAG, "购买商品 " + productDetails.toString());
|
||||
}
|
||||
|
||||
//消耗商品 支付成功之后,调用我们后台下发商品成功之后,调用消耗
|
||||
public void consume(List<Purchase> list) {
|
||||
if (!init()) {
|
||||
return;
|
||||
}
|
||||
for (Purchase purchase : list) {
|
||||
getConsumeGoods(purchase);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 消耗所有商品
|
||||
*/
|
||||
public void consumeAll() {
|
||||
if (!init()) {
|
||||
return;
|
||||
}
|
||||
//以下示例展示了如何提取用户的订阅购买交易。请注意,queryPurchasesAsync() 仅返回有效订阅和非消耗型一次性购买交易。
|
||||
QueryPurchasesParams inAppPurchasesQuery = QueryPurchasesParams.newBuilder().setProductType(BillingClient.ProductType.INAPP).build();
|
||||
billingClient.queryPurchasesAsync(inAppPurchasesQuery, (billingResult, list) -> {
|
||||
if (BillingClient.BillingResponseCode.OK == billingResult.getResponseCode()) {
|
||||
for (Purchase purchase : list) {
|
||||
//0:PurchaseState.UNSPECIFIED_STATE:未知状态
|
||||
//1:PurchaseState.PURCHASED:付款完成
|
||||
//2:PurchaseState.PENDING:购买正在等待付款完成。
|
||||
if (Purchase.PurchaseState.PURCHASED == purchase.getPurchaseState()) {
|
||||
//调用google去消费
|
||||
//如果之后还出现谷歌掉单的行为在来处理
|
||||
CommonHttpUtil.notifyGoogle(purchase.getPurchaseToken(),
|
||||
purchase.getProducts().get(0), new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
getConsumeGoods(purchase);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 公共消费商品接口
|
||||
*/
|
||||
private void getConsumeGoods(Purchase purchase) {
|
||||
if (purchase != null) {
|
||||
Log.i(TAG, "-----开始消耗商品:" + purchase.toString());
|
||||
ConsumeParams.Builder consumeParams = ConsumeParams.newBuilder();
|
||||
consumeParams.setPurchaseToken(purchase.getPurchaseToken());
|
||||
//调用消耗商品方法
|
||||
consumeAsync(consumeParams.build(), purchase);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 消耗商品
|
||||
* int SERVICE_TIMEOUT = -3; //服务超时
|
||||
* int FEATURE_NOT_SUPPORTED = -2; //不支持功能
|
||||
* int SERVICE_DISCONNECTED = -1; //服务单元已断开
|
||||
* int OK = 0; //成功
|
||||
* int USER_CANCELED = 1; //用户按上一步或取消对话框
|
||||
* int SERVICE_UNAVAILABLE = 2; //网络连接断开
|
||||
* int BILLING_UNAVAILABLE = 3; //所请求的类型不支持 Google Play 结算服务 AIDL 版本
|
||||
* int ITEM_UNAVAILABLE = 4; //请求的商品已不再出售。
|
||||
* int DEVELOPER_ERROR = 5; //提供给 API 的参数无效。此错误也可能说明应用未针对结算服务正确签名或设置,或者在其清单中缺少必要的权限。
|
||||
* int ERROR = 6; //API 操作期间出现严重错误
|
||||
* int ITEM_ALREADY_OWNED = 7; //未能购买,因为已经拥有此商品
|
||||
* int ITEM_NOT_OWNED = 8; //未能消费,因为尚未拥有此商品
|
||||
*/
|
||||
private void consumeAsync(ConsumeParams consumeParams, Purchase purchase) {
|
||||
if (!init()) {
|
||||
return;
|
||||
}
|
||||
billingClient.consumeAsync(consumeParams, (billingResult, purchaseToken) -> {
|
||||
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK) {
|
||||
Log.i(TAG, "-----消耗商品成功");
|
||||
} else {
|
||||
Log.i(TAG, "-----消耗商品失败" + billingResult.toString() + "---" + purchaseToken + "--code:" + billingResult.getResponseCode());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPurchasesUpdated(@NonNull BillingResult billingResult, @Nullable List<Purchase> purchases) {
|
||||
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK
|
||||
&& purchases != null) {
|
||||
//支付成功
|
||||
if (billingListener != null)//消耗掉商品放到外面调用我们服务器成功的时候去消耗 todo 暂时注释掉 这样可以模拟掉单的问题
|
||||
billingListener.onPaySuccess(purchases);
|
||||
/*
|
||||
* 一旦您验证了购买交易,您的应用就可以向用户授予使用权了。若要确认与购买交易相关联的用户账号,
|
||||
* 您可以使用 Purchases.products:get 返回的 ProductPurchase.obfuscatedExternalAccountId(适用于应用内商品的购买交易)
|
||||
* 和 Purchases.subscriptions:get 返回的 SubscriptionPurchase.obfuscatedExternalAccountId(适用于服务器端的订阅),
|
||||
* 或者 Purchase.getAccountIdentifiers() 在客户端返回的 obfuscatedAccountId(如果在交易时已使用 setObfuscatedAccountId 设置该 ID)。
|
||||
* */
|
||||
// purchases.get(0).getAccountIdentifiers()
|
||||
for (Purchase purchase : purchases) {
|
||||
Log.d("mLog", "谷歌支付的回调 " + purchase);
|
||||
}
|
||||
} else if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.USER_CANCELED) {
|
||||
//取消支付了
|
||||
if (billingListener != null)
|
||||
billingListener.onPayFailed(CommonAppContext.sInstance.getString(R.string.pay_cancel));
|
||||
} else {
|
||||
//支付失败
|
||||
if (billingListener != null)
|
||||
billingListener.onPayFailed(CommonAppContext.sInstance.getString(R.string.pay_fail));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测GooglePlay服务是否可用(需要导入包api "com.google.android.gms:play-services-location:11.8.0",也可以不检查,跳过这个代码)
|
||||
*/
|
||||
public boolean getGoogleService() {
|
||||
GoogleApiAvailability googleApiAvailability = GoogleApiAvailability.getInstance();
|
||||
if (googleApiAvailability != null) {
|
||||
int resultCode = googleApiAvailability.isGooglePlayServicesAvailable(CommonAppContext.sInstance);
|
||||
return resultCode == ConnectionResult.SUCCESS;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getAdId() {
|
||||
try {
|
||||
return AdvertisingIdClient.getAdvertisingIdInfo(CommonAppContext.sInstance).getId();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.e("GooglePlay", "获取谷歌的id错误了");
|
||||
}
|
||||
return "google_default_id";
|
||||
}
|
||||
|
||||
public void setBillingListener(GoogleBillingListener listener) {
|
||||
billingListener = listener;
|
||||
}
|
||||
|
||||
/**
|
||||
* 定义接口返回支付结果
|
||||
*/
|
||||
public interface GoogleBillingListener {
|
||||
void onPaySuccess(List<Purchase> purchases);
|
||||
|
||||
void onPayFailed(String msg);
|
||||
}
|
||||
|
||||
public static class GooglePlayHelper {
|
||||
static GooglePlay googlePlay = new GooglePlay();
|
||||
}
|
||||
|
||||
public static GooglePlay getInstance() {
|
||||
return GooglePlayHelper.googlePlay;
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,21 @@ package com.yunbao.common.utils;
|
||||
import android.Manifest;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.ImageDecoder;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.MediaStore;
|
||||
|
||||
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.PickVisualMediaRequest;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.core.content.FileProvider;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.yalantis.ucrop.UCrop;
|
||||
import com.yalantis.ucrop.util.FileUtils;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
@@ -39,6 +47,7 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
private ImageResultCallback mResultCallback;
|
||||
private boolean mNeedCrop;//是否需要裁剪
|
||||
private boolean mNeedGif;//允许gif图
|
||||
ActivityResultLauncher<PickVisualMediaRequest> launcher;
|
||||
|
||||
public void setNeedGif(boolean mNeedGif) {
|
||||
this.mNeedGif = mNeedGif;
|
||||
@@ -83,7 +92,7 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
if (mNeedCrop) {
|
||||
Uri uri = null;
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
uri = FileProvider.getUriForFile(mContext, "com.pandora.cs.fileprovider", mCameraResult);
|
||||
uri = FileProvider.getUriForFile(mContext, mContext.getPackageName() +".fileprovider", mCameraResult);
|
||||
} else {
|
||||
uri = Uri.fromFile(mCameraResult);
|
||||
}
|
||||
@@ -117,6 +126,19 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
return;
|
||||
}
|
||||
String path = FileUtils.getPath(mContext, intent.getData());
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
ImageDecoder.Source source = ImageDecoder.createSource(mContext.getContentResolver(), intent.getData());
|
||||
try {
|
||||
Bitmap bitmap = ImageDecoder.decodeBitmap(source);
|
||||
path=BitmapUtil.getInstance().saveBitmap(bitmap);
|
||||
bitmap.recycle();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
mResultCallback.onFailure();
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
File file = new File(path);
|
||||
if (file.exists()) {
|
||||
mResultCallback.onSuccess(file);
|
||||
@@ -153,6 +175,19 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
}
|
||||
}
|
||||
};
|
||||
launcher = ((AppCompatActivity) mContext).registerForActivityResult(new ActivityResultContracts.PickVisualMedia(), new androidx.activity.result.ActivityResultCallback<Uri>() {
|
||||
@Override
|
||||
public void onActivityResult(Uri result) {
|
||||
LogUtils.e("result:" + result);
|
||||
if (result == null) {
|
||||
mAlumbResultCallback.onFailure();
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent();
|
||||
intent.setData(result);
|
||||
mAlumbResultCallback.onSuccess(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -173,15 +208,28 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
/**
|
||||
* 相册获取图片
|
||||
*/
|
||||
public void getImageByAlumb() {
|
||||
public void getImageByAlbum() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
showSystemPick();
|
||||
return;
|
||||
}
|
||||
requestPermissions(mAlumbPermissions, mAlumbPermissionCallback);
|
||||
}
|
||||
|
||||
public void getImageByAlumb(boolean needCrop) {
|
||||
public void getImageByAlbum(boolean needCrop) {
|
||||
this.mNeedCrop = needCrop;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
showSystemPick();
|
||||
return;
|
||||
}
|
||||
requestPermissions(mAlumbPermissions, mAlumbPermissionCallback);
|
||||
}
|
||||
|
||||
private void showSystemPick() {
|
||||
PickVisualMediaRequest.Builder builder = new PickVisualMediaRequest.Builder()
|
||||
.setMediaType(ActivityResultContracts.PickVisualMedia.ImageOnly.INSTANCE);
|
||||
launcher.launch(builder.build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启摄像头,执行照相
|
||||
@@ -195,7 +243,7 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
mCameraResult = getNewFile();
|
||||
Uri uri = null;
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
uri = FileProvider.getUriForFile(mContext, "com.pandora.cs.fileprovider", mCameraResult);
|
||||
uri = FileProvider.getUriForFile(mContext, mContext.getPackageName()+".fileprovider", mCameraResult);
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
|
||||
} else {
|
||||
uri = Uri.fromFile(mCameraResult);
|
||||
@@ -255,7 +303,7 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
startActivityForResult(intent, mCropResultCallback);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
Uri resultUri = FileProvider.getUriForFile(mContext, "com.pandora.cs.fileprovider", mCorpResult);
|
||||
Uri resultUri = FileProvider.getUriForFile(mContext, mContext.getPackageName()+".fileprovider", mCorpResult);
|
||||
if (resultUri == null || mFragment == null || mContext == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.conversationlist.model.BaseUiConversation;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
|
||||
public class UiConversationCodeUtil {
|
||||
|
||||
|
||||
public static final int FILTER_OFFLINE = 0;
|
||||
public static final int FILTER_ONLINE = 1;
|
||||
public static final int FILTER_UNREAD = 2;
|
||||
public static final int FILTER_READ = 4;
|
||||
public static final int FILTER_ALL = 7;
|
||||
|
||||
|
||||
public static boolean checkIsSame(List<BaseUiConversation> list1, List<BaseUiConversation> list2) {
|
||||
if (list1.isEmpty()){
|
||||
return false;
|
||||
}
|
||||
if (list1.size() != list2.size()) return false;
|
||||
int hashCode1 = getListHasCode(list1);
|
||||
int hashCode2 = getListHasCode(list2);
|
||||
return hashCode1 == hashCode2;
|
||||
}
|
||||
|
||||
public static boolean checkIsSame(int hashCode1, List<BaseUiConversation> list2) {
|
||||
int hashCode2 = getListHasCode(list2);
|
||||
return hashCode1 == hashCode2;
|
||||
}
|
||||
|
||||
public static int getListHasCode(List<BaseUiConversation> list) {
|
||||
int hashCodeValue = 1;
|
||||
if (list == null || list.isEmpty())
|
||||
return 1;
|
||||
for (BaseUiConversation conversation : list) {
|
||||
if (conversation != null) {
|
||||
hashCodeValue = 31 * hashCodeValue + getBaseUiConversationHashCode(conversation);
|
||||
}
|
||||
}
|
||||
return hashCodeValue;
|
||||
}
|
||||
|
||||
|
||||
//根据BaseUiConversation对象的属性计算hashCode
|
||||
private static int getBaseUiConversationHashCode(BaseUiConversation item) {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
Conversation mCore = item.mCore;
|
||||
result = prime * result + ((mCore.getPortraitUrl() == null) ? 0 : mCore.getPortraitUrl().hashCode());
|
||||
result = prime * result + ((mCore.getConversationTitle() == null) ? 0 : mCore.getConversationTitle().hashCode());
|
||||
// result = prime * result + ((item.mConversationContent == null) ? 0 : item.mConversationContent.hashCode());
|
||||
result = prime * result + (int) (mCore.getSentTime() ^ (mCore.getSentTime() >>> 32));
|
||||
result = prime * result + ((mCore.getDraft() == null) ? 0 : mCore.getDraft().hashCode());
|
||||
result = prime * result + mCore.getUnreadMessageCount();
|
||||
|
||||
Message message = mCore.getMessage();
|
||||
if (message != null) {
|
||||
Message.MessageDirection direction = message.getMessageDirection();
|
||||
if (direction != null) {
|
||||
result = prime * result + direction.hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
result = prime * result + ((mCore.getSentStatus() == null) ? 0 : mCore.getSentStatus().hashCode());
|
||||
result = prime * result + ((mCore.getReceivedStatus() == null) ? 0 : mCore.getReceivedStatus().hashCode());
|
||||
result = prime * result + ((mCore.getTargetId() == null) ? 0 : mCore.getTargetId().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private static boolean isContains(List<BaseUiConversation> list, BaseUiConversation item) {
|
||||
// 根据 item.mCore.getChannelId() 判断 list 是否包含
|
||||
if (list == null || list.isEmpty() || item == null || item.mCore == null) {
|
||||
return false;
|
||||
}
|
||||
for (BaseUiConversation conversation : list) {
|
||||
// 增加空值检查
|
||||
if (conversation != null && conversation.mCore != null
|
||||
&& conversation.mCore.getTargetId() != null
|
||||
&& conversation.mCore.getTargetId().equals(item.mCore.getTargetId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static List<BaseUiConversation> FilterData(int filterType, List<BaseUiConversation> keyList,List<BaseUiConversation> srcList) {
|
||||
List<BaseUiConversation> showData = new ArrayList<>();
|
||||
if (keyList == null || keyList.isEmpty())
|
||||
return showData;
|
||||
Log.i("MainConversationListAdapter", "FilterData: 源" + keyList.size());
|
||||
switch (filterType) {
|
||||
case FILTER_ALL:
|
||||
showData = keyList;
|
||||
break;
|
||||
case FILTER_ONLINE:
|
||||
for (BaseUiConversation conversation : srcList) {
|
||||
if ("0".equals(conversation.mCore.getDraft()) && isContains(keyList, conversation)) {
|
||||
showData.add(conversation);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FILTER_OFFLINE:
|
||||
for (BaseUiConversation conversation : keyList) {
|
||||
if (!"0".equals(conversation.mCore.getDraft())) {
|
||||
showData.add(conversation);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FILTER_READ:
|
||||
for (BaseUiConversation conversation : keyList)
|
||||
if (conversation.mCore.getMessage() != null && conversation.mCore.getMessage().getMessageDirection() != null) {
|
||||
if (conversation.mCore.getMessage().getMessageDirection() == Message.MessageDirection.SEND) {
|
||||
if (conversation.mCore.getSentStatus() == Message.SentStatus.READ) {
|
||||
showData.add(conversation);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FILTER_UNREAD:
|
||||
for (BaseUiConversation conversation : keyList) {
|
||||
boolean isRead;
|
||||
if (conversation.mCore.getMessage() != null && conversation.mCore.getMessage().getMessageDirection() != null) {
|
||||
if (conversation.mCore.getMessage().getMessageDirection() == Message.MessageDirection.SEND) {
|
||||
if (conversation.mCore.getSentStatus() != Message.SentStatus.READ) {
|
||||
showData.add(conversation);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
Log.i("MainConversationListAdapter", "FilterData: 结果" + showData.size());
|
||||
return showData;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static List<BaseUiConversation> FilterData(int filterType, List<BaseUiConversation> data) {
|
||||
List<BaseUiConversation> showData = new ArrayList<>();
|
||||
if (data == null || data.isEmpty())
|
||||
return showData;
|
||||
Log.i("MainConversationListAdapter", "设置数据源 FilterData: 源" + data.size());
|
||||
switch (filterType) {
|
||||
case FILTER_ALL:
|
||||
showData = data;
|
||||
break;
|
||||
case FILTER_ONLINE:
|
||||
for (BaseUiConversation conversation : data) {
|
||||
if ("0".equals(conversation.mCore.getDraft())) {
|
||||
showData.add(conversation);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FILTER_OFFLINE:
|
||||
for (BaseUiConversation conversation : data) {
|
||||
if (!"0".equals(conversation.mCore.getDraft())) {
|
||||
showData.add(conversation);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FILTER_READ:
|
||||
for (BaseUiConversation conversation : data)
|
||||
if (conversation.mCore.getMessage() != null && conversation.mCore.getMessage().getMessageDirection() != null) {
|
||||
if (conversation.mCore.getMessage().getMessageDirection() == Message.MessageDirection.SEND) {
|
||||
if (conversation.mCore.getSentStatus() == Message.SentStatus.READ) {
|
||||
showData.add(conversation);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FILTER_UNREAD:
|
||||
for (BaseUiConversation conversation : data) {
|
||||
if (conversation.mCore.getMessage() != null && conversation.mCore.getMessage().getMessageDirection() != null) {
|
||||
if (conversation.mCore.getMessage().getMessageDirection() == Message.MessageDirection.SEND) {
|
||||
if (conversation.mCore.getSentStatus() != Message.SentStatus.READ) {
|
||||
showData.add(conversation);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
Log.i("MainConversationListAdapter", " 设置数据源 FilterData: 结果" + showData.size());
|
||||
return showData;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public class VersionUtil {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pandora.cs"));
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id="+context.getPackageName()));
|
||||
context.startActivity(i);
|
||||
context.finish();
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class VersionUtil {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pandora.cs"));
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id="+context.getPackageName()));
|
||||
context.startActivity(i);
|
||||
context.finish();
|
||||
}
|
||||
|
||||
@@ -35,7 +35,9 @@ public class WordUtil {
|
||||
|
||||
public static boolean isNewZh() {
|
||||
return IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE
|
||||
|| IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.TRADITIONAL_CHINESE ;
|
||||
|| IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.TRADITIONAL_CHINESE
|
||||
|| IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.CHINESE
|
||||
|| IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.CHINA;
|
||||
}
|
||||
|
||||
public static String getNewString(int res) {
|
||||
|
||||
@@ -128,7 +128,7 @@ public class APKUpdateCustomPopup extends CenterPopupView {
|
||||
public void onViewClicks() {
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
||||
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pandora.cs"));
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id="+mContext.getPackageName()));
|
||||
mContext.startActivity(i);
|
||||
mContext.finish();
|
||||
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/1/27.
|
||||
* RecyclerView顶部渐变的itemDecoration
|
||||
*/
|
||||
|
||||
public class DividerItemDecoration extends RecyclerView.ItemDecoration {
|
||||
|
||||
private Drawable mDivider;
|
||||
|
||||
public DividerItemDecoration(Context context, int dividerHeight, int dividerColor) {
|
||||
// 创建一个带有颜色和高度的Drawable作为分割线
|
||||
mDivider = new ColorDrawable(dividerColor);
|
||||
// 如果你想让分割线有一定的内边距(比如左右边距),可以使用LayerDrawable或自定义Drawable
|
||||
// 这里简单起见,我们只设置高度
|
||||
mDivider.setBounds(0, 0, 0, dividerHeight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
|
||||
drawVertical(c, parent);
|
||||
}
|
||||
|
||||
private void drawVertical(Canvas c, RecyclerView parent) {
|
||||
final int left = parent.getPaddingLeft();
|
||||
final int right = parent.getWidth() - parent.getPaddingRight();
|
||||
|
||||
final int childCount = parent.getChildCount();
|
||||
for (int i = 0; i < childCount - 1; i++) {
|
||||
final View child = parent.getChildAt(i);
|
||||
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
|
||||
final int top = child.getBottom() + params.bottomMargin;
|
||||
final int bottom = top + mDivider.getIntrinsicHeight();
|
||||
|
||||
mDivider.setBounds(left, top, right, bottom);
|
||||
mDivider.draw(c);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
|
||||
if (mDivider == null) return;
|
||||
outRect.set(0, 0, 0, mDivider.getIntrinsicHeight());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import static io.rong.imlib.publicservice.model.PublicServiceMenu.PublicServiceMenuItemType.View;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.lxj.xpopup.core.AttachPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.MainConversationListAdapter;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import org.repackage.com.zui.opendeviceidlibrary.OpenDeviceId;
|
||||
|
||||
public class MsgChatTypeSelectPoPupView extends AttachPopupView implements android.view.View.OnClickListener {
|
||||
|
||||
private TextView chatTypeTv1, chatTypeTv2, chatTypeTv3, chatTypeTv4, chatTypeTv5;
|
||||
private ImageView chatTypeImg1, chatTypeImg2, chatTypeImg3, chatTypeImg4, chatTypeImg5;
|
||||
|
||||
private ResultCallBack mResultCallBack;
|
||||
private int lastType;
|
||||
|
||||
public MsgChatTypeSelectPoPupView(@NonNull Context context, int type, ResultCallBack itemDelListener) {
|
||||
super(context);
|
||||
mResultCallBack = itemDelListener;
|
||||
lastType = type;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.view_msg_select_chat_type;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
|
||||
// 获取屏幕宽度
|
||||
DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics();
|
||||
int screenWidth = displayMetrics.widthPixels;
|
||||
|
||||
// 设置弹窗宽度为屏幕宽度的 3/4
|
||||
View view = findViewById(R.id.root);
|
||||
ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
|
||||
layoutParams.width = screenWidth*3/4;
|
||||
view.setLayoutParams(layoutParams);
|
||||
|
||||
chatTypeTv1 = findViewById(R.id.chatTypeTv1);
|
||||
chatTypeImg1 = findViewById(R.id.chatTypeImg1);
|
||||
chatTypeTv2 = findViewById(R.id.chatTypeTv2);
|
||||
chatTypeImg2 = findViewById(R.id.chatTypeImg2);
|
||||
chatTypeTv3 = findViewById(R.id.chatTypeTv3);
|
||||
chatTypeImg3 = findViewById(R.id.chatTypeImg3);
|
||||
chatTypeTv4 = findViewById(R.id.chatTypeTv4);
|
||||
chatTypeImg4 = findViewById(R.id.chatTypeImg4);
|
||||
chatTypeTv5 = findViewById(R.id.chatTypeTv5);
|
||||
chatTypeImg5 = findViewById(R.id.chatTypeImg5);
|
||||
|
||||
chatTypeImg1.setOnClickListener(this);
|
||||
chatTypeImg2.setOnClickListener(this);
|
||||
chatTypeImg3.setOnClickListener(this);
|
||||
chatTypeImg4.setOnClickListener(this);
|
||||
chatTypeImg5.setOnClickListener(this);
|
||||
|
||||
handleChatTypeClick(lastType);
|
||||
}
|
||||
|
||||
|
||||
private void handleChatTypeClick(int type) {
|
||||
switch (type) {
|
||||
case MainConversationListAdapter.FILTER_ALL:
|
||||
chatTypeImg1.setImageResource(R.mipmap.ic_chat_type_select);
|
||||
chatTypeTv1.setTextColor(ContextCompat.getColor(chatTypeTv1.getContext(), R.color.colorMainTab));
|
||||
break;
|
||||
case MainConversationListAdapter.FILTER_ONLINE:
|
||||
chatTypeImg2.setImageResource(R.mipmap.ic_chat_type_select);
|
||||
chatTypeTv2.setTextColor(ContextCompat.getColor(chatTypeTv2.getContext(), R.color.colorMainTab));
|
||||
break;
|
||||
case MainConversationListAdapter.FILTER_OFFLINE:
|
||||
chatTypeImg3.setImageResource(R.mipmap.ic_chat_type_select);
|
||||
chatTypeTv3.setTextColor(ContextCompat.getColor(chatTypeTv3.getContext(), R.color.colorMainTab));
|
||||
break;
|
||||
case MainConversationListAdapter.FILTER_READ:
|
||||
chatTypeImg4.setImageResource(R.mipmap.ic_chat_type_select);
|
||||
chatTypeTv4.setTextColor(ContextCompat.getColor(chatTypeTv4.getContext(), R.color.colorMainTab));
|
||||
break;
|
||||
case MainConversationListAdapter.FILTER_UNREAD:
|
||||
chatTypeImg5.setImageResource(R.mipmap.ic_chat_type_select);
|
||||
chatTypeTv5.setTextColor(ContextCompat.getColor(chatTypeTv5.getContext(), R.color.colorMainTab));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(android.view.View v) {
|
||||
if (v.getId() == R.id.chatTypeImg1) {
|
||||
mResultCallBack.callBack(MainConversationListAdapter.FILTER_ALL, chatTypeTv1.getText().toString());
|
||||
} else if (v.getId() == R.id.chatTypeImg2) {
|
||||
mResultCallBack.callBack(MainConversationListAdapter.FILTER_ONLINE, chatTypeTv2.getText().toString());
|
||||
} else if (v.getId() == R.id.chatTypeImg3) {
|
||||
mResultCallBack.callBack(MainConversationListAdapter.FILTER_OFFLINE, chatTypeTv3.getText().toString());
|
||||
} else if (v.getId() == R.id.chatTypeImg4) {
|
||||
mResultCallBack.callBack(MainConversationListAdapter.FILTER_READ, chatTypeTv4.getText().toString());
|
||||
} else if (v.getId() == R.id.chatTypeImg5) {
|
||||
mResultCallBack.callBack(MainConversationListAdapter.FILTER_UNREAD, chatTypeTv5.getText().toString());
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
||||
|
||||
public interface ResultCallBack {
|
||||
void callBack(int i, String string);
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="-45"
|
||||
android:endColor="#FF0FA4FF"
|
||||
android:startColor="#FF0FA4FF" />
|
||||
android:endColor="#EB6FFF"
|
||||
android:startColor="#FF83C6" />
|
||||
<corners
|
||||
android:bottomLeftRadius="90dp"
|
||||
android:bottomRightRadius="90dp"
|
||||
|
||||
11
common/src/main/res/drawable/green_dot.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval"> <!-- 设置形状为圆形 -->
|
||||
|
||||
<solid android:color="#6DFF7C" /> <!-- 设置填充颜色 -->
|
||||
|
||||
<!-- 可以添加额外的属性如边框等 -->
|
||||
<!-- <stroke
|
||||
android:width="2dp"
|
||||
android:color="#000000" /> -->
|
||||
|
||||
</shape>
|
||||
10
common/src/main/res/drawable/red_dot.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval"> <!-- 设置形状为圆形 -->
|
||||
|
||||
<solid android:color="#ffff4874" /> <!-- 设置填充颜色 -->
|
||||
|
||||
<stroke
|
||||
android:width="2dp"
|
||||
android:color="#30ff4874" /> <!-- 设置边框颜色为黑色并带有 70% 的不透明度 (BB 是 alpha 值) -->
|
||||
|
||||
</shape>
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="4dp"/>
|
||||
<solid android:color="#FF0FA4FF"/>
|
||||
<corners android:radius="20dp"/>
|
||||
<solid android:color="@color/white"/>
|
||||
|
||||
</shape>
|
||||
29
common/src/main/res/layout/rc_conversation_type_item.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/rc_conversation_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/chatTypeTv"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_weight="1"
|
||||
android:textColor="@color/colorMainTab"
|
||||
tools:text="全部聊天" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/chatTypeImg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:src="@mipmap/ic_chat_type_select" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -14,7 +14,6 @@
|
||||
android:id="@+id/rc_conversation_portrait_rl"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
|
||||
android:layout_marginTop="@dimen/rc_margin_size_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -27,6 +26,30 @@
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/beauty_jingbai" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rc_conversation_unread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_conversation_unread_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@drawable/rc_unread_count_bg_normal" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_unread_count"
|
||||
style="@style/TextStyle.Alignment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="15"
|
||||
android:textColor="@color/rc_white_color"
|
||||
android:textSize="@dimen/rc_font_auxiliary_size" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -156,6 +179,7 @@
|
||||
android:layout_marginBottom="@dimen/rc_margin_size_12"
|
||||
android:src="@drawable/rc_read_receipt"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/rc_conversation_no_disturb"
|
||||
app:layout_goneMarginRight="@dimen/rc_margin_size_12" />
|
||||
@@ -167,39 +191,6 @@
|
||||
android:background="@color/rc_divider_color"
|
||||
app:layout_constraintStart_toStartOf="@id/rc_conversation_title_layout"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rc_conversation_unread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="20dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginEnd="5dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="MissingConstraints">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_conversation_unread_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@drawable/rc_unread_count_bg_normal" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_unread_count"
|
||||
style="@style/TextStyle.Alignment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="15"
|
||||
android:textColor="@color/rc_white_color"
|
||||
android:textSize="@dimen/rc_font_auxiliary_size" />
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
159
common/src/main/res/layout/rc_conversationlist_item2.xml
Normal file
@@ -0,0 +1,159 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/rc_conversation_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/rc_conversation_item_height">
|
||||
|
||||
<com.yunbao.common.views.weight.ClipPathCircleImage
|
||||
android:id="@+id/rc_conversation_portrait"
|
||||
android:layout_width="54dp"
|
||||
android:layout_height="54dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/beauty_jingbai"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_conversation_live_online"
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:layout_marginEnd="1dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@drawable/green_dot"
|
||||
app:layout_constraintEnd_toEndOf="@+id/rc_conversation_portrait"
|
||||
app:layout_constraintTop_toTopOf="@+id/rc_conversation_portrait" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_title"
|
||||
style="@style/TextStyle.Alignment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:ellipsize="end"
|
||||
android:maxWidth="120dp"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/rc_text_main_color"
|
||||
android:textSize="13dp"
|
||||
app:layout_constraintStart_toEndOf="@+id/rc_conversation_portrait"
|
||||
app:layout_constraintTop_toTopOf="@+id/rc_conversation_portrait"
|
||||
tools:text="张三11111111111111111111111" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_live_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_main_message_chat_list_live_timer"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingEnd="3dp"
|
||||
android:paddingBottom="3dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="#EC70FD"
|
||||
android:layout_marginStart="12dp"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintTop_toTopOf="@+id/rc_conversation_title"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/rc_conversation_title"
|
||||
app:layout_constraintStart_toEndOf="@+id/rc_conversation_title"
|
||||
android:visibility="gone"
|
||||
tools:text="看直播10min"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_date"
|
||||
style="@style/TextStyle.Alignment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="3 月 22 日"
|
||||
android:layout_marginEnd="12dp"
|
||||
app:layout_constraintTop_toTopOf="@+id/rc_conversation_title"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/rc_conversation_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:textColor="@color/rc_auxiliary_color"
|
||||
android:textSize="@dimen/rc_font_nav_or_date_size"
|
||||
|
||||
/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_unread_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginBottom="4dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/rc_conversation_portrait"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="@+id/rc_conversation_title"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
tools:text="[已读]"
|
||||
app:layout_constraintEnd_toStartOf="@id/rc_conversation_content"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
android:textColor="@color/rc_secondary_color"
|
||||
android:textSize="13dp" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_content"
|
||||
style="@style/TextStyle.Alignment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="6dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/rc_secondary_color"
|
||||
android:textSize="13dp"
|
||||
app:layout_constraintEnd_toStartOf="@+id/rc_conversation_read_receipt"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toEndOf="@+id/rc_conversation_unread_tv"
|
||||
android:layout_marginBottom="4dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/rc_conversation_portrait"
|
||||
tools:text="你好,朋友!111111111111111111111" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_unread_count"
|
||||
app:layout_constraintTop_toTopOf="@+id/rc_conversation_content"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/rc_conversation_content"
|
||||
app:layout_constraintEnd_toEndOf="@+id/rc_conversation_date"
|
||||
style="@style/TextStyle.Alignment"
|
||||
app:layout_constraintDimensionRatio="1"
|
||||
android:layout_width="18dp"
|
||||
android:gravity="center"
|
||||
android:layout_height="18dp"
|
||||
android:background="@drawable/red_dot"
|
||||
android:text="15"
|
||||
android:textColor="@color/rc_white_color"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_conversation_no_disturb"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginEnd="@dimen/rc_margin_size_2"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@+id/rc_conversation_unread_count"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/rc_conversation_unread_count"
|
||||
app:layout_constraintEnd_toStartOf="@+id/rc_conversation_unread_count"
|
||||
android:src="@drawable/rc_no_disturb"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_conversation_read_receipt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/rc_margin_size_2"
|
||||
android:src="@drawable/rc_read_receipt"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/rc_conversation_no_disturb"
|
||||
app:layout_constraintEnd_toStartOf="@+id/rc_conversation_no_disturb"
|
||||
app:layout_constraintTop_toTopOf="@+id/rc_conversation_no_disturb"
|
||||
app:layout_constraintVertical_bias="1.0"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
139
common/src/main/res/layout/view_msg_select_chat_type.xml
Normal file
@@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/root"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_white">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/chatTypeTv1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="22dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/all_chats"
|
||||
android:textColor="#777777"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:textColor="@color/colorMainTab" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/chatTypeImg1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:padding="5dp"
|
||||
android:src="@mipmap/ic_chat_type_unselect"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/chatTypeTv1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/chatTypeTv1"
|
||||
tools:src="@mipmap/ic_chat_type_select" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/chatTypeTv2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="22dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/online_only"
|
||||
android:textColor="#777777"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/chatTypeTv1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/chatTypeImg2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:padding="5dp"
|
||||
android:src="@mipmap/ic_chat_type_unselect"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/chatTypeTv2"
|
||||
app:layout_constraintEnd_toEndOf="@+id/chatTypeImg1"
|
||||
app:layout_constraintTop_toTopOf="@+id/chatTypeTv2" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/chatTypeTv3"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="22dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/offline_only"
|
||||
android:textColor="#777777"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/chatTypeTv2" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/chatTypeImg3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:padding="5dp"
|
||||
android:src="@mipmap/ic_chat_type_unselect"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/chatTypeTv3"
|
||||
app:layout_constraintEnd_toEndOf="@+id/chatTypeImg1"
|
||||
app:layout_constraintTop_toTopOf="@+id/chatTypeTv3" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/chatTypeTv4"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="22dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/read_only"
|
||||
android:textColor="#777777"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/chatTypeTv3" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/chatTypeImg4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:padding="5dp"
|
||||
android:src="@mipmap/ic_chat_type_unselect"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/chatTypeTv4"
|
||||
app:layout_constraintEnd_toEndOf="@+id/chatTypeImg1"
|
||||
app:layout_constraintTop_toTopOf="@+id/chatTypeTv4" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/chatTypeTv5"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="22dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/unread_only"
|
||||
android:textColor="#777777"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/chatTypeTv4" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/chatTypeImg5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:padding="5dp"
|
||||
android:src="@mipmap/ic_chat_type_unselect"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/chatTypeTv5"
|
||||
app:layout_constraintEnd_toEndOf="@+id/chatTypeImg1"
|
||||
app:layout_constraintTop_toTopOf="@+id/chatTypeTv5" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
BIN
common/src/main/res/mipmap-mdpi/ic_chat_type_select.png
Normal file
|
After Width: | Height: | Size: 642 B |
BIN
common/src/main/res/mipmap-mdpi/ic_chat_type_unselect.png
Normal file
|
After Width: | Height: | Size: 542 B |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 586 KiB After Width: | Height: | Size: 169 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/ic_chat_type_select.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/ic_chat_type_unselect.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/icon_collectibles.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
common/src/main/res/mipmap-xxxhdpi/ic_chat_type_select.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
common/src/main/res/mipmap-xxxhdpi/ic_chat_type_unselect.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
@@ -256,7 +256,6 @@
|
||||
<string name="login_auth_failure">privilege grant failed</string>
|
||||
<string name="login_auth_cancle">Authorization cancelled</string>
|
||||
<string name="live">Live</string>
|
||||
<string name="community">Community</string>
|
||||
<string name="login_tip_4">Log in</string>
|
||||
<string name="shopmall">shopmall</string>
|
||||
<string name="recomment">Hot</string>
|
||||
@@ -797,8 +796,8 @@
|
||||
<string name="facebook_client_token">6e90a23e0679c8d21b0888d5fa755535</string>
|
||||
|
||||
|
||||
<string name="twitter_key">ui10vIggex2F043HnztYNuA3g</string>
|
||||
<string name="twitter_secret">J8jvBBeJoZbVojbkWUrvsj0K0UUkuV69CqQ7CEobhJn6tvAKpQ</string>
|
||||
<string name="twitter_key">JDd7XEXr0kLcx0KkkJGUbD4MQ</string>
|
||||
<string name="twitter_secret">aq0eV4R1pqMK_AAeKRWnjPr7ErGMGgTPGgZJdm73WeRY-Kluws</string>
|
||||
<string name="twitter_key2">ZWRrZnRUNlBlcHVxMXpsMzVmb2k6MTpjaQ</string>
|
||||
<string name="twitter_secret2">aq0eV4R1pqMK_AAeKRWnjPr7ErGMGgTPGgZJdm73WeRY-Kluws</string>
|
||||
|
||||
@@ -1060,11 +1059,11 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="privacy_terms">Privacy Policy</string>
|
||||
<string name="terms_and_policies">Terms and policies</string>
|
||||
<string name="install_the_application">For details, please read the following message to install the application:</string>
|
||||
<string name="treat_and_protect">Welcome to PandoraLive. For your personal information and privacy, we will adopt the highest standards of treatment and protection.</string>
|
||||
<string name="treat_and_protect">Welcome to FeelWe. For your personal information and privacy, we will adopt the highest standards of treatment and protection.</string>
|
||||
<string name="anti_cheating_services">In order to provide users with better services, our products integrate [Alliance SDK], SDK needs to collect your device information (IMEI/MAC/Android ID/IDFA/OpenUDID/GUID/IP address /SIM card IMSI information, etc.), In order for you to better understand the types and purposes of the data collected by [Alliance SDK] and how to protect your personal information, you can log on to: https://www.umeng.com/page/policy Learn about [Alliance SDK] Privacy Policy [Alliance +] Privacy Policy [Alliance +], a third-party global big data service provider, providing customers with PC/APP/ offline statistics, advertising effect monitoring, message push/micro community/sharing /IM and other operating tools,DIP, global index and industry reports. https://www.umeng.com/page/policy</string>
|
||||
<string name="read_and_agre">Clicking Agree means you have read and agree to all of the above.。</string>
|
||||
<string name="agreement">agreement</string>
|
||||
<string name="come_to">Welcome to PandoraLive.</string>
|
||||
<string name="come_to">Welcome to FeelWe.</string>
|
||||
<string name="live_gift">gift</string>
|
||||
<string name="register_tip_2">User service agreement</string>
|
||||
<string name="live_fans_medal_pri_des">一 Fan privilege 一</string>
|
||||
@@ -1475,4 +1474,11 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="activity_msg_list_include">Include:</string>
|
||||
<string name="message_chat_msg_look_live">看直播%dmin</string>
|
||||
<string name="activity_msg_list_title_chat_records">Chat Records</string>
|
||||
<string name="message_chat_msg_read_tip">[Read]</string>
|
||||
<string name="message_chat_msg_unread_tip">[Unread]</string>
|
||||
<string name="all_chats">All Chats</string>
|
||||
<string name="online_only">Show Online </string>
|
||||
<string name="offline_only">Show Offline </string>
|
||||
<string name="read_only">Show Read </string>
|
||||
<string name="unread_only">Show Unread </string>
|
||||
</resources>
|
||||
|
||||
@@ -208,7 +208,6 @@
|
||||
<string name="login_auth_failure">授權失敗</string>
|
||||
<string name="login_auth_cancle">授權取消</string>
|
||||
<string name="live">直播</string>
|
||||
<string name="community">社區</string>
|
||||
<string name="shopmall">商城</string>
|
||||
<string name="cust_server">客服</string>
|
||||
<string name="live_anchor">主播</string>
|
||||
@@ -652,7 +651,7 @@
|
||||
<string name="welcome_pdlive">歡迎來到PDLIVE</string>
|
||||
<string name="newcomer">恭喜你獲得了新人獎勵</string>
|
||||
|
||||
<string name="FILE_PROVIDER">com.pandora.cs.fileprovider</string>
|
||||
<string name="FILE_PROVIDER">com.newpandora.yo.fileprovider</string>
|
||||
<string name="ren">人</string>
|
||||
<string name="ge">個</string>
|
||||
<string name="count">數量</string>
|
||||
@@ -836,8 +835,9 @@
|
||||
<string name="facebook_app_id">977019710454991</string>
|
||||
<string name="facebook_client_token">6e90a23e0679c8d21b0888d5fa755535</string>
|
||||
|
||||
<string name="twitter_key">ui10vIggex2F043HnztYNuA3g</string>
|
||||
<string name="twitter_secret">J8jvBBeJoZbVojbkWUrvsj0K0UUkuV69CqQ7CEobhJn6tvAKpQ</string>
|
||||
<string name="twitter_key">JDd7XEXr0kLcx0KkkJGUbD4MQ</string>
|
||||
<string name="twitter_secret">aq0eV4R1pqMK_AAeKRWnjPr7ErGMGgTPGgZJdm73WeRY-Kluws</string>
|
||||
|
||||
<string name="twitter_key2">F8t7PgspJ8Xl2k09ccqmnmynf</string>
|
||||
<string name="twitter_secret2">aq0eV4R1pqMK_AAeKRWnjPr7ErGMGgTPGgZJdm73WeRY-Kluws</string>
|
||||
|
||||
@@ -1082,14 +1082,14 @@
|
||||
<string name="and">和</string>
|
||||
<string name="privacy_terms">隱私條款</string>
|
||||
<string name="terms_and_policies">條款和政策</string>
|
||||
<string name="treat_and_protect">歡迎來到PandoraLive,對於您的個人信息及隱私,我們將採用最高標準對待和保護。</string>
|
||||
<string name="treat_and_protect">歡迎來到FeelWe,對於您的個人信息及隱私,我們將採用最高標準對待和保護。</string>
|
||||
<string name="install_the_application">詳情請您閱讀以下安裝應用程序的消息:</string>
|
||||
<string name="anti_cheating_services">為了給用戶提供更好的服務,我們的產品集成[友盟SDK],SDK需要收集您的设备信息(IMEI/MAC/Android ID/IDFA/OpenUDID/GUID/IP地址/SIM 卡 IMSI 信息等),為便於您更好地了解[友盟SDK]采集的數據類型及用途,以及何保護您的個人信息,您可以登陸:https://www.umeng.com/page/policy 了解[友盟SDK]隱私權政策【友盟+】隐私政策【友盟+】,第三方全域大数据服务提供商,为客户提供PC/APP/线下统计,广告效果监测,消息推送/微社区/分享/IM等运营工具,DIP,全域指数与行业报告等。https://www.umeng.com/page/policy</string>
|
||||
<string name="agreement">同意</string>
|
||||
<string name="read_and_agre">點擊同意後即代表您已閱讀並同意以上所有內容。</string>
|
||||
<string name="support_login">本應用會收集位置數據以支持登錄和註冊的功能使用。</string>
|
||||
<string name="come_to">歡迎來到PandoraLive。</string>
|
||||
<string name="sign_up_for">註冊PandoraLive</string>
|
||||
<string name="come_to">歡迎來到FeelWe。</string>
|
||||
<string name="sign_up_for">註冊FeelWe</string>
|
||||
<string name="register_and_log_in">註冊並登錄</string>
|
||||
<string name="enjoy_a_lot">開通貴族,尊享超多特權!</string>
|
||||
<string name="layout_live_anchor_say_ready_title">女神說</string>
|
||||
@@ -1605,5 +1605,11 @@
|
||||
<string name="live_end_view_ban_reason">違規原因:</string>
|
||||
<string name="live_end_view_ban_content">處罰內容:</string>
|
||||
<string name="live_end_view_ban_timer">處罰時間:</string>
|
||||
|
||||
<string name="message_chat_msg_read_tip">[已讀]</string>
|
||||
<string name="message_chat_msg_unread_tip">[未讀]</string>
|
||||
<string name="all_chats">全部聊天</string>
|
||||
<string name="online_only">僅展示在線</string>
|
||||
<string name="offline_only">僅展示離線</string>
|
||||
<string name="read_only">展示對方已讀</string>
|
||||
<string name="unread_only">展示對方未讀</string>
|
||||
</resources>
|
||||
|
||||
@@ -78,6 +78,4 @@
|
||||
<color name="gray_f6f7fb">#F6F7FB</color>
|
||||
|
||||
<color name="gray_F4F4F4">#F4F4F4</color>
|
||||
|
||||
<color name="gray_8A8A8A">#FFEFEFEF</color>
|
||||
</resources>
|
||||
|
||||
@@ -204,7 +204,6 @@
|
||||
<string name="login_ing">Logon</string>
|
||||
<string name="login_auth_ing">Authorizing login</string>
|
||||
<string name="live">Live</string>
|
||||
<string name="community">Community</string>
|
||||
<string name="login_tip_4">Log in</string>
|
||||
<string name="recomment">Hot</string>
|
||||
<string name="main_type_find">Find</string>
|
||||
@@ -642,8 +641,8 @@
|
||||
<string name="facebook_app_id">977019710454991</string>
|
||||
<string name="facebook_client_token">6e90a23e0679c8d21b0888d5fa755535</string>
|
||||
|
||||
<string name="twitter_key">ui10vIggex2F043HnztYNuA3g</string>
|
||||
<string name="twitter_secret">J8jvBBeJoZbVojbkWUrvsj0K0UUkuV69CqQ7CEobhJn6tvAKpQ</string>
|
||||
<string name="twitter_key">JDd7XEXr0kLcx0KkkJGUbD4MQ</string>
|
||||
<string name="twitter_secret">aq0eV4R1pqMK_AAeKRWnjPr7ErGMGgTPGgZJdm73WeRY-Kluws</string>
|
||||
|
||||
<string name="user_task_text1">Complete the new person\'s pre task</string>
|
||||
<string name="user_task_text2">Unlock custom features</string>
|
||||
@@ -889,11 +888,11 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="privacy_terms">Privacy Policy</string>
|
||||
<string name="terms_and_policies">Terms and policies</string>
|
||||
<string name="install_the_application">For details, please read the following message to install the application:</string>
|
||||
<string name="treat_and_protect">Welcome to PandoraLive. For your personal information and privacy, we will adopt the highest standards of treatment and protection.</string>
|
||||
<string name="treat_and_protect">Welcome to FeelWe. For your personal information and privacy, we will adopt the highest standards of treatment and protection.</string>
|
||||
<string name="anti_cheating_services">In order to provide users with better services, our products integrate [Alliance SDK], SDK needs to collect your device information (IMEI/MAC/Android ID/IDFA/OpenUDID/GUID/IP address /SIM card IMSI information, etc.), In order for you to better understand the types and purposes of the data collected by [Alliance SDK] and how to protect your personal information, you can log on to: https://www.umeng.com/page/policy Learn about [Alliance SDK] Privacy Policy [Alliance +] Privacy Policy [Alliance +], a third-party global big data service provider, providing customers with PC/APP/ offline statistics, advertising effect monitoring, message push/micro community/sharing /IM and other operating tools,DIP, global index and industry reports. https://www.umeng.com/page/policy</string>
|
||||
<string name="read_and_agre">Clicking Agree means you have read and agree to all of the above.。</string>
|
||||
<string name="agreement">agreement</string>
|
||||
<string name="come_to">Welcome to PandoraLive.</string>
|
||||
<string name="come_to">Welcome to FeelWe.</string>
|
||||
<string name="live_gift">gift</string>
|
||||
<string name="register_tip_2">User service agreement</string>
|
||||
<string name="live_fans_medal_pri_des">一 Fan privilege 一</string>
|
||||
@@ -1413,5 +1412,11 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="dialog_gift_wall_text_personal_hal">Personal hal</string>
|
||||
<string name="dialog_gift_wall_text_site_hal">Whole site hal</string>
|
||||
<string name="dialog_gift_wall_text_honors">Honors</string>
|
||||
|
||||
<string name="message_chat_msg_read_tip">[Read]</string>
|
||||
<string name="message_chat_msg_unread_tip">[Unread]</string>
|
||||
<string name="all_chats">All Chats</string>
|
||||
<string name="online_only">Show Online </string>
|
||||
<string name="offline_only">Show Offline </string>
|
||||
<string name="read_only">Show Read </string>
|
||||
<string name="unread_only">Show Unread </string>
|
||||
</resources>
|
||||
|
||||
@@ -4,8 +4,8 @@ ext {
|
||||
buildToolsVersion: "29.0.2",
|
||||
minSdkVersion : 23,
|
||||
targetSdkVersion : 34,
|
||||
versionCode : 550,
|
||||
versionName : "6.8.0",
|
||||
versionCode : 604,
|
||||
versionName : "6.8.1",
|
||||
namespace : "com.pandoralive.shayu"
|
||||
]
|
||||
manifestPlaceholders = [
|
||||
|
||||
@@ -22,7 +22,7 @@ ext {
|
||||
// "tencent-bugly" : 'com.tencent.bugly:crashreport:2.6.6',//腾讯bugly
|
||||
// "umeng-common" : 'com.umeng.sdk:common:1.5.3',//友盟统计
|
||||
// "umeng-analytics" : 'com.umeng.sdk:analytics:7.5.3',//友盟统计
|
||||
"ucrop" : 'com.github.yalantis:ucrop:2.2.3',//图片裁剪
|
||||
"ucrop" : 'com.github.yalantis:ucrop:2.2.9',//图片裁剪
|
||||
"smartRefreshLayout" : 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-20',//下拉刷新上拉加载
|
||||
"magicIndicator" : 'com.github.hackware1993:MagicIndicator:1.6.0',//ViewPager指示器
|
||||
"banner" : 'com.ms:banner:1.0.0',//轮播图
|
||||
|
||||
@@ -24,6 +24,6 @@ android.nonTransitiveRClass=false
|
||||
|
||||
systemProp.http.proxyHost=127.0.0.1
|
||||
systemProp.https.proxyHost=127.0.0.1
|
||||
systemProp.https.proxyPort=7890
|
||||
systemProp.http.proxyPort=7890
|
||||
#android.enableR8.fullMode=true
|
||||
systemProp.https.proxyPort=9098
|
||||
systemProp.http.proxyPort=9098
|
||||
android.enableR8.fullMode=true
|
||||
@@ -422,9 +422,8 @@ public class SWAuManager extends BaseCacheManager {
|
||||
|
||||
public void preloadChannel(List<LiveBean> uids){
|
||||
for (int i = 0; i <uids.size(); i++) {
|
||||
L.eSw("设置秒开数据 uid"+uids.get(i).getUid()+" --- userName:"+uids.get(i).getUserNiceName());
|
||||
int code = mRtcEngine.preloadChannel(CommonAppConfig.SWToken,getChannelName(uids.get(i).getUid()),Integer.parseInt(CommonAppConfig.getInstance().getUid()));
|
||||
//L.eSw("设置秒开数据 uid"+uids.get(i).getUid()+" --- userName:"+uids.get(i).getUserNiceName()+" code "+code);
|
||||
L.eSw("设置秒开数据 uid"+uids.get(i).getUid()+" --- userName:"+uids.get(i).getUserNiceName()+" code "+code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,16 @@ import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.hardware.camera2.CameraManager;
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
import android.view.SurfaceView;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.bean.SwTokenModel;
|
||||
@@ -68,6 +71,7 @@ public class SWManager extends BaseCacheManager {
|
||||
private ImageTrackOptions imageTrackOptions = null;
|
||||
|
||||
private onDrPkJoinSuccessListener onDrPkJoinSuccessListener;
|
||||
String openCameraId = "1";
|
||||
|
||||
public void setOnDrPkJoinSuccessListener(SWManager.onDrPkJoinSuccessListener onDrPkJoinSuccessListener) {
|
||||
this.onDrPkJoinSuccessListener = onDrPkJoinSuccessListener;
|
||||
@@ -252,7 +256,20 @@ public class SWManager extends BaseCacheManager {
|
||||
*/
|
||||
public void switchCamera() {
|
||||
if (mRtcEngine != null) {
|
||||
mRtcEngine.switchCamera();
|
||||
if (openCameraId.equals("0")) {
|
||||
mRtcEngine.switchCamera("1");
|
||||
openCameraId = "1";
|
||||
} else {
|
||||
mRtcEngine.switchCamera("0");
|
||||
openCameraId = "0";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void resetCamera() {
|
||||
LogUtils.e("重置摄像头", openCameraId);
|
||||
if (mRtcEngine != null && !TextUtils.isEmpty(openCameraId)) {
|
||||
mRtcEngine.switchCamera(openCameraId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -524,6 +541,9 @@ public class SWManager extends BaseCacheManager {
|
||||
});
|
||||
}
|
||||
|
||||
public void release() {
|
||||
}
|
||||
|
||||
public interface onRtcEngineListener {
|
||||
void onOpenSuccess(String channel, int uid);
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ public class LiveReportAdapter extends RecyclerView.Adapter {
|
||||
if (tag == R.string.camera) {
|
||||
mImageUtil.getImageByCamera();
|
||||
} else {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -691,7 +691,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
|
||||
*/
|
||||
private void setAvatar() {
|
||||
if (mLiveSdk == Constants.LIVE_SDK_TX) {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum();
|
||||
} else {
|
||||
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
|
||||
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
|
||||
@@ -700,7 +700,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
|
||||
if (tag == R.string.camera) {
|
||||
mImageUtil.getImageByCamera();
|
||||
} else {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -673,7 +673,7 @@ public class LiveNewReadySwViewHolder extends AbsViewHolder implements View.OnCl
|
||||
*/
|
||||
private void setAvatar() {
|
||||
if (mLiveSdk == Constants.LIVE_SDK_TX) {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum(true);
|
||||
} else {
|
||||
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
|
||||
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
|
||||
@@ -682,7 +682,7 @@ public class LiveNewReadySwViewHolder extends AbsViewHolder implements View.OnCl
|
||||
if (tag == R.string.camera) {
|
||||
mImageUtil.getImageByCamera();
|
||||
} else {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -504,8 +504,9 @@ public class LivePushSwViewHolder extends AbsRyLivePushViewHolder implements ITX
|
||||
public void onResume() {
|
||||
mPaused = false;
|
||||
Log.i("摄像头", "onResume: " + isNeedOpenCamera);
|
||||
swManager.resetCamera();
|
||||
if (isNeedOpenCamera) {
|
||||
RCRTCEngine.getInstance().getDefaultVideoStream().startCamera(new IRCRTCResultDataCallback<Boolean>() {
|
||||
/*RCRTCEngine.getInstance().getDefaultVideoStream().startCamera(new IRCRTCResultDataCallback<Boolean>() {
|
||||
@Override
|
||||
public void onSuccess(Boolean data) {
|
||||
//设置摄像头最大缩放比例
|
||||
@@ -519,7 +520,7 @@ public class LivePushSwViewHolder extends AbsRyLivePushViewHolder implements ITX
|
||||
public void onFailed(RTCErrorCode errorCode) {
|
||||
Log.i("摄像头", "onFailed: 打开摄像头失败 " + errorCode);
|
||||
}
|
||||
});
|
||||
});*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -549,6 +550,8 @@ public class LivePushSwViewHolder extends AbsRyLivePushViewHolder implements ITX
|
||||
public void release() {
|
||||
super.release();
|
||||
Bus.getOff(this);
|
||||
onDestroy();
|
||||
SWManager.get().release();
|
||||
LiveHttpUtil.cancel(LiveHttpConsts.LINK_MIC_TX_MIX_STREAM);
|
||||
rtcRoom = null;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.activity.LiveChooseClassActivity;
|
||||
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
||||
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
||||
import com.yunbao.live.adapter.LiveReadyShareAdapter;
|
||||
import com.yunbao.common.bean.LiveRoomTypeBean;
|
||||
import com.yunbao.live.dialog.LiveRoomTypeDialogFragment;
|
||||
@@ -262,7 +261,7 @@ public class LiveReadyRyViewHolder extends AbsViewHolder implements View.OnClick
|
||||
*/
|
||||
private void setAvatar() {
|
||||
if (mLiveSdk == Constants.LIVE_SDK_TX) {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum();
|
||||
} else {
|
||||
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
|
||||
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
|
||||
@@ -271,7 +270,7 @@ public class LiveReadyRyViewHolder extends AbsViewHolder implements View.OnClick
|
||||
if (tag == R.string.camera) {
|
||||
mImageUtil.getImageByCamera();
|
||||
} else {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -285,7 +285,7 @@ public class LiveReadyViewHolder extends AbsViewHolder implements View.OnClickLi
|
||||
*/
|
||||
private void setAvatar() {
|
||||
if (mLiveSdk == Constants.LIVE_SDK_TX) {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum();
|
||||
} else {
|
||||
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
|
||||
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
|
||||
@@ -294,7 +294,7 @@ public class LiveReadyViewHolder extends AbsViewHolder implements View.OnClickLi
|
||||
if (tag == R.string.camera) {
|
||||
mImageUtil.getImageByCamera();
|
||||
} else {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="30dp" />
|
||||
<solid android:color="#ffffff" />
|
||||
<solid android:color="#FFF4F4F4" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
BIN
live/src/main/res/mipmap-mdpi/icon_collectibles.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
@@ -1,63 +0,0 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "867032862719",
|
||||
"project_id": "pdlnew",
|
||||
"storage_bucket": "pdlnew.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:867032862719:android:841a73fdfb6c37453ae1ca",
|
||||
"android_client_info": {
|
||||
"package_name": "com.pandora.cs"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "867032862719-af2dnojobjd8s6ekdr1is1vev8nk36sv.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pandora.cs",
|
||||
"certificate_hash": "38cc19306c9facee36a9224e9a4070bc0be15c7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "867032862719-ohaa1f18e186qpasvgt7qkk1i1pivniq.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pandora.cs",
|
||||
"certificate_hash": "b66dc8d21cfcf6c729577ddcf0c312b2a31ed872"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "867032862719-snpbqruvqcc9fsifjnmm1h3dcgtr8am4.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pandora.cs",
|
||||
"certificate_hash": "15fc5e70cf238323bf7111c8c627803985478e87"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "867032862719-ep4r92lpjmn7gs9tg0r7q0l75a4gm9mt.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyAnlY2aBEGyg7QpghHo7EaMRkM89dVNgq8"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "867032862719-ep4r92lpjmn7gs9tg0r7q0l75a4gm9mt.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
@@ -218,7 +218,7 @@ public class CompleteUserInfoActivity extends AbsActivity {
|
||||
if (isCamera) {
|
||||
cameraUtil.getImageByCamera();
|
||||
} else {
|
||||
cameraUtil.getImageByAlumb();
|
||||
cameraUtil.getImageByAlbum();
|
||||
}
|
||||
});
|
||||
new XPopup.Builder(mContext).asCustom(userAvatarPopup).show();
|
||||
|
||||
@@ -546,7 +546,7 @@ public class EditProfileActivity extends AbsActivity {
|
||||
if (tag == R.string.camera) {
|
||||
mImageUtil.getImageByCamera();
|
||||
} else if (tag == R.string.alumb) {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum(true);
|
||||
} else {
|
||||
RouteUtil.forwardUserAvatarSelect();
|
||||
}
|
||||
|
||||
@@ -118,10 +118,10 @@ import java.util.TimerTask;
|
||||
public class EntryActivity extends AppCompatActivity {
|
||||
|
||||
private VideoView video_view;
|
||||
private ImageView btn_phone, btn_line, btn_twitter;
|
||||
private ImageView btn_line, btn_twitter;
|
||||
private TextView btn_tip, btn_tip1, tv_customer;
|
||||
private TwitterLoginButton tt_login_button;
|
||||
private LinearLayout btn_google, googleLayout;
|
||||
private LinearLayout btn_google, googleLayout,btn_phone;
|
||||
public static Activity activity;
|
||||
private static String mLoginType = Constants.MOB_PHONE;//登录方式
|
||||
public String mPromoCode = "", UserID = "";//推广码
|
||||
@@ -221,19 +221,19 @@ public class EntryActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
lt_btn_facebook = findViewById(R.id.lt_btn_facebook);
|
||||
lt_btn_twitter = findViewById(R.id.lt_btn_twitter);
|
||||
//lt_btn_twitter = findViewById(R.id.lt_btn_twitter);
|
||||
btn_tip = findViewById(R.id.btn_tip);
|
||||
btn_tip1 = findViewById(R.id.btn_tip1);
|
||||
|
||||
img_view = findViewById(R.id.img_view);
|
||||
|
||||
btn_google = findViewById(R.id.btn_google);
|
||||
btn_twitter = findViewById(R.id.btn_twitter);
|
||||
tt_login_button = findViewById(R.id.tt_login_button);
|
||||
//btn_twitter = findViewById(R.id.btn_twitter);
|
||||
//tt_login_button = findViewById(R.id.tt_login_button);
|
||||
|
||||
tv_customer = findViewById(R.id.tv_customer);
|
||||
btn_phone = findViewById(R.id.btn_phone);
|
||||
btn_line = findViewById(R.id.btn_line);
|
||||
//btn_line = findViewById(R.id.btn_line);
|
||||
lt_customer = findViewById(R.id.lt_customer);
|
||||
|
||||
btn_tip.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);
|
||||
@@ -334,7 +334,7 @@ public class EntryActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
|
||||
lt_btn_twitter.setOnClickListener(new View.OnClickListener() {
|
||||
/*lt_btn_twitter.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (isBtnClick()) {
|
||||
@@ -342,9 +342,9 @@ public class EntryActivity extends AppCompatActivity {
|
||||
}
|
||||
verfiy(3);
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
tt_login_button.setCallback(new Callback<TwitterSession>() {
|
||||
/*tt_login_button.setCallback(new Callback<TwitterSession>() {
|
||||
@Override
|
||||
public void success(Result<TwitterSession> result) {
|
||||
// Do something with result, which provides a TwitterSession for making API calls
|
||||
@@ -373,8 +373,8 @@ public class EntryActivity extends AppCompatActivity {
|
||||
Log.i("Log", "TwitterException = " + exception);
|
||||
ToastUtil.show(getResources().getString(R.string.user_login_outtime));
|
||||
}
|
||||
});
|
||||
findViewById(R.id.btn_line).setOnClickListener(new View.OnClickListener() {
|
||||
});*/
|
||||
/*findViewById(R.id.btn_line).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (isBtnClick()) {
|
||||
@@ -382,7 +382,7 @@ public class EntryActivity extends AppCompatActivity {
|
||||
}
|
||||
verfiy(4);
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
getUrl();
|
||||
|
||||
@@ -441,10 +441,10 @@ public class EntryActivity extends AppCompatActivity {
|
||||
} else if (loginType == 4) {
|
||||
try {
|
||||
// App-to-app login
|
||||
Intent loginIntent = LineLoginApi.getLoginIntent(findViewById(R.id.btn_line).getContext(), "1656399535", new LineAuthenticationParams.Builder().scopes(Arrays.asList(Scope.PROFILE))
|
||||
/* Intent loginIntent = LineLoginApi.getLoginIntent(findViewById(R.id.btn_line).getContext(), "2006124380", new LineAuthenticationParams.Builder().scopes(Arrays.asList(Scope.PROFILE))
|
||||
// .nonce("<a randomly-generated string>") // nonce can be used to improve security
|
||||
.build());
|
||||
startActivityForResult(loginIntent, 1001);
|
||||
startActivityForResult(loginIntent, 1001);*/
|
||||
} catch (Exception e) {
|
||||
Log.e("ERROR", e.toString());
|
||||
ToastUtil.show(getResources().getString(R.string.user_login_outtime));
|
||||
|
||||
@@ -33,8 +33,6 @@ import com.yunbao.main.R;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@Route(path = RouteUtil.PATH_FEEDBACK_EDIT_ACTIVITY)
|
||||
public class FeedbackEditActivity extends AbsActivity {
|
||||
@@ -299,7 +297,7 @@ public class FeedbackEditActivity extends AbsActivity {
|
||||
loadingDialog = DialogUitl.loadingDialog(mContext);
|
||||
loadingDialog.show();
|
||||
if (tag == 1) {
|
||||
imageUtil.getImageByAlumb(false);
|
||||
imageUtil.getImageByAlbum(false);
|
||||
} else {
|
||||
imageUtil.getImageByCamera(false);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.yunbao.main.activity;
|
||||
|
||||
|
||||
import static com.yunbao.main.activity.MyWalletActivity.dis;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
@@ -16,15 +14,17 @@ import android.webkit.WebView;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.facebook.appevents.AppEventsConstants;
|
||||
import com.android.billingclient.api.Purchase;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.utils.GoogleUtils;
|
||||
import com.yunbao.common.pay.google.GooglePlay;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.views.TestWebViewClient;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@SuppressLint("ValidFragment")
|
||||
public class GoogleFragment extends Fragment {
|
||||
|
||||
@@ -38,7 +38,7 @@ public class GoogleFragment extends Fragment {
|
||||
private String url;
|
||||
String adid = null;
|
||||
|
||||
GoogleUtils googleUtils;
|
||||
private GooglePlay googlePlay;
|
||||
|
||||
boolean isGoogleService = true;
|
||||
|
||||
@@ -62,17 +62,16 @@ public class GoogleFragment extends Fragment {
|
||||
Log.e("ttt", url);
|
||||
rlWebview.loadUrl(url);
|
||||
|
||||
googleUtils = new GoogleUtils(getActivity());
|
||||
googlePlay = GooglePlay.getInstance();
|
||||
|
||||
// 验证是否已在此设备上安装并启用Google Play服务,以及此设备上安装的旧版本是否为此客户端所需的版本
|
||||
if (googleUtils.getGoogleService()) {
|
||||
if (googlePlay.getGoogleService()) {
|
||||
isGoogleService = true;
|
||||
// 支持Google服务
|
||||
initGooglePay();
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
adid = googleUtils.getAdid();
|
||||
adid = googlePlay.getAdId();
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
@@ -100,11 +99,6 @@ public class GoogleFragment extends Fragment {
|
||||
|
||||
String TAG = "GooglePay";
|
||||
|
||||
private void initGooglePay() {
|
||||
googleUtils = new GoogleUtils(getActivity());
|
||||
googleUtils.initGooglePay();
|
||||
}
|
||||
|
||||
private Handler payHandler = new Handler();
|
||||
|
||||
//js调用原生
|
||||
@@ -117,51 +111,31 @@ public class GoogleFragment extends Fragment {
|
||||
mProductId = ProductId;
|
||||
mOrderid = OrderNumber;
|
||||
MoneyUsds = MoneyUsd;
|
||||
|
||||
googleUtils.setBillingListener(new GoogleUtils.GoogleBillingListener() {
|
||||
googlePlay.setBillingListener(new GooglePlay.GoogleBillingListener() {
|
||||
@Override
|
||||
public void onPaySuccess(String token, String orderId) {
|
||||
payHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CommonHttpUtil.notifyGoogle(token, orderId, mProductId, mOrderid, adid, new HttpCallback() {
|
||||
public void onPaySuccess(List<Purchase> purchases) {
|
||||
Log.i("mLog", "调用谷歌支付成功了 " + purchases.toString());
|
||||
CommonHttpUtil.notifyGoogle(purchases.get(0).getPurchaseToken(),
|
||||
purchases.get(0).getProducts().get(0), new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
Bundle params = new Bundle();
|
||||
params.putString("currency", "HKD");
|
||||
params.putString("money", MoneyUsds);
|
||||
Bundle fb_params = new Bundle();
|
||||
fb_params.putString(AppEventsConstants.EVENT_PARAM_CURRENCY, "HKD");
|
||||
fb_params.putString(AppEventsConstants.EVENT_PARAM_CONTENT_ID, mProductId);
|
||||
//Google官方充值通知
|
||||
Bundle google_params = new Bundle();
|
||||
google_params.putString("currency", "HKD");
|
||||
google_params.putString("product_id", mProductId);
|
||||
google_params.putString("transaction_id", mOrderid);
|
||||
google_params.putString("value", MoneyUsds);
|
||||
google_params.putString("price", MoneyUsds);
|
||||
google_params.putString("quantity", "1");
|
||||
dis();
|
||||
googlePlay.consume(purchases);
|
||||
getActivity().finish();
|
||||
ToastUtil.show(getString(R.string.pay_suc));
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPayFailed(String msg) {
|
||||
payHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
});
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
});
|
||||
googleUtils.purchase(mProductId);
|
||||
googlePlay.purchase(getActivity(), mOrderid, mProductId);
|
||||
}
|
||||
lastClickTime = currentTime;
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ import androidx.viewpager.widget.ViewPager;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.jakewharton.rxbinding3.view.RxView;
|
||||
@@ -137,7 +138,7 @@ import com.yunbao.main.views.MainHomeViewHolder;
|
||||
import com.yunbao.main.views.MainMeViewHolder;
|
||||
import com.yunbao.main.views.MainMessageViewHolder;
|
||||
import com.yunbao.video.utils.VideoStorge;
|
||||
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
@@ -224,7 +225,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
super.create();
|
||||
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
|
||||
getWindow().setSharedElementEnterTransition(new FullAdToBannerTransition(1, 0.4f, new DecelerateInterpolator()));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -235,6 +235,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
LogUtils.e("MainActivity",
|
||||
"语言:"+IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage(),
|
||||
"测试文本:"+getString(R.string.hot)
|
||||
);
|
||||
ToastUtil.showDebug("打包时间:"+CommonAppConfig.BUILD_TIME+"\n系统语言:"+IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage());
|
||||
//初始化声网
|
||||
SWAuManager.get().initRtcEngine(this);
|
||||
ActivityCompat.postponeEnterTransition(this);
|
||||
@@ -352,6 +357,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
frameLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
mViewList.add(frameLayout);
|
||||
}
|
||||
mainHomeComViewHolder = new MainHomeComViewHolder(mContext, MainActivity.this, mViewList.get(0));
|
||||
|
||||
mViewPager.setAdapter(new ViewPagerAdapter(mViewList));
|
||||
mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
@@ -551,7 +558,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
|
||||
//选中监听
|
||||
mTabButtonGroup.addTabButtonGroupChangeListener((view, index) -> {
|
||||
if (index == 0) {
|
||||
if (index == 1) {
|
||||
isfloatBannernet = true;
|
||||
initAnchorRecommendBanner();
|
||||
} else if (index == 2) {
|
||||
@@ -875,6 +882,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
//RandomPkDialogFragment fragment = new RandomPkDialogFragment();
|
||||
//fragment.show(this.getSupportFragmentManager(), "RandomPkDialogFragment");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void showStartDialog() {
|
||||
@@ -902,6 +911,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1278,17 +1288,13 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
return;
|
||||
}
|
||||
if (position == 0) {
|
||||
mainHomeViewHolder = new MainHomeViewHolder(mContext, parent);
|
||||
vh = mainHomeViewHolder;
|
||||
/*mainHomeComViewHolder = new MainHomeComViewHolder(mContext, MainActivity.this, parent);
|
||||
vh = mainHomeComViewHolder;*/
|
||||
} else if (position == 1) {
|
||||
/*mainHomeViewHolder = new MainHomeViewHolder(mContext, parent);
|
||||
vh = mainHomeViewHolder;*/
|
||||
/* mMainHomeCommunityViewHolder = new MainHomeCommunityViewHolder(mContext, parent, this);//直播
|
||||
vh = mMainHomeCommunityViewHolder;*/
|
||||
mainHomeComViewHolder = new MainHomeComViewHolder(mContext, MainActivity.this, parent);
|
||||
//mainHomeComViewHolder = new MainHomeComViewHolder(mContext, MainActivity.this, parent);
|
||||
vh = mainHomeComViewHolder;
|
||||
} else if (position == 1) {
|
||||
mainHomeViewHolder = new MainHomeViewHolder(mContext, parent);
|
||||
vh = mainHomeViewHolder;
|
||||
/* mMainHomeCommunityViewHolder = new MainHomeCommunityViewHolder(mContext, parent, this);//直播
|
||||
vh = mMainHomeCommunityViewHolder;*/
|
||||
} else if (position == 2) {
|
||||
mainMessageViewHolder = new MainMessageViewHolder(this, parent);
|
||||
vh = mainMessageViewHolder;
|
||||
|
||||
@@ -409,7 +409,7 @@ public class MessageHiConfigActivity extends AbsActivity {
|
||||
}
|
||||
}
|
||||
});
|
||||
imageUtil.getImageByAlumb();
|
||||
imageUtil.getImageByAlbum();
|
||||
loading = DialogUitl.loadingDialog(mContext);
|
||||
loading.show();
|
||||
}
|
||||
|
||||
@@ -18,17 +18,18 @@ import androidx.fragment.app.FragmentPagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.fragment.LoadingDialog;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.pay.google.GooglePlay;
|
||||
import com.yunbao.common.pay.hw.HwBuilder;
|
||||
import com.yunbao.common.pay.samsung.SamsungUtil;
|
||||
import com.yunbao.common.utils.GoogleUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.main.R;
|
||||
@@ -62,7 +63,7 @@ public class MyWalletActivity extends AbsActivity {
|
||||
public static String orderId;
|
||||
|
||||
HwBuilder hwBuilder;
|
||||
GoogleUtils googleUtils;
|
||||
private GooglePlay googlePlay;
|
||||
|
||||
LoadingDialog loadingDialog;
|
||||
SamsungUtil samsungUtil;
|
||||
@@ -78,17 +79,15 @@ public class MyWalletActivity extends AbsActivity {
|
||||
mw = MyWalletActivity.this;
|
||||
setTitle(mContext.getString(R.string.wallet));
|
||||
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
||||
googleUtils = new GoogleUtils(mContext);
|
||||
googleUtils.initGooglePay();
|
||||
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
||||
hwBuilder = new HwBuilder(MyWalletActivity.this);
|
||||
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 3) {
|
||||
samsungUtil = SamsungUtil.newInstance(mContext);
|
||||
samsungUtil.init();
|
||||
}else{
|
||||
googleUtils = new GoogleUtils(mContext);
|
||||
googleUtils.initGooglePay();
|
||||
} else {
|
||||
googlePlay = GooglePlay.getInstance();
|
||||
//消耗所有商品
|
||||
googlePlay.consumeAll();
|
||||
}
|
||||
|
||||
|
||||
@@ -104,50 +103,8 @@ public class MyWalletActivity extends AbsActivity {
|
||||
loadingDialog.setShowText(getString(R.string.order_query));
|
||||
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
||||
googleUtils.setQueryPurchaseListener(mContext, new GoogleUtils.QueryPurchasesListener() {
|
||||
@Override
|
||||
public void onResult(JSONObject obj) {
|
||||
try {
|
||||
int code = obj.getInt("querySize");
|
||||
if (code == 0) {
|
||||
payHandler.post(runnable1);
|
||||
payHandler.postDelayed(runnable2, 1000);
|
||||
} else {
|
||||
JSONArray tokenList = obj.getJSONArray("tokenList");
|
||||
JSONArray orderList = obj.getJSONArray("orderList");
|
||||
String tradeNo = obj.getString("tradeNo");
|
||||
|
||||
for (int i = 0; i < tokenList.length(); i++) {
|
||||
int finalI = i;
|
||||
payHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
//谷歌掉单处理
|
||||
try {
|
||||
CommonHttpUtil.Google_sec_pay(tokenList.getString(finalI), orderList.getString(finalI), tradeNo, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (finalI == tokenList.length() - 1) {
|
||||
loadingDialog.setShowText(getString(R.string.order_query_success));
|
||||
loadingDialog.dismiss();
|
||||
}
|
||||
ToastUtil.show("充值已到账");
|
||||
finish();
|
||||
}
|
||||
});
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
googleUtils.queryPurchasesAsync();
|
||||
//消耗所有商品
|
||||
googlePlay.consumeAll();
|
||||
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
||||
hwBuilder.consume();
|
||||
payHandler.post(runnable1);
|
||||
@@ -186,12 +143,12 @@ public class MyWalletActivity extends AbsActivity {
|
||||
|
||||
googleFragment1 = new GoogleFragment();
|
||||
Bundle bundle1 = new Bundle();
|
||||
bundle1.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
||||
bundle1.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
||||
googleFragment1.setArguments(bundle1);
|
||||
|
||||
googleFragment2 = new GoogleFragment();
|
||||
Bundle bundle2 = new Bundle();
|
||||
bundle2.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaygole&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
||||
bundle2.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaygole&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
||||
googleFragment2.setArguments(bundle2);
|
||||
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
||||
//华为
|
||||
@@ -203,12 +160,12 @@ public class MyWalletActivity extends AbsActivity {
|
||||
|
||||
huaWeiFragment1 = new HuaWeiFragment();
|
||||
Bundle bundle1 = new Bundle();
|
||||
bundle1.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/huaweipaycoin.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd");
|
||||
bundle1.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/huaweipaycoin.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo");
|
||||
huaWeiFragment1.setArguments(bundle1);
|
||||
|
||||
huaWeiFragment2 = new HuaWeiFragment();
|
||||
Bundle bundle2 = new Bundle();
|
||||
bundle2.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/huaweipaygole.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd");
|
||||
bundle2.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/huaweipaygole.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo");
|
||||
huaWeiFragment2.setArguments(bundle2);
|
||||
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 3) {
|
||||
|
||||
@@ -271,12 +228,12 @@ public class MyWalletActivity extends AbsActivity {
|
||||
|
||||
huaWeiFragment1 = new HuaWeiFragment();
|
||||
Bundle bundle1 = new Bundle();
|
||||
bundle1.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/huaweipaycoin.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd");
|
||||
bundle1.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/huaweipaycoin.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo");
|
||||
huaWeiFragment1.setArguments(bundle1);
|
||||
|
||||
huaWeiFragment2 = new HuaWeiFragment();
|
||||
Bundle bundle2 = new Bundle();
|
||||
bundle2.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/huaweipaygole.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd");
|
||||
bundle2.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/huaweipaygole.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo");
|
||||
huaWeiFragment2.setArguments(bundle2);
|
||||
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 3) {
|
||||
rView.setVisibility(View.VISIBLE);
|
||||
@@ -287,12 +244,12 @@ public class MyWalletActivity extends AbsActivity {
|
||||
|
||||
samsungFragment1 = new SamsungFragment();
|
||||
Bundle bundle1 = new Bundle();
|
||||
bundle1.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/samsungpaycoin.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
||||
bundle1.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/samsungpaycoin.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
||||
samsungFragment1.setArguments(bundle1);
|
||||
|
||||
samsungFragment2 = new SamsungFragment();
|
||||
Bundle bundle2 = new Bundle();
|
||||
bundle2.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/samsungpaygole.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
||||
bundle2.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/samsungpaygole.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
||||
samsungFragment2.setArguments(bundle2);
|
||||
} else {
|
||||
Log.i("tss", "不是首充");
|
||||
@@ -300,17 +257,17 @@ public class MyWalletActivity extends AbsActivity {
|
||||
|
||||
walletFragment = new WalletFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
||||
bundle.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
||||
walletFragment.setArguments(bundle);
|
||||
|
||||
googleFragment1 = new GoogleFragment();
|
||||
Bundle bundle1 = new Bundle();
|
||||
bundle1.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
||||
bundle1.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
||||
googleFragment1.setArguments(bundle1);
|
||||
|
||||
googleFragment2 = new GoogleFragment();
|
||||
Bundle bundle2 = new Bundle();
|
||||
bundle2.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
||||
bundle2.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
||||
googleFragment2.setArguments(bundle2);
|
||||
}
|
||||
}
|
||||
@@ -491,7 +448,7 @@ public class MyWalletActivity extends AbsActivity {
|
||||
|
||||
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -586,7 +586,7 @@ public class MyWebViewActivity extends AbsActivity {
|
||||
if (tag == com.yunbao.main.R.string.camera) {
|
||||
mImageUtil.getImageByCamera();
|
||||
} else {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -49,7 +49,7 @@ public class OneLoginActivity extends AbsActivity {
|
||||
if (tag == R.string.camera) {
|
||||
mImageUtil.getImageByCamera();
|
||||
} else {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -94,10 +94,13 @@ public class MainHomeComClassAdapter extends RecyclerView.Adapter<MainHomeComCla
|
||||
} else {
|
||||
mName.setText(bean.getTalk_name());
|
||||
}
|
||||
|
||||
if (position == choice) {
|
||||
mName.setTextColor(Color.parseColor("#FF0FA4FF"));
|
||||
mName.setBackgroundResource(R.drawable.bg_main_community_type_01);
|
||||
mName.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
} else {
|
||||
mName.setTextColor(Color.parseColor("#FF777777"));
|
||||
mName.setBackgroundResource(R.drawable.bg_main_community_type_02);
|
||||
mName.setTextColor(Color.parseColor("#777777"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,13 +67,10 @@ public class MainHomeLiveAdapter extends RefreshAdapter<LiveBean> {
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
if (position == 4) {
|
||||
if (position == 0) {
|
||||
return HEAD;
|
||||
} else{
|
||||
if(position>4){
|
||||
|
||||
}
|
||||
LiveBean mode = mList.get(position>4?position-1:position);
|
||||
} else if (position > 0) {
|
||||
LiveBean mode = mList.get(position - 1);
|
||||
if (TextUtils.equals(mode.getIs_week(), "1")) {
|
||||
return WEEKLAYOUT;
|
||||
} else {
|
||||
@@ -117,9 +114,8 @@ public class MainHomeLiveAdapter extends RefreshAdapter<LiveBean> {
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder vh, int position) {
|
||||
int nowPosition = position>4?position-1:position;
|
||||
if (vh instanceof MainHomeLiveWeekItemViewHolder) {
|
||||
((MainHomeLiveWeekItemViewHolder) vh).loadViewDate(mList.get(nowPosition), nowPosition, Height, new MainHomeLiveWeekItemViewHolder.OnItemClickListener() {
|
||||
((MainHomeLiveWeekItemViewHolder) vh).loadViewDate(mList.get(position - 1), position - 1, Height, new MainHomeLiveWeekItemViewHolder.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(LiveBean bean, int position) {
|
||||
if (mOnItemClickListener != null) {
|
||||
@@ -128,7 +124,7 @@ public class MainHomeLiveAdapter extends RefreshAdapter<LiveBean> {
|
||||
}
|
||||
});
|
||||
} else if (vh instanceof MainHomeLiveItemViewHolder) {
|
||||
((MainHomeLiveItemViewHolder) vh).loadViewDate(mList.get(nowPosition), nowPosition, Height, new MainHomeLiveItemViewHolder.OnItemClickListener() {
|
||||
((MainHomeLiveItemViewHolder) vh).loadViewDate(mList.get(position - 1), position - 1, Height, new MainHomeLiveItemViewHolder.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(LiveBean bean, int position) {
|
||||
if (mOnItemClickListener != null) {
|
||||
@@ -141,7 +137,7 @@ public class MainHomeLiveAdapter extends RefreshAdapter<LiveBean> {
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return super.getItemCount();
|
||||
return super.getItemCount() + 1;
|
||||
}
|
||||
|
||||
class HeadVh extends RecyclerView.ViewHolder {
|
||||
|
||||
@@ -96,9 +96,11 @@ public class MainHomeLivesClassAdapter extends RecyclerView.Adapter<MainHomeLive
|
||||
}
|
||||
|
||||
if (position == choice) {
|
||||
mName.setTextColor(Color.parseColor("#FF0FA4FF"));
|
||||
mName.setBackgroundResource(R.drawable.button_ffc621);
|
||||
mName.setTextColor(Color.parseColor("#7d77fc"));
|
||||
} else {
|
||||
mName.setTextColor(Color.parseColor("#FF777777"));
|
||||
mName.setBackgroundResource(R.drawable.button_cbd5e0);
|
||||
mName.setTextColor(Color.parseColor("#484D68"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,130 +0,0 @@
|
||||
package com.yunbao.main.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
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.yunbao.common.bean.UserItemBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.main.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/9/28.
|
||||
*/
|
||||
|
||||
public class MainMeBottomAdapter extends RecyclerView.Adapter<MainMeBottomAdapter.Vh> {
|
||||
|
||||
private static final int NORMAL = 0;
|
||||
private static final int GROUP_LAST = 1;
|
||||
private static final int ALL_LAST = 2;
|
||||
|
||||
private Context mContext;
|
||||
private List<UserItemBean> mList;
|
||||
private LayoutInflater mInflater;
|
||||
private OnItemClickListener<UserItemBean> mOnItemClickListener;
|
||||
|
||||
public MainMeBottomAdapter(Context context, List<UserItemBean> list) {
|
||||
mContext = context;
|
||||
mList = list;
|
||||
mInflater = LayoutInflater.from(context);
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener<UserItemBean> onItemClickListener) {
|
||||
mOnItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
UserItemBean bean = mList.get(position);
|
||||
if (bean.isGroupLast()) {
|
||||
return GROUP_LAST;
|
||||
} else if (bean.isAllLast()) {
|
||||
return ALL_LAST;
|
||||
} else {
|
||||
return NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setList(List<UserItemBean> list) {
|
||||
if (list == null) {
|
||||
return;
|
||||
}
|
||||
boolean changed = false;
|
||||
if (mList.size() != list.size()) {
|
||||
changed = true;
|
||||
} else {
|
||||
for (int i = 0, size = mList.size(); i < size; i++) {
|
||||
if (!mList.get(i).equals(list.get(i))) {
|
||||
changed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
mList = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Vh onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
int res = 0;
|
||||
// if (viewType == GROUP_LAST) {
|
||||
// res = R.layout.item_main_me_1;//竖向单列表
|
||||
// } else if (viewType == ALL_LAST) {
|
||||
res = R.layout.item_main_me_3;//横向4列
|
||||
// } else {
|
||||
// res = R.layout.item_main_me_0;
|
||||
// }
|
||||
return new Vh(mInflater.inflate(res, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull Vh vh, int position) {
|
||||
vh.setData(mList.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
class Vh extends RecyclerView.ViewHolder {
|
||||
|
||||
ImageView mThumb;
|
||||
TextView mName;
|
||||
|
||||
public Vh(View itemView) {
|
||||
super(itemView);
|
||||
mThumb = (ImageView) itemView.findViewById(R.id.thumb);
|
||||
mName = (TextView) itemView.findViewById(R.id.name);
|
||||
ViewClicksAntiShake.clicksAntiShake(itemView, () -> {
|
||||
Object tag = itemView.getTag();
|
||||
if (tag != null) {
|
||||
UserItemBean bean = (UserItemBean) tag;
|
||||
if (mOnItemClickListener != null) {
|
||||
mOnItemClickListener.onItemClick(bean, 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void setData(UserItemBean bean) {
|
||||
itemView.setTag(bean);
|
||||
ImgLoader.display(mContext, bean.getThumb(), mThumb);
|
||||
mName.setText(bean.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,7 +174,12 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
boolean isAnchor = IMLoginManager.get(mContext).getUserInfo().anchorUserType();
|
||||
if (isAnchor) {
|
||||
String[] permissions;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
permissions = new String[]{
|
||||
Manifest.permission.CAMERA,
|
||||
Manifest.permission.RECORD_AUDIO
|
||||
};
|
||||
} else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU) {
|
||||
permissions = new String[]{
|
||||
//Manifest.permission.READ_MEDIA_IMAGES, 去掉选择图片的权限,到里面选择封面的时候再去申请
|
||||
Manifest.permission.CAMERA,
|
||||
@@ -200,7 +205,12 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
boolean isAnchor = IMLoginManager.get(mContext).getUserInfo().anchorUserType();
|
||||
if (isAnchor) {
|
||||
String[] permissions;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
permissions = new String[]{
|
||||
Manifest.permission.CAMERA,
|
||||
Manifest.permission.RECORD_AUDIO
|
||||
};
|
||||
} else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU) {
|
||||
permissions = new String[]{
|
||||
Manifest.permission.READ_MEDIA_IMAGES,
|
||||
Manifest.permission.CAMERA,
|
||||
@@ -239,9 +249,9 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
JSONObject obj1 = JSON.parseObject(info1[0]);
|
||||
try {
|
||||
if(code==201){ //声网
|
||||
if (code == 201) { //声网
|
||||
LiveSwAnchorActivity.forward(mContext, Constants.LIVE_SDK_SW, JSON.parseObject(obj.getString("android"), LiveKsyConfigBean.class));
|
||||
}else if(code==200){//融云
|
||||
} else if (code == 200) {//融云
|
||||
LiveRyAnchorActivity.forward(mContext, obj.getIntValue("live_sdk"), JSON.parseObject(obj.getString("android"), LiveKsyConfigBean.class));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -316,7 +326,7 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
if (i == R.id.btn_close) {
|
||||
} else if (i == R.id.btn_live) {
|
||||
if (isWifiProxy(mContext) || checkVPN((ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE))) {
|
||||
ToastUtil.show(WordUtil.isNewZh()?"檢測開啓了VPN或者代理,請先關閉VPN或者代理再開播。":
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "檢測開啓了VPN或者代理,請先關閉VPN或者代理再開播。" :
|
||||
"It is detected that VPN or proxy is turned on. Please turn off VPN or proxy before starting the broadcast.");
|
||||
DebugUtils.runDebugCode(() -> mCallback.onLiveClick());
|
||||
} else {
|
||||
@@ -332,6 +342,7 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isWifiProxy(Context context) {
|
||||
final boolean IS_ICS_OR_LATER = Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH;
|
||||
String proxyAddress;
|
||||
@@ -353,6 +364,7 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
boolean isVpnConn = networkInfo == null ? false : networkInfo.isConnected();
|
||||
return isVpnConn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
@@ -51,7 +51,7 @@ public class MainHttpUtil {
|
||||
.params("pushid", "")
|
||||
.params("lastlogindevice", "Android")
|
||||
.params("uuid_Device", uuid)
|
||||
.params("langue", WordUtil.isNewZh() ? "chinese" : "english")
|
||||
.params("langue", WordUtil.isNewZh()?"chinese":"english")
|
||||
.execute(callback);
|
||||
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class MainHttpUtil {
|
||||
* 第三方登录---增加参数:推广码,手机唯一标识
|
||||
*/
|
||||
|
||||
public static void loginByThird(String UserID, String openid, String promoCode, String uuidDevice, String nicename, String avatar, String type, HttpCallback callback) {
|
||||
public static void loginByThird(String UserID,String openid, String promoCode, String uuidDevice, String nicename, String avatar, String type, HttpCallback callback) {
|
||||
String sign = MD5Util.getMD5("openid=" + openid + "&" + SALT);
|
||||
String appSource = "2";
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 0) {
|
||||
@@ -106,7 +106,7 @@ public class MainHttpUtil {
|
||||
.params("sign", sign)
|
||||
.params("lastlogindevice", "Android")
|
||||
.params("pushid", "")
|
||||
.params("langue", WordUtil.isNewZh() ? "chinese" : "english")
|
||||
.params("langue", WordUtil.isNewZh()?"chinese":"english")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -255,7 +255,6 @@ public class MainHttpUtil {
|
||||
*/
|
||||
public static void getBaseInfo(String uid, String token, final CommonCallback<UserBean> commonCallback) {
|
||||
HttpClient.getInstance().get("User.getBaseInfos", MainHttpConsts.GET_BASE_INFO)
|
||||
.params("is_pdl", "1")
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
@@ -266,7 +265,7 @@ public class MainHttpUtil {
|
||||
bean.setMedalName(obj.getString("medal_name"));
|
||||
bean.setMedalLevel(obj.getIntValue("medal_level"));
|
||||
CommonAppConfig.getInstance().setUserBean(bean);
|
||||
CommonAppConfig.getInstance().setUserItemList(obj.getString("pdl_list"));
|
||||
CommonAppConfig.getInstance().setUserItemList(obj.getString("list"));
|
||||
SpUtil.getInstance().setStringValue(SpUtil.USER_INFO, info[0]);
|
||||
if (commonCallback != null) {
|
||||
commonCallback.callback(bean);
|
||||
@@ -339,7 +338,7 @@ public class MainHttpUtil {
|
||||
public static void getSettingList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.getPerSetting", MainHttpConsts.GET_SETTING_LIST)
|
||||
.params("version", VersionUtil.getVersion())
|
||||
.params("package_name", "panduo")
|
||||
.params("package_name","feelWe")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -353,11 +352,10 @@ public class MainHttpUtil {
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
public static void searchnew(String fan_key, String jian_key, int type, int p, HttpCallback callback) {
|
||||
public static void searchnew(String fan_key, String jian_key,int type, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("", MainHttpConsts.SEARCH)
|
||||
.params("jian_key", jian_key)
|
||||
.params("fan_key", fan_key)
|
||||
@@ -515,8 +513,8 @@ public class MainHttpUtil {
|
||||
HttpClient.getInstance().get("Login.getCode", MainHttpConsts.GET_REGISTER_CODE)
|
||||
.params("mobile", mobile)
|
||||
.params("sign", sign)
|
||||
.params("source", "1")
|
||||
.params("langue", WordUtil.isNewZh() ? "chinese" : "english")
|
||||
.params("source", "2")
|
||||
.params("langue", WordUtil.isNewZh()?"chinese":"english")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -538,8 +536,8 @@ public class MainHttpUtil {
|
||||
.params("Ticket", Ticket)
|
||||
.params("MacAddress", macUitl.getNewMac())
|
||||
.params("Imei", uuid)
|
||||
.params("source", "1")
|
||||
.params("langue", WordUtil.isNewZh() ? "chinese" : "english")
|
||||
.params("source", "2")
|
||||
.params("langue", WordUtil.isNewZh()?"chinese":"english")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -587,7 +585,7 @@ public class MainHttpUtil {
|
||||
/**
|
||||
* 手机注册接口---增加参数:推广码,手机唯一标识,国家代码
|
||||
*/
|
||||
public static void register(String UserID, String invitecode, String user_login, String promo_code, String uuidDevice, int countryCode, String pass, String pass2, String code, HttpCallback callback) {
|
||||
public static void register(String UserID,String invitecode, String user_login, String promo_code, String uuidDevice, int countryCode, String pass, String pass2, String code, HttpCallback callback) {
|
||||
String appSource = "2";
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 0) {
|
||||
appSource = "2";
|
||||
@@ -610,7 +608,7 @@ public class MainHttpUtil {
|
||||
.params("code", code)
|
||||
.params("source", DEVICE)
|
||||
.params("invitation_code", invitecode)
|
||||
.params("langue", WordUtil.isNewZh() ? "chinese" : "english")
|
||||
.params("langue", WordUtil.isNewZh()?"chinese":"english")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -623,7 +621,7 @@ public class MainHttpUtil {
|
||||
.params("user_pass", pass)
|
||||
.params("user_pass2", pass2)
|
||||
.params("code", code)
|
||||
.params("langue", WordUtil.isNewZh() ? "chinese" : "english")
|
||||
.params("langue", WordUtil.isNewZh()?"chinese":"english")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -648,8 +646,8 @@ public class MainHttpUtil {
|
||||
HttpClient.getInstance().get("Login.getCode", MainHttpConsts.GET_FIND_PWD_CODE)
|
||||
.params("mobile", mobile)
|
||||
.params("country_code", country_code)
|
||||
.params("source", "1")
|
||||
.params("langue", WordUtil.isNewZh() ? "chinese" : "english")
|
||||
.params("source", "2")
|
||||
.params("langue", WordUtil.isNewZh()?"chinese":"english")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -704,6 +702,7 @@ public class MainHttpUtil {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 是否是主播
|
||||
*/
|
||||
@@ -743,10 +742,9 @@ public class MainHttpUtil {
|
||||
HttpClient.getInstance().get("User.isInstructor", MainHttpConsts.ISINSTRUCTOR)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
//
|
||||
public static void setMessageReadAll() {
|
||||
HttpClient.getInstance().get("User.getUserInstructor", "")
|
||||
//
|
||||
public static void setMessageReadAll(){
|
||||
HttpClient.getInstance().get("User.getUserInstructor","")
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
@@ -754,11 +752,10 @@ public class MainHttpUtil {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备号有没有注册过
|
||||
*/
|
||||
public static void getDeviceLoginType(HttpCallback callback) {
|
||||
public static void getDeviceLoginType( HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Login.getDeviceLoginType", "Login.getDeviceLoginType")
|
||||
.params("uuid_Device", DeviceUtils.getUniqueDeviceId())
|
||||
.execute(callback);
|
||||
|
||||
@@ -44,7 +44,7 @@ public abstract class AbsMainHomeParentViewHolder extends AbsMainViewHolder {
|
||||
|
||||
private AppBarLayout mAppBarLayout;
|
||||
protected ViewPager mViewPager;
|
||||
public MagicIndicator mIndicator;
|
||||
private MagicIndicator mIndicator;
|
||||
private TextView mRedPoint;//显示未读消息数量的红点
|
||||
protected AbsMainHomeChildViewHolder[] mViewHolders;
|
||||
private MainAppBarLayoutListener mAppBarLayoutListener;
|
||||
@@ -138,8 +138,8 @@ public abstract class AbsMainHomeParentViewHolder extends AbsMainViewHolder {
|
||||
@Override
|
||||
public IPagerTitleView getTitleView(Context context, final int index) {
|
||||
SimplePagerTitleView simplePagerTitleView = new ColorTransitionPagerTitleView(context);
|
||||
simplePagerTitleView.setNormalColor(Color.parseColor("#FF777777"));
|
||||
simplePagerTitleView.setSelectedColor(Color.parseColor("#FF333333"));
|
||||
simplePagerTitleView.setNormalColor(Color.parseColor("#B1B1B1"));
|
||||
simplePagerTitleView.setSelectedColor(Color.parseColor("#7d77fc"));
|
||||
simplePagerTitleView.setText(titles[index]);
|
||||
simplePagerTitleView.setTextSize(18);
|
||||
simplePagerTitleView.getPaint().setFakeBoldText(true);
|
||||
@@ -160,7 +160,7 @@ public abstract class AbsMainHomeParentViewHolder extends AbsMainViewHolder {
|
||||
linePagerIndicator.setMode(LinePagerIndicator.MODE_WRAP_CONTENT);
|
||||
linePagerIndicator.setXOffset(DpUtil.dp2px(5));
|
||||
linePagerIndicator.setRoundRadius(DpUtil.dp2px(2));
|
||||
linePagerIndicator.setColors(Color.parseColor("#FF0FA4FF"));
|
||||
linePagerIndicator.setColors(Color.parseColor("#7d77fc"));
|
||||
return linePagerIndicator;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.greenrobot.eventbus.EventBus;
|
||||
* MainActivity 首页-社区
|
||||
*/
|
||||
|
||||
public class MainHomeComViewHolder extends AbsMainHomeParentViewHolder {
|
||||
public class MainHomeComViewHolder extends AbsMainHomeParentComViewHolder {
|
||||
private MainHomeFollComViewHolder mainHomeFollLiveViewHolder;
|
||||
private MainHomeNewViewHolder mainHomeLiveViewHolder;
|
||||
private MainHomeRecomComViewHolder mainHomeRecomComViewHolder;
|
||||
@@ -115,11 +115,11 @@ public class MainHomeComViewHolder extends AbsMainHomeParentViewHolder {
|
||||
RouteUtil.forwardCommunityActivity();
|
||||
mIndicator.onPageSelected(selected);
|
||||
setCurPosition(selected);
|
||||
//refreshIndex(selected);
|
||||
refreshIndex(selected);
|
||||
return;
|
||||
}
|
||||
selected = position;
|
||||
//refreshIndex(position);
|
||||
refreshIndex(position);
|
||||
switch (position) {
|
||||
case 0:
|
||||
floatWarOrder = false;
|
||||
|
||||
@@ -163,7 +163,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
|
||||
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
|
||||
@Override
|
||||
public int getSpanSize(int position) {
|
||||
if (position == 4) {
|
||||
if (position == 0) {
|
||||
return 2;
|
||||
}
|
||||
return 1;
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
package com.yunbao.main.views;
|
||||
|
||||
import static com.yunbao.common.manager.imrongcloud.RongcloudIMManager.connectIM;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
@@ -13,42 +8,18 @@ import android.widget.HorizontalScrollView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.dialog.MessageSayHiNotifyDialog;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.event.FloatWarOrderEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.MessageSayHiNotifyManager;
|
||||
import com.yunbao.common.utils.PluginManager;
|
||||
import com.yunbao.common.utils.ProcessResultUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.LiveConfig;
|
||||
import com.yunbao.live.activity.LiveAnchorActivity;
|
||||
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
||||
import com.yunbao.live.activity.LiveSwAnchorActivity;
|
||||
import com.yunbao.live.bean.LiveKsyConfigBean;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
import com.yunbao.main.dialog.MainStartDialogFragment;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import io.rong.imlib.RongIMClient;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/9/22.
|
||||
* MainActivity 首页 删除
|
||||
@@ -81,8 +52,6 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
mProcessResultUtil = new ProcessResultUtil((FragmentActivity) mContext);
|
||||
|
||||
img_trophy = (ImageView) findViewById(R.id.img_trophy);
|
||||
|
||||
ImgLoader.display(mContext, "https://downs.yaoulive.com/gif_trophy.gif", img_trophy);
|
||||
@@ -100,102 +69,8 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
||||
RouteUtil.forwardCommunityActivity();
|
||||
}
|
||||
});
|
||||
findViewById(R.id.btn_live).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
boolean isAnchor = IMLoginManager.get(mContext).getUserInfo().anchorUserType();
|
||||
if (isAnchor) {
|
||||
String[] permissions;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
permissions = new String[]{
|
||||
//Manifest.permission.READ_MEDIA_IMAGES, 去掉选择图片的权限,到里面选择封面的时候再去申请
|
||||
Manifest.permission.CAMERA,
|
||||
Manifest.permission.RECORD_AUDIO
|
||||
};
|
||||
} else {
|
||||
permissions = new String[]{
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.CAMERA,
|
||||
Manifest.permission.RECORD_AUDIO
|
||||
};
|
||||
}
|
||||
mProcessResultUtil.requestPermissions(permissions, mStartLiveRunnable);
|
||||
} else {
|
||||
ToastUtil.show(mContext.getString(R.string.only_open_anchor));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private Runnable mStartLiveRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (CommonAppConfig.LIVE_SDK_CHANGED) {
|
||||
if (mGetLiveSdkCallback == null) {
|
||||
mGetLiveSdkCallback = new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, final String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveHttpUtil.getisRong(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info1) {
|
||||
try {
|
||||
LiveHttpUtil.getIsSw(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] infos) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
JSONObject obj1 = JSON.parseObject(info1[0]);
|
||||
try {
|
||||
if(code==201){ //声网
|
||||
LiveSwAnchorActivity.forward(mContext, Constants.LIVE_SDK_SW, JSON.parseObject(obj.getString("android"), LiveKsyConfigBean.class));
|
||||
}else if(code==200){//融云
|
||||
LiveRyAnchorActivity.forward(mContext, obj.getIntValue("live_sdk"), JSON.parseObject(obj.getString("android"), LiveKsyConfigBean.class));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
if (!CommonAppConfig.IS_PLUGIN_MODEL || PluginManager.getInstance().isDownloadApk()) {
|
||||
PluginManager.getInstance().loadAnchorPlugin(it -> {
|
||||
LiveHttpUtil.getLiveSdk(mGetLiveSdkCallback);
|
||||
});
|
||||
} else {
|
||||
String tips = "需要下載開播插件,是否下載";
|
||||
if (!WordUtil.isNewZh()) {
|
||||
tips = "You need to download the plug-in, whether to download";
|
||||
}
|
||||
DialogUitl.showSimpleDialog(mContext, tips, new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
Dialog downloadDialog = DialogUitl.loadingDialog(mContext, "Downloading...");
|
||||
downloadDialog.show();
|
||||
PluginManager.getInstance().loadAnchorPlugin(it -> {
|
||||
LiveHttpUtil.getLiveSdk(mGetLiveSdkCallback);
|
||||
downloadDialog.dismiss();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
LiveAnchorActivity.forward(mContext, CommonAppConfig.LIVE_SDK_USED, LiveConfig.getDefaultKsyConfig());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private HttpCallback mGetLiveSdkCallback;
|
||||
private ProcessResultUtil mProcessResultUtil;
|
||||
|
||||
public void setCurPosition(int position) {
|
||||
mViewPager.setCurrentItem(position);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@@ -52,7 +51,6 @@ import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.AbsMainViewHolder;
|
||||
import com.yunbao.common.views.DividerItemDecoration;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.activity.LiveRecordActivity;
|
||||
import com.yunbao.live.activity.RoomManageActivity;
|
||||
@@ -72,7 +70,6 @@ import com.yunbao.main.activity.SettingActivity;
|
||||
import com.yunbao.main.activity.ThreeDistributActivity;
|
||||
import com.yunbao.main.activity.ZhuangBanActivity;
|
||||
import com.yunbao.main.adapter.MainMeAdapter;
|
||||
import com.yunbao.main.adapter.MainMeBottomAdapter;
|
||||
import com.yunbao.main.http.MainHttpConsts;
|
||||
import com.yunbao.main.http.MainHttpUtil;
|
||||
|
||||
@@ -104,9 +101,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
||||
private TextView mFans;
|
||||
private boolean mPaused;
|
||||
private RecyclerView mRecyclerView;
|
||||
private RecyclerView bottomRecyclerView;
|
||||
private MainMeAdapter mAdapter;
|
||||
private MainMeBottomAdapter mainMeBottomAdapter;
|
||||
private TextView signature;
|
||||
private TextView coin, gold, star_coin;//金豆,钻石,星币
|
||||
private TextView btnCopy;
|
||||
@@ -198,7 +193,6 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
||||
mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
||||
mRecyclerView.setHasFixedSize(true);
|
||||
mRecyclerView.setLayoutManager(new GridLayoutManager(mContext, 4, GridLayoutManager.VERTICAL, false));
|
||||
|
||||
banner_me.setOutlineProvider(new ViewOutlineProvider() {
|
||||
@Override
|
||||
public void getOutline(View view, Outline outline) {
|
||||
@@ -212,11 +206,6 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
||||
mContext.startActivity(new Intent(mContext, EditProfileActivity.class));
|
||||
}
|
||||
});
|
||||
|
||||
bottomRecyclerView = findViewById(R.id.bottomRecyclerView);
|
||||
bottomRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||
bottomRecyclerView.addItemDecoration(new DividerItemDecoration(mContext,1,mContext.getColor(R.color.gray_8A8A8A)));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -300,16 +289,15 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
||||
@Override
|
||||
public void callback(UserBean bean) {
|
||||
List<UserItemBean> list = CommonAppConfig.getInstance().getUserItemList();
|
||||
List<UserItemBean> newList = CommonAppConfig.getInstance().getUserItemNewList();
|
||||
if (bean != null) {
|
||||
showData(bean, list,newList);
|
||||
showData(bean, list);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private List<SlideBean> mBannerListNew = new ArrayList<>();
|
||||
|
||||
private void showData(UserBean u, List<UserItemBean> list,List<UserItemBean> newList) {
|
||||
private void showData(UserBean u, List<UserItemBean> list) {
|
||||
mBannerList.clear();
|
||||
mBannerListNew.clear();
|
||||
if (!StringUtil.isEmpty(u.getSlide())) {
|
||||
@@ -376,7 +364,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
||||
good_nub_ico.setImageResource(R.mipmap.usercard_good_nub);
|
||||
|
||||
|
||||
//ImgLoader.display(mContext, R.mipmap.icon_zhubolv, img_lv_pic);
|
||||
ImgLoader.display(mContext, R.mipmap.icon_zhubolv, img_lv_pic);
|
||||
//主播等级
|
||||
tv_level.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -439,14 +427,6 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
||||
} else {
|
||||
mAdapter.setList(listNow);
|
||||
}
|
||||
|
||||
if (mainMeBottomAdapter == null) {
|
||||
mainMeBottomAdapter = new MainMeBottomAdapter(mContext, newList);
|
||||
mainMeBottomAdapter.setOnItemClickListener(this);
|
||||
bottomRecyclerView.setAdapter(mainMeBottomAdapter);
|
||||
} else {
|
||||
mainMeBottomAdapter.setList(newList);
|
||||
}
|
||||
}
|
||||
if (beanKefu != null) {
|
||||
}
|
||||
@@ -457,11 +437,11 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
||||
Constants.myUid = u.getGoodnum();
|
||||
Constants.myAvatar = u.getAvatar();
|
||||
if (u.getUserInfoComplete() == 1) {
|
||||
//findViewById(R.id.complete_information_radius).setVisibility(View.INVISIBLE);
|
||||
//findViewById(R.id.complete_information).setVisibility(View.INVISIBLE);
|
||||
findViewById(R.id.complete_information_radius).setVisibility(View.INVISIBLE);
|
||||
findViewById(R.id.complete_information).setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
//findViewById(R.id.complete_information_radius).setVisibility(View.VISIBLE);
|
||||
//findViewById(R.id.complete_information).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.complete_information_radius).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.complete_information).setVisibility(View.VISIBLE);
|
||||
}
|
||||
EventBus.getDefault().post(new CompleteInformationEvent().setCompleteInformation(findViewById(R.id.complete_information).getVisibility() == View.VISIBLE));
|
||||
}
|
||||
@@ -492,20 +472,6 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
||||
case 17:
|
||||
RouteUtil.forwardActivity(RouteUtil.PATH_FEEDBACK_ACTIVITY);
|
||||
break;
|
||||
case 66:
|
||||
MobclickAgent.onEvent(mContext, "my_noble", "个人中心点贵族");
|
||||
Constants.isTitle = true;
|
||||
UserBean u = CommonAppConfig.getInstance().getUserBean();
|
||||
String url1 = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname=" + u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
ZhuangBanActivity.forward(mContext, url1, false);
|
||||
break;
|
||||
case 67:
|
||||
MobclickAgent.onEvent(mContext, "my_guard_btn", "我的-守护点击次数及人数");
|
||||
Constants.isTitle = true;
|
||||
String url2 = CommonAppConfig.HOST + "/h5/Guard/index.html?token=" + CommonAppConfig.getInstance().getToken()
|
||||
+ "&uid=" + CommonAppConfig.getInstance().getUid() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
ZhuangBanActivity.forward(mContext, url2, false);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
//21 在线客服
|
||||
@@ -672,7 +638,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
||||
lt_advertisement.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
/*lt_advertisement.setVisibility(View.VISIBLE);
|
||||
lt_advertisement.setVisibility(View.VISIBLE);
|
||||
if (mBannerList.size() == 1) {
|
||||
banner_me.setAutoPlay(false)
|
||||
.setPages(mBannerList, new CustomMyViewHolder())
|
||||
@@ -719,18 +685,18 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
||||
map_ekv.put("link", url);
|
||||
MobclickAgent.onEvent(mContext, "my_banner", map_ekv);
|
||||
|
||||
*//*if(bean.getSlide_id().equals("95")){
|
||||
/*if(bean.getSlide_id().equals("95")){
|
||||
RouteUtil.forwardCustomerService(url);
|
||||
}else {
|
||||
ZhuangBanActivity.forward(mContext, url, false);
|
||||
}*//*
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.start();
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
502
main/src/main/java/com/yunbao/main/views/MainMeViewHolder1.java
Normal file
@@ -0,0 +1,502 @@
|
||||
package com.yunbao.main.views;
|
||||
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.WebViewActivity;
|
||||
import com.yunbao.common.bean.GoogleBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.bean.UserItemBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.AbsMainViewHolder;
|
||||
import com.yunbao.live.activity.LiveRecordActivity;
|
||||
import com.yunbao.live.activity.RoomManageActivity;
|
||||
import com.yunbao.live.activity.WebViewActivityMedal;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.EditProfileActivity;
|
||||
import com.yunbao.main.activity.FansActivity;
|
||||
import com.yunbao.main.activity.FollowActivity;
|
||||
import com.yunbao.main.activity.MyProfitActivity;
|
||||
import com.yunbao.main.activity.MyVideoActivity;
|
||||
import com.yunbao.main.activity.MyWalletActivity;
|
||||
import com.yunbao.main.activity.RewardActivity;
|
||||
import com.yunbao.main.activity.SettingActivity;
|
||||
import com.yunbao.main.activity.ThreeDistributActivity;
|
||||
import com.yunbao.main.activity.ZhuangBanActivity;
|
||||
import com.yunbao.main.adapter.MainMeAdapter;
|
||||
import com.yunbao.main.http.MainHttpConsts;
|
||||
import com.yunbao.main.http.MainHttpUtil;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/9/22.
|
||||
* 我的
|
||||
*/
|
||||
|
||||
public class MainMeViewHolder1 extends AbsMainViewHolder implements OnItemClickListener<UserItemBean>, View.OnClickListener {
|
||||
|
||||
private ImageView mAvatar, mSex, mLevelAnchor, mLevel;
|
||||
|
||||
private TextView mName, tv_level, mID;
|
||||
private ImageView img_kefu, img_setting;
|
||||
private RelativeLayout rt_kefu, rt_setting;
|
||||
private boolean mPaused;
|
||||
private RecyclerView mRecyclerView;
|
||||
private MainMeAdapter mAdapter;
|
||||
private TextView signature;
|
||||
private TextView coin, gold;//金豆,钻石
|
||||
private TextView btnCopy;
|
||||
private SVGAImageView gift_svga;
|
||||
private View v_noble;
|
||||
// private LinearLayout btnUserNoble;
|
||||
private ImageView user_noble_ico, good_nub_ico;
|
||||
private TextView user_noble_text, leave;
|
||||
private UserItemBean beanStetting = null, beanKefu = null;
|
||||
private boolean firstInto = true;
|
||||
|
||||
public MainMeViewHolder1(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.view_main_me1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
mAvatar = (ImageView) findViewById(R.id.avatar);
|
||||
mAvatar.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
RouteUtil.forwardUserHome(mContext, CommonAppConfig.getInstance().getUid(), 0);
|
||||
}
|
||||
});
|
||||
|
||||
mName = (TextView) findViewById(R.id.name);
|
||||
gift_svga = (SVGAImageView) findViewById(com.yunbao.live.R.id.gift_svga);
|
||||
gift_svga.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
RouteUtil.forwardUserHome(mContext, CommonAppConfig.getInstance().getUid(), 0);
|
||||
}
|
||||
});
|
||||
|
||||
user_noble_ico = (ImageView) findViewById(R.id.user_noble_ico);
|
||||
// mSex = (ImageView) findViewById(R.id.sex);
|
||||
mLevelAnchor = (ImageView) findViewById(R.id.level_anchor);
|
||||
mLevel = (ImageView) findViewById(R.id.level);
|
||||
tv_level = (TextView) findViewById(R.id.tv_level);
|
||||
good_nub_ico = (ImageView) findViewById(R.id.good_nub_ico);
|
||||
mID = (TextView) findViewById(R.id.id_val);
|
||||
// mFollow = (TextView) findViewById(R.id.btn_follow);
|
||||
// mFans = (TextView) findViewById(R.id.btn_fans);
|
||||
signature = (TextView) findViewById(R.id.signature);
|
||||
coin = (TextView) findViewById(R.id.coin);
|
||||
gold = (TextView) findViewById(R.id.gold);
|
||||
btnCopy = (TextView) findViewById(R.id.btn_copy);
|
||||
// btnUserNoble = (LinearLayout) findViewById(R.id.btn_user_noble);
|
||||
user_noble_text = (TextView) findViewById(R.id.user_noble_text);
|
||||
leave = (TextView) findViewById(R.id.leave);
|
||||
|
||||
img_kefu = (ImageView) findViewById(R.id.img_kefu);
|
||||
img_setting = (ImageView) findViewById(R.id.img_setting);
|
||||
rt_kefu = (RelativeLayout) findViewById(R.id.rt_kefu);
|
||||
rt_setting = (RelativeLayout) findViewById(R.id.rt_setting);
|
||||
|
||||
v_noble = (View) findViewById(R.id.v_noble);
|
||||
|
||||
// mFollow.setOnClickListener(this);
|
||||
// mFans.setOnClickListener(this);
|
||||
findViewById(R.id.btn_edit).setOnClickListener(this);
|
||||
// findViewById(R.id.btn_msg).setOnClickListener(this);
|
||||
findViewById(R.id.btn_wallet).setOnClickListener(this);
|
||||
findViewById(R.id.btn_coin).setOnClickListener(this);
|
||||
findViewById(R.id.btn_gold).setOnClickListener(this);
|
||||
|
||||
findViewById(R.id.rt_kefu).setOnClickListener(this);
|
||||
findViewById(R.id.rt_setting).setOnClickListener(this);
|
||||
findViewById(R.id.v_noble).setOnClickListener(this);
|
||||
|
||||
//主播等级
|
||||
mLevelAnchor.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Level&a=index" + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0") + "&for";
|
||||
WebViewActivity.forward(mContext, url, false);
|
||||
}
|
||||
});
|
||||
//用户等级
|
||||
mLevel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Level&a=index" + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
WebViewActivity.forward(mContext, url, false);
|
||||
}
|
||||
});
|
||||
|
||||
// btnUserNoble.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// UserBean u = CommonAppConfig.getInstance().getUserBean();
|
||||
// String url = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname=" + u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid();
|
||||
// ZhuangBanActivity.forward(mContext, url, false);
|
||||
// }
|
||||
// });
|
||||
|
||||
btnCopy.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
ClipboardManager cm = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
cm.setText(mID.getText() + "");
|
||||
Toast.makeText(mContext, "複製成功", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
// findViewById(R.id.btn_detail).setOnClickListener(this);
|
||||
// findViewById(R.id.btn_shop).setOnClickListener(this);
|
||||
mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
||||
mRecyclerView.setHasFixedSize(true);
|
||||
// mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||
mRecyclerView.setLayoutManager(new GridLayoutManager(mContext, 4, GridLayoutManager.VERTICAL, false));
|
||||
// EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
mPaused = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (isShowed() && mPaused) {
|
||||
loadData();
|
||||
}
|
||||
mPaused = false;
|
||||
// EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
MainHttpUtil.cancel(MainHttpConsts.GET_BASE_INFO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadData() {
|
||||
if (isFirstLoadData()) {
|
||||
CommonAppConfig appConfig = CommonAppConfig.getInstance();
|
||||
UserBean u = appConfig.getUserBean();
|
||||
List<UserItemBean> list = appConfig.getUserItemList();
|
||||
if (u != null && list != null) {
|
||||
showData(u, list);
|
||||
}
|
||||
}
|
||||
|
||||
MainHttpUtil.getGoogle(mCallback1);
|
||||
MainHttpUtil.getBaseInfo(mCallback);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//获取谷歌
|
||||
//谷歌支付是否打开 1是打开 0 关闭
|
||||
String Is_hide = "1";
|
||||
private CommonCallback<GoogleBean> mCallback1 = new CommonCallback<GoogleBean>() {
|
||||
@Override
|
||||
public void callback(GoogleBean bean) {
|
||||
if (bean != null) {
|
||||
Is_hide = bean.getIs_hide();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private CommonCallback<UserBean> mCallback = new CommonCallback<UserBean>() {
|
||||
@Override
|
||||
public void callback(UserBean bean) {
|
||||
List<UserItemBean> list = CommonAppConfig.getInstance().getUserItemList();
|
||||
if (bean != null) {
|
||||
showData(bean, list);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private void showData(UserBean u, List<UserItemBean> list) {
|
||||
ImgLoader.displayAvatar(mContext, u.getAvatar(), mAvatar);
|
||||
// mTtileView.setText(u.getUserNiceName());
|
||||
mName.setText(u.getUserNiceName());
|
||||
user_noble_text.setText(u.getNoble_name());
|
||||
// mSex.setImageResource(CommonIconUtil.getSexIcon(u.getSex()));
|
||||
coin.setText(u.getYuanbao());
|
||||
gold.setText(u.getCoin());
|
||||
signature.setText(u.getSignature());
|
||||
CommonAppConfig appConfig = CommonAppConfig.getInstance();
|
||||
|
||||
|
||||
if (u.getDress().getAvatar_frame() != null) {
|
||||
if (u.getDress().getAvatar_frame().contains("svga")) {
|
||||
try {
|
||||
new SVGAParser(mContext).parse(new URL(u.getDress().getAvatar_frame()), new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
public void onComplete(SVGAVideoEntity videoItem) {
|
||||
SVGADrawable drawable = new SVGADrawable(videoItem);
|
||||
gift_svga.setImageDrawable(drawable);
|
||||
SVGAViewUtils.playEndClear(gift_svga);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
}
|
||||
});
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
ImgLoader.display(mContext, u.getDress().getAvatar_frame(), gift_svga);
|
||||
}
|
||||
}
|
||||
|
||||
if (u.getDress().getMedal() != null) {
|
||||
Log.e("tag", u.getDress().getMedal());
|
||||
ImgLoader.display(mContext, u.getDress().getMedal(), user_noble_ico);
|
||||
} else {
|
||||
user_noble_ico.setImageResource(R.mipmap.df_nobe);
|
||||
}
|
||||
|
||||
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
|
||||
int anchorLevel = 0;
|
||||
|
||||
|
||||
anchorLevel = u.getLevelAnchor();
|
||||
String imgUrl = "";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getThumb();
|
||||
}
|
||||
}
|
||||
leave.setText(String.valueOf(u.getLevelAnchor()));
|
||||
ImgLoader.display(mContext, imgUrl, mLevelAnchor);
|
||||
new LiveTextRender().getLevelImage(mContext, u.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
//修改靓号图标 个人中心
|
||||
if (u.getGoodnum() != null && !u.getGoodnum().equals("")) {
|
||||
good_nub_ico.setVisibility(View.VISIBLE);
|
||||
mID.setText(" " + u.getGoodnum());
|
||||
} else {
|
||||
good_nub_ico.setVisibility(View.GONE);
|
||||
mID.setText(u.getLiangNameTip());
|
||||
}
|
||||
// mFollow.setText("" + u.getFollows());
|
||||
// mFans.setText("" + u.getFans());
|
||||
if (list != null && list.size() > 0) {
|
||||
List<UserItemBean> listNow = new ArrayList<>();
|
||||
for (UserItemBean userItemBean : list) {
|
||||
if (userItemBean.getId() != 21 && userItemBean.getId() != 13) {
|
||||
listNow.add(userItemBean);
|
||||
} else if (userItemBean.getId() == 21) {
|
||||
beanKefu = userItemBean;
|
||||
} else if (userItemBean.getId() == 13) {
|
||||
beanStetting = userItemBean;
|
||||
}
|
||||
}
|
||||
if (mAdapter == null) {
|
||||
mAdapter = new MainMeAdapter(mContext, listNow);
|
||||
mAdapter.setOnItemClickListener(this);
|
||||
mRecyclerView.setAdapter(mAdapter);
|
||||
} else {
|
||||
mAdapter.setList(listNow);
|
||||
}
|
||||
}
|
||||
if (beanKefu != null) {
|
||||
ImgLoader.display(mContext, beanKefu.getThumb(), img_kefu);
|
||||
}
|
||||
if (beanStetting != null) {
|
||||
ImgLoader.display(mContext, beanStetting.getThumb(), img_setting);
|
||||
}
|
||||
Constants.myUid = u.getGoodnum();
|
||||
Constants.myAvatar = u.getAvatar();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(UserItemBean bean, int position) {
|
||||
String url = bean.getHref();
|
||||
if (TextUtils.isEmpty(url)) {
|
||||
switch (bean.getId()) {
|
||||
case 1:
|
||||
forwardProfit();
|
||||
break;
|
||||
case 2:
|
||||
forwardCoin();
|
||||
break;
|
||||
case 13:
|
||||
// forwardSetting();
|
||||
break;
|
||||
case 19:
|
||||
forwardMyVideo();
|
||||
break;
|
||||
case 20:
|
||||
forwardRoomManage();
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
//21 在线客服
|
||||
Log.i("tag", bean.getId() + "");
|
||||
if (bean.getId() == 8) {//三级分销
|
||||
ThreeDistributActivity.forward(mContext, bean.getName(), url);
|
||||
} else {
|
||||
if (bean.getId() == 31) {
|
||||
//跳转网页版粉丝徽章
|
||||
WebViewActivityMedal.forward(mContext, url);
|
||||
} else if (bean.getId() == 5) {
|
||||
ZhuangBanActivity.forward(mContext, CommonAppConfig.HOST + "/h5/Personality.html");
|
||||
//獎勵中心
|
||||
} else if (bean.getId() == 23) {
|
||||
Log.i("tsa", url);
|
||||
RewardActivity.forward(mContext, url);
|
||||
} else {
|
||||
WebViewActivity.forward(mContext, url, false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int i = v.getId();
|
||||
if (i == R.id.btn_edit) {
|
||||
mContext.startActivity(new Intent(mContext, EditProfileActivity.class));
|
||||
}
|
||||
// else if (i == R.id.btn_follow) {
|
||||
// forwardFollow();
|
||||
// }
|
||||
else if (i == R.id.btn_fans) {
|
||||
forwardFans();
|
||||
// } else if (i == R.id.btn_msg) {
|
||||
// ChatActivity.forward(mContext);
|
||||
} else if (i == R.id.btn_wallet) {
|
||||
mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 0));
|
||||
} else if (i == R.id.btn_coin) {
|
||||
mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 2));
|
||||
} else if (i == R.id.btn_gold) {
|
||||
mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 0));
|
||||
} else if (i == R.id.rt_kefu) {
|
||||
WebViewActivity.forward(mContext, beanKefu.getHref(), false);
|
||||
} else if (i == R.id.rt_setting) {
|
||||
forwardSetting();
|
||||
} else if (i == R.id.v_noble) {
|
||||
UserBean u = CommonAppConfig.getInstance().getUserBean();
|
||||
String url = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname=" + u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
ZhuangBanActivity.forward(mContext, url, false);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑个人资料
|
||||
*/
|
||||
private void forwardEditProfile() {
|
||||
mContext.startActivity(new Intent(mContext, EditProfileActivity.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的关注
|
||||
*/
|
||||
private void forwardFollow() {
|
||||
FollowActivity.forward(mContext, CommonAppConfig.getInstance().getUid(), 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的粉丝
|
||||
*/
|
||||
private void forwardFans() {
|
||||
FansActivity.forward(mContext, CommonAppConfig.getInstance().getUid());
|
||||
}
|
||||
|
||||
/**
|
||||
* 直播记录
|
||||
*/
|
||||
private void forwardLiveRecord() {
|
||||
LiveRecordActivity.forward(mContext, CommonAppConfig.getInstance().getUserBean());
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的收益
|
||||
*/
|
||||
private void forwardProfit() {
|
||||
mContext.startActivity(new Intent(mContext, MyProfitActivity.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的钻石
|
||||
*/
|
||||
private void forwardCoin() {
|
||||
RouteUtil.forwardMyCoin(mContext);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
*/
|
||||
private void forwardSetting() {
|
||||
mContext.startActivity(new Intent(mContext, SettingActivity.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的视频
|
||||
*/
|
||||
private void forwardMyVideo() {
|
||||
mContext.startActivity(new Intent(mContext, MyVideoActivity.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 房间管理
|
||||
*/
|
||||
private void forwardRoomManage() {
|
||||
mContext.startActivity(new Intent(mContext, RoomManageActivity.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,9 +32,11 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
@@ -43,12 +45,15 @@ import com.binioter.guideview.Guide;
|
||||
import com.binioter.guideview.GuideBuilder;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BasePopupView;
|
||||
import com.lxj.xpopup.enums.PopupPosition;
|
||||
import com.lxj.xpopup.interfaces.XPopupCallback;
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.fragment.ChatViewModel;
|
||||
import com.yunbao.common.fragment.MainMessageRecommendFragment;
|
||||
import com.yunbao.common.utils.DebugUtils;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
@@ -73,6 +78,7 @@ import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.ViewPageIndicatorUtils;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.AbsMainViewHolder;
|
||||
import com.yunbao.common.views.MsgChatTypeSelectPoPupView;
|
||||
import com.yunbao.common.views.MsgRecommendPopupView;
|
||||
import com.yunbao.common.views.MsgSysDelPopupView;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
@@ -132,17 +138,20 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
private MagicIndicator mIndicator;
|
||||
private List<AbsMainMessageChatListFragment> fragmentList;
|
||||
|
||||
private ConstraintLayout tabLayout1, tabLayout2, tabLayout3;
|
||||
private Group tabLayout1, tabLayout2, tabLayout3;
|
||||
private TextView tab1, tab2, tab3;
|
||||
private ImageView imageView1, imageView2, imageView3;
|
||||
private View tab_line1, tab_line2, tab_line3;
|
||||
private ImageView tab_icon;
|
||||
|
||||
private List<ConstraintLayout> relativeLayouts = new ArrayList<>();
|
||||
private List<Group> relativeLayouts = new ArrayList<>();
|
||||
private List<TextView> tabTexts = new ArrayList<>();
|
||||
private List<View> tabLine = new ArrayList<>();
|
||||
private LinearLayout tabLayouts;
|
||||
private List<ImageView> tabExpend = new ArrayList<>();
|
||||
private ConstraintLayout tabLayouts;
|
||||
|
||||
private int userType = 0; // (0)普通用户 (1)主播A (2)主播B
|
||||
ChatViewModel chatViewModel;
|
||||
|
||||
public MainMessageViewHolder setHomeZdyPop(String homeZdyPop) {
|
||||
this.homeZdyPop = homeZdyPop;
|
||||
@@ -156,6 +165,7 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
public MainMessageViewHolder(MainActivity context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
mContext = context;
|
||||
chatViewModel= (new ViewModelProvider(mContext)).get(ChatViewModel.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -193,14 +203,28 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
tabLayouts = findViewById(R.id.tabLayouts);
|
||||
|
||||
tab_icon = findViewById(R.id.tab_icon);
|
||||
tabLayout1 = findViewById(R.id.tabLayout1);
|
||||
tabLayout2 = findViewById(R.id.tabLayout2);
|
||||
tabLayout3 = findViewById(R.id.tabLayout3);
|
||||
tabLayout1 = findViewById(R.id.group_tab1);
|
||||
tabLayout2 = findViewById(R.id.group_tab2);
|
||||
tabLayout3 = findViewById(R.id.group_tab3);
|
||||
|
||||
tab1 = findViewById(R.id.tab1);
|
||||
tab2 = findViewById(R.id.tab2);
|
||||
tab3 = findViewById(R.id.tab3);
|
||||
|
||||
imageView1 = findViewById(R.id.expendImg1);
|
||||
imageView2 = findViewById(R.id.expendImg2);
|
||||
imageView3 = findViewById(R.id.expendImg3);
|
||||
|
||||
imageView1.setOnClickListener(view -> {
|
||||
selectChatType(view, 0);
|
||||
});
|
||||
imageView2.setOnClickListener(view -> {
|
||||
selectChatType(view, 1);
|
||||
});
|
||||
imageView3.setOnClickListener(view -> {
|
||||
selectChatType(view, 2);
|
||||
});
|
||||
|
||||
tab_line1 = findViewById(R.id.tab_line1);
|
||||
tab_line2 = findViewById(R.id.tab_line2);
|
||||
tab_line3 = findViewById(R.id.tab_line3);
|
||||
@@ -224,6 +248,73 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
});
|
||||
}
|
||||
|
||||
private void selectChatType(View view, int position) {
|
||||
AbsMainMessageChatListFragment fragment = fragmentList.get(position);
|
||||
if (!(fragment instanceof MainMessageChatListFragment) || !(view instanceof ImageView)) {
|
||||
return;
|
||||
}
|
||||
MainMessageChatListFragment chatFragment = (MainMessageChatListFragment) fragment;
|
||||
ImageView expendImg = (ImageView) view;
|
||||
expendImg.setImageResource(R.mipmap.ic_expend_up);
|
||||
XPopup.Builder builder = new XPopup.Builder(mContext).atView(tabTexts.get(position));
|
||||
builder.offsetY(16);
|
||||
builder.dismissOnTouchOutside(true);
|
||||
builder.setPopupCallback(new XPopupCallback() {
|
||||
@Override
|
||||
public void onCreated(BasePopupView popupView) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeShow(BasePopupView popupView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShow(BasePopupView popupView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(BasePopupView popupView) {
|
||||
expendImg.setImageResource(R.mipmap.ic_expend_down);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeDismiss(BasePopupView popupView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBackPressed(BasePopupView popupView) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKeyBoardStateChanged(BasePopupView popupView, int height) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDrag(BasePopupView popupView, int value, float percent, boolean upOrLeft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickOutside(BasePopupView popupView) {
|
||||
|
||||
}
|
||||
});
|
||||
builder.asCustom(new MsgChatTypeSelectPoPupView(mContext, chatFragment.getFilter(), new MsgChatTypeSelectPoPupView.ResultCallBack() {
|
||||
@Override
|
||||
public void callBack(int i,String str) {
|
||||
tabTexts.get(position).setText(str);
|
||||
chatFragment.setFilter(i);
|
||||
}
|
||||
})).show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void initFragment() {
|
||||
final String[] titles;
|
||||
fragmentList = new ArrayList<>();
|
||||
@@ -264,9 +355,9 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
return fragmentList.get(i);
|
||||
}
|
||||
});
|
||||
if(userType==1){
|
||||
if (userType == 1) {
|
||||
viewPager.setCurrentItem(1);
|
||||
}else{
|
||||
} else {
|
||||
viewPager.setCurrentItem(0);
|
||||
}
|
||||
viewPager.setUserInputEnabled(false);
|
||||
@@ -340,7 +431,7 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
super.onPageSelected(position);
|
||||
if(!StringUtil.isEmpty(search.getText().toString())) {
|
||||
if (!StringUtil.isEmpty(search.getText().toString())) {
|
||||
search.setText("");
|
||||
}
|
||||
selectTab(position);
|
||||
@@ -369,6 +460,12 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void showChatTypeSelect() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void initTabView() {
|
||||
relativeLayouts = new ArrayList<>();
|
||||
tabTexts = new ArrayList<>();
|
||||
@@ -382,14 +479,19 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
tabTexts.add(tab2);
|
||||
tabTexts.add(tab3);
|
||||
|
||||
tabExpend.add(imageView1);
|
||||
tabExpend.add(imageView2);
|
||||
tabExpend.add(imageView3);
|
||||
|
||||
tabLine.add(tab_line1);
|
||||
tabLine.add(tab_line2);
|
||||
tabLine.add(tab_line3);
|
||||
if (userType == 0) { //普通用户
|
||||
relativeLayouts.get(0).setVisibility(View.VISIBLE);
|
||||
tabTexts.get(0).setText(WordUtil.getNewString(R.string.message_chat_msg_all_an_a));
|
||||
tabTexts.get(0).setText(WordUtil.getNewString(chatViewModel.getTitleTextId()));
|
||||
ViewGroup.LayoutParams params = tabLayouts.getLayoutParams();
|
||||
params.width = LinearLayout.LayoutParams.WRAP_CONTENT;
|
||||
//tabExpend.get(0).setVisibility(View.VISIBLE);
|
||||
tabLayouts.setLayoutParams(params);
|
||||
} else if (userType == 1) {//主播A
|
||||
tab_icon.setVisibility(View.VISIBLE);
|
||||
@@ -409,10 +511,12 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
relativeLayouts.get(0).setVisibility(View.VISIBLE);
|
||||
tabTexts.get(0).setText(WordUtil.getNewString(R.string.message_chat_msg_recommend));
|
||||
relativeLayouts.get(1).setVisibility(View.VISIBLE);
|
||||
tabTexts.get(1).setText(WordUtil.getNewString(R.string.message_chat_msg_all_an_a));
|
||||
tabTexts.get(1).setText(WordUtil.getNewString(chatViewModel.getTitleTextId()));
|
||||
// tabExpend.get(1).setVisibility(View.VISIBLE);
|
||||
} else { //主播B
|
||||
tabExpend.get(0).setVisibility(View.VISIBLE);
|
||||
relativeLayouts.get(0).setVisibility(View.VISIBLE);
|
||||
tabTexts.get(0).setText(WordUtil.getNewString(R.string.message_chat_msg_all));
|
||||
tabTexts.get(0).setText(WordUtil.getNewString(chatViewModel.getTitleTextId()));
|
||||
relativeLayouts.get(1).setVisibility(View.VISIBLE);
|
||||
tabTexts.get(1).setText(WordUtil.getNewString(R.string.message_chat_msg_system));
|
||||
relativeLayouts.get(2).setVisibility(View.VISIBLE);
|
||||
@@ -420,7 +524,7 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
}
|
||||
for (int i = 0; i < relativeLayouts.size(); i++) {
|
||||
int finalI = i;
|
||||
relativeLayouts.get(i).setOnClickListener(new View.OnClickListener() {
|
||||
tabTexts.get(i).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
selectTab(finalI);
|
||||
@@ -428,9 +532,9 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
}
|
||||
});
|
||||
}
|
||||
if(userType==1){
|
||||
if (userType == 1) {
|
||||
selectTab(1);
|
||||
}else{
|
||||
} else {
|
||||
selectTab(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="15dp"/>
|
||||
<solid android:color="#FFFFBA26"/>
|
||||
</shape>
|
||||
@@ -4,12 +4,14 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activity.EntryActivity">
|
||||
|
||||
|
||||
<com.yunbao.main.views.CustomVideoView
|
||||
android:id="@+id/video_view"
|
||||
android:layout_width="match_parent"
|
||||
android:visibility="gone"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
@@ -34,25 +36,26 @@
|
||||
android:layout_marginBottom="21dp">
|
||||
|
||||
<LinearLayout
|
||||
android:visibility="gone"
|
||||
android:id="@+id/lt_btn_facebook"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="54dp"
|
||||
android:layout_marginLeft="42dp"
|
||||
android:layout_marginRight="42dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginLeft="48dp"
|
||||
android:layout_marginRight="48dp"
|
||||
android:background="@drawable/background_227bef"
|
||||
android:gravity="center|left">
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="54dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:src="@mipmap/icon_facebook" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="21dp"
|
||||
android:text="@string/user_login_facebook"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
@@ -64,35 +67,67 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
android:layout_marginBottom="21dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btn_google"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="54dp"
|
||||
android:layout_marginLeft="42dp"
|
||||
android:layout_marginRight="42dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginLeft="48dp"
|
||||
android:layout_marginRight="48dp"
|
||||
android:background="@drawable/background_fff_d20"
|
||||
android:gravity="center|left">
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="54dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:src="@mipmap/login_google" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="6dp"
|
||||
android:layout_marginLeft="35dp"
|
||||
android:text="@string/user_login_google"
|
||||
android:textColor="@color/black1"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/phonelayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="21dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btn_phone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="54dp"
|
||||
android:layout_marginLeft="48dp"
|
||||
android:layout_marginRight="48dp"
|
||||
android:background="@drawable/background_fff_d20"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:src="@mipmap/entry_phone" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/login_use_phone"
|
||||
android:layout_marginLeft="35dp"
|
||||
android:textColor="@color/black1"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- <RelativeLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
@@ -142,7 +177,7 @@
|
||||
android:layout_marginRight="25dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
<!--<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="12dp"
|
||||
@@ -192,8 +227,7 @@
|
||||
android:layout_height="57dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:src="@mipmap/login_line"
|
||||
android:visibility="gone" />
|
||||
android:src="@mipmap/login_line" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="57dp"
|
||||
@@ -223,7 +257,7 @@
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>-->
|
||||
|
||||
|
||||
<LinearLayout
|
||||
@@ -248,14 +282,14 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="22dp"
|
||||
android:layout_marginBottom="22dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/next_step_is_consent"
|
||||
android:textColor="#ffb1b1b1"
|
||||
android:textColor="#FF999999"
|
||||
android:textSize="10sp" />
|
||||
|
||||
|
||||
@@ -265,7 +299,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="1dp"
|
||||
android:text="@string/user_protocol2"
|
||||
android:textColor="#ffb1b1b1"
|
||||
android:textColor="#FF000000"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
@@ -273,7 +307,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="1dp"
|
||||
android:text="@string/and"
|
||||
android:textColor="#ffb1b1b1"
|
||||
android:textColor="#FF999999"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
@@ -282,7 +316,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="1dp"
|
||||
android:text="@string/privacy_terms"
|
||||
android:textColor="#ffb1b1b1"
|
||||
android:textColor="#FF000000"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -294,8 +328,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="80dp"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="125dp"
|
||||
android:src="@mipmap/white_logo" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -303,7 +336,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
tools:visibility="gone">
|
||||
|
||||
<View
|
||||
android:id="@+id/view2"
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_class_name"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="26dp"
|
||||
android:text="音乐"
|
||||
android:textSize="16sp"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="30dp"
|
||||
android:background="@drawable/bg_main_com_type"
|
||||
android:gravity="center"
|
||||
android:textColor="#FF777777"/>
|
||||
|
||||
android:text="音乐"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13sp" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="135dp"
|
||||
android:orientation="vertical">
|
||||
@@ -25,8 +26,9 @@
|
||||
android:id="@+id/banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginLeft="3dp"
|
||||
|
||||
android:layout_marginBottom="5dp"
|
||||
app:delay_time="3000"
|
||||
app:indicator_drawable_selected="@drawable/bg_home_indicator_selected"
|
||||
app:indicator_drawable_unselected="@drawable/bg_home_indicator_unselected"
|
||||
|
||||