Merge remote-tracking branch 'origin/dev_6.5.5_语聊' into dev_6.5.5_语聊
# Conflicts: # OneToOne/src/main/java/com/shayu/onetoone/activity/login/CompleteActivity.java
This commit is contained in:
commit
ad7ab6bcf2
@ -95,7 +95,7 @@ android {
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
versionCode rootProject.ext.android.otoversionCode
|
||||
versionName rootProject.ext.android.otoversionName
|
||||
versionName rootProject.ext.android.otoversionName+new Date().format("HHmm", TimeZone.getTimeZone("GMT+8"))
|
||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||
@ -170,6 +170,7 @@ dependencies {
|
||||
//common
|
||||
api project(path: ':common')
|
||||
api project(path:':FaceUnity')//新娱美颜
|
||||
api project(path:':Share')
|
||||
|
||||
api project(path:':TabLayout')
|
||||
api project(path:':ViewPager2Delegate')
|
||||
|
@ -96,18 +96,16 @@
|
||||
tools:replace="theme,label,icon,allowBackup">
|
||||
<activity
|
||||
android:name=".activity.login.TagselectionActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.login.TagSelection_Activity"
|
||||
android:exported="false"
|
||||
android:label="@string/title_activity_tag_selection"
|
||||
android:theme="@style/AppTheme" />
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activity.login.CompleteActivity"
|
||||
android:exported="false" />
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activity.LauncherActivity"
|
||||
android:exported="true">
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@ -116,127 +114,150 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.login.EntryActivity"
|
||||
android:exported="true" />
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activity.MainActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:launchMode="singleTask"
|
||||
android:exported="false" />
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activity.message.MsgMoreGreetConfigActivity"
|
||||
android:exported="false" />
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activity.message.ChatActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.login.LoginActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.login.FindPwdActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.login.RegisterActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.WebViewActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.HomepageRankingActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.MyArnActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.DiamondExchangeActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.setting.OneMsgSettActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.ExchangeRecordActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.HomeScreenActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.HomeSearchActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.message.CallVideoActivity"
|
||||
android:hardwareAccelerated="true"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.message.CallAudioActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.MatchingActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.EndCallActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.MyFriendListActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".activity.login.ChooseLabelActivity"
|
||||
android:label="选择标签"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.setting.SettingActivity"
|
||||
android:label="設定"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.user.EditProfileActivity"
|
||||
android:label="编辑资料"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.user.EditNameActivity"
|
||||
android:label="编辑名称"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.user.EditSignActivity"
|
||||
android:label="编辑签名"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.user.AuthActivity"
|
||||
android:label="实名认证"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.user.AuthBloggerActivity"
|
||||
android:label="达人认证"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.user.AuthBloggerInletActivity"
|
||||
android:label="达人认证入口"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.setting.FollowActivity"
|
||||
android:label="达人认证入口"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.setting.ModifyPwdActivity"
|
||||
android:label="修改密码"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".activity.setting.WebViewActivity"
|
||||
android:label="WebView"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
|
35
OneToOne/src/main/assets/Reward_instructions.html
Normal file
35
OneToOne/src/main/assets/Reward_instructions.html
Normal file
@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>本地HTML页面</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>獎勵說明</h1>
|
||||
<p>在您使用平台服務取得和提取收益(包括:互動收益、通話收益)前,您應閱讀並遵守本說明及將來公示的新增的單項說明或規則、操作時的提示以及規則。 我們在此特別提醒您認真閱讀並充分理解本說明,特別是免除或限制我們責任、限制您的權利、規定爭議解決方式的相關條款。 除非您接受本說明,否則您無權使用相關功能。 您一經使用獎勵獲取、收益兌換和提現等相關功能,即視為您已理解並接受本說明。 我們保留根據相關法律規定、主管機關要求、業務開展情況等,對獎勵的領取、兌換、提現規則進行變更、調整、中止或終止的權利,同時也會將變更、調整予以公示並自公示之日起生效。</p>
|
||||
<h1>1、如何獲得獎勵?</h1>
|
||||
|
||||
<h1>A.付費消息:</h1>
|
||||
<p>用戶在以下情況將有機會獲得付費方付費訊息星幣價值的固定比例作為獎勵:</p>
|
||||
<p>(1)系統匹配的會話,不同等級時,低等級用戶為付費方;同等級時,男用戶為付費方(目前等級由低到高分別為:未認證用戶,真人認證用戶,達人認證用戶 )。 系統匹配的會話包括:系統匹配的搭訕/訊息(如紅娘牽線)等; </p>
|
||||
<p>(2)除系統匹配的會話及平台另有規定外,首發訊息的一方為雙方會話關係中的付費方。 首發訊息包含:一鍵搭訕/搭訕/私訊,以及視訊和語音通話;</p>
|
||||
<p>(3)若一方在會話關係中已經被認定為付費方,則系統配對到同一會話關係時,該方仍為付費方; 當用戶收到其他用戶的付費訊息時,達人認證用戶會獲得該部分付費訊息星幣價值的33%作為獎勵(具體獎勵以平台顯示為準);真人認證用戶可以獲得的獎勵為22%; 未認證用戶僅可獲得11%。 我們鼓勵您進行真人認證交友。</p>
|
||||
<h1>B.禮物:</h1>
|
||||
|
||||
<p>1、當用戶收到收益禮物時,達人認證用戶將會獲得該禮物星幣價值的34%作為獎勵;真人認證用戶可以獲得的獎勵為22%;未認證用戶僅可獲得11%。 用戶背包中尚未送出的禮物不能用於提取收益。</p>
|
||||
<p>2、獎勵如何領取? 領取獎勵前,需先進行真人認證,通過認證後,綁定收款方式方可提領。</p>
|
||||
<p>3.最小提現金額? 10美元起提。</p>
|
||||
<p>4.什麼情況下會領取失敗? 用戶的帳號存在異常; 收款方式異常; 平台技術故障; 用戶被其他用戶舉報、受到平台調查或監管部門有特定要求等存在未解決爭議事項;</p>
|
||||
<p>5.領取失敗後,該筆獎勵會到哪裡? 領取失敗會導致該筆獎勵退回,如有疑問,請聯絡客服。</p>
|
||||
<p>6、其他費用 用戶對其收益應依法納稅,其平台收益相關的報稅、稅費及相關責任義務等由用戶與其合作方(公會、靈活用工平台等)約定,與平台方無關。</p>
|
||||
<p>7、其他聲明 用戶瞭解並同意,獎勵規則具體以平台顯示為準。若因平台系統突發故障、第三方軟體服務商故障、駭客攻擊等導致平台顯示及功能故障,平台將在發現後儘快修復,平台無須因此承擔賠償責任。</p>
|
||||
<p>8.無效獎勵 若經平台核查認定您全部或部分獎勵無效時,平台為履行法定義務、配合相關執法部門或履行社會責任等原因,有權自行決策將與上述無效獎勵對應的用戶側消費款項予以退還;您同意支援平台的相應決策,並配合平台要求退還您的相關獎勵或等價金額。 此時,平台有權從您帳號的收益餘額中自行扣除相應金額,若不足以扣除時,您應在平台作出通知後指定週期內按照本公司告知的方式補足。</p>
|
||||
<h1> 無效獎勵包括但不限於您基於以下情形而獲得的對應獎勵:</h1>
|
||||
<p>(1)無民事行為能力人或限制民事行為能力人的使用者打賞或進行其他消費而產生的您的獎勵收益;</p>
|
||||
<p>(2)因您透過違法、違規、違反平台規則或違反公序良俗、誠實信用原則的行為而獲取的獎勵收益;</p>
|
||||
<p>(3)因司法/行政機關要求退還/劃撥的收益(及司法/行政機關要求退還/劃撥用戶消費金額時該等消費金額中對應的您的獎勵收益); </p>
|
||||
<p>(4)使用者使用非法收入、作弊收入或非平台指定方式儲值或消費而產生的您的獎勵收益;</p>
|
||||
<p>(5)用戶依法依規撤銷其消費行為(包括但不限於支付通路退款等)時其相應消費所對應的您的獎勵收益;</p>
|
||||
<p>(6)本公司有權基於平台風控判斷、用戶投訴、行政或司法機關的要求等情形確認您的部分或全部獎勵收益無效。 在您使用平台服務取得和提取收益(包括:互動收益、通話收益)前,您應閱讀並遵守本說明及將來公示的新增的單項說明或規則、操作時的提示以及規則。 我們在此特別提醒您認真閱讀並充分理解本說明,特別是免除或限制我們責任、限制您的權利、規定爭議解決方式的相關條款。 除非您接受本說明,否則您無權使用相關功能。 您一經使用獎勵獲取、收益兌換和提現等相關功能,即視為您已理解並接受本說明。 我們保留根據相關法律規定、主管機關要求、業務開展情況等,對獎勵的領取、兌換、提現規則進行變更、調整、中止或終止的權利,同時也會將變更、調整予以公示並自公示之日起生效。</p>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,11 +1,16 @@
|
||||
package com.shayu.onetoone;
|
||||
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Process;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.facebook.FacebookSdk;
|
||||
import com.shayu.onetoone.activity.fragments.message.ChatMessageFragment;
|
||||
@ -24,6 +29,7 @@ import com.shayu.onetoone.utils.ChatPluginExtensionConfig;
|
||||
import com.shayu.onetoone.utils.NeverCrashUtils;
|
||||
import com.yunbao.common.BuildConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.bean.CrashSaveBean;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendReward;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendRewardProvider;
|
||||
@ -34,9 +40,12 @@ import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.callkit.CallEndMessageItemProvider;
|
||||
import io.rong.imkit.IMCenter;
|
||||
import io.rong.imkit.RongIM;
|
||||
import io.rong.imkit.config.RongConfigCenter;
|
||||
import io.rong.imkit.conversation.extension.RongExtension;
|
||||
@ -47,17 +56,36 @@ import io.rong.imkit.utils.RouteUtils;
|
||||
import io.rong.imkit.widget.adapter.ProviderManager;
|
||||
import io.rong.imlib.IMLibRTCClient;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.InitOption;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.imlib.model.MessageContent;
|
||||
import io.rong.message.CommandMessage;
|
||||
import io.rong.message.TextMessage;
|
||||
|
||||
public class AppContext extends CommonAppContext {
|
||||
private final static List<WeakReference<Activity>> activities = new ArrayList<>();
|
||||
|
||||
public static void exit() {
|
||||
for (WeakReference<Activity> activity : activities) {
|
||||
try {
|
||||
if (activity.get() != null) {
|
||||
activity.get().finish();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
L.setDeBug(true);
|
||||
SpUtil.getInstance();
|
||||
registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks());
|
||||
|
||||
NeverCrashUtils.getInstance()
|
||||
.setDebugMode(BuildConfig.DEBUG)
|
||||
.setMainCrashHandler((t, e) -> {
|
||||
@ -109,7 +137,6 @@ public class AppContext extends CommonAppContext {
|
||||
});
|
||||
|
||||
|
||||
|
||||
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
||||
@Override
|
||||
public boolean onReceived(Message message, int left, boolean hasPackage, boolean offline) {
|
||||
@ -126,9 +153,52 @@ public class AppContext extends CommonAppContext {
|
||||
IMLoginManager.get(this).setLanguage(false);
|
||||
|
||||
|
||||
RongConfigCenter.conversationConfig().replaceMessageProvider(CallEndMessageItemProvider.class,new OTOCallEndMessageItemProvider());
|
||||
RongConfigCenter.conversationConfig().replaceMessageProvider(CallEndMessageItemProvider.class, new OTOCallEndMessageItemProvider());
|
||||
RongExtensionManager.getInstance().setExtensionConfig(new ChatPluginExtensionConfig());
|
||||
|
||||
}
|
||||
|
||||
private static final class AdjustLifecycleCallbacks implements ActivityLifecycleCallbacks {
|
||||
@Override
|
||||
public void onActivityResumed(Activity activity) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(Activity activity) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStopped(@NonNull Activity activity) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle outState) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityDestroyed(@NonNull Activity activity) {
|
||||
for (WeakReference<Activity> reference : activities) {
|
||||
if (reference.get() == activity) {
|
||||
activities.remove(reference);
|
||||
return;
|
||||
}
|
||||
}
|
||||
AppManager.getInstance().removeActivity(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
|
||||
activities.add(new WeakReference<>(activity));
|
||||
CrashSaveBean.getInstance().setActivitySize(activities);
|
||||
AppManager.getInstance().addActivity(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStarted(@NonNull Activity activity) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -173,8 +173,8 @@ public class DiamondExchangeActivity extends AbsOTOActivity {
|
||||
|
||||
private void initData() {
|
||||
|
||||
if (getIntent() != null && getIntent().getBundleExtra("bundle") != null) {
|
||||
type = getIntent().getBundleExtra("bundle").getString("type");
|
||||
if (getIntent() != null && getIntent().getExtras() != null) {
|
||||
type = getIntent().getExtras().getString("type");
|
||||
if (TextUtils.equals(type, "yuanbao")) {
|
||||
title.setText(getString(R.string.my_arnings_exchange_star));
|
||||
} else {
|
||||
|
@ -60,15 +60,11 @@ public class HomeScreenActivity extends AbsOTOActivity {
|
||||
if(auth.equals("all")){
|
||||
auth="0";
|
||||
}
|
||||
if (StringUtil.isEmptyAll(age, auth, sex)) {
|
||||
RouteManager.forwardMainActivity();
|
||||
} else {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("age", age);
|
||||
bundle.putString("sex", sex);
|
||||
bundle.putString("auth", auth);
|
||||
RouteManager.forwardMainActivityForScreen(bundle);
|
||||
}
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("age", age);
|
||||
bundle.putString("sex", sex);
|
||||
bundle.putString("auth", auth);
|
||||
RouteManager.forwardMainActivityForScreen(bundle);
|
||||
});
|
||||
tvSearch.setOnClickListener(v -> {
|
||||
String search = etSearch.getText().toString();
|
||||
|
@ -19,6 +19,7 @@ import com.yunbao.common.adapter.SpaceGridItemDecoration;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -73,9 +74,20 @@ public class HomeSearchActivity extends AbsOTOActivity {
|
||||
recommendList.setAdapter(recommendListAdapter);
|
||||
recommendList.addItemDecoration(new SpaceGridItemDecoration(10));
|
||||
|
||||
refresh.setOnClickListener(v -> refresh());
|
||||
|
||||
searchBtn.setOnClickListener(v -> search(edit.getText().toString()));
|
||||
ViewClicksAntiShake.clicksAntiShake(refresh, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
refresh();
|
||||
}
|
||||
});
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(searchBtn, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
search(edit.getText().toString());
|
||||
}
|
||||
});
|
||||
|
||||
edit.setText(getIntent().getExtras().getString("search"));
|
||||
search(edit.getText().toString());
|
||||
|
@ -13,6 +13,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.angcyo.tablayout.DslTabLayout;
|
||||
import com.angcyo.tablayout.DslTabLayoutConfig;
|
||||
import com.angcyo.tablayout.delegate2.ViewPager2Delegate;
|
||||
import com.shayu.onetoone.AppContext;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.fragments.BaseFragment;
|
||||
@ -32,6 +33,7 @@ import com.shayu.onetoone.manager.CallClientManager;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.manager.SendMessageManager;
|
||||
import com.shayu.onetoone.utils.UserManager;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
@ -171,7 +173,7 @@ public class MainActivity extends AbsOTOActivity {
|
||||
isHome = true;
|
||||
}
|
||||
if (data.getChat() == 0) {
|
||||
isMan = IMLoginManager.get(mContext).getUserInfo().getSex() == 1;
|
||||
isMan = UserManager.getUserBean().getUser().getSex() == 1;
|
||||
}
|
||||
if (!isHome && data.getChat() != 0) {
|
||||
isShow = false;
|
||||
@ -232,9 +234,10 @@ public class MainActivity extends AbsOTOActivity {
|
||||
* 检测用户是否设置个人信息
|
||||
*/
|
||||
private void checkUserInfoIsSet() {
|
||||
OTONetManager.getInstance(mContext).getBaseInfos(true, new com.yunbao.common.http.base.HttpCallback<com.shayu.onetoone.bean.UserBean>() {
|
||||
OTONetManager.getInstance(mContext).getBaseInfos(false, new com.yunbao.common.http.base.HttpCallback<com.shayu.onetoone.bean.UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(com.shayu.onetoone.bean.UserBean data) {
|
||||
UserManager.saveUserBean(mContext,data);
|
||||
if (data.getStatus() == 0) {
|
||||
RouteManager.forwardCompleteActivity();
|
||||
}
|
||||
@ -273,7 +276,11 @@ public class MainActivity extends AbsOTOActivity {
|
||||
|
||||
private void updateUnreadCount(int count) {
|
||||
dslTabLayout.setDrawBadge(count > 0);
|
||||
dslTabLayout.updateTabBadge(2, count + "");
|
||||
if(count>99){
|
||||
dslTabLayout.updateTabBadge(2, "99+");
|
||||
}else {
|
||||
dslTabLayout.updateTabBadge(2, count + "");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -289,7 +296,8 @@ public class MainActivity extends AbsOTOActivity {
|
||||
ToastUtil.show(R.string.main_click_next_exit);
|
||||
return;
|
||||
}
|
||||
super.onBackPressed();
|
||||
//super.onBackPressed();
|
||||
AppContext.exit();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
|
@ -17,6 +17,7 @@ import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.yanzhenjie.recyclerview.SwipeRecyclerView;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.List;
|
||||
@ -87,7 +88,14 @@ public class MyArnActivity extends AbsOTOActivity {
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_DIAMOND_EXCHANGE, bundle);
|
||||
}
|
||||
});
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.info), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
RouteManager.forwardWebViewActivity(WordUtil.getNewString(R.string.my_arnings_reward_description),
|
||||
"file:android_asset/Reward_instructions.html"
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void refreshMyArn() {
|
||||
|
@ -20,18 +20,25 @@ import android.webkit.WebViewClient;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.utils.UserManager;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.AndroidBug5497Workaround;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.JavascriptInterfaceUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.share.ui.InvitePopDialog;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
@Route(path = RouteManager.ACTIVITY_WEB_VIEW)
|
||||
public class WebViewActivity extends AbsOTOActivity {
|
||||
WebView webView;
|
||||
@ -44,6 +51,7 @@ public class WebViewActivity extends AbsOTOActivity {
|
||||
|
||||
@Override
|
||||
protected void main(Bundle savedInstanceState) {
|
||||
Bus.getOn(this);
|
||||
webView = findViewById(R.id.webView);
|
||||
titleString = getIntent().getStringExtra("title");
|
||||
if (!StringUtil.isEmpty(titleString)) {
|
||||
@ -52,6 +60,12 @@ public class WebViewActivity extends AbsOTOActivity {
|
||||
initWebView();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
Bus.getOff(this);
|
||||
}
|
||||
|
||||
private void initWebView() {
|
||||
WebSettings settings = webView.getSettings();
|
||||
settings.setJavaScriptEnabled(true); // 是否开启JS支持
|
||||
@ -68,10 +82,11 @@ public class WebViewActivity extends AbsOTOActivity {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
if (!url.contains("token")) {
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
if (!url.contains("token")&&url.startsWith("http")) {
|
||||
IMLoginModel userInfo = UserManager.getUserBean().getUser();
|
||||
url += "&uid=" + userInfo.getId() + "&token=" + userInfo.getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
}
|
||||
Log.i("WebView",url);
|
||||
webView.loadUrl(url);
|
||||
AndroidBug5497Workaround.assistActivity(this);
|
||||
|
||||
@ -117,4 +132,13 @@ public class WebViewActivity extends AbsOTOActivity {
|
||||
cm.setPrimaryClip(clipData);
|
||||
ToastUtil.show(getString(R.string.copy_success));
|
||||
}
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void event(JavascriptInterfaceEvent event){
|
||||
if(event.getMethod().equals("androidInviteShare")){
|
||||
new InvitePopDialog(mContext)
|
||||
.setTitle("快來認識更多有趣的朋友吧!")
|
||||
.setUrl(event.getData())
|
||||
.showDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.utils.UserManager;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
@ -77,7 +78,7 @@ public class DynamicFragment extends BaseFragment {
|
||||
super.onReceivedHttpError(view, request, errorResponse);
|
||||
}
|
||||
});
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
IMLoginModel userInfo = UserManager.getUserBean().getUser();
|
||||
String url = CommonAppConfig.HOST + "/h5/shequ/index.html#/h5/shequ?stack-key-1=698c5f85%20&uid="
|
||||
+ userInfo.getId() + "&token=" + userInfo.getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
Log.i("Web", url);
|
||||
|
@ -28,12 +28,14 @@ import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.manager.SendMessageManager;
|
||||
import com.shayu.onetoone.utils.UserManager;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
@ -86,39 +88,43 @@ public class FriendsFragment extends BaseFragment {
|
||||
viewPager2.setCurrentItem(0);
|
||||
}
|
||||
|
||||
|
||||
matching.setOnClickListener(v -> {
|
||||
SendMessageManager.matching(new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt("type", ChatActivity.CALL_CHAT_TYPE_MATCH);
|
||||
bundle.putString("data", JSONObject.toJSONString(bean));
|
||||
if (configBean != null) {
|
||||
bundle.putInt("time", configBean.getMateTime());
|
||||
} else {
|
||||
bundle.putInt("time", 5);
|
||||
ViewClicksAntiShake.clicksAntiShake(matching, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
SendMessageManager.matching(new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt("type", ChatActivity.CALL_CHAT_TYPE_MATCH);
|
||||
bundle.putString("data", JSONObject.toJSONString(bean));
|
||||
if (configBean != null) {
|
||||
bundle.putInt("time", configBean.getMateTime());
|
||||
} else {
|
||||
bundle.putInt("time", 5);
|
||||
}
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_MATCHING, bundle);
|
||||
}
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_MATCHING, bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg, SendConsumeBean bean) {
|
||||
super.onError(status, msg, bean);
|
||||
int money = 100;
|
||||
if (configBean != null) {
|
||||
money = configBean.getMatePrice();
|
||||
@Override
|
||||
public void onError(int status, String msg, SendConsumeBean bean) {
|
||||
super.onError(status, msg, bean);
|
||||
if (status == 503) {
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_MATCHING);
|
||||
return;
|
||||
}
|
||||
int money = 100;
|
||||
if (configBean != null) {
|
||||
money = configBean.getMatePrice();
|
||||
}
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.gift_not_money))
|
||||
.setCancelText(WordUtil.getNewString(R.string.dialog_cancel_tip))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_to_money_tip))
|
||||
.showDialog();
|
||||
}
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_video_tips), money))
|
||||
.setCancelText(WordUtil.getNewString(R.string.dialog_cancel_tip))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_to_money_tip))
|
||||
.showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
initMateConfig();
|
||||
}
|
||||
@ -127,7 +133,7 @@ public class FriendsFragment extends BaseFragment {
|
||||
|
||||
private void initMateConfig() {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getMessageConsumeConfig(IMLoginManager.get(mContext).getUserInfo().getId() + "", new HttpCallback<MessageConsumeConfigBean>() {
|
||||
.getMessageConsumeConfig(UserManager.getUserBean().getUser().getId() + "", new HttpCallback<MessageConsumeConfigBean>() {
|
||||
@Override
|
||||
public void onSuccess(MessageConsumeConfigBean data) {
|
||||
configBean = data;
|
||||
|
@ -40,6 +40,7 @@ import com.shayu.onetoone.bean.SlideBean;
|
||||
import com.shayu.onetoone.bean.UserItemBean;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.utils.HtmlUrlUtils;
|
||||
import com.shayu.onetoone.utils.MainHttpConsts;
|
||||
import com.shayu.onetoone.utils.MainHttpUtil;
|
||||
import com.shayu.onetoone.view.CustomMyViewHolder;
|
||||
@ -198,6 +199,9 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
||||
outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 10);
|
||||
}
|
||||
});
|
||||
mAdapter = new MainMeAdapter(mContext, new ArrayList<>());
|
||||
mAdapter.setOnItemClickListener(this);
|
||||
mRecyclerView.setAdapter(mAdapter);
|
||||
redPoint.setVisibility(APKManager.get().getApkVerNew() ? View.GONE : View.VISIBLE);
|
||||
ViewClicksAntiShake.clicksAntiShake(itemView.findViewById(R.id.complete_information), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
@ -320,9 +324,12 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
||||
private void initAuth(AuthBean data) {
|
||||
if (data.getName_auth() == 2) {
|
||||
authStatus.setVisibility(View.VISIBLE);
|
||||
mName.setMaxEms(4);
|
||||
} else {
|
||||
authStatus.setVisibility(View.GONE);
|
||||
mName.setMaxEms(6);
|
||||
}
|
||||
mName.invalidate();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -331,25 +338,7 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
||||
* @param list
|
||||
*/
|
||||
private void initMenu(List<UserItemBean> list) {
|
||||
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, list);
|
||||
mAdapter.setOnItemClickListener(this);
|
||||
mRecyclerView.setAdapter(mAdapter);
|
||||
} else {
|
||||
mAdapter.setList(list);
|
||||
}
|
||||
}
|
||||
mAdapter.setList(list);
|
||||
}
|
||||
|
||||
|
||||
@ -512,9 +501,15 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
||||
RouteManager.forwardWebViewActivity(bean.getName(), bean.getHref());
|
||||
} else {
|
||||
switch (bean.getId()) {
|
||||
case 2:
|
||||
RouteManager.forwardWebViewActivity(null, HtmlUrlUtils.getPayUrl(mContext,false,HtmlUrlUtils.URL_PAY_COIN));
|
||||
break;
|
||||
case 13:
|
||||
forwardSetting();
|
||||
break;
|
||||
case 14:
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_MY_ARN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -579,13 +574,17 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
||||
} else if (i == R.id.signature) {
|
||||
// mContext.startActivity(new Intent(mContext, EditProfileActivity.class));
|
||||
} else if (i == R.id.lt_star_coin) {
|
||||
RouteManager.forwardWebViewActivity(null, HtmlUrlUtils.getPayUrl(mContext,false,HtmlUrlUtils.URL_PAY_GOLD));
|
||||
// mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 1));
|
||||
// Bundle bundle = new Bundle();
|
||||
// bundle.putString("type", "yuanbao");
|
||||
// RouteManager.forwardActivity(RouteManager.ACTIVITY_DIAMOND_EXCHANGE, bundle);
|
||||
} else if (i == R.id.btn_coin) {
|
||||
// mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 0));
|
||||
RouteManager.forwardWebViewActivity(null, HtmlUrlUtils.getPayUrl(mContext,false,HtmlUrlUtils.URL_PAY_COIN));
|
||||
} else if (i == R.id.btn_gold) {
|
||||
// mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 2));
|
||||
String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=task&a=index";
|
||||
// RewardActivity.forward(mContext, url);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("type", "coin");
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_DIAMOND_EXCHANGE, bundle);
|
||||
} else if (i == R.id.rt_kefu) {
|
||||
//WebViewActivity.forward(mContext, beanKefu.getHref(), false);
|
||||
RouteManager.forwardWebViewActivity(beanKefu.getName(), beanKefu.getHref());
|
||||
@ -702,7 +701,7 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
||||
if (!bean.getSlide_url().equals("")) {
|
||||
Constants.isTitle = true;
|
||||
String url = bean.getSlide_url() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
||||
RouteUtil.forwardCustomerService(url);
|
||||
RouteManager.forwardWebViewActivity("", url);
|
||||
/*if(bean.getSlide_id().equals("95")){
|
||||
RouteUtil.forwardCustomerService(url);
|
||||
}else {
|
||||
|
@ -15,12 +15,15 @@ import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.fragments.BaseFragment;
|
||||
import com.shayu.onetoone.adapter.HomeRankListAdapter;
|
||||
import com.shayu.onetoone.bean.FollowBean;
|
||||
import com.shayu.onetoone.bean.HomeRankBean;
|
||||
import com.shayu.onetoone.listener.OnAppbarListener;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.utils.UserManager;
|
||||
import com.yanzhenjie.recyclerview.SwipeRecyclerView;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -189,12 +192,12 @@ public class HomeRankFragment extends BaseFragment {
|
||||
}
|
||||
|
||||
void setData(HomeRankBean user, int position) {
|
||||
getItem(position,mItem1,mItem2,mItem3).setVisibility(View.VISIBLE);
|
||||
getItem(position,diamond1,diamond2,diamond3).setVisibility(View.VISIBLE);
|
||||
getItem(position, mItem1, mItem2, mItem3).setVisibility(View.VISIBLE);
|
||||
getItem(position, diamond1, diamond2, diamond3).setVisibility(View.VISIBLE);
|
||||
getItem(position, mName1, mName2, mName3).setText(user.getUserNicename());
|
||||
getItem(position, mVotes1, mVotes2, mVotes3).setText(user.getMoney());
|
||||
if (user.isFollow()) {
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setVisibility(View.GONE);
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setVisibility(View.VISIBLE);
|
||||
}
|
||||
@ -215,6 +218,16 @@ public class HomeRankFragment extends BaseFragment {
|
||||
break;
|
||||
}
|
||||
ImgLoader.display(mContext, user.getAvatar(), getItem(position, mAvatar1, mAvatar2, mAvatar3));
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setOnClickListener(v -> {
|
||||
UserManager.follow(mContext, user.getUid(), new OnItemClickListener<FollowBean>() {
|
||||
@Override
|
||||
public void onItemClick(FollowBean bean, int status) {
|
||||
if (status == 0) {
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private <T> T getItem(int position, T... views) {
|
||||
@ -232,7 +245,7 @@ public class HomeRankFragment extends BaseFragment {
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
setVisibility(View.INVISIBLE,-1,mItem1,mItem2,mItem3);
|
||||
setVisibility(View.INVISIBLE, -1, mItem1, mItem2, mItem3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.InputFilter;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@ -23,6 +24,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.FileProvider;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.PermissionUtils;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
@ -46,6 +48,8 @@ import com.shayu.onetoone.manager.CallClientManager;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.manager.SendMessageManager;
|
||||
import com.shayu.onetoone.utils.MsgCheckUtils;
|
||||
import com.shayu.onetoone.utils.UserManager;
|
||||
import com.shayu.onetoone.view.MsgInputPanelForAudio;
|
||||
import com.shayu.onetoone.view.MsgInputPanelForGift;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
@ -60,30 +64,36 @@ import com.yunbao.common.utils.ProcessImageUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.lifecycle.Observer;
|
||||
import io.rong.calllib.RongCallClient;
|
||||
import io.rong.imkit.IMCenter;
|
||||
import io.rong.imkit.config.RongConfigCenter;
|
||||
import io.rong.imkit.conversation.MessageListAdapter;
|
||||
import io.rong.imkit.conversation.extension.InputMode;
|
||||
import io.rong.imkit.conversation.extension.RongExtensionViewModel;
|
||||
import io.rong.imkit.conversation.extension.component.inputpanel.InputPanel;
|
||||
import io.rong.imkit.model.UiMessage;
|
||||
import io.rong.imkit.picture.PictureSelector;
|
||||
import io.rong.imkit.picture.config.PictureMimeType;
|
||||
import io.rong.imkit.picture.entity.LocalMedia;
|
||||
import io.rong.imkit.userinfo.RongUserInfoManager;
|
||||
import io.rong.imlib.IRongCallback;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.imlib.model.UserInfo;
|
||||
import io.rong.message.ImageMessage;
|
||||
import io.rong.message.TextMessage;
|
||||
|
||||
@ -91,6 +101,7 @@ import io.rong.message.TextMessage;
|
||||
* 融云聊天UI
|
||||
*/
|
||||
public class ChatMessageFragment extends AbsConversationFragment {
|
||||
private static WeakReference<UserBean> targetUser;
|
||||
Button mSendBtn;
|
||||
View mInputPanel;
|
||||
View numLayout;
|
||||
@ -114,7 +125,6 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
|
||||
private String token;
|
||||
private static final String TAG = "聊天界面";
|
||||
private MessageConsumeConfigBean configBean;
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
@ -122,6 +132,10 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
Bus.getOff(this);
|
||||
}
|
||||
|
||||
public static UserBean getTargetUser() {
|
||||
return targetUser.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
@ -132,7 +146,6 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
numLayout.setVisibility(View.INVISIBLE);
|
||||
initBtn();
|
||||
initChat();
|
||||
initPriceBean();
|
||||
cameraUtil = new ProcessImageUtil(getActivity(), mContext.getPackageName() + ".fileprovider");
|
||||
|
||||
mRongExtension.setVisibility(View.VISIBLE);
|
||||
@ -156,17 +169,25 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
if (status == OnSendMessageListener.STATUS_NOT_PRICE) {
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_tips), msg))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_apply))
|
||||
.setOnDialogClickListener(new OnDialogClickListener() {
|
||||
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
}
|
||||
}).showDialog();
|
||||
MsgCheckUtils.checkPrice(mContext, targetId, new OnItemClickListener<MessageConsumeConfigBean>() {
|
||||
@Override
|
||||
public void onItemClick(MessageConsumeConfigBean bean, int position) {
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_tips), bean.getPrice()))
|
||||
.setCancelText(WordUtil.getNewString(R.string.dialog_cancel_tip))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_to_money_tip))
|
||||
.setOnDialogClickListener(new OnDialogClickListener() {
|
||||
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
}
|
||||
}).showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
@ -227,6 +248,7 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
call = mInputPanel.getRootView().findViewById(R.id.input_panel_call_btn);
|
||||
gift = mInputPanel.getRootView().findViewById(R.id.input_panel_gift_btn);
|
||||
mEditText = mInputPanel.getRootView().findViewById(R.id.edit_btn);
|
||||
mEditText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(300)});
|
||||
mEmojiToggleBtn = mInputPanel.findViewById(R.id.input_panel_emoji_btn);
|
||||
ImageView mVoiceToggleBtn = (ImageView) mInputPanel.getRootView().findViewById(R.id.input_panel_voice_toggle);
|
||||
assert mVoiceToggleBtn != null;
|
||||
@ -242,14 +264,19 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
}
|
||||
}
|
||||
});
|
||||
this.mExtensionViewModel.getInputModeLiveData().observe(getViewLifecycleOwner(), new Observer<InputMode>() {
|
||||
public void onChanged(InputMode inputMode) {
|
||||
updateViewByInputMode(inputMode);
|
||||
}
|
||||
});
|
||||
mVoiceToggleBtn.setOnClickListener(view -> {
|
||||
mExtensionViewModel.getInputModeLiveData().setValue(InputMode.TextInput);
|
||||
mExtensionViewModel.getInputModeLiveData().setValue(InputMode.NormalMode);
|
||||
giftPanel.hide();
|
||||
audio.show();
|
||||
});
|
||||
|
||||
gift.setOnClickListener(v -> {
|
||||
mExtensionViewModel.getInputModeLiveData().setValue(InputMode.TextInput);
|
||||
mExtensionViewModel.getInputModeLiveData().setValue(InputMode.NormalMode);
|
||||
audio.hide();
|
||||
giftPanel.show();
|
||||
});
|
||||
@ -263,197 +290,211 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
}
|
||||
});
|
||||
|
||||
video.setOnClickListener(v -> {
|
||||
if (call.getTag() != null) {
|
||||
ToastUtil.show(R.string.toast_call_not_unlock);
|
||||
return;
|
||||
}
|
||||
if(CallClientManager.getManager().isCalling()){
|
||||
ToastUtil.show(R.string.now_call_tips);
|
||||
return;
|
||||
}
|
||||
checkAuth(new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
new BottomListDialog(mContext).setSelect(new OnItemClickListener<String>() {
|
||||
@Override
|
||||
public void onItemClick(String bean, int position) {
|
||||
CallClientManager.getManager().checkMoney(targetId, true, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("model", CallClientManager.VIDEO_CALL);
|
||||
bundle.putString("targetId", targetId);
|
||||
bundle.putString("callId", targetId);
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_CALL_VIDEO, bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_video_tips), configBean.getVideoPrice()))
|
||||
.setCancelText(WordUtil.getNewString(R.string.dialog_cancel_tip))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_to_money_tip))
|
||||
.showDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
}).setStrings(Collections.singletonList(String.format(WordUtil.getNewString(R.string.chat_video_tips), configBean.getVideoPrice())))
|
||||
.showDialog();
|
||||
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(video, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (call.getTag() != null) {
|
||||
ToastUtil.show(R.string.toast_call_not_unlock);
|
||||
return;
|
||||
}
|
||||
if (CallClientManager.getManager().isCalling()) {
|
||||
ToastUtil.show(R.string.now_call_tips);
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
if (status == 1) {
|
||||
sendAuthRequest();
|
||||
} else if (!StringUtil.isEmpty(msg)) {
|
||||
ToastUtil.show(msg);
|
||||
MsgCheckUtils.checkAuth(mContext, targetId, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
MsgCheckUtils.checkPrice(mContext, targetId, new OnItemClickListener<MessageConsumeConfigBean>() {
|
||||
@Override
|
||||
public void onItemClick(MessageConsumeConfigBean configBean, int position) {
|
||||
new BottomListDialog(mContext).setSelect(new OnItemClickListener<String>() {
|
||||
@Override
|
||||
public void onItemClick(String bean, int position) {
|
||||
CallClientManager.getManager().checkMoney(targetId, true, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("model", CallClientManager.VIDEO_CALL);
|
||||
bundle.putString("targetId", targetId);
|
||||
bundle.putString("callId", targetId);
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_CALL_VIDEO, bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_video_tips), configBean.getVideoPrice()))
|
||||
.setCancelText(WordUtil.getNewString(R.string.dialog_cancel_tip))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_to_money_tip))
|
||||
.showDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
}).setStrings(Collections.singletonList(String.format(WordUtil.getNewString(R.string.chat_video_tips), configBean.getVideoPrice())))
|
||||
.showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
call.setOnClickListener(v -> {
|
||||
if (call.getTag() != null) {
|
||||
ToastUtil.show(R.string.toast_call_not_unlock);
|
||||
return;
|
||||
}
|
||||
if(CallClientManager.getManager().isCalling() || isFloatWindows()){
|
||||
ToastUtil.show(R.string.now_call_tips);
|
||||
return;
|
||||
}
|
||||
|
||||
checkAuth(new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
new BottomListDialog(mContext).setSelect(new OnItemClickListener<String>() {
|
||||
@Override
|
||||
public void onItemClick(String bean, int position) {
|
||||
CallClientManager.getManager().checkMoney(targetId, false, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("model", CallClientManager.AUDIO_CALL);
|
||||
bundle.putString("targetId", targetId);
|
||||
bundle.putString("callId", targetId);
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_CALL_AUDIO, bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_audio_tips), configBean.getMp3Price()))
|
||||
.setCancelText(WordUtil.getNewString(R.string.dialog_cancel_tip))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_to_money_tip))
|
||||
.showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}).setStrings(Collections.singletonList(String.format(WordUtil.getNewString(R.string.chat_audio_tips), configBean.getMp3Price())))
|
||||
.showDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
if (status == 1) {
|
||||
sendAuthRequest();
|
||||
} else if (!StringUtil.isEmpty(msg)) {
|
||||
ToastUtil.show(msg);
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
if (status == 1) {
|
||||
sendAuthRequest();
|
||||
} else if (!StringUtil.isEmpty(msg)) {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
img.setOnClickListener(v -> {
|
||||
new BottomListDialog(mContext)
|
||||
.setStrings(Arrays.asList(WordUtil.getNewString(R.string.album), WordUtil.getNewString(R.string.camera)))
|
||||
.setSelect(new OnItemClickListener<String>() {
|
||||
@Override
|
||||
public void onItemClick(String bean, int position) {
|
||||
boolean isCamera = position == 1;
|
||||
ViewClicksAntiShake.clicksAntiShake(call, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (call.getTag() != null) {
|
||||
ToastUtil.show(R.string.toast_call_not_unlock);
|
||||
return;
|
||||
}
|
||||
if (CallClientManager.getManager().isCalling() || isFloatWindows()) {
|
||||
ToastUtil.show(R.string.now_call_tips);
|
||||
return;
|
||||
}
|
||||
|
||||
MsgCheckUtils.checkAuth(mContext, targetId, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
MsgCheckUtils.checkPrice(mContext, targetId, new OnItemClickListener<MessageConsumeConfigBean>() {
|
||||
@Override
|
||||
public void onItemClick(MessageConsumeConfigBean configBean, int position) {
|
||||
new BottomListDialog(mContext).setSelect(new OnItemClickListener<String>() {
|
||||
@Override
|
||||
public void onItemClick(String bean, int position) {
|
||||
CallClientManager.getManager().checkMoney(targetId, false, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("model", CallClientManager.AUDIO_CALL);
|
||||
bundle.putString("targetId", targetId);
|
||||
bundle.putString("callId", targetId);
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_CALL_AUDIO, bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_audio_tips), configBean.getMp3Price()))
|
||||
.setCancelText(WordUtil.getNewString(R.string.dialog_cancel_tip))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_to_money_tip))
|
||||
.showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}).setStrings(Collections.singletonList(String.format(WordUtil.getNewString(R.string.chat_audio_tips), configBean.getMp3Price())))
|
||||
.showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
if (status == 1) {
|
||||
sendAuthRequest();
|
||||
} else if (!StringUtil.isEmpty(msg)) {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(img, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new BottomListDialog(mContext)
|
||||
.setStrings(Arrays.asList(WordUtil.getNewString(R.string.album), WordUtil.getNewString(R.string.camera)))
|
||||
.setSelect(new OnItemClickListener<String>() {
|
||||
@Override
|
||||
public void onItemClick(String bean, int position) {
|
||||
boolean isCamera = position == 1;
|
||||
|
||||
SendMessageManager.sendMessageForText(targetId, WordUtil.getNewString(R.string.photo_info), new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
ChatMessageFragment.this.token = token;
|
||||
if (isCamera) {
|
||||
cameraUtil.getImageByCamera(false);
|
||||
} else {
|
||||
PictureSelector.create(ChatMessageFragment.this)
|
||||
.openGallery(PictureMimeType.ofImage())
|
||||
.loadImageEngine(RongConfigCenter.featureConfig().getKitImageEngine())
|
||||
.setRequestedOrientation(1)
|
||||
.videoDurationLimit(RongIMClient.getInstance().getVideoLimitTime())
|
||||
.maxSelectNum(9)
|
||||
.imageSpanCount(3)
|
||||
.isGif(true)
|
||||
.forResult(110);
|
||||
}
|
||||
|
||||
SendMessageManager.sendMessageForText(targetId, WordUtil.getNewString(R.string.photo_info), new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
ChatMessageFragment.this.token = token;
|
||||
if (isCamera) {
|
||||
cameraUtil.getImageByCamera(false);
|
||||
} else {
|
||||
PictureSelector.create(ChatMessageFragment.this)
|
||||
.openGallery(PictureMimeType.ofImage())
|
||||
.loadImageEngine(RongConfigCenter.featureConfig().getKitImageEngine())
|
||||
.setRequestedOrientation(1)
|
||||
.videoDurationLimit(RongIMClient.getInstance().getVideoLimitTime())
|
||||
.maxSelectNum(9)
|
||||
.imageSpanCount(3)
|
||||
.isGif(true)
|
||||
.forResult(110);
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
MsgCheckUtils.checkPrice(mContext, targetId, new OnItemClickListener<MessageConsumeConfigBean>() {
|
||||
@Override
|
||||
public void onItemClick(MessageConsumeConfigBean bean, int position) {
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_tips), bean.getPrice()))
|
||||
.setCancelText(WordUtil.getNewString(R.string.dialog_cancel_tip))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_to_money_tip))
|
||||
.setOnDialogClickListener(new OnDialogClickListener() {
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_tips), msg))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_apply))
|
||||
.setOnDialogClickListener(new OnDialogClickListener() {
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
}
|
||||
}).showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
}
|
||||
}).showDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
}).showDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
}).showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateViewByInputMode(InputMode inputMode) {
|
||||
if(inputMode==InputMode.TextInput){
|
||||
audio.hide();
|
||||
giftPanel.hide();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isFloatWindows() {
|
||||
return EasyFloat.isShow("call");
|
||||
}
|
||||
|
||||
private void checkAuth(OnSendMessageListener listener) {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getTargetUserInfo(Integer.parseInt(targetId), new HttpCallback<UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(UserBean data) {
|
||||
if (data.getInfo().getName_auth() == 2) {
|
||||
listener.onSuccess("", null);
|
||||
} else if (data.getInfo().getName_auth() == 3) {
|
||||
listener.onError(data.getInfo().getName_auth(), "當前正在審核中,請耐心等待");
|
||||
}
|
||||
AppManager.runDebugCode(()->{
|
||||
listener.onSuccess("", null);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
Log.e(TAG, "onError: " + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void sendAuthRequest() {
|
||||
MessageChatAuthContent content = MessageChatAuthContent.obtain("");
|
||||
@ -601,6 +642,7 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
.getTargetUserInfo(Integer.parseInt(targetId), new HttpCallback<UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(UserBean data) {
|
||||
targetUser = new WeakReference<>(data);
|
||||
ImgLoader.display(mContext, data.getUser().getAvatar(), avatar);
|
||||
uname.setText(data.getUser().getUserNicename());
|
||||
sign.setText(data.getUser().getSignature());
|
||||
@ -609,8 +651,8 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
} else {
|
||||
sex.setImageResource(R.mipmap.ic_message_tab_woman);
|
||||
}
|
||||
System.out.println("同性別:" + data.getUser().getSex() + "|" + IMLoginManager.get(mContext).getUserInfo().getSex());
|
||||
if (data.getUser().getSex() == IMLoginManager.get(mContext).getUserInfo().getSex()) {
|
||||
System.out.println("同性別:" + data.getUser().getSex() + "|" + UserManager.getUserBean().getUser().getSex());
|
||||
if (data.getUser().getSex() == UserManager.getUserBean().getUser().getSex()) {
|
||||
call.setVisibility(View.GONE);
|
||||
video.setVisibility(View.GONE);
|
||||
}
|
||||
@ -632,11 +674,14 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
video.setImageResource(R.mipmap.ic_msg_video_lock);
|
||||
call.setTag("true");
|
||||
}
|
||||
AppManager.runDebugCode(()->{
|
||||
UserInfo info = new UserInfo(data.getUser().getId() + "", data.getUser().getUserNicename(), Uri.parse(data.getUser().getAvatar()));
|
||||
info.setExtra(JSONObject.toJSONString(data));
|
||||
RongUserInfoManager.getInstance().refreshUserInfoCache(info);
|
||||
/* AppManager.runDebugCode(() -> {
|
||||
call.setTag(null);
|
||||
call.setImageResource(R.mipmap.ic_msg_call);
|
||||
video.setImageResource(R.mipmap.ic_msg_video);
|
||||
});
|
||||
});*/
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -653,11 +698,12 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
boolean isTextMessage = data.getMessage().getContent() instanceof TextMessage;
|
||||
String[] list;
|
||||
if (isTextMessage) {
|
||||
if (isMy) {
|
||||
/* if (isMy) {
|
||||
list = new String[]{WordUtil.getNewString(R.string.copy), WordUtil.getNewString(R.string.delete)};
|
||||
} else {
|
||||
list = new String[]{WordUtil.getNewString(R.string.copy)};
|
||||
}
|
||||
}*/
|
||||
list = new String[]{WordUtil.getNewString(R.string.copy), WordUtil.getNewString(R.string.delete)};
|
||||
} else {
|
||||
if (isMy) {
|
||||
list = new String[]{WordUtil.getNewString(R.string.delete)};
|
||||
@ -771,43 +817,28 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
}
|
||||
}
|
||||
|
||||
private void initPriceBean() {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getMessageConsumeConfig(targetId, new HttpCallback<MessageConsumeConfigBean>() {
|
||||
private void showRedPoint() {
|
||||
RongIMClient.getInstance().getUnreadCount(new Conversation.ConversationType[]{Conversation.ConversationType.PRIVATE}
|
||||
, false
|
||||
, new RongIMClient.ResultCallback<Integer>() {
|
||||
@Override
|
||||
public void onSuccess(MessageConsumeConfigBean data) {
|
||||
configBean = data;
|
||||
public void onSuccess(Integer integer) {
|
||||
Integer tmp = integer + MsgMessageFragment.systemPoint;
|
||||
if (tmp <= 0) {
|
||||
numLayout.setVisibility(View.INVISIBLE);
|
||||
return;
|
||||
}
|
||||
numLayout.setVisibility(View.VISIBLE);
|
||||
num.setText(tmp + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showRedPoint() {
|
||||
RongIMClient.getInstance().getUnreadCount(new Conversation.ConversationType[]{Conversation.ConversationType.PRIVATE}
|
||||
,false
|
||||
,new RongIMClient.ResultCallback<Integer>() {
|
||||
@Override
|
||||
public void onSuccess(Integer integer) {
|
||||
Integer tmp = integer + MsgMessageFragment.systemPoint;
|
||||
if (tmp <= 0) {
|
||||
numLayout.setVisibility(View.INVISIBLE);
|
||||
return;
|
||||
}
|
||||
numLayout.setVisibility(View.VISIBLE);
|
||||
num.setText(tmp + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void moneyEvent(MoneyUpdateEvent event) {
|
||||
if (giftPanel != null) {
|
||||
|
@ -59,6 +59,7 @@ public class MsgFriendFragment extends BaseFragment implements BaseAdapter.OnIte
|
||||
SmartRefreshLayout mRefreshLayout;
|
||||
MsgMessageRecyclerViewAdapter mAdapter;
|
||||
List<BaseUiConversation> list;
|
||||
List<HomeItemBean> itemBeans;
|
||||
private int page = 1;
|
||||
private static final String TAG = MsgFriendFragment.class.getName();
|
||||
|
||||
@ -98,7 +99,6 @@ public class MsgFriendFragment extends BaseFragment implements BaseAdapter.OnIte
|
||||
mList.setLayoutManager(layoutManager);
|
||||
mList.setAdapter(this.mAdapter);
|
||||
initRefreshView();
|
||||
initData();
|
||||
|
||||
}
|
||||
|
||||
@ -114,6 +114,7 @@ public class MsgFriendFragment extends BaseFragment implements BaseAdapter.OnIte
|
||||
});
|
||||
this.mRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
page++;
|
||||
initData();
|
||||
}
|
||||
});
|
||||
@ -145,7 +146,6 @@ public class MsgFriendFragment extends BaseFragment implements BaseAdapter.OnIte
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getFriends(page, new HttpCallback<List<HomeItemBean>>() {
|
||||
@Override
|
||||
@ -153,6 +153,7 @@ public class MsgFriendFragment extends BaseFragment implements BaseAdapter.OnIte
|
||||
if (page == 1) {
|
||||
list.clear();
|
||||
}
|
||||
itemBeans=data;
|
||||
if (data.isEmpty()) {
|
||||
mAdapter.setDataCollection(list);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
@ -160,9 +161,7 @@ public class MsgFriendFragment extends BaseFragment implements BaseAdapter.OnIte
|
||||
mRefreshLayout.finishLoadMore();
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
getNewData(data.get(i), i == data.size() - 1);
|
||||
}
|
||||
getNewData(data);
|
||||
|
||||
}
|
||||
|
||||
@ -171,37 +170,47 @@ public class MsgFriendFragment extends BaseFragment implements BaseAdapter.OnIte
|
||||
|
||||
}
|
||||
|
||||
public synchronized void getNewData(HomeItemBean item, boolean over) {
|
||||
RongIMClient.getInstance().getConversation(Conversation.ConversationType.PRIVATE, item.getId() + "", new RongIMClient.ResultCallback<Conversation>() {
|
||||
@Override
|
||||
public void onSuccess(Conversation conversation) {
|
||||
if(conversation==null){
|
||||
conversation=new Conversation();
|
||||
}
|
||||
SingleConversation singleConversation = new SingleConversation(mContext, conversation);
|
||||
if (StringUtil.isEmpty(singleConversation.mConversationContent.toString())) {
|
||||
singleConversation.mConversationContent = new SpannableString("你们什么都没聊");
|
||||
}
|
||||
list.add(singleConversation);
|
||||
if (over) {
|
||||
mAdapter.setDataCollection(list);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mRefreshLayout.finishRefresh();
|
||||
mRefreshLayout.finishLoadMore();
|
||||
page++;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void getNewData(List<HomeItemBean> data) {
|
||||
if(data==null){
|
||||
page=1;
|
||||
initData();
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
HomeItemBean item = data.get(i);
|
||||
boolean over = i == data.size() - 1;
|
||||
RongIMClient.getInstance().getConversation(Conversation.ConversationType.PRIVATE, item.getId() + "", new RongIMClient.ResultCallback<Conversation>() {
|
||||
@Override
|
||||
public void onSuccess(Conversation conversation) {
|
||||
if (conversation == null) {
|
||||
conversation = new Conversation();
|
||||
}
|
||||
SingleConversation singleConversation = new SingleConversation(mContext, conversation);
|
||||
if (StringUtil.isEmpty(singleConversation.mConversationContent.toString())) {
|
||||
singleConversation.mConversationContent = new SpannableString("你们什么都没聊");
|
||||
}
|
||||
list.add(singleConversation);
|
||||
if (over) {
|
||||
mAdapter.setDataCollection(list);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mRefreshLayout.finishRefresh();
|
||||
mRefreshLayout.finishLoadMore();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(View view, ViewHolder holder, int position) {
|
||||
if (position >= 0 && position < this.mAdapter.getData().size()) {
|
||||
@ -232,8 +241,9 @@ public class MsgFriendFragment extends BaseFragment implements BaseAdapter.OnIte
|
||||
@Subscribe
|
||||
public void event(MessageMsgBusEvent event) {
|
||||
if (event.getType() == MessageMsgBusEvent.TYPE_UPDATE_POINT) {
|
||||
page = 1;
|
||||
initData();
|
||||
/* page = 1;
|
||||
initData();*/
|
||||
getNewData(itemBeans);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +87,8 @@ public class ChooseLabelActivity extends AbsOTOActivity {
|
||||
if (isUserHome) {
|
||||
next.setVisibility(View.GONE);
|
||||
getUserLabel();
|
||||
|
||||
}else{
|
||||
findViewById(R.id.btn_back).setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.ProcessImageUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Calendar;
|
||||
@ -206,9 +207,9 @@ public class CompleteActivity extends AbsOTOActivity {
|
||||
pvTime.show();
|
||||
}
|
||||
});
|
||||
btnRegister.setOnClickListener(new View.OnClickListener() {
|
||||
ViewClicksAntiShake.clicksAntiShake(btnRegister, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
public void onViewClicks() {
|
||||
if (StringUtils.isEmpty(userNickName.getText().toString())) {
|
||||
Toast.makeText(mContext, WordUtil.getNewString(R.string.nickname_hint), Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
@ -229,7 +230,7 @@ public class CompleteActivity extends AbsOTOActivity {
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
Toast.makeText(mContext, error, Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -58,6 +58,7 @@ import com.shayu.onetoone.bean.JoinAnchorBean;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.utils.UserManager;
|
||||
import com.twitter.sdk.android.core.Callback;
|
||||
import com.twitter.sdk.android.core.DefaultLogger;
|
||||
import com.twitter.sdk.android.core.Result;
|
||||
@ -612,6 +613,7 @@ public class EntryActivity extends AbsOTOActivity {
|
||||
.getBaseInfos(true,new HttpCallback<UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(UserBean data) {
|
||||
UserManager.saveUserBean(mContext,data);
|
||||
if (mFirstLogin) {
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY) {
|
||||
RouteManager.forwardMainActivity();
|
||||
|
@ -3,6 +3,7 @@ package com.shayu.onetoone.activity.message;
|
||||
import android.Manifest;
|
||||
import android.app.Dialog;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.SurfaceView;
|
||||
import android.view.View;
|
||||
@ -13,6 +14,10 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import io.rong.callkit.util.CallRingingUtil;
|
||||
import io.rong.callkit.util.RingingMode;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
@ -36,6 +41,7 @@ import com.shayu.onetoone.manager.CallClientManager;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.utils.ConversationUtils;
|
||||
import com.shayu.onetoone.utils.HtmlUrlUtils;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
@ -43,10 +49,12 @@ import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
|
||||
@Route(path = RouteManager.ACTIVITY_CALL_AUDIO)
|
||||
public class CallAudioActivity extends AbsOTOActivity implements View.OnClickListener {
|
||||
private static final String TAG = "语音通话";
|
||||
private ImageView vague;
|
||||
private ImageView close;
|
||||
private ImageView avatar;
|
||||
@ -85,7 +93,7 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
model = bundle.getString("model");
|
||||
initView();
|
||||
onCallStatusListener = new CallStatusListener();
|
||||
CallClientManager.getManager().addOnVoIPCallListener(CallAudioActivity.class,onCallStatusListener);
|
||||
CallClientManager.getManager().addOnVoIPCallListener(CallAudioActivity.class, onCallStatusListener);
|
||||
initTargetData();
|
||||
if (model.equals(CallClientManager.VIDEO_FLOAT)) {
|
||||
EasyFloat.dismiss("call");
|
||||
@ -94,7 +102,7 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
gift.setVisibility(View.VISIBLE);
|
||||
money.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if(!com.blankj.utilcode.util.PermissionUtils.isGranted(Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO)) {
|
||||
if (!com.blankj.utilcode.util.PermissionUtils.isGranted(Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO)) {
|
||||
com.blankj.utilcode.util.PermissionUtils.permission(Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO).callback(new com.blankj.utilcode.util.PermissionUtils.SimpleCallback() {
|
||||
@Override
|
||||
public void onGranted() {
|
||||
@ -116,12 +124,17 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
CallClientManager.getManager().callAudio(targetId);
|
||||
callMsg.setTag(true);
|
||||
callMsg.setImageResource(R.mipmap.ic_call_audio_msg);
|
||||
CallRingingUtil.getInstance().startRinging(this, RingingMode.Outgoing);
|
||||
}else if(model.equals(CallClientManager.AUDIO_RECEIVED_CALL)){
|
||||
CallRingingUtil.getInstance().startRinging(this, RingingMode.Incoming);
|
||||
close.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
CallRingingUtil.getInstance().stopRinging();
|
||||
CallClientManager.getManager().removeOnVoIPCallListener(CallAudioActivity.class);
|
||||
}
|
||||
|
||||
@ -190,6 +203,7 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
}
|
||||
|
||||
private void accept() {
|
||||
close.setVisibility(View.VISIBLE);
|
||||
CallClientManager.getManager().acceptCall(targetId);
|
||||
}
|
||||
|
||||
@ -219,7 +233,34 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
});
|
||||
}
|
||||
|
||||
private void showWindow(boolean toChatView) {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
if (model.equals(CallClientManager.AUDIO_FLOAT)) {
|
||||
EasyFloat.getFloatView("call").setOnClickListener(null);
|
||||
//((ViewGroup) EasyFloat.getFloatView("call").getParent()).removeAllViews();
|
||||
EasyFloat.dismiss("call");
|
||||
String sessionId = CallClientManager.getManager().getSessionId();
|
||||
if (StringUtil.isEmpty(sessionId)) {
|
||||
model = CallClientManager.AUDIO_CALL;
|
||||
gift.setVisibility(View.INVISIBLE);
|
||||
money.setVisibility(View.INVISIBLE);
|
||||
return;
|
||||
}
|
||||
if (sessionId.equals(targetId)) {
|
||||
gift.setVisibility(View.INVISIBLE);
|
||||
money.setVisibility(View.INVISIBLE);
|
||||
model = CallClientManager.AUDIO_RECEIVED_CALL;
|
||||
} else {
|
||||
gift.setVisibility(View.VISIBLE);
|
||||
money.setVisibility(View.VISIBLE);
|
||||
model = CallClientManager.AUDIO_CALL;
|
||||
}
|
||||
callMsg.setImageResource(R.mipmap.ic_call_audio_msg);
|
||||
}
|
||||
}
|
||||
|
||||
private void showWindow(boolean toChatView, boolean toPay) {
|
||||
if (!PermissionUtils.checkPermission(this)) {
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.permission_hint))
|
||||
@ -233,7 +274,7 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
@Override
|
||||
public void permissionResult(boolean b) {
|
||||
if (b) {
|
||||
showWindow(toChatView);
|
||||
showWindow(toChatView, toPay);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -247,7 +288,6 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
icon.setTag(getIntent().getExtras());
|
||||
icon.setImageResource(io.rong.callkit.R.drawable.rc_voip_audio_answer_selector_new);
|
||||
icon.setLayoutParams(new ViewGroup.LayoutParams(DpUtil.dp2px(40), DpUtil.dp2px(40)));
|
||||
finish();
|
||||
EasyFloat.with(this)
|
||||
.setLayout(icon)
|
||||
.setShowPattern(ShowPattern.FOREGROUND)
|
||||
@ -264,13 +304,16 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
|
||||
@Override
|
||||
public void show(@NonNull View view) {
|
||||
view.setOnClickListener(v -> {
|
||||
Bundle bundle = (Bundle) v.getTag();
|
||||
bundle.putString("model", CallClientManager.AUDIO_FLOAT);
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_CALL_AUDIO, bundle);
|
||||
ViewClicksAntiShake.clicksAntiShake(view, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
Bundle bundle = (Bundle) view.getTag();
|
||||
bundle.putString("model", CallClientManager.AUDIO_FLOAT);
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_CALL_AUDIO, bundle);
|
||||
}
|
||||
});
|
||||
windowListener = new WindowCallStatusListener();
|
||||
CallClientManager.getManager().addOnVoIPCallListener(EasyFloat.class,windowListener);
|
||||
CallClientManager.getManager().addOnVoIPCallListener(EasyFloat.class, windowListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -298,12 +341,20 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
|
||||
}
|
||||
}).show();
|
||||
finish();
|
||||
if (toPay) {
|
||||
Log.e(TAG, "调起支付界面");
|
||||
// RouteManager.forwardWebViewActivity(null, "https://www.baidu.com");
|
||||
RouteManager.forwardWebViewActivity(null, HtmlUrlUtils.getPayUrl(mContext,false,HtmlUrlUtils.URL_PAY_COIN));
|
||||
}
|
||||
if (toChatView) {
|
||||
ConversationUtils.startConversation(mContext, targetId);
|
||||
}
|
||||
}
|
||||
|
||||
private class CallStatusListener extends OnCallStatusListener {
|
||||
String sessionId;
|
||||
|
||||
@Override
|
||||
public void onCallWait(SurfaceView surfaceView) {
|
||||
tips.setVisibility(View.VISIBLE);
|
||||
@ -312,6 +363,7 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
|
||||
@Override
|
||||
public void onCallStart(String userId, SurfaceView surfaceView) {
|
||||
CallRingingUtil.getInstance().stopRinging();
|
||||
if (model.equals(CallClientManager.AUDIO_RECEIVED_CALL)) {
|
||||
gift.setVisibility(View.INVISIBLE);
|
||||
money.setVisibility(View.INVISIBLE);
|
||||
@ -320,21 +372,24 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
money.setVisibility(View.VISIBLE);
|
||||
}
|
||||
tips.setText(R.string.call_tips2);
|
||||
tips.postDelayed(()->{
|
||||
tips.postDelayed(() -> {
|
||||
tips.setVisibility(View.GONE);
|
||||
},1000);
|
||||
}, 1000);
|
||||
sessionId = CallClientManager.getManager().getSessionId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCallEnd() {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("model", CallClientManager.AUDIO_CALL);
|
||||
bundle.putString("targetId", targetId);
|
||||
bundle.putString("callId", targetId);
|
||||
bundle.putString("user", JSONObject.toJSONString(userData));
|
||||
bundle.putString("time", callTime.getText().toString());
|
||||
bundle.putString("path", RouteManager.ACTIVITY_CALL_AUDIO);
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_END_CALL, bundle);
|
||||
if (sessionId != null && !sessionId.equals(targetId)) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("model", CallClientManager.AUDIO_CALL);
|
||||
bundle.putString("targetId", targetId);
|
||||
bundle.putString("callId", targetId);
|
||||
bundle.putString("user", JSONObject.toJSONString(userData));
|
||||
bundle.putString("time", callTime.getText().toString());
|
||||
bundle.putString("path", RouteManager.ACTIVITY_CALL_AUDIO);
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_END_CALL, bundle);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
@ -346,7 +401,7 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
@Override
|
||||
public void onTime(String time) {
|
||||
super.onTime(time);
|
||||
callTime.setText(WordUtil.getNewString(R.string.call_time)+""+ time);
|
||||
callTime.setText(WordUtil.getNewString(R.string.call_time) + "" + time);
|
||||
}
|
||||
|
||||
|
||||
@ -356,19 +411,28 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
@Override
|
||||
public void onTimeWarning(long msg) {
|
||||
super.onTimeWarning(msg);
|
||||
Log.i(TAG, "通话时间:" + msg);
|
||||
if (tipsView == null) {
|
||||
createShow(msg);
|
||||
} else {
|
||||
if (msg <= 0) {
|
||||
Log.i(TAG, "时间不够,挂断");
|
||||
CallClientManager.getManager().endCall();
|
||||
return;
|
||||
}
|
||||
tipsDialog.updateTips(String.format(WordUtil.getNewString(R.string.call_tips), msg));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void createShow(long msg) {
|
||||
if (model.equals(CallClientManager.AUDIO_RECEIVED_CALL)||model.equals(CallClientManager.VIDEO_RECEIVED_CALL)) {
|
||||
if (model.equals(CallClientManager.AUDIO_RECEIVED_CALL) || model.equals(CallClientManager.VIDEO_RECEIVED_CALL)) {
|
||||
return;
|
||||
}
|
||||
if(msg<=0){
|
||||
|
||||
if (msg <= 0) {
|
||||
Log.i(TAG, "时间不够,挂断");
|
||||
CallClientManager.getManager().endCall();
|
||||
return;
|
||||
}
|
||||
tipsDialog = new TipsTextDialog(mContext)
|
||||
@ -400,7 +464,7 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
|
||||
@Override
|
||||
public void onCallStart(String userId, SurfaceView surfaceView) {
|
||||
|
||||
CallRingingUtil.getInstance().stopRinging();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -422,16 +486,18 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
v.setTag(true);
|
||||
callMsg.setImageResource(R.mipmap.ic_call_audio_msg);
|
||||
} else {
|
||||
showWindow(true);
|
||||
showWindow(true, false);
|
||||
}
|
||||
} else if (id == R.id.call_stop) {
|
||||
stop();
|
||||
} else if (id == R.id.gift) {
|
||||
showGift();
|
||||
} else if (id == R.id.close) {
|
||||
showWindow(false);
|
||||
showWindow(false, false);
|
||||
} else if (id == R.id.follow) {
|
||||
follow();
|
||||
} else if (id == R.id.money) {
|
||||
showWindow(false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.SurfaceView;
|
||||
@ -42,6 +43,7 @@ import com.shayu.onetoone.manager.CallClientManager;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.utils.ConversationUtils;
|
||||
import com.shayu.onetoone.utils.HtmlUrlUtils;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
@ -49,15 +51,18 @@ import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import io.rong.callkit.util.CallRingingUtil;
|
||||
import io.rong.callkit.util.RingingMode;
|
||||
import io.rong.calllib.RongCallClient;
|
||||
import io.rong.calllib.StartIncomingPreviewCallback;
|
||||
|
||||
@Route(path = RouteManager.ACTIVITY_CALL_VIDEO)
|
||||
public class CallVideoActivity extends AbsOTOActivity {
|
||||
|
||||
private static final String TAG = "视频通话";
|
||||
|
||||
private ViewGroup myView;
|
||||
private ViewGroup targetView;
|
||||
@ -111,7 +116,7 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
model = bundle.getString("model");
|
||||
|
||||
onCallStatusListener = new CallStatusListener();
|
||||
CallClientManager.getManager().addOnVoIPCallListener(CallVideoActivity.class,onCallStatusListener);
|
||||
CallClientManager.getManager().addOnVoIPCallListener(CallVideoActivity.class, onCallStatusListener);
|
||||
|
||||
if (!model.equals(CallClientManager.VIDEO_FLOAT)) {
|
||||
RongCallClient.getInstance()
|
||||
@ -130,7 +135,7 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
});
|
||||
}
|
||||
initButton(buttonView);
|
||||
if(!com.blankj.utilcode.util.PermissionUtils.isGranted(Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO)) {
|
||||
if (!com.blankj.utilcode.util.PermissionUtils.isGranted(Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO)) {
|
||||
com.blankj.utilcode.util.PermissionUtils.permission(Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO).callback(new com.blankj.utilcode.util.PermissionUtils.SimpleCallback() {
|
||||
@Override
|
||||
public void onGranted() {
|
||||
@ -145,12 +150,18 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
finish();
|
||||
}
|
||||
}).request();
|
||||
return;
|
||||
return;
|
||||
}
|
||||
if (!StringUtil.isEmpty(targetId)) {
|
||||
CallClientManager.getManager().callVideo(targetId);
|
||||
initWaitView();
|
||||
}
|
||||
if(model.equals(CallClientManager.VIDEO_RECEIVED_CALL)){
|
||||
CallRingingUtil.getInstance().startRinging(this,RingingMode.Incoming);
|
||||
close.setVisibility(View.GONE);
|
||||
}else if(model.equals(CallClientManager.VIDEO_CALL)){
|
||||
CallRingingUtil.getInstance().startRinging(this, RingingMode.Outgoing);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -167,7 +178,7 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
.postDelayed(() -> {
|
||||
SurfaceView localVideo = CallClientManager.getManager().getLocalVideo();
|
||||
SurfaceView surfaceView = CallClientManager.getManager().getRemoteVideo();
|
||||
if(localVideo.getParent()!=null){
|
||||
if (localVideo.getParent() != null) {
|
||||
((ViewGroup) localVideo.getParent()).removeAllViews();
|
||||
}
|
||||
if (surfaceView != null) {
|
||||
@ -326,12 +337,13 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
|
||||
private void accept() {
|
||||
callLayout.setVisibility(View.GONE);
|
||||
close.setVisibility(View.VISIBLE);
|
||||
CallClientManager.getManager().acceptCall(callId);
|
||||
}
|
||||
|
||||
private void closeCamera() {
|
||||
RongCallClient.getInstance().setEnableLocalVideo(!RongCallClient.getInstance().isLocalVideoEnabled());
|
||||
cameraCloseSwitch.setImageResource(RongCallClient.getInstance().isLocalAudioEnabled() ? R.mipmap.ic_call_video_select : R.mipmap.ic_call_video);
|
||||
cameraCloseSwitch.setImageResource(RongCallClient.getInstance().isLocalVideoEnabled() ? R.mipmap.ic_call_video_select : R.mipmap.ic_call_video);
|
||||
if (RongCallClient.getInstance().isLocalVideoEnabled()) {
|
||||
targetView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
@ -349,7 +361,7 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
micSwitch.setImageResource(!enabled ? R.mipmap.ic_call_audio_select : R.mipmap.ic_call_audio);
|
||||
}
|
||||
|
||||
private void showWindow(boolean toChatView) {
|
||||
private void showWindow(boolean toChatView, boolean toPay) {
|
||||
if (!PermissionUtils.checkPermission(this)) {
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.permission_hint))
|
||||
@ -363,7 +375,7 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
@Override
|
||||
public void permissionResult(boolean b) {
|
||||
if (b) {
|
||||
showWindow(toChatView);
|
||||
showWindow(toChatView, toPay);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -403,13 +415,17 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
|
||||
@Override
|
||||
public void show(@NonNull View view) {
|
||||
view.setOnClickListener(v -> {
|
||||
Bundle bundle = (Bundle) v.getTag();
|
||||
bundle.putString("model", CallClientManager.VIDEO_FLOAT);
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_CALL_VIDEO, bundle);
|
||||
ViewClicksAntiShake.clicksAntiShake(view, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
Bundle bundle = (Bundle) view.getTag();
|
||||
bundle.putString("model", CallClientManager.VIDEO_FLOAT);
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_CALL_VIDEO, bundle);
|
||||
}
|
||||
});
|
||||
windowListener = new WindowCallStatusListener(view);
|
||||
CallClientManager.getManager().addOnVoIPCallListener(EasyFloat.class,windowListener);
|
||||
CallClientManager.getManager().addOnVoIPCallListener(EasyFloat.class, windowListener);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -438,6 +454,9 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
|
||||
}
|
||||
}).show();
|
||||
if (toPay) {
|
||||
RouteManager.forwardWebViewActivity(null, HtmlUrlUtils.getPayUrl(mContext, false, HtmlUrlUtils.URL_PAY_COIN));
|
||||
}
|
||||
if (toChatView) {
|
||||
ConversationUtils.startConversation(mContext, targetId);
|
||||
}
|
||||
@ -489,6 +508,7 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
if (id == R.id.rc_voip_call_answer_btn) {
|
||||
accept();
|
||||
} else if (id == R.id.call_stop || id == R.id.rc_voip_call_hang_up) {
|
||||
CallRingingUtil.getInstance().stopRinging();
|
||||
CallClientManager.getManager().endCall();
|
||||
} else if (id == R.id.gift) {
|
||||
new GiftDialog(mContext)
|
||||
@ -501,11 +521,13 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
} else if (id == R.id.mic_switch) {
|
||||
switchAudio();
|
||||
} else if (id == R.id.close || id == R.id.close1) {
|
||||
showWindow(false);
|
||||
showWindow(false, false);
|
||||
} else if (id == R.id.message) {
|
||||
showWindow(true);
|
||||
showWindow(true, false);
|
||||
} else if (id == R.id.follow) {
|
||||
follow();
|
||||
} else if (id == R.id.money) {
|
||||
showWindow(false, true);
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -524,6 +546,7 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
|
||||
@Override
|
||||
public void onCallStart(String userId, SurfaceView surfaceView) {
|
||||
CallRingingUtil.getInstance().stopRinging();
|
||||
closeWait.setVisibility(View.GONE);
|
||||
initView();
|
||||
initButton(buttonView);
|
||||
@ -537,11 +560,11 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
surfaceView.setZOrderMediaOverlay(false);
|
||||
surfaceView.invalidate();
|
||||
});
|
||||
if(surfaceView.getParent()!=null){
|
||||
((ViewGroup)surfaceView.getParent()).removeAllViews();
|
||||
if (surfaceView.getParent() != null) {
|
||||
((ViewGroup) surfaceView.getParent()).removeAllViews();
|
||||
}
|
||||
if(CallClientManager.getManager().getLocalVideo().getParent()!=null){
|
||||
((ViewGroup)CallClientManager.getManager().getLocalVideo().getParent()).removeAllViews();
|
||||
if (CallClientManager.getManager().getLocalVideo().getParent() != null) {
|
||||
((ViewGroup) CallClientManager.getManager().getLocalVideo().getParent()).removeAllViews();
|
||||
}
|
||||
myView.addView(surfaceView);
|
||||
targetView.removeAllViews();
|
||||
@ -558,7 +581,7 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
//
|
||||
@Override
|
||||
public void onCallEnd() {
|
||||
if (!sessionId.equals(targetId)){
|
||||
if (sessionId != null && !sessionId.equals(targetId)) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("model", CallClientManager.VIDEO_CALL);
|
||||
bundle.putString("targetId", targetId);
|
||||
@ -590,9 +613,15 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
@Override
|
||||
public void onTimeWarning(long msg) {
|
||||
super.onTimeWarning(msg);
|
||||
Log.i(TAG, "通话时间:" + msg);
|
||||
if (tipsView == null) {
|
||||
createShow(msg);
|
||||
} else {
|
||||
if (msg <= 0) {
|
||||
Log.i(TAG, "时间不够,挂断");
|
||||
CallClientManager.getManager().endCall();
|
||||
return;
|
||||
}
|
||||
tipsDialog.updateTips(String.format(WordUtil.getNewString(R.string.call_tips), msg));
|
||||
}
|
||||
|
||||
@ -602,7 +631,9 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
if (model.equals(CallClientManager.VIDEO_RECEIVED_CALL)) {
|
||||
return;
|
||||
}
|
||||
if(msg<=0){
|
||||
if (msg <= 0) {
|
||||
Log.i(TAG, "时间不够,挂断");
|
||||
CallClientManager.getManager().endCall();
|
||||
return;
|
||||
}
|
||||
tipsDialog = new TipsTextDialog(mContext)
|
||||
@ -640,11 +671,12 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
|
||||
@Override
|
||||
public void onCallStart(String userId, SurfaceView surfaceView) {
|
||||
CallRingingUtil.getInstance().stopRinging();
|
||||
Object tag = rootView.getTag();
|
||||
ViewGroup parent = (ViewGroup) rootView.getParent();
|
||||
parent.removeView(rootView);
|
||||
if(surfaceView.getParent()!=null){
|
||||
((ViewGroup)surfaceView.getParent()).removeAllViews();
|
||||
if (surfaceView.getParent() != null) {
|
||||
((ViewGroup) surfaceView.getParent()).removeAllViews();
|
||||
}
|
||||
surfaceView.setLayoutParams(new ViewGroup.LayoutParams(DpUtil.dp2px(114), DpUtil.dp2px(164)));
|
||||
surfaceView.setTag(tag);
|
||||
@ -671,5 +703,10 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
CallClientManager.getManager().removeOnVoIPCallListener(CallVideoActivity.class);
|
||||
CallRingingUtil.getInstance().stopRinging();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.shayu.onetoone.activity.message;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
@ -23,6 +24,7 @@ import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.interfaces.ImageResultCallback;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.ProcessImageUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
@ -46,7 +48,7 @@ public class MsgMoreGreetConfigActivity extends AbsOTOActivity {
|
||||
Button cancel, apply;
|
||||
|
||||
ProcessImageUtil imageUtil;
|
||||
|
||||
Dialog uploadImgDialog;
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_msg_config;
|
||||
@ -55,6 +57,7 @@ public class MsgMoreGreetConfigActivity extends AbsOTOActivity {
|
||||
@Override
|
||||
protected void main(Bundle savedInstanceState) {
|
||||
setTitle(WordUtil.getNewString(R.string.title_greet_config));
|
||||
uploadImgDialog=DialogUitl.loadingDialog(mContext);
|
||||
imageUtil = new ProcessImageUtil(this);
|
||||
recyclerView = findViewById(R.id.msg_recyclerView);
|
||||
msgSwitch = findViewById(R.id.msg_switch);
|
||||
@ -105,13 +108,14 @@ public class MsgMoreGreetConfigActivity extends AbsOTOActivity {
|
||||
|
||||
@Override
|
||||
public void onSuccess(File file) {
|
||||
uploadImgDialog.show();
|
||||
System.out.println("file = " + file.getAbsolutePath());
|
||||
System.out.println("file.exists() = " + file.exists());
|
||||
OTONetManager.getInstance(mContext)
|
||||
.updateFile(file, new HttpCallback<AvatarBean>() {
|
||||
@Override
|
||||
public void onSuccess(AvatarBean data) {
|
||||
System.out.println("头像地址:" + data);
|
||||
System.out.println("头像地址:" + data.getAvatar());
|
||||
OTONetManager.getInstance(mContext)
|
||||
.addMessageMoreGreetConfig(data.getAvatar(), "2", new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
@ -119,18 +123,21 @@ public class MsgMoreGreetConfigActivity extends AbsOTOActivity {
|
||||
if (upload.getCode() == 0) {
|
||||
ImgLoader.display(mContext, data.getAvatar(), (ImageView) findViewById(R.id.imageView5));
|
||||
}
|
||||
uploadImgDialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
uploadImgDialog.dismiss();
|
||||
ToastUtil.showDebug(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
uploadImgDialog.dismiss();
|
||||
ToastUtil.showDebug(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -10,6 +10,8 @@ import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.login.EntryActivity;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.utils.HtmlUrlUtils;
|
||||
import com.shayu.onetoone.utils.UserManager;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
@ -50,7 +52,7 @@ public class SettingActivity extends AbsActivity {
|
||||
@Override
|
||||
protected void main() {
|
||||
setTitle(mContext.getString(R.string.set_up));
|
||||
IMLoginModel model = IMLoginManager.get(mContext).getUserInfo();
|
||||
IMLoginModel model = UserManager.getUserBean().getUser();
|
||||
|
||||
versionCode = findViewById(R.id.versionCode);
|
||||
cacheSize = findViewById(R.id.cacheSize);
|
||||
@ -109,12 +111,30 @@ public class SettingActivity extends AbsActivity {
|
||||
startActivity(new Intent(SettingActivity.this, OneMsgSettActivity.class));
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.qa), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
RouteManager.forwardWebViewActivity(null, HtmlUrlUtils.getQAUrl());
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.user_agreement), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
RouteManager.forwardWebViewActivity(null,HtmlUrlUtils.getUserAgreement());
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.server_agreement), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
RouteManager.forwardWebViewActivity(null,HtmlUrlUtils.getServerAgreement());
|
||||
}
|
||||
});
|
||||
intiData();
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private void intiData() {
|
||||
versionCode.setText(VersionUtil.getVersion());
|
||||
versionCode.setText(VersionUtil.getVersion()+"("+VersionUtil.getVersionCode()+")");
|
||||
cacheSize.setText(GlideCatchUtil.getInstance().getCacheSize());
|
||||
}
|
||||
|
||||
|
@ -20,9 +20,11 @@ import com.sahooz.library.OnPick;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.AuthBean;
|
||||
import com.shayu.onetoone.bean.AvatarBean;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.utils.MainHttpUtil;
|
||||
import com.shayu.onetoone.utils.UserManager;
|
||||
import com.shayu.onetoone.view.UserAvatarPopup;
|
||||
import com.tencent.imsdk.v2.V2TIMCallback;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
@ -32,7 +34,6 @@ import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.activity.WebViewActivity;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.event.UpdateFieldEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
@ -58,11 +59,13 @@ import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import cn.qqtheme.framework.entity.City;
|
||||
import cn.qqtheme.framework.entity.County;
|
||||
import cn.qqtheme.framework.entity.Province;
|
||||
import cn.qqtheme.framework.picker.AddressPicker;
|
||||
import io.rong.imkit.userinfo.db.model.User;
|
||||
|
||||
/**
|
||||
* 我的 编辑资料
|
||||
@ -78,6 +81,7 @@ public class EditProfileActivity extends AbsActivity {
|
||||
private TextView mCity;
|
||||
private TextView tv_bind_phone;
|
||||
private TextView auth_status;
|
||||
private TextView tag;
|
||||
private ProcessImageUtil cameraUtil;
|
||||
private UserBean mUserBean;
|
||||
private String mProvinceVal;
|
||||
@ -109,14 +113,21 @@ public class EditProfileActivity extends AbsActivity {
|
||||
mSex = (TextView) findViewById(R.id.sex);
|
||||
mCity = (TextView) findViewById(R.id.city);
|
||||
tv_bind_phone = (TextView) findViewById(R.id.tv_bind_phone);
|
||||
mUserBean = CommonAppConfig.getInstance().getUserBean();
|
||||
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
|
||||
@Override
|
||||
public void callback(UserBean u) {
|
||||
mUserBean = u;
|
||||
showData(u);
|
||||
}
|
||||
});
|
||||
tag = findViewById(R.id.u_tag);
|
||||
mUserBean = UserManager.getUserBean();
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getBaseInfos(false, new com.yunbao.common.http.base.HttpCallback<UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(UserBean data) {
|
||||
mUserBean = data;
|
||||
showData(mUserBean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
findViewById(R.id.btn_person).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@ -135,10 +146,15 @@ public class EditProfileActivity extends AbsActivity {
|
||||
});
|
||||
}*/
|
||||
initCamera();
|
||||
com.shayu.onetoone.bean.UserBean bean = UserManager.getUserBean();
|
||||
if (bean != null) {
|
||||
tag.setText(bean.getInfo().getCn_label());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void initCamera() {
|
||||
cameraUtil = new ProcessImageUtil(this, getPackageName()+".fileprovider");
|
||||
cameraUtil = new ProcessImageUtil(this, getPackageName() + ".fileprovider");
|
||||
cameraUtil.setImageResultCallback(new ImageResultCallback() {
|
||||
@Override
|
||||
public void beforeCamera() {
|
||||
@ -202,7 +218,7 @@ public class EditProfileActivity extends AbsActivity {
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (userModel.getUserInfoComplete() == 1) {
|
||||
if (userModel.getUser().getUserInfoComplete() == 1) {
|
||||
finish();
|
||||
} else {
|
||||
new XPopup.Builder(mContext).asCustom(new CompleteInformationPopup(mContext, true, new CompleteInformationPopup.CompleteInformationCallBack() {
|
||||
@ -303,15 +319,15 @@ public class EditProfileActivity extends AbsActivity {
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
if (data.getCode() == 0) {
|
||||
ToastUtil.show(data.getMsg());
|
||||
UserBean u = CommonAppConfig.getInstance().getUserBean();
|
||||
UserBean u = UserManager.getUserBean();
|
||||
if (u != null) {
|
||||
u.setLocation(country.name);
|
||||
u.getUser().setLocation(country.name);
|
||||
}
|
||||
if (userModel != null) {
|
||||
userModel.setLocation(country.name);
|
||||
userModel.getUser().setLocation(country.name);
|
||||
showData(userModel);
|
||||
}
|
||||
|
||||
showData(userModel);
|
||||
EventBus.getDefault().post(new UpdateFieldEvent());
|
||||
}
|
||||
}
|
||||
@ -340,13 +356,13 @@ public class EditProfileActivity extends AbsActivity {
|
||||
|
||||
private void editName() {
|
||||
Intent intent = new Intent(mContext, EditNameActivity.class);
|
||||
intent.putExtra(Constants.NICK_NAME, mUserBean.getUserNiceName());
|
||||
intent.putExtra(Constants.NICK_NAME, mUserBean.getUser().getUserNicename());
|
||||
cameraUtil.startActivityForResult(intent, new ActivityResultCallback() {
|
||||
@Override
|
||||
public void onSuccess(Intent intent) {
|
||||
if (intent != null) {
|
||||
String nickName = intent.getStringExtra(Constants.NICK_NAME);
|
||||
mUserBean.setSignature(nickName);
|
||||
mUserBean.getUser().setSignature(nickName);
|
||||
mName.setText(nickName);
|
||||
EventBus.getDefault().post(new UpdateFieldEvent());
|
||||
}
|
||||
@ -422,13 +438,13 @@ public class EditProfileActivity extends AbsActivity {
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent(mContext, EditSignActivity.class);
|
||||
intent.putExtra(Constants.SIGN, mUserBean.getSignature());
|
||||
intent.putExtra(Constants.SIGN, mUserBean.getUser().getSignature());
|
||||
cameraUtil.startActivityForResult(intent, new ActivityResultCallback() {
|
||||
@Override
|
||||
public void onSuccess(Intent intent) {
|
||||
if (intent != null) {
|
||||
String sign = intent.getStringExtra(Constants.SIGN);
|
||||
mUserBean.setSignature(sign);
|
||||
mUserBean.getUser().setSignature(sign);
|
||||
mSign.setText(sign);
|
||||
EventBus.getDefault().post(new UpdateFieldEvent());
|
||||
}
|
||||
@ -447,7 +463,7 @@ public class EditProfileActivity extends AbsActivity {
|
||||
return;
|
||||
}
|
||||
|
||||
String[] times = mUserBean.getBirthday().split("-");
|
||||
String[] times = mUserBean.getUser().getBirthday().split("-");
|
||||
year = Integer.parseInt(times[0]);
|
||||
month = Integer.parseInt(times[1]) - 1;
|
||||
day = Integer.parseInt(times[2]);
|
||||
@ -474,11 +490,11 @@ public class EditProfileActivity extends AbsActivity {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
if (data.getCode() == 0) {
|
||||
mUserBean.setBirthday(strbir);
|
||||
mUserBean.getUser().setBirthday(strbir);
|
||||
mBirthday.setText(strbir);
|
||||
|
||||
if (userModel != null) {
|
||||
userModel.setBirthday(strbir);
|
||||
userModel.getUser().setBirthday(strbir);
|
||||
}
|
||||
|
||||
showData(userModel);
|
||||
@ -535,12 +551,18 @@ public class EditProfileActivity extends AbsActivity {
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onEditProfileEvent(/*EditProfileEvent event*/) {
|
||||
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
|
||||
@Override
|
||||
public void callback(UserBean u) {
|
||||
showData(u);
|
||||
}
|
||||
});
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getBaseInfos(false, new com.yunbao.common.http.base.HttpCallback<UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(UserBean data) {
|
||||
showData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private UserBean userModel;
|
||||
@ -548,13 +570,13 @@ public class EditProfileActivity extends AbsActivity {
|
||||
private void showData(UserBean u) {
|
||||
userModel = u;
|
||||
int index = 0;
|
||||
String birthday = u.getBirthday();
|
||||
String location = u.getLocation();
|
||||
String bindPhone = u.getMobile();
|
||||
String birthday = u.getUser().getBirthday();
|
||||
String location = u.getUser().getLocation();
|
||||
String bindPhone = u.getUser().getMobile();
|
||||
String sex = "";
|
||||
if (u.getSex() == 1) {
|
||||
if (u.getUser().getSex() == 1) {
|
||||
sex = mContext.getString(R.string.sex_male);
|
||||
} else if (u.getSex() == 2) {
|
||||
} else if (u.getUser().getSex() == 2) {
|
||||
sex = mContext.getString(R.string.sex_female);
|
||||
}
|
||||
if (!TextUtils.isEmpty(bindPhone)) {
|
||||
@ -641,21 +663,21 @@ public class EditProfileActivity extends AbsActivity {
|
||||
submit.setTextColor(Color.parseColor("#935902"));
|
||||
submit.setEnabled(true);
|
||||
}*/
|
||||
ImgLoader.displayAvatar(mContext, u.getAvatar(), mAvatar);
|
||||
mName.setText(u.getUserNiceName());
|
||||
mSign.setText(u.getSignature());
|
||||
mBirthday.setText(u.getBirthday());
|
||||
if (u.getSex() == 0) {
|
||||
ImgLoader.displayAvatar(mContext, u.getUser().getAvatar(), mAvatar);
|
||||
mName.setText(u.getUser().getUserNicename());
|
||||
mSign.setText(u.getUser().getSignature());
|
||||
mBirthday.setText(u.getUser().getBirthday());
|
||||
if (u.getUser().getSex() == 0) {
|
||||
mSex.setText("");
|
||||
} else if (u.getSex() == 1) {
|
||||
} else if (u.getUser().getSex() == 1) {
|
||||
mSex.setText(R.string.sex_male);
|
||||
} else if (u.getSex() == 2) {
|
||||
} else if (u.getUser().getSex() == 2) {
|
||||
mSex.setText(R.string.sex_female);
|
||||
}
|
||||
|
||||
mCity.setText(u.getLocation());
|
||||
if ("1".equals(u.getIs_bind())) {
|
||||
mobile = u.getMobile();
|
||||
mCity.setText(u.getUser().getCity());
|
||||
if (u.getUser().getLoginType().equals("phone")) {
|
||||
mobile = u.getUser().getMobile();
|
||||
tv_bind_phone.setText(mobile);
|
||||
isBind = "1";
|
||||
} else {
|
||||
@ -766,9 +788,9 @@ public class EditProfileActivity extends AbsActivity {
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
ToastUtil.show(data.getMsg());
|
||||
if (data.getCode() == 0) {
|
||||
UserBean u = CommonAppConfig.getInstance().getUserBean();
|
||||
UserBean u = UserManager.getUserBean();
|
||||
if (u != null) {
|
||||
u.setLocation(location);
|
||||
u.getUser().setLocation(location);
|
||||
}
|
||||
EventBus.getDefault().post(new UpdateFieldEvent());
|
||||
}
|
||||
@ -789,32 +811,34 @@ public class EditProfileActivity extends AbsActivity {
|
||||
if (Constants.isShowPage != -1) {
|
||||
finish();
|
||||
}
|
||||
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
|
||||
@Override
|
||||
public void callback(UserBean u) {
|
||||
if (u != null && "1".equals(u.getIs_bind())) {
|
||||
mobile = u.getMobile();
|
||||
tv_bind_phone.setText(mobile);
|
||||
isBind = "1";
|
||||
} else {
|
||||
tv_bind_phone.setHint(getResources().getString(R.string.bind_phone_text));
|
||||
isBind = "0";
|
||||
}
|
||||
}
|
||||
});
|
||||
if (mUserBean.getUser().getLoginType().equals("phone")) {
|
||||
mobile = mUserBean.getUser().getMobile();
|
||||
tv_bind_phone.setText(mobile);
|
||||
isBind = "1";
|
||||
} else {
|
||||
tv_bind_phone.setHint(getResources().getString(R.string.bind_phone_text));
|
||||
isBind = "0";
|
||||
}
|
||||
|
||||
// getTaskType();
|
||||
if (isName) {
|
||||
isName = false;
|
||||
MainHttpUtil.getBaseInfo(CommonAppConfig.getInstance().getUid(), CommonAppConfig.getInstance().getToken(), new CommonCallback<UserBean>() {
|
||||
@Override
|
||||
public void callback(UserBean bean) {
|
||||
if (bean != null) {
|
||||
CommonAppConfig.getInstance().setLoginInfo(CommonAppConfig.getInstance().getUid(), CommonAppConfig.getInstance().getToken(), false);
|
||||
mUserBean = CommonAppConfig.getInstance().getUserBean();
|
||||
mName.setText(mUserBean.getUserNiceName());
|
||||
}
|
||||
}
|
||||
});
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getBaseInfos(false, new com.yunbao.common.http.base.HttpCallback<UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(UserBean data) {
|
||||
if (data != null) {
|
||||
CommonAppConfig.getInstance().setLoginInfo(CommonAppConfig.getInstance().getUid(), CommonAppConfig.getInstance().getToken(), false);
|
||||
mUserBean = data;
|
||||
mName.setText(mUserBean.getUser().getUserNicename());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ import com.shayu.onetoone.utils.ConversationUtils;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -113,9 +114,9 @@ public class HomeHotListAdapter extends RecyclerView.Adapter<HomeHotListAdapter.
|
||||
status.setImageResource(R.mipmap.ic_home_hot_status_busy);
|
||||
}
|
||||
ImgLoader.display(mContext, bean.getAvatar(), avatar);
|
||||
itemView.setOnClickListener(new View.OnClickListener() {
|
||||
ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
public void onViewClicks() {
|
||||
if (bean.getIs_accost() == 0) {
|
||||
ConversationUtils.startConversation(mContext, bean.getId() + "");
|
||||
return;
|
||||
@ -143,7 +144,6 @@ public class HomeHotListAdapter extends RecyclerView.Adapter<HomeHotListAdapter.
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
ToastUtil.showDebug("跳充值页面");
|
||||
}
|
||||
})
|
||||
.setCancelText(WordUtil.getNewString(R.string.money_cancel))
|
||||
|
@ -87,12 +87,7 @@ public class HomeRankListAdapter extends RecyclerView.Adapter<HomeRankListAdapte
|
||||
|
||||
private void setData(HomeRankBean bean, int position) {
|
||||
rank.setText(position + 4 + "");
|
||||
|
||||
if (bean.getUserNicename().length() > 5) {
|
||||
user_name.setText(bean.getUserNicename().substring(0, 4) + "...");
|
||||
} else {
|
||||
user_name.setText(bean.getUserNicename());
|
||||
}
|
||||
user_name.setText(bean.getUserNicename());
|
||||
level.setText("Lv." + bean.getLevel());
|
||||
money.setText(bean.getMoney());
|
||||
|
||||
@ -102,7 +97,7 @@ public class HomeRankListAdapter extends RecyclerView.Adapter<HomeRankListAdapte
|
||||
sex.setImageResource(R.mipmap.ic_message_tab_woman);
|
||||
}
|
||||
if (bean.isFollow()) {
|
||||
follow.setVisibility(View.GONE);
|
||||
follow.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
follow.setVisibility(View.VISIBLE);
|
||||
}
|
||||
@ -115,7 +110,7 @@ public class HomeRankListAdapter extends RecyclerView.Adapter<HomeRankListAdapte
|
||||
@Override
|
||||
public void onSuccess(FollowBean data) {
|
||||
ToastUtil.show(WordUtil.getNewString(R.string.system_tip_success));
|
||||
v.setVisibility(View.GONE);
|
||||
v.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -28,6 +28,7 @@ import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -75,6 +76,7 @@ public class HomeRecommendListAdapter extends RecyclerView.Adapter<HomeRecommend
|
||||
private ImageView auth;
|
||||
private TextView star;
|
||||
private TextView sign;
|
||||
private TextView level;
|
||||
private LinearLayout tagLayout;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
@ -87,12 +89,14 @@ public class HomeRecommendListAdapter extends RecyclerView.Adapter<HomeRecommend
|
||||
tagLayout = itemView.findViewById(R.id.user_tag_layout);
|
||||
sign = itemView.findViewById(R.id.user_sign);
|
||||
auth = itemView.findViewById(R.id.auth);
|
||||
level = itemView.findViewById(R.id.level);
|
||||
}
|
||||
|
||||
private void setData(HomeItemBean itemBean, int position) {
|
||||
star.setText(itemBean.getStar() + "·" + itemBean.getStar_name());
|
||||
sign.setText(itemBean.getSignature());
|
||||
userName.setText(itemBean.getUser_nicename());
|
||||
level.setText("Lv."+itemBean.getLevel());
|
||||
tagLayout.removeAllViews();
|
||||
if (WordUtil.isNewZh()) {
|
||||
addTag(itemBean.getCn_label());
|
||||
@ -115,9 +119,9 @@ public class HomeRecommendListAdapter extends RecyclerView.Adapter<HomeRecommend
|
||||
chat.setImageResource(R.mipmap.ic_home_recommend_chat);
|
||||
}
|
||||
ImgLoader.display(mContext, itemBean.getAvatar(), avatar);
|
||||
chat.setOnClickListener(new View.OnClickListener() {
|
||||
ViewClicksAntiShake.clicksAntiShake(chat, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
public void onViewClicks() {
|
||||
if (itemBean.getIs_accost() == 0) {
|
||||
ConversationUtils.startConversation(mContext, itemBean.getId() + "");
|
||||
return;
|
||||
@ -145,7 +149,6 @@ public class HomeRecommendListAdapter extends RecyclerView.Adapter<HomeRecommend
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
ToastUtil.showDebug("跳充值页面");
|
||||
}
|
||||
})
|
||||
.showDialog();
|
||||
|
@ -58,24 +58,8 @@ public class MainMeAdapter extends RecyclerView.Adapter<MainMeAdapter.Vh> {
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
mList = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
@ -44,7 +44,7 @@ public class MessageInteractionConversationListAdapter extends MessageListAdapte
|
||||
holder.setText(R.id.text, bean.getUser_nicename());
|
||||
holder.setText(R.id.time, new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault()).format(new Date(bean.getAddtime() * 1000)));
|
||||
ImgLoader.display(holder.getContext(), bean.getAvatar(), holder.getView(R.id.ico));
|
||||
ImgLoader.display(holder.getContext(), bean.getAvatar(), holder.getView(R.id.img_item_interaction));
|
||||
//ImgLoader.display(holder.getContext(), bean.getAvatar(), holder.getView(R.id.img_item_interaction));//右侧头像
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.shayu.onetoone.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.Editable;
|
||||
import android.text.InputFilter;
|
||||
import android.text.TextWatcher;
|
||||
@ -19,6 +21,7 @@ import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.GreetBean;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -30,13 +33,20 @@ public class MsgGreetConfigAdapter extends RecyclerView.Adapter<MsgGreetConfigAd
|
||||
List<GreetBean> mList;
|
||||
Context mContext;
|
||||
OnItemClickListener<GreetBean> deleteListener;
|
||||
Handler handler;
|
||||
public static final String TAG="打招呼列表";
|
||||
|
||||
public MsgGreetConfigAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
this.mList = new ArrayList<>();
|
||||
handler = new Handler(Looper.getMainLooper());
|
||||
}
|
||||
|
||||
public void setList(List<GreetBean> mList) {
|
||||
if (mList.isEmpty()) {
|
||||
GreetBean bean = new GreetBean();
|
||||
mList.add(bean);
|
||||
}
|
||||
this.mList = mList;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
@ -84,6 +94,10 @@ public class MsgGreetConfigAdapter extends RecyclerView.Adapter<MsgGreetConfigAd
|
||||
public void clear() {
|
||||
mList.clear();
|
||||
notifyDataSetChanged();
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
mList.add(new GreetBean());
|
||||
notifyDataSetChanged();
|
||||
}, 300);
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
@ -101,15 +115,21 @@ public class MsgGreetConfigAdapter extends RecyclerView.Adapter<MsgGreetConfigAd
|
||||
}
|
||||
|
||||
public void setData(GreetBean bean, int position) {
|
||||
editText.clearFocus();
|
||||
del.setOnClickListener(v -> {
|
||||
mList.get(position).setContent(editText.getText().toString());
|
||||
editText.setEnabled(false);
|
||||
mList.remove(position);
|
||||
if (deleteListener != null) {
|
||||
deleteListener.onItemClick(bean, mList.size());
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
handler.postDelayed(() -> {
|
||||
editText.setEnabled(false);
|
||||
mList.remove(position);
|
||||
if (deleteListener != null) {
|
||||
deleteListener.onItemClick(bean, mList.size());
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}, 50);
|
||||
|
||||
|
||||
});
|
||||
Log.i(TAG, position+"|"+bean.getContent()+"||"+mList.size());
|
||||
edit.setOnClickListener(v -> {
|
||||
mList.get(position).setEdit(true);
|
||||
editText.setEnabled(true);
|
||||
@ -118,6 +138,7 @@ public class MsgGreetConfigAdapter extends RecyclerView.Adapter<MsgGreetConfigAd
|
||||
if (bean.getContent() == null) {
|
||||
editText.setEnabled(true);
|
||||
editText.setText("");
|
||||
editText.requestFocus();
|
||||
} else {
|
||||
editText.setText(bean.getContent());
|
||||
editText.setEnabled(false);
|
||||
@ -126,9 +147,10 @@ public class MsgGreetConfigAdapter extends RecyclerView.Adapter<MsgGreetConfigAd
|
||||
editText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
if (!hasFocus && editText.getText().toString().length() > 0) {
|
||||
if (!hasFocus && editText.getText().toString().length() > 0 && mList.size() > position) {
|
||||
mList.get(position).setContent(editText.getText().toString());
|
||||
editText.setEnabled(false);
|
||||
Log.d(TAG, "设置文本:"+position+" → "+editText.getText().toString());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -39,7 +39,8 @@ public class MsgMessageRecyclerViewAdapter extends ConversationListAdapter {
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
String targetId = getData().get(position).mCore.getTargetId();
|
||||
BaseUiConversation conversation = getData().get(position);
|
||||
String targetId = conversation.mCore.getTargetId();
|
||||
try {
|
||||
int type = Integer.parseInt(targetId);
|
||||
mList.setSwipeItemMenuEnabled(position, type > 100);
|
||||
@ -47,6 +48,10 @@ public class MsgMessageRecyclerViewAdapter extends ConversationListAdapter {
|
||||
e.printStackTrace();
|
||||
}
|
||||
super.onBindViewHolder(holder, position);
|
||||
if(conversation.mCore.getUnreadMessageCount()>99){
|
||||
holder.setText(R.id.rc_conversation_unread_count,"99+");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -10,10 +10,12 @@ public class SendConsumeBean extends BaseModel {
|
||||
private UserBean mateUser;
|
||||
@SerializedName("vodie_time")
|
||||
private long videoTime;
|
||||
@SerializedName("mp3_time")
|
||||
private long mp3Time;
|
||||
private int code;
|
||||
private String msg;
|
||||
private String accostMsg;
|
||||
private String money;
|
||||
|
||||
public SendConsumeBean() {
|
||||
}
|
||||
@ -73,4 +75,8 @@ public class SendConsumeBean extends BaseModel {
|
||||
public void setProp(PropBean prop) {
|
||||
this.prop = prop;
|
||||
}
|
||||
|
||||
public String getMoney() {
|
||||
return money;
|
||||
}
|
||||
}
|
||||
|
@ -69,12 +69,12 @@ public class UserBean extends BaseModel {
|
||||
private int b_y;
|
||||
private int b_ym;
|
||||
private String b_ymd;
|
||||
private int name_auth;//1 未提交 2 已认证 3已提交
|
||||
private int name_auth;//1 未提交 2 已认证 3已提交 4被驳回
|
||||
private long name_auth_time;
|
||||
private String auth_front;
|
||||
private String auth_back;
|
||||
private String auth_remark;
|
||||
private int sage_auth;
|
||||
private int sage_auth;//1 未提交 2 已认证 3已提交 4被驳回
|
||||
private long sage_auth_time;
|
||||
private int is_hot;
|
||||
private String vodie_price;
|
||||
|
@ -18,6 +18,7 @@ import com.shayu.onetoone.bean.SendConsumeBean;
|
||||
import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.SendMessageManager;
|
||||
import com.shayu.onetoone.utils.UserManager;
|
||||
import com.shayu.onetoone.view.MsgInputPanelForGift;
|
||||
import com.shayu.onetoone.widget.PagerConfig;
|
||||
import com.shayu.onetoone.widget.PagerGridLayoutManager;
|
||||
@ -107,7 +108,7 @@ public class GiftDialog extends AbsDialogPopupWindow {
|
||||
}
|
||||
|
||||
private void sendGift(GiftBean item) {
|
||||
MessageChatGiftContent bean = MessageChatGiftContent.obtain(JSONObject.toJSONString(item), "1", IMLoginManager.get(mContext).getUserInfo().getId() + "");
|
||||
MessageChatGiftContent bean = MessageChatGiftContent.obtain(JSONObject.toJSONString(item), "1", UserManager.getUserBean().getUser().getId() + "");
|
||||
bean.setExtra(JSONObject.toJSONString(item));
|
||||
IMCenter.getInstance().sendMessage(Message.obtain(targetId, Conversation.ConversationType.PRIVATE, bean),
|
||||
null,
|
||||
|
@ -7,8 +7,12 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.AttachPopupView;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.shayu.onetoone.event.MessageMsgBusEvent;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.utils.UserManager;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
|
||||
/**
|
||||
@ -33,6 +37,10 @@ public class MsgMoreDialog extends AttachPopupView implements View.OnClickListen
|
||||
read = findViewById(R.id.ll_read);
|
||||
config.setOnClickListener(this);
|
||||
read.setOnClickListener(this);
|
||||
UserBean bean = UserManager.getUserBean();
|
||||
if (bean.getInfo().getSage_auth()!=2) {
|
||||
// config.setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -11,8 +11,11 @@ import androidx.annotation.NonNull;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.listener.OnDialogClickListener;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.utils.HtmlUrlUtils;
|
||||
import com.yunbao.common.dialog.AbsDialogCenterPopupWindow;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
public class TipsDialog extends AbsDialogCenterPopupWindow {
|
||||
private String title, content;
|
||||
@ -107,6 +110,11 @@ public class TipsDialog extends AbsDialogCenterPopupWindow {
|
||||
dismiss();
|
||||
});
|
||||
mApply.setOnClickListener(v -> {
|
||||
if (!StringUtil.isEmpty(applyText)&&(
|
||||
applyText.equals(WordUtil.getNewString(R.string.money_apply))
|
||||
|| applyText.equals(WordUtil.getNewString(R.string.dialog_to_money_tip)))) {
|
||||
RouteManager.forwardWebViewActivity(null, HtmlUrlUtils.getPayUrl(mContext, false, HtmlUrlUtils.URL_PAY_COIN));
|
||||
}
|
||||
if (onDialogClickListener != null) {
|
||||
onDialogClickListener.onApply(dialog);
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.SurfaceView;
|
||||
|
||||
import com.blankj.utilcode.util.PermissionUtils;
|
||||
@ -28,6 +29,8 @@ import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import io.rong.callkit.util.CallKitUtils;
|
||||
import io.rong.callkit.util.CallRingingUtil;
|
||||
import io.rong.callkit.util.RingingMode;
|
||||
import io.rong.calllib.CallUserProfile;
|
||||
import io.rong.calllib.IRongCallListener;
|
||||
import io.rong.calllib.IRongReceivedCallListener;
|
||||
@ -42,6 +45,7 @@ import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
|
||||
public class CallClientManager {
|
||||
public static final String TAG="拨打控制器";
|
||||
public static final String VIDEO_RECEIVED_CALL = "receivedVideoCall";//接听
|
||||
public static final String VIDEO_CALL = "callVideo";//拨打
|
||||
public static final String VIDEO_FLOAT = "videoFloatWindow";//浮窗
|
||||
@ -50,7 +54,7 @@ public class CallClientManager {
|
||||
public static final String AUDIO_FLOAT = "audioFloatWindow";//浮窗
|
||||
private static CallClientManager manager;
|
||||
private SurfaceView localVideo, remoteVideo;
|
||||
private Map<Class,OnCallStatusListener> listeners;
|
||||
private Map<Class, OnCallStatusListener> listeners;
|
||||
private CallTimeTask timeTask = null;
|
||||
|
||||
public static CallClientManager getManager() {
|
||||
@ -84,8 +88,8 @@ public class CallClientManager {
|
||||
RongCallClient.setReceivedCallListener(new CallMeListener());
|
||||
}
|
||||
|
||||
public void addOnVoIPCallListener(Class zlass,OnCallStatusListener statusListener) {
|
||||
listeners.put(zlass,statusListener);
|
||||
public void addOnVoIPCallListener(Class zlass, OnCallStatusListener statusListener) {
|
||||
listeners.put(zlass, statusListener);
|
||||
RongCallClient.getInstance().setVoIPCallListener(new CallStatusListener(new OnCallStatusListener() {
|
||||
@Override
|
||||
public void onCallWait(SurfaceView localVideo) {
|
||||
@ -96,7 +100,7 @@ public class CallClientManager {
|
||||
|
||||
@Override
|
||||
public void onCallStart(String userId, SurfaceView remoteVideo) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onCallStart(userId, remoteVideo);
|
||||
}
|
||||
startTimer(null);
|
||||
@ -104,7 +108,7 @@ public class CallClientManager {
|
||||
|
||||
@Override
|
||||
public void onCallEnd() {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onCallEnd();
|
||||
}
|
||||
endTimer();
|
||||
@ -112,7 +116,7 @@ public class CallClientManager {
|
||||
|
||||
@Override
|
||||
public void onStartFirstFrame() {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onStartFirstFrame();
|
||||
}
|
||||
}
|
||||
@ -147,17 +151,18 @@ public class CallClientManager {
|
||||
}
|
||||
|
||||
public void callVideo(String targetId) {
|
||||
|
||||
RongCallClient.getInstance().setVoIPCallListener(new CallStatusListener(new OnCallStatusListener() {
|
||||
@Override
|
||||
public void onCallWait(SurfaceView localVideo) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onCallWait(localVideo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCallStart(String userId, SurfaceView remoteVideo) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onCallStart(userId, remoteVideo);
|
||||
}
|
||||
startTimer(targetId);
|
||||
@ -165,7 +170,7 @@ public class CallClientManager {
|
||||
|
||||
@Override
|
||||
public void onCallEnd() {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onCallEnd();
|
||||
}
|
||||
endTimer();
|
||||
@ -173,7 +178,7 @@ public class CallClientManager {
|
||||
|
||||
@Override
|
||||
public void onStartFirstFrame() {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onStartFirstFrame();
|
||||
}
|
||||
}
|
||||
@ -187,14 +192,14 @@ public class CallClientManager {
|
||||
RongCallClient.getInstance().setVoIPCallListener(new CallStatusListener(new OnCallStatusListener() {
|
||||
@Override
|
||||
public void onCallWait(SurfaceView localVideo) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onCallWait(localVideo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCallStart(String userId, SurfaceView remoteVideo) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onCallStart(userId, remoteVideo);
|
||||
}
|
||||
startTimer(targetId);
|
||||
@ -202,7 +207,7 @@ public class CallClientManager {
|
||||
|
||||
@Override
|
||||
public void onCallEnd() {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onCallEnd();
|
||||
}
|
||||
endTimer();
|
||||
@ -210,7 +215,7 @@ public class CallClientManager {
|
||||
|
||||
@Override
|
||||
public void onStartFirstFrame() {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onStartFirstFrame();
|
||||
}
|
||||
}
|
||||
@ -244,7 +249,7 @@ public class CallClientManager {
|
||||
|
||||
public String getSessionId() {
|
||||
RongCallSession callSession = RongCallClient.getInstance().getCallSession();
|
||||
if(callSession==null){
|
||||
if (callSession == null) {
|
||||
return "";
|
||||
}
|
||||
return callSession.getCallerUserId();
|
||||
@ -256,7 +261,7 @@ public class CallClientManager {
|
||||
private String targetId;
|
||||
private String sessionId;
|
||||
private boolean isCallVideo = false;
|
||||
long warningTime;
|
||||
long warningTime=-999;
|
||||
long activeTime;
|
||||
|
||||
public CallTimeTask(String targetId) {
|
||||
@ -265,7 +270,8 @@ public class CallClientManager {
|
||||
|
||||
@Override
|
||||
public boolean cancel() {
|
||||
if (sessionId.equals(targetId)) {
|
||||
long id = IMLoginManager.get(CommonAppContext.sInstance).getUserInfo().getId();
|
||||
if (sessionId.equals(targetId) || !sessionId.equals(id + "")) {
|
||||
System.err.println("接听方不计费 结束");
|
||||
return super.cancel();
|
||||
}
|
||||
@ -309,9 +315,9 @@ public class CallClientManager {
|
||||
extra = String.format(Locale.ROOT, "%02d:%02d", (time % 3600) / 60, (time % 60));
|
||||
}
|
||||
handler.post(() -> {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onTime(extra);
|
||||
if (warningTime <= 60) {
|
||||
if (warningTime!=-999 && warningTime <= 60) {
|
||||
listener.onTimeWarning(warningTime--);
|
||||
}
|
||||
}
|
||||
@ -354,8 +360,8 @@ public class CallClientManager {
|
||||
} else {
|
||||
warningTime = bean.getMp3Time();
|
||||
}
|
||||
if (warningTime <= 60) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
if (warningTime!=-999 && warningTime <= 60) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onTimeWarning(warningTime);
|
||||
}
|
||||
}
|
||||
@ -365,7 +371,7 @@ public class CallClientManager {
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
if (status == OnSendMessageListener.STATUS_NOT_PRICE) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onErrorNotPrice(msg);
|
||||
}
|
||||
endCall();
|
||||
@ -553,12 +559,12 @@ public class CallClientManager {
|
||||
* 如果对端调用{@link RongCallClient#startCall(int, boolean, Conversation.ConversationType, String, List, List, RongCallCommon.CallMediaType, String, StartCameraCallback)} 或
|
||||
* {@link RongCallClient#acceptCall(String, int, boolean, StartCameraCallback)}开始的音视频通话,则可以使用如下设置改变对端视频流的镜像显示:<br />
|
||||
* <pre class="prettyprint">
|
||||
* public void onRemoteUserJoined(String userId, RongCallCommon.CallMediaType mediaType, int userType, SurfaceView remoteVideo) {
|
||||
* if (null != remoteVideo) {
|
||||
* ((RongRTCVideoView) remoteVideo).setMirror( boolean);//观看对方视频流是否镜像处理
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
* public void onRemoteUserJoined(String userId, RongCallCommon.CallMediaType mediaType, int userType, SurfaceView remoteVideo) {
|
||||
* if (null != remoteVideo) {
|
||||
* ((RongRTCVideoView) remoteVideo).setMirror( boolean);//观看对方视频流是否镜像处理
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
@Override
|
||||
public void onRemoteUserJoined(String userId, RongCallCommon.CallMediaType mediaType, int userType, SurfaceView remoteVideo) {
|
||||
@ -604,7 +610,7 @@ public class CallClientManager {
|
||||
|
||||
@Override
|
||||
public void onError(RongCallCommon.CallErrorCode errorCode) {
|
||||
System.out.println("CallStatusListener.onError");
|
||||
Log.e(TAG,"CallStatusListener.onError "+errorCode);
|
||||
if (statusListener != null) {
|
||||
statusListener.onCallEnd();
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ import com.shayu.onetoone.bean.TargetUserInfoBean;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.shayu.onetoone.bean.UserItemBean;
|
||||
import com.shayu.onetoone.network.API;
|
||||
import com.shayu.onetoone.utils.UserManager;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
@ -42,6 +43,7 @@ import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.MD5Util;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
@ -118,6 +120,7 @@ public class OTONetManager {
|
||||
UserInfo info = new UserInfo(userInfo.getId() + "", userInfo.getUserNicename(), Uri.parse(userInfo.getAvatar()));
|
||||
info.setExtra(JSONObject.toJSONString(userInfo));
|
||||
RongUserInfoManager.getInstance().refreshUserInfoCache(info);
|
||||
UserManager.saveUserBean(mContext, liveGiftBeanResponseModel.getData().getInfo());
|
||||
callback.onSuccess(liveGiftBeanResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
@ -391,7 +394,7 @@ public class OTONetManager {
|
||||
|
||||
public void updateFile(File file, HttpCallback<AvatarBean> callback) {
|
||||
MultipartBody.Part uploadFile = createUploadFile(file);
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
IMLoginModel userInfo = UserManager.getUserBean().getUser();
|
||||
API.get().otoApi(mContext)
|
||||
.updateFile(uploadFile, userInfo.getId() + "", userInfo.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
@ -438,6 +441,10 @@ public class OTONetManager {
|
||||
}
|
||||
|
||||
public void getTargetUserInfoList(List<Integer> ids, HttpCallback<List<TargetUserInfoBean>> callback) {
|
||||
if (ids.isEmpty()) {
|
||||
callback.onSuccess(new ArrayList<>());
|
||||
return;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (Integer id : ids) {
|
||||
sb.append(id).append(",");
|
||||
@ -599,6 +606,45 @@ public class OTONetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void sendMessageBefore(String tuid,
|
||||
int type,
|
||||
String giftId,
|
||||
String msg,
|
||||
String time,
|
||||
int online,
|
||||
String method,
|
||||
HttpCallback<SendConsumeBean> callback) {
|
||||
|
||||
API.get().otoApi(mContext)
|
||||
.sendMessageBefore(tuid, type, giftId, msg, time, online, method)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(model -> {
|
||||
if (callback != null) {
|
||||
if (model.isError()) {
|
||||
JSONObject json = JSONObject.parseObject(model.getJsonSrc());
|
||||
SendConsumeBean bean = new SendConsumeBean();
|
||||
bean.setCode(json.getJSONObject("data").getInteger("code"));
|
||||
bean.setMsg(json.getJSONObject("data").getString("msg"));
|
||||
callback.onSuccess(bean);
|
||||
return;
|
||||
}
|
||||
SendConsumeBean bean = model.getData().getInfo();
|
||||
bean.setCode(model.getData().getCode());
|
||||
bean.setMsg(model.getData().getMsg());
|
||||
callback.onSuccess(bean);
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
Log.e(TAG, "accept: ", throwable);
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getMessageConsumeConfig(String toUid, HttpCallback<MessageConsumeConfigBean> callback) {
|
||||
|
||||
API.get().otoApi(mContext)
|
||||
@ -897,6 +943,7 @@ public class OTONetManager {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<LabelBean>> objectResponseModel) throws Exception {
|
||||
if (objectResponseModel.getData().getCode() == 0) {
|
||||
UserManager.saveUserTag(objectResponseModel.getData().getInfo());
|
||||
callback.onSuccess(objectResponseModel.getData().getInfo());
|
||||
} else {
|
||||
callback.onError(objectResponseModel.getData().getMsg());
|
||||
@ -1166,7 +1213,7 @@ public class OTONetManager {
|
||||
|
||||
public void getFriendAppMoneySum(HttpCallback<FriendAppMoneySumModel> callback) {
|
||||
API.get().otoApi(mContext).
|
||||
getFriendAppMoneySum()
|
||||
getFriendAppMoneySum(3, 1)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<FriendAppMoneySumModel>>() {
|
||||
|
@ -126,5 +126,4 @@ public class RouteManager {
|
||||
ARouter.getInstance().build(path).withSerializable("data", serializable).navigation();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.shayu.onetoone.bean.PurseBean;
|
||||
import com.shayu.onetoone.bean.SendConsumeBean;
|
||||
import com.shayu.onetoone.event.MoneyUpdateEvent;
|
||||
import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||
import com.shayu.onetoone.utils.UserManager;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
@ -72,6 +73,10 @@ public class SendMessageManager {
|
||||
}
|
||||
|
||||
public static void pingVideoMessage(String toUid, String time, OnSendMessageListener listener) {
|
||||
if ("0".equals(time)) {
|
||||
listener.onError(504,"时间错误");
|
||||
return;
|
||||
}
|
||||
SendData sendData = new SendData(toUid,
|
||||
2,
|
||||
"not",
|
||||
@ -123,6 +128,45 @@ public class SendMessageManager {
|
||||
}
|
||||
|
||||
private static void send(SendData sendData, OnSendMessageListener messageListener) {
|
||||
if(sendData.method.equals("before")){
|
||||
OTONetManager.getInstance(null)
|
||||
.sendMessageBefore(sendData.toUid,
|
||||
sendData.type,
|
||||
sendData.giftId,
|
||||
sendData.content,
|
||||
sendData.time,
|
||||
sendData.online,
|
||||
sendData.method,
|
||||
new HttpCallback<SendConsumeBean>() {
|
||||
@Override
|
||||
public void onSuccess(SendConsumeBean consumeBean) {
|
||||
if (consumeBean.getCode() != 0) {
|
||||
if (consumeBean.getCode() == 503 || consumeBean.getCode()==500) {
|
||||
messageListener.onError(OnSendMessageListener.STATUS_NOT_PRICE, consumeBean.getMsg(), consumeBean);
|
||||
} else {
|
||||
messageListener.onError(OnSendMessageListener.STATUS_ERROR, consumeBean.getMsg(), consumeBean);
|
||||
}
|
||||
|
||||
} else {
|
||||
String token = null;
|
||||
if (sendData.needToken) {
|
||||
token = UUID.randomUUID().toString();
|
||||
cache.put(token, sendData);
|
||||
}
|
||||
messageListener.onSuccess(token, consumeBean);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
messageListener.onError(OnSendMessageListener.STATUS_ERROR, error);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
OTONetManager.getInstance(null)
|
||||
.sendMessage(sendData.toUid,
|
||||
sendData.type,
|
||||
@ -135,7 +179,8 @@ public class SendMessageManager {
|
||||
@Override
|
||||
public void onSuccess(SendConsumeBean consumeBean) {
|
||||
if (consumeBean.getCode() != 0) {
|
||||
if (consumeBean.getCode() == 500) {
|
||||
UserManager.saveMoney(consumeBean.getMoney());
|
||||
if (consumeBean.getCode() == 503 || consumeBean.getCode()==500) {
|
||||
messageListener.onError(OnSendMessageListener.STATUS_NOT_PRICE, consumeBean.getMsg(), consumeBean);
|
||||
} else {
|
||||
messageListener.onError(OnSendMessageListener.STATUS_ERROR, consumeBean.getMsg(), consumeBean);
|
||||
@ -175,6 +220,7 @@ public class SendMessageManager {
|
||||
new HttpCallback<SendConsumeBean>() {
|
||||
@Override
|
||||
public void onSuccess(SendConsumeBean sd) {
|
||||
UserManager.saveMoney(sd.getMoney());
|
||||
if (sd.getCode() != 0) {
|
||||
if (listener != null) {
|
||||
listener.onSuccess(sd.getMsg(), sd);
|
||||
@ -185,8 +231,7 @@ public class SendMessageManager {
|
||||
listener.onSuccess(null, sd);
|
||||
}
|
||||
}
|
||||
iniPurse(null);
|
||||
|
||||
Bus.get().post(new MoneyUpdateEvent(MoneyUpdateEvent.TYPE_UPDATE,sd.getMoney()+""));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -147,6 +147,16 @@ public interface OneToOneApi {
|
||||
@Query("online") int online,
|
||||
@Query("method") String method
|
||||
);
|
||||
@GET("/api/public/?service=Friendappmsg.sendBefore")
|
||||
Observable<ResponseModel<SendConsumeBean>> sendMessageBefore(
|
||||
@Query("tuid") String tuid,
|
||||
@Query("type") int type,
|
||||
@Query("gift_id") String giftId,
|
||||
@Query("msg") String msg,
|
||||
@Query("time") String time,
|
||||
@Query("online") int online,
|
||||
@Query("method") String method
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Friendappmsg.getConfig")
|
||||
Observable<ResponseModel<MessageConsumeConfigBean>> getMessageConsumeConfig(@Query("tuid") String toUid);
|
||||
@ -216,10 +226,9 @@ public interface OneToOneApi {
|
||||
/**
|
||||
* 设置标签
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/api/public/?service=Friendappinfos.setLabel")
|
||||
@GET("/api/public/?service=Friendappinfos.setLabel")
|
||||
Observable<ResponseModel<List<BaseModel>>> setLabels(
|
||||
@Field("labels") String avatar
|
||||
@Query("labels") String avatar
|
||||
);
|
||||
|
||||
/**
|
||||
@ -237,7 +246,8 @@ public interface OneToOneApi {
|
||||
*/
|
||||
@GET("/api/public/?service=Friendappmoney.sum")
|
||||
Observable<ResponseModel<FriendAppMoneySumModel>> getFriendAppMoneySum(
|
||||
|
||||
@Query("currency_type")int type,
|
||||
@Query("income")int income
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -12,6 +12,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.GiftBean;
|
||||
import com.shayu.onetoone.bean.MessageChatGiftContent;
|
||||
import com.shayu.onetoone.utils.UserManager;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
@ -59,7 +60,7 @@ public class MessageChatReceiveGiftItemProvider extends BaseMessageItemProvider<
|
||||
ImgLoader.display(mContext, item.getGifticon(), holder.getView(R.id.giftIcon));
|
||||
LinearLayout holderView = holder.getView(R.id.layout_root);
|
||||
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
if (messageChatGiftContent.getSendUid().equals(IMLoginManager.get(mContext).getUserInfo().getId() + "")) {
|
||||
if (messageChatGiftContent.getSendUid().equals(UserManager.getUserBean().getUser().getId() + "")) {
|
||||
params.gravity = Gravity.END;
|
||||
uiMessage.setMessageDirection(Message.MessageDirection.SEND);
|
||||
holder.setText(R.id.title, WordUtil.getNewString(R.string.gift_send_ta));
|
||||
|
@ -10,7 +10,9 @@ import android.text.SpannableString;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.fragments.message.ChatMessageFragment;
|
||||
import com.shayu.onetoone.bean.MessageChatAuthContent;
|
||||
import com.shayu.onetoone.bean.SendConsumeBean;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
@ -20,8 +22,10 @@ import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||
import com.shayu.onetoone.manager.CallClientManager;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.utils.MsgCheckUtils;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.Collections;
|
||||
@ -45,6 +49,8 @@ import io.rong.imlib.model.MessageContent;
|
||||
|
||||
public class OTOCallEndMessageItemProvider extends CallEndMessageItemProvider {
|
||||
|
||||
long clickTimer;
|
||||
|
||||
@Override
|
||||
protected boolean onItemClick(
|
||||
ViewHolder holder,
|
||||
@ -82,9 +88,26 @@ public class OTOCallEndMessageItemProvider extends CallEndMessageItemProvider {
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
if(EasyFloat.isShow("call")){
|
||||
Toast.makeText(
|
||||
context,
|
||||
"正在通话中,请不要重复发起通话",
|
||||
Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
if (System.currentTimeMillis() - clickTimer < 600) {
|
||||
return true;
|
||||
}
|
||||
clickTimer = System.currentTimeMillis();
|
||||
if (ChatMessageFragment.getTargetUser() != null) {
|
||||
if (ChatMessageFragment.getTargetUser().getGiftNum() == 0) {
|
||||
ToastUtil.show(R.string.toast_call_not_unlock);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
checkAuth(uiMessage.getMessage().getTargetId(), new OnSendMessageListener() {
|
||||
MsgCheckUtils.checkAuth(context, uiMessage.getMessage().getTargetId(), new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
@ -130,24 +153,6 @@ public class OTOCallEndMessageItemProvider extends CallEndMessageItemProvider {
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAuth(String targetId, OnSendMessageListener listener) {
|
||||
OTONetManager.getInstance(null)
|
||||
.getTargetUserInfo(Integer.parseInt(targetId), new HttpCallback<UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(UserBean data) {
|
||||
if (data.getInfo().getName_auth() == 1) {
|
||||
listener.onError(0, "");
|
||||
} else {
|
||||
listener.onSuccess("", null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
Log.e(TAG, "onError: " + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void sendAuthRequest(String targetId) {
|
||||
MessageChatAuthContent content = MessageChatAuthContent.obtain("");
|
||||
|
@ -0,0 +1,91 @@
|
||||
package com.shayu.onetoone.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class HtmlUrlUtils {
|
||||
public static final int URL_PAY_COIN = 0;
|
||||
public static final int URL_PAY_GOLD = 1;
|
||||
public static final int URL_PAY_BEAN = 2;
|
||||
|
||||
/**
|
||||
* 获取支付链接
|
||||
*
|
||||
* @param isFirst 是否为首充
|
||||
* @param type 类型 URL_PAY_COIN/URL_PAY_GOLD/URL_PAY_BEAN
|
||||
*/
|
||||
public static String getPayUrl(Context mContext, boolean isFirst, int type) {
|
||||
if (isFirst) {
|
||||
Log.i("tss", "首充");
|
||||
if (!CommonAppConfig.IS_GOOGLE_PLAY) {
|
||||
switch (type) {
|
||||
case URL_PAY_COIN:
|
||||
return CommonAppConfig.HOST + "/index.php?g=Appapi&first_page=1&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
case URL_PAY_GOLD:
|
||||
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
case URL_PAY_BEAN:
|
||||
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
}
|
||||
} else {
|
||||
switch (type) {
|
||||
case URL_PAY_COIN:
|
||||
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
case URL_PAY_GOLD:
|
||||
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=googlepaygole&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
case URL_PAY_BEAN:
|
||||
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!CommonAppConfig.IS_GOOGLE_PLAY) {
|
||||
Log.i("tss", "不是首充");
|
||||
//链接版本
|
||||
switch (type) {
|
||||
case URL_PAY_COIN:
|
||||
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
case URL_PAY_GOLD:
|
||||
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
case URL_PAY_BEAN:
|
||||
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
}
|
||||
} else {
|
||||
switch (type) {
|
||||
case URL_PAY_COIN:
|
||||
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
case URL_PAY_GOLD:
|
||||
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaygole&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
case URL_PAY_BEAN:
|
||||
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getQAUrl() {
|
||||
return CommonAppConfig.HOST + "/h5/FAQ/index.html?t=1";
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户协议
|
||||
*/
|
||||
public static String getUserAgreement() {
|
||||
return CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=59";
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务协议
|
||||
*/
|
||||
public static String getServerAgreement() {
|
||||
return CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=668";
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.shayu.onetoone.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
|
||||
public class MsgCheckUtils {
|
||||
public static void checkPrice(Context mContext,String targetId,OnItemClickListener<MessageConsumeConfigBean> listener) {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getMessageConsumeConfig(targetId, new HttpCallback<MessageConsumeConfigBean>() {
|
||||
@Override
|
||||
public void onSuccess(MessageConsumeConfigBean data) {
|
||||
listener.onItemClick(data, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
public static void checkAuth(Context mContext,String targetId,OnSendMessageListener listener) {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getTargetUserInfo(Integer.parseInt(targetId), new HttpCallback<UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(UserBean data) {
|
||||
if (data.getInfo().getName_auth() == 2) {
|
||||
listener.onSuccess("", null);
|
||||
} else if (data.getInfo().getName_auth() == 3) {
|
||||
listener.onError(data.getInfo().getName_auth(), "當前正在審核中,請耐心等待");
|
||||
}else {
|
||||
listener.onError(data.getInfo().getName_auth(), "");
|
||||
}
|
||||
AppManager.runDebugCode(() -> {
|
||||
listener.onSuccess("", null);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
Log.e("ChatAuth", "onError: " + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
114
OneToOne/src/main/java/com/shayu/onetoone/utils/UserManager.java
Normal file
114
OneToOne/src/main/java/com/shayu/onetoone/utils/UserManager.java
Normal file
@ -0,0 +1,114 @@
|
||||
package com.shayu.onetoone.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.FollowBean;
|
||||
import com.shayu.onetoone.bean.LabelBean;
|
||||
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
||||
import com.shayu.onetoone.bean.PurseBean;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.shayu.onetoone.listener.OnDialogClickListener;
|
||||
import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class UserManager {
|
||||
public static UserBean userBean;
|
||||
|
||||
public static UserBean getUserBean() {
|
||||
if (userBean == null) {
|
||||
userBean = JSONObject.parseObject(SpUtil.getStringValue("oto_user_info"), UserBean.class);
|
||||
}
|
||||
System.out.println("读取用户信息+" + userBean);
|
||||
return userBean;
|
||||
}
|
||||
|
||||
public static void saveUserBean(Context mContext, UserBean bean) {
|
||||
userBean = bean;
|
||||
if(StringUtil.isEmpty(bean.getUser().getTokenRong())){
|
||||
IMLoginModel model = IMLoginManager.get(mContext).getUserInfo();;
|
||||
bean.getUser().setTokenRong(model.getTokenRong());
|
||||
bean.getUser().setToken(model.getToken());
|
||||
}
|
||||
System.out.println("保存用户信息" + JSONObject.toJSONString(bean));
|
||||
IMLoginManager.get(mContext).setupLoginUser(bean.getUser());
|
||||
SpUtil.setStringValue("oto_user_info", JSONObject.toJSONString(bean));
|
||||
}
|
||||
|
||||
public static void follow(Context mContext, String userId, OnItemClickListener<FollowBean> listener) {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.follow(userId + "", new HttpCallback<FollowBean>() {
|
||||
@Override
|
||||
public void onSuccess(FollowBean data) {
|
||||
ToastUtil.show(WordUtil.getNewString(R.string.system_tip_success));
|
||||
if (listener != null) {
|
||||
listener.onItemClick(data, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (listener != null) {
|
||||
listener.onItemClick(null, -1);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void saveMoney(String money) {
|
||||
if (StringUtil.isEmpty(money)) {
|
||||
return;
|
||||
}
|
||||
SpUtil.setStringValue("oto_user_money", money);
|
||||
}
|
||||
|
||||
public static void getMoney(Context mContext, String targetId, OnItemClickListener<String> listener) {
|
||||
String money = SpUtil.getStringValue("oto_user_money");
|
||||
if (StringUtil.isEmpty(money)) {
|
||||
money = null;
|
||||
}
|
||||
if (money == null) {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getPurseInfo(new HttpCallback<PurseBean>() {
|
||||
@Override
|
||||
public void onSuccess(PurseBean data) {
|
||||
listener.onItemClick(data.getStart() + "", 0);
|
||||
saveMoney(data.getStart() + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
listener.onItemClick(money, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public static void saveUserTag(List<LabelBean> info) {
|
||||
SpUtil.setStringValue("oto_user_info_tag", JSONArray.toJSONString(info));
|
||||
}
|
||||
|
||||
public static List<LabelBean> getUserTag() {
|
||||
String info = SpUtil.getStringValue("oto_user_info_tag");
|
||||
if (StringUtil.isEmpty(info)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return JSONArray.parseArray(info, LabelBean.class);
|
||||
}
|
||||
}
|
@ -13,11 +13,14 @@ import android.widget.Toast;
|
||||
|
||||
import com.blankj.utilcode.util.PermissionUtils;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
||||
import com.shayu.onetoone.bean.SendConsumeBean;
|
||||
import com.shayu.onetoone.dialog.TipsDialog;
|
||||
import com.shayu.onetoone.listener.OnDialogClickListener;
|
||||
import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||
import com.shayu.onetoone.manager.SendMessageManager;
|
||||
import com.shayu.onetoone.utils.MsgCheckUtils;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
@ -143,16 +146,24 @@ public class MsgInputPanelForAudio extends AbsInputPanel {
|
||||
AudioRecordManager.getInstance().stopRecord();
|
||||
isAudio = false;
|
||||
mUpDirection = false;
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_text_tips), msg))
|
||||
.setOnDialogClickListener(new OnDialogClickListener() {
|
||||
MsgCheckUtils.checkPrice(mContext, targetId, new OnItemClickListener<MessageConsumeConfigBean>() {
|
||||
@Override
|
||||
public void onItemClick(MessageConsumeConfigBean bean, int position) {
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_text_tips), bean.getPrice()))
|
||||
.setCancelText(WordUtil.getNewString(R.string.dialog_cancel_tip))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_to_money_tip))
|
||||
.setOnDialogClickListener(new OnDialogClickListener() {
|
||||
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
}
|
||||
}).showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
}
|
||||
}).showDialog();
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ import com.shayu.onetoone.listener.OnDialogClickListener;
|
||||
import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.SendMessageManager;
|
||||
import com.shayu.onetoone.utils.UserManager;
|
||||
import com.shayu.onetoone.widget.PagerConfig;
|
||||
import com.shayu.onetoone.widget.PagerGridLayoutManager;
|
||||
import com.shayu.onetoone.widget.PagerGridSnapHelper;
|
||||
@ -104,7 +105,6 @@ public class MsgInputPanelForGift extends AbsInputPanel {
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
ToastUtil.showDebug("沒有H5頁面!");
|
||||
}
|
||||
})
|
||||
.showDialog();
|
||||
@ -114,7 +114,7 @@ public class MsgInputPanelForGift extends AbsInputPanel {
|
||||
}
|
||||
|
||||
private void sendGift(GiftBean item) {
|
||||
MessageChatGiftContent bean = MessageChatGiftContent.obtain(JSONObject.toJSONString(item), "1", IMLoginManager.get(mContext).getUserInfo().getId() + "");
|
||||
MessageChatGiftContent bean = MessageChatGiftContent.obtain(JSONObject.toJSONString(item), "1", UserManager.getUserBean().getUser().getId() + "");
|
||||
bean.setExtra(JSONObject.toJSONString(item));
|
||||
IMCenter.getInstance().sendMessage(Message.obtain(targetId, Conversation.ConversationType.PRIVATE, bean),
|
||||
null,
|
||||
@ -161,10 +161,10 @@ public class MsgInputPanelForGift extends AbsInputPanel {
|
||||
|
||||
}
|
||||
});
|
||||
SendMessageManager.iniPurse(new OnItemClickListener<PurseBean>() {
|
||||
UserManager.getMoney(mContext, targetId, new OnItemClickListener<String>() {
|
||||
@Override
|
||||
public void onItemClick(PurseBean bean, int position) {
|
||||
money.setText(bean.getStart());
|
||||
public void onItemClick(String bean, int position) {
|
||||
money.setText(bean);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#fff1f1f1" />
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/button_my_arn_exchange2" android:state_enabled="true"/>
|
||||
<item android:drawable="@drawable/button_my_arn_exchange3" android:state_enabled="false"/>
|
||||
</selector>
|
@ -3,20 +3,39 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/activity_top"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:padding="15dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<ImageView
|
||||
android:id="@+id/btn_back"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginStart="18dp"
|
||||
android:scaleType="center"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/ic_top_break" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/next"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right"
|
||||
android:layout_marginTop="@dimen/activity_top"
|
||||
android:padding="10dp"
|
||||
android:text="@string/layout_choose_label_tip1"
|
||||
android:textColor="@color/black2"
|
||||
android:textSize="14sp" />
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
|
@ -398,6 +398,7 @@
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/u_tag"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
|
@ -277,7 +277,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/next_step_is_consent"
|
||||
android:textColor="#ffb1b1b1"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="10sp" />
|
||||
|
||||
|
||||
@ -295,7 +295,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="1dp"
|
||||
android:text="@string/and"
|
||||
android:textColor="#ffb1b1b1"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
|
@ -30,6 +30,7 @@
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
@ -249,10 +250,17 @@
|
||||
android:textColor="#A279E4"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
||||
<Button
|
||||
android:background="@drawable/button_my_arn_exchange_btn"
|
||||
android:enabled="false"
|
||||
android:text="@string/my_arnings_wait"
|
||||
android:layout_gravity="end"
|
||||
android:layout_width="151dp"
|
||||
android:layout_height="42dp"/>
|
||||
<LinearLayout
|
||||
android:layout_width="151dp"
|
||||
android:layout_height="42dp"
|
||||
android:visibility="gone"
|
||||
android:layout_gravity="end"
|
||||
android:background="@drawable/button_my_arn_exchange2"
|
||||
android:gravity="center"
|
||||
@ -277,6 +285,7 @@
|
||||
android:gravity="center"
|
||||
android:paddingStart="15dp"
|
||||
android:paddingEnd="15dp"
|
||||
android:visibility="gone"
|
||||
android:singleLine="true"
|
||||
android:text="@string/my_arnings_incentive_withdrawal_minimum"
|
||||
android:textColor="@color/white"
|
||||
|
@ -102,6 +102,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
@ -160,6 +161,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="10dp"
|
||||
android:visibility="gone"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<TextView
|
||||
@ -187,6 +189,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
@ -241,6 +244,7 @@
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/qa"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
@ -269,6 +273,7 @@
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/server_agreement"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
@ -297,6 +302,7 @@
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/user_agreement"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
|
@ -127,7 +127,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxEms="5"
|
||||
android:maxEms="4"
|
||||
android:singleLine="true"
|
||||
tools:text="啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊"
|
||||
android:text="@string/layout_f_my_tips1"
|
||||
@ -591,7 +591,7 @@
|
||||
android:id="@+id/tv_star_coin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/withdrawal"
|
||||
android:text="@string/charge"
|
||||
android:textColor="@color/gray_B1B1B1"
|
||||
android:textSize="12sp" />
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="13dp"
|
||||
android:layout_gravity="center"
|
||||
app:srcCompat="@mipmap/ic_drill" />
|
||||
app:srcCompat="@mipmap/diamond" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/money"
|
||||
|
@ -102,7 +102,7 @@
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginStart="5dp"
|
||||
app:srcCompat="@mipmap/ic_home_hot_woman" />
|
||||
app:srcCompat="@mipmap/icon_level" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/level"
|
||||
@ -131,7 +131,7 @@
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
app:srcCompat="@mipmap/ic_drill" />
|
||||
app:srcCompat="@mipmap/diamond" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/money"
|
||||
|
@ -59,11 +59,12 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
tools:text="TextView"
|
||||
tools:text="用户——1234567890"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
@ -74,6 +75,35 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/ic_home_auth" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout3"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="15dp"
|
||||
android:background="@mipmap/bg_home_hot_live"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toTopOf="@+id/user_name"
|
||||
app:layout_constraintStart_toStartOf="@+id/user_name">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ic_level"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginStart="5dp"
|
||||
app:srcCompat="@mipmap/icon_level" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/level"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_gravity="center"
|
||||
android:text="LV.21"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
@ -88,6 +88,7 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_item_interaction"
|
||||
android:visibility="gone"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:scaleType="centerCrop" />
|
||||
|
@ -92,13 +92,13 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_unread_count"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:background="@drawable/bg_red_point"
|
||||
android:ellipsize="marquee"
|
||||
android:gravity="center"
|
||||
android:text="0"
|
||||
tools:text="99+"
|
||||
android:textColor="#fff"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
@ -44,7 +44,7 @@
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
app:srcCompat="@mipmap/ic_drill" />
|
||||
app:srcCompat="@mipmap/diamond" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/money"
|
||||
|
@ -1,26 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/linearLayout5"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/linearLayout6"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/memo_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="13dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:ellipsize="end"
|
||||
android:maxWidth="170dp"
|
||||
android:singleLine="true"
|
||||
android:text="收到×××的×××禮物"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14sp" />
|
||||
android:textSize="14sp"
|
||||
tools:text="收到×××的×××禮物收到×××的××1234567890214644" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/create_time"
|
||||
@ -38,11 +44,14 @@
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:layout_marginEnd="19dp"
|
||||
android:gravity="center_vertical">
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="14dp"
|
||||
@ -54,9 +63,9 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxWidth="100dp"
|
||||
android:maxEms="5"
|
||||
android:singleLine="true"
|
||||
android:text="+1111111110.5"
|
||||
tools:text="+1111111110.5"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
@ -65,7 +74,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="#80999999" />
|
||||
</FrameLayout>
|
||||
android:background="#80999999"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Binary file not shown.
Before Width: | Height: | Size: 198 KiB After Width: | Height: | Size: 2.6 MiB |
Binary file not shown.
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 45 KiB |
@ -28,6 +28,7 @@
|
||||
<string name="my_arnings_total_convertibility">可兌換總額</string>
|
||||
<string name="my_arnings_gold_coin">金幣</string>
|
||||
<string name="my_arnings_toggle">切換</string>
|
||||
<string name="my_arnings_wait">敬請期待</string>
|
||||
<string name="diamond_exchange_input_hint">請輸入需兌換的星幣金額</string>
|
||||
<string name="diamond_exchange_immediate_exchange">立即兌換</string>
|
||||
<string name="diamond_exchange_full_conversion">全額兌換</string>
|
||||
@ -35,15 +36,15 @@
|
||||
<string name="choose_img_max">最多選 %1$s 張圖片哦</string>
|
||||
<string name="view_friend_empty_text">暫無好友消息~</string>
|
||||
<string name="not_money">餘額不足</string>
|
||||
<string name="not_money_tips">文字聊天每條續消耗%s鑽,您可通過充值獲取更多星幣以便繼續聊天</string>
|
||||
<string name="not_money_tips">文字聊天每條續消耗%s星幣,您可通過充值獲取更多星幣以便繼續聊天</string>
|
||||
|
||||
<string name="not_money_video_tips">與TA視頻聊天每分鐘續消耗%s星幣您可通過充值獲取更多星幣以便繼續聊天</string>
|
||||
<string name="not_money_audio_tips">與TA語音聊天每分鐘續消耗%s星幣您可通過充值獲取更多星幣以便繼續聊天</string>
|
||||
<string name="not_money_text_tips">聊天每條續消耗%s鑽,您可通過充值獲取更多星幣以便繼續聊天</string>
|
||||
<string name="not_money_text_tips">聊天每條續消耗%s星幣,您可通過充值獲取更多星幣以便繼續聊天</string>
|
||||
<string name="dialog_cancel_tip">離開</string>
|
||||
<string name="dialog_to_money_tip">去充值</string>
|
||||
<string name="chat_video_tips">發起視頻通話\n%s鑽/分鐘</string>
|
||||
<string name="chat_audio_tips">發起語音通話\n%s鑽/分鐘</string>
|
||||
<string name="chat_video_tips">發起視頻通話\n%s星幣/分鐘</string>
|
||||
<string name="chat_audio_tips">發起語音通話\n%s星幣/分鐘</string>
|
||||
<string name="album">相冊</string>
|
||||
<string name="camera">拍照</string>
|
||||
<string name="photo_info">圖片信息</string>
|
||||
|
@ -28,6 +28,7 @@
|
||||
<string name="my_arnings_total_convertibility">可兌換總額</string>
|
||||
<string name="my_arnings_gold_coin">金幣</string>
|
||||
<string name="my_arnings_toggle">切換</string>
|
||||
<string name="my_arnings_wait">敬請期待</string>
|
||||
<string name="diamond_exchange_input_hint">請輸入需兌換的星幣金額</string>
|
||||
<string name="diamond_exchange_immediate_exchange">立即兌換</string>
|
||||
<string name="diamond_exchange_full_conversion">全額兌換</string>
|
||||
@ -35,15 +36,15 @@
|
||||
<string name="choose_img_max">最多選 %1$s 張圖片哦</string>
|
||||
<string name="view_friend_empty_text">暫無好友消息~</string>
|
||||
<string name="not_money">餘額不足</string>
|
||||
<string name="not_money_tips">文字聊天每條續消耗%s鑽,您可通過充值獲取更多星幣以便繼續聊天</string>
|
||||
<string name="not_money_tips">文字聊天每條續消耗%s星幣,您可通過充值獲取更多星幣以便繼續聊天</string>
|
||||
|
||||
<string name="not_money_video_tips">與TA視頻聊天每分鐘續消耗%s星幣您可通過充值獲取更多星幣以便繼續聊天</string>
|
||||
<string name="not_money_audio_tips">與TA語音聊天每分鐘續消耗%s星幣您可通過充值獲取更多星幣以便繼續聊天</string>
|
||||
<string name="not_money_text_tips">聊天每條續消耗%s鑽,您可通過充值獲取更多星幣以便繼續聊天</string>
|
||||
<string name="not_money_text_tips">聊天每條續消耗%s星幣,您可通過充值獲取更多星幣以便繼續聊天</string>
|
||||
<string name="dialog_cancel_tip">離開</string>
|
||||
<string name="dialog_to_money_tip">去充值</string>
|
||||
<string name="chat_video_tips">發起視頻通話\n%s鑽/分鐘</string>
|
||||
<string name="chat_audio_tips">發起語音通話\n%s鑽/分鐘</string>
|
||||
<string name="chat_video_tips">發起視頻通話\n%s星幣/分鐘</string>
|
||||
<string name="chat_audio_tips">發起語音通話\n%s星幣/分鐘</string>
|
||||
<string name="album">相冊</string>
|
||||
<string name="camera">拍照</string>
|
||||
<string name="photo_info">圖片信息</string>
|
||||
|
@ -28,6 +28,7 @@
|
||||
<string name="my_arnings_total_convertibility">可兌換總額</string>
|
||||
<string name="my_arnings_gold_coin">金幣</string>
|
||||
<string name="my_arnings_toggle">切換</string>
|
||||
<string name="my_arnings_wait">敬請期待</string>
|
||||
<string name="diamond_exchange_input_hint">請輸入需兌換的星幣金額</string>
|
||||
<string name="diamond_exchange_immediate_exchange">立即兌換</string>
|
||||
<string name="diamond_exchange_full_conversion">全額兌換</string>
|
||||
@ -36,16 +37,16 @@
|
||||
|
||||
<string name="view_friend_empty_text">friend empty</string>
|
||||
<string name="not_money">餘額不足</string>
|
||||
<string name="not_money_tips">"文字聊天每條續消耗%s鑽,您可通過充值獲取更多星幣以便繼續聊天"</string>
|
||||
<string name="not_money_tips">"文字聊天每條續消耗%s星幣,您可通過充值獲取更多星幣以便繼續聊天"</string>
|
||||
|
||||
|
||||
<string name="not_money_video_tips">與TA視頻聊天每分鐘續消耗%s星幣您可通過充值獲取更多星幣以便繼續聊天</string>
|
||||
<string name="not_money_audio_tips">與TA語音聊天每分鐘續消耗%s星幣您可通過充值獲取更多星幣以便繼續聊天</string>
|
||||
<string name="not_money_text_tips">聊天每條續消耗%s鑽,您可通過充值獲取更多星幣以便繼續聊天</string>
|
||||
<string name="not_money_text_tips">聊天每條續消耗%s星幣,您可通過充值獲取更多星幣以便繼續聊天</string>
|
||||
<string name="dialog_cancel_tip">離開</string>
|
||||
<string name="dialog_to_money_tip">去充值</string>
|
||||
<string name="chat_video_tips">發起視頻通話\n%s鑽/分鐘</string>
|
||||
<string name="chat_audio_tips">發起語音通話\n%s鑽/分鐘</string>
|
||||
<string name="chat_video_tips">發起視頻通話\n%s星幣/分鐘</string>
|
||||
<string name="chat_audio_tips">發起語音通話\n%s星幣/分鐘</string>
|
||||
<string name="album">相冊</string>
|
||||
<string name="camera">拍照</string>
|
||||
<string name="photo_info">圖片信息</string>
|
||||
@ -73,7 +74,7 @@
|
||||
<string name="dialog_normal_title">首次匹配成功獎勵</string>
|
||||
<string name="dialog_normal_content">恭喜獲得</string>
|
||||
<string name="title_greet_config">打招呼設置</string>
|
||||
<string name="title_audit_config">審核中,請耐心等待审核通过</string>
|
||||
<string name="title_audit_config">審核中,請耐心等待審核通過</string>
|
||||
<string name="title_audit_config2">已發起審核,請耐心等待審核結果</string>
|
||||
<string name="title_audit_config3">審核失敗,去提交</string>
|
||||
<string name="title_audit_config4">審核中</string>
|
||||
@ -114,8 +115,8 @@
|
||||
<string name="layout_auth_tips4">身份證背面</string>
|
||||
<string name="layout_auth_tips5">發起審核</string>
|
||||
|
||||
<string name="layout_auth_blogger_tips1">带*为必填项,為保障您的利益,請如實填寫</string>
|
||||
<string name="layout_auth_blogger_tips2">性别</string>
|
||||
<string name="layout_auth_blogger_tips1">帶*為必填項,為保障您的利益,請如實填寫</string>
|
||||
<string name="layout_auth_blogger_tips2">性別</string>
|
||||
<string name="layout_auth_blogger_tips3">男</string>
|
||||
<string name="layout_auth_blogger_tips4">女</string>
|
||||
<string name="layout_auth_blogger_tips5">真實姓名</string>
|
||||
@ -132,7 +133,7 @@
|
||||
|
||||
<string name="layout_auth_blogger_inlet_tips1">真人說明</string>
|
||||
<string name="layout_auth_blogger_inlet_tips2">請上傳您的身份證正反面完成真人認證,完成認證可獲得跟多消息推送並提高聊天,收禮的收益比例</string>
|
||||
<string name="layout_auth_blogger_inlet_tips3">條件一:完後真人認證 </string>
|
||||
<string name="layout_auth_blogger_inlet_tips3">條件一:完后真人認證 </string>
|
||||
<string name="layout_auth_blogger_inlet_tips4">已完成</string>
|
||||
<string name="layout_auth_blogger_inlet_tips5">條件二:上傳入駐資料 </string>
|
||||
<string name="layout_auth_blogger_inlet_tips6">已完成</string>
|
||||
@ -253,12 +254,12 @@
|
||||
|
||||
<string name="layout_v_greet_config_add_tips1">添加更多</string>
|
||||
<string name="layout_v_custom_tips1">保存</string>
|
||||
<string name="activity_my_friend_list_fans">被關註</string>
|
||||
<string name="activity_my_friend_list_fans">被關注</string>
|
||||
<string name="activity_my_friend_list_follow">關注</string>
|
||||
<string name="activity_my_friend_list_friend">互動關註</string>
|
||||
<string name="activity_my_friend_list_friend">互動關注</string>
|
||||
<string name="activity_my_friend_list_people">人</string>
|
||||
|
||||
<string name="activity_my_friend_list_item_0">未關註</string>
|
||||
<string name="activity_my_friend_list_item_0">未關注</string>
|
||||
<string name="activity_my_friend_list_item_1">回關</string>
|
||||
<string name="activity_my_friend_list_item_2">已關注</string>
|
||||
<string name="activity_my_friend_list_item_3">相互關注</string>
|
||||
@ -269,8 +270,8 @@
|
||||
|
||||
<string name="dialog_call_prop_apply">收下獎勵</string>
|
||||
<string name="toast_call_not_unlock">發送任意禮物后即可解鎖</string>
|
||||
<string name="gift_not_money">余额不足,请充值后再进行尝试吧~</string>
|
||||
<string name="end_of_the_call">通话结束</string>
|
||||
<string name="end_resume_call_not_auth">对方未完成真人认证,暂时无法向对方发起通话</string>
|
||||
<string name="gift_not_money">餘額不足,請充值后再進行嘗試吧~</string>
|
||||
<string name="end_of_the_call">通話結束</string>
|
||||
<string name="end_resume_call_not_auth">對方未完成真人認證,暫時無法向對方發起通話</string>
|
||||
<string name="now_call_tips">您當前正在通話中,請掛斷後再試</string>
|
||||
</resources>
|
@ -62,7 +62,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies["appcompat-androidx"]
|
||||
implementation rootProject.ext.dependencies["recyclerview-androidx"]
|
||||
//common
|
||||
implementation project(path: ':common')
|
||||
api project(path: ':common')
|
||||
//Twitter
|
||||
implementation 'com.twitter.sdk.android:twitter:3.1.1'
|
||||
//facebook & Messenger
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.pdlive.shayu">
|
||||
package="com.yunbao.share">
|
||||
|
||||
<queries>
|
||||
<package android:name="com.pdlive.shayu"/>
|
||||
<package android:name="com.yunbao.share"/>
|
||||
<package android:name="com.facebook.orca"/>
|
||||
|
||||
<package
|
||||
@ -26,10 +26,10 @@
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<provider
|
||||
<!-- <provider
|
||||
android:name="com.facebook.FacebookContentProvider"
|
||||
android:authorities="com.facebook.app.FacebookContentProvider2011402032399020"
|
||||
android:exported="true" />
|
||||
android:exported="true" />-->
|
||||
<receiver
|
||||
android:name="com.yunbao.share.receiver.TwitterResultReceiver"
|
||||
android:exported="false">
|
||||
|
@ -13,7 +13,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.pdlive.shayu.R;
|
||||
import com.yunbao.share.R;
|
||||
import com.yunbao.share.ICallback;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
import com.yunbao.share.platform.FacebookShare;
|
||||
|
@ -2,14 +2,12 @@ package com.yunbao.share.ui;
|
||||
|
||||
import static android.content.Context.CLIPBOARD_SERVICE;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.LinearGradient;
|
||||
import android.graphics.Shader;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@ -19,14 +17,13 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.pdlive.shayu.R;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
import com.yunbao.share.R;
|
||||
import com.yunbao.share.adapters.ShareAppAdapter;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -45,6 +42,7 @@ public class InvitePopDialog extends AbsDialogPopupWindow {
|
||||
private String anchorName;
|
||||
private String anchorAvatar;
|
||||
private String url;
|
||||
private String titleStr;
|
||||
|
||||
public InvitePopDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
@ -59,6 +57,10 @@ public class InvitePopDialog extends AbsDialogPopupWindow {
|
||||
this.anchorId = anchorId;
|
||||
return this;
|
||||
}
|
||||
public InvitePopDialog setTitle(String title){
|
||||
this.titleStr=title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public InvitePopDialog setAnchorName(String anchorName) {
|
||||
this.anchorName = anchorName;
|
||||
@ -99,7 +101,11 @@ public class InvitePopDialog extends AbsDialogPopupWindow {
|
||||
list.setAdapter(adapter);
|
||||
initData();
|
||||
link.setText(url.substring(0, 40));
|
||||
info.setText(R.string.dialog_invite_info);
|
||||
if(StringUtil.isEmpty(titleStr)) {
|
||||
info.setText(R.string.dialog_invite_info);
|
||||
}else{
|
||||
info.setText(titleStr);
|
||||
}
|
||||
avatar.setImageResource(R.mipmap.ic_launcher);
|
||||
//title.setTextColor(getContext().getResources().getColorStateList(R.drawable.bg_invite_title));
|
||||
title.setText(R.string.dialog_invite_title);
|
||||
@ -123,7 +129,7 @@ public class InvitePopDialog extends AbsDialogPopupWindow {
|
||||
|
||||
private void initData() {
|
||||
data = new ArrayList<>();
|
||||
data.add(builder(ShareBuilder.APP_FACEBOOK));
|
||||
//data.add(builder(ShareBuilder.APP_FACEBOOK));
|
||||
data.add(builder(ShareBuilder.APP_LINE));
|
||||
data.add(builder(ShareBuilder.APP_TWITTER));
|
||||
data.add(builder(ShareBuilder.APP_WHATSAPP));
|
||||
|
@ -13,14 +13,13 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.pdlive.shayu.R;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
import com.yunbao.share.R;
|
||||
import com.yunbao.share.adapters.ShareAppAdapter;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -261,6 +261,26 @@ public class IMLoginModel extends BaseModel {
|
||||
private String online;
|
||||
@SerializedName("isAttention")
|
||||
private int isAttention;//0 未关注 1被关注 2已关注 3互相关注
|
||||
@SerializedName("user_info_complete")
|
||||
private int userInfoComplete;
|
||||
@SerializedName("login_type")
|
||||
private String loginType;
|
||||
|
||||
public String getLoginType() {
|
||||
return loginType;
|
||||
}
|
||||
|
||||
public void setLoginType(String loginType) {
|
||||
this.loginType = loginType;
|
||||
}
|
||||
|
||||
public int getUserInfoComplete() {
|
||||
return userInfoComplete;
|
||||
}
|
||||
|
||||
public void setUserInfoComplete(int userInfoComplete) {
|
||||
this.userInfoComplete = userInfoComplete;
|
||||
}
|
||||
|
||||
public int getIsAttention() {
|
||||
return isAttention;
|
||||
|
@ -377,12 +377,16 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
netHandler.post(isInstructorRunnable);
|
||||
}
|
||||
|
||||
boolean initInstructor = false;
|
||||
/**
|
||||
* 获取是不是新手指导员的身份
|
||||
*/
|
||||
private Runnable isInstructorRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (initInstructor) {
|
||||
return;
|
||||
}
|
||||
HttpClient.getInstance().get("User.isInstructor", "isInstructor")
|
||||
.params("uid", userInfo.getId(), true)
|
||||
.params("token", userInfo.getToken(), true)
|
||||
@ -397,6 +401,7 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
userInfo.setIsAdmin("0");
|
||||
}
|
||||
}
|
||||
initInstructor = true;
|
||||
put(KEY_USER_INFO, new Gson().toJson(userInfo));
|
||||
//兼容老模块(之后要把用户维护的类更换掉)
|
||||
SpUtil.getInstance().setStringValue(SpUtil.USER_INFO, new Gson().toJson(userInfo));
|
||||
|
@ -64,6 +64,15 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
};
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
mCameraPermissions = new String[]{
|
||||
Manifest.permission.READ_MEDIA_IMAGES,
|
||||
Manifest.permission.CAMERA
|
||||
};
|
||||
mAlumbPermissions = new String[]{
|
||||
Manifest.permission.READ_MEDIA_IMAGES,
|
||||
};
|
||||
}
|
||||
mCameraPermissionCallback = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -172,4 +172,14 @@ public class VersionUtil {
|
||||
return sVersion;
|
||||
}
|
||||
|
||||
public static String getVersionCode() {
|
||||
try {
|
||||
PackageManager manager = CommonAppContext.sInstance.getPackageManager();
|
||||
PackageInfo info = manager.getPackageInfo(CommonAppContext.sInstance.getPackageName(), 0);
|
||||
return info.versionCode+"";
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "NUL";
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ ext {
|
||||
targetSdkVersion : 33,
|
||||
versionCode : 445,
|
||||
versionName : "6.5.4",
|
||||
otoversionCode : 100,
|
||||
otoversionCode : 101,
|
||||
otoversionName : "1.0"
|
||||
]
|
||||
manifestPlaceholders = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user