Commit 44a36e43 by 霍志良

Merge remote-tracking branch 'origin/new_dev_4.3.91' into 心事动态发布优化

# Conflicts:
#	config.gradle
parents c1a4c286 62e5cd47
......@@ -12,7 +12,8 @@ kapt {
}
android {
compileSdkVersion 28
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
......@@ -20,8 +21,8 @@ android {
defaultConfig {
applicationId "com.ydl.component"
minSdkVersion 21
targetSdkVersion 28
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode 1
versionName "1.0"
multiDexEnabled true
......@@ -37,7 +38,7 @@ android {
multiDexEnabled true
ndk {
abiFilters "arm64-v8a" // 指定要ndk需要兼容的架构(这样其他依赖包里mips,x86,armeabi,arm-v8之类的so会被过滤掉)
abiFilters "arm64-v8a","armeabi-v7a" // 指定要ndk需要兼容的架构(这样其他依赖包里mips,x86,armeabi,arm-v8之类的so会被过滤掉)
}
}
......@@ -175,14 +176,21 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation(rootProject.ext.dependencies["appcompat-v7"])
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
// kapt rootProject.ext.dependencies["dagger2-compiler"]
api rootProject.ext.dependencies["butterknife"]
kapt rootProject.ext.dependencies["butterknife-compiler"]
implementation(rootProject.ext.dependencies["design"])
implementation(rootProject.ext.dependencies["appcompat-v7"])
implementation(rootProject.ext.dependencies["espresso-core"])
implementation(rootProject.ext.dependencies["okhttp3"])
// TPNS SDK 主工程依赖包
// implementation 'com.tencent.liteav:LiteAVSDK_TRTC:latest.release'
if (true) {
//开发模式
......@@ -221,8 +229,9 @@ dependencies {
implementation project(':m-fm')
implementation modularPublication('com.ydl:m-fm-api')
} else {
implementation project(':ydl-tuicore')
} else {
//发布模式
api 'com.ydl:m-user-module-ydl:0.0.6'
api rootProject.ext.dependencies["ydl-webview"]
......@@ -232,6 +241,9 @@ dependencies {
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
api(rootProject.ext.dependencies["ydl-tuicalling"]) {
transitive = true
}
}
......
......@@ -74,7 +74,46 @@
<activity
android:name=".home.HomeActivity"
android:launchMode="singleTask"
android:noHistory="true"></activity>
android:noHistory="true"/>
<activity
android:name=".rtc.MDTLoginActivity"
android:launchMode="singleTask"
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".rtc.MDTMainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.tencent.liteav.action.portal" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="com.tencent.qcloud"
android:path="/detail"
android:scheme="pushscheme" />
</intent-filter>
<intent-filter>
<action android:name="com.tencent.trtc.tuicalling" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".rtc.ProfileActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity
android:name=".rtc.TUICallingEntranceActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar" />
<activity android:name=".rtc.VideoCallingEnterActivity" />
</application>
</manifest>
\ No newline at end of file
......@@ -20,6 +20,7 @@ import com.ydl.component.music.FragmentContainerActivity
import com.ydl.component.mvp.DemoContract
import com.ydl.component.mvp.DemoPresenter
import com.ydl.component.route.PlatformTempCommonRouteImpl
import com.ydl.component.rtc.MDTLoginActivity
import com.ydl.confide.home.ConfideHomeActivity
import com.ydl.media.audio.PlayService
import com.ydl.ydlcommon.modular.ModularServiceManager
......@@ -83,6 +84,11 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
bindService()
reLoadData()
requestPermission()
bt_mdt.setOnClickListener {
val intent = Intent(this, MDTLoginActivity::class.java)
startActivity(intent)
}
tv_user.setOnClickListener {
reLoadData()
}
......
......@@ -9,6 +9,7 @@ import android.webkit.WebView;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.meituan.android.walle.WalleChannelReader;
import com.tencent.qcloud.tuicore.calling.trtccalling.model.TRTCCalling;
import com.umeng.analytics.MobclickAgent;
import com.umeng.commonsdk.UMConfigure;
import com.umeng.socialize.PlatformConfig;
......@@ -21,6 +22,7 @@ import com.ydl.ydlcommon.router.YdlCommonRouterManager;
import com.ydl.ydlcommon.utils.AppProgressUtils;
import com.ydl.ydlcommon.utils.Utils;
import com.yidianling.common.tools.LogUtil;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.course.lifeCallback.CoursePlayLifecycle;
......@@ -61,6 +63,23 @@ public class ComponentTestApp extends BaseApp {
registerActivityLifecycleCallbacks(new CoursePlayLifecycle());
Fresco.initialize(this);
TRTCCalling.sharedInstance(this).setMdtCallBack(new TRTCCalling.MdtCallBack() {
@Override
public void onReceiveNewInvitation(String roomId) {
ToastUtil.toastShort("电话邀请"+roomId);
}
@Override
public void onInviteeAccepted(String roomId) {
ToastUtil.toastShort("接受邀请"+roomId);
}
@Override
public void onInviteeRejected(String roomId) {
ToastUtil.toastShort("拒绝邀请"+roomId);
}
});
}
private void initUmeng() {
......
package com.ydl.component.rtc
import android.annotation.SuppressLint
import android.content.Intent
import android.graphics.Color
import android.os.Build
import android.os.Bundle
import android.text.TextUtils
import android.util.Log
import android.view.View
import android.view.WindowManager
import android.widget.Button
import android.widget.EditText
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.blankj.utilcode.util.ToastUtils
import com.tencent.imsdk.v2.*
import com.tencent.qcloud.tuicore.TUILogin
import com.tencent.qcloud.tuicore.calling.basic.UserModel
import com.tencent.qcloud.tuicore.calling.basic.UserModelManager
import com.ydl.component.R
import com.ydl.component.rtc.bean.UserSigResponse
import com.ydl.component.rtc.http.MDTHttpImpl.Companion.getInstance
import com.ydl.ydlcommon.modular.ModularServiceManager.provide
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.service.IUserService
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import java.util.*
class MDTLoginActivity : AppCompatActivity() {
private var mEditUserId: EditText? = null
private var mButtonLogin: Button? = null
public override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_login)
initStatusBar()
initView()
}
private fun initView() {
mEditUserId = findViewById<View>(R.id.et_userId) as EditText
initButtonLogin()
}
private fun initButtonLogin() {
mButtonLogin = findViewById<View>(R.id.tv_login) as Button
mButtonLogin!!.setOnClickListener {
getSigin()
}
}
@SuppressLint("CheckResult")
private fun getSigin() {
var user = provide(
IUserService::class.java
).getUserInfo()
val uid = user?.uid
mEditUserId!!.setText(uid)
val userId = mEditUserId!!.text.toString().trim { it <= ' ' }
if (TextUtils.isEmpty(userId)) {
Toast.makeText(this, R.string.user_id_is_empty, Toast.LENGTH_SHORT).show()
return
}
val manager = UserModelManager.getInstance()
val userModel = manager.userModel
uid?.let {uid ->
getInstance().getSecret(UserSigResponse(uid))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ response ->
val data = response.data
if ("200" == response.code) {
userModel.appId = Integer.valueOf(data.appId)
userModel.phone = userId
userModel.userId = userId
userModel.userSig = data.userSig
userModel.userAvatar =user?.head
userModel.userName =user?.nick_name
manager.userModel = userModel
login(userModel)
} else {
ToastUtil.toastShort(response.msg)
}
}, { error ->
ToastUtil.toastShort(error.message)
})
}
}
private fun login(userModel: UserModel) {
val config = V2TIMSDKConfig()
config.logLevel = V2TIMSDKConfig.V2TIM_LOG_DEBUG
TUILogin.init(this, userModel.appId, null, object : V2TIMSDKListener() {
override fun onKickedOffline() {}
override fun onUserSigExpired() {}
})
TUILogin.login(userModel.userId, userModel.userSig, object : V2TIMCallback {
override fun onError(code: Int, msg: String) {
ToastUtils.showLong("登录IM失败,所有功能不可用[%d]%s", code, msg)
Log.d(TAG, "login fail code: $code msg:$msg")
}
override fun onSuccess() {
Log.d(TAG, "login onSuccess")
userInfo
}
})
}//如果用户信息不为空,则直接进入主界面//如果用户名和头像为空,则跳转设置界面进行设置
//先查询用户是否存在
private val userInfo: Unit
private get() {
val manager = UserModelManager.getInstance()
val userModel = manager.userModel
//先查询用户是否存在
val userIdList: MutableList<String> = ArrayList()
userIdList.add(userModel.userId)
Log.d(TAG, "setUserInfo: userIdList = $userIdList")
V2TIMManager.getInstance()
.getUsersInfo(userIdList, object : V2TIMValueCallback<List<V2TIMUserFullInfo>?> {
override fun onError(code: Int, msg: String) {
Log.e(TAG, "get group info list fail, code:$code msg: $msg")
}
override fun onSuccess(resultList: List<V2TIMUserFullInfo>?) {
if (resultList == null || resultList.isEmpty()) {
return
}
val result = resultList[0]
val userName = result.nickName
val userAvatar = result.faceUrl
Log.d(TAG, "onSuccess: userName = $userName , userAvatar = $userAvatar")
//如果用户名和头像为空,则跳转设置界面进行设置
if (TextUtils.isEmpty(userName) || TextUtils.isEmpty(userAvatar)) {
val intent = Intent(this@MDTLoginActivity, ProfileActivity::class.java)
startActivity(intent)
finish()
} else {
userModel.userAvatar = userAvatar
userModel.userName = userName
manager.userModel = userModel
//如果用户信息不为空,则直接进入主界面
val intent = Intent(this@MDTLoginActivity, MDTMainActivity::class.java)
startActivity(intent)
finish()
}
}
})
}
private fun initStatusBar() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
val window = window
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE)
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
window.statusBarColor = Color.TRANSPARENT
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
}
}
companion object {
private const val TAG = "LoginActivity"
}
}
\ No newline at end of file
package com.ydl.component.rtc;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.blankj.utilcode.util.ToastUtils;
import com.tencent.imsdk.v2.V2TIMCallback;
import com.tencent.imsdk.v2.V2TIMManager;
import com.tencent.imsdk.v2.V2TIMUserFullInfo;
import com.tencent.qcloud.tuicore.calling.basic.AvatarConstant;
import com.tencent.qcloud.tuicore.calling.basic.ImageLoader;
import com.tencent.qcloud.tuicore.calling.basic.UserModel;
import com.tencent.qcloud.tuicore.calling.basic.UserModelManager;
import com.ydl.component.R;
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ProfileActivity extends AppCompatActivity {
private static final String TAG = "ProfileActivity";
private ImageView mImageAvatar;
private EditText mEditUserName;
private Button mButtonRegister;
private TextView mTvInputTips; //昵称限制提示
private String mAvatarUrl; //用户头像
//自定义随机登录名
private static final int[] CUSTOM_NAME_ARRAY = {
R.string.app_custom_name_1,
R.string.app_custom_name_2,
R.string.app_custom_name_3,
R.string.app_custom_name_4,
R.string.app_custom_name_5,
R.string.app_custom_name_6,
R.string.app_custom_name_7,
R.string.app_custom_name_8,
R.string.app_custom_name_9,
R.string.app_custom_name_10,
R.string.app_custom_name_11,
R.string.app_custom_name_12,
};
private void startMainActivity() {
Intent intent = new Intent();
intent.addCategory("android.intent.category.DEFAULT");
intent.setAction("com.tencent.liteav.action.portal");
startActivity(intent);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login_profile);
initStatusBar();
initView();
}
private void initView() {
mImageAvatar = (ImageView) findViewById(R.id.iv_user_avatar);
mEditUserName = (EditText) findViewById(R.id.et_user_name);
mButtonRegister = (Button) findViewById(R.id.tv_register);
mTvInputTips = (TextView) findViewById(R.id.tv_tips_user_name);
String[] avatarArr = AvatarConstant.USER_AVATAR_ARRAY;
int index = new Random().nextInt(avatarArr.length);
mAvatarUrl = avatarArr[index];
ImageLoader.loadImage(this, mImageAvatar, mAvatarUrl, R.mipmap.ic_avatar);
mButtonRegister.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setProfile();
}
});
int customNameIndex = new Random().nextInt(CUSTOM_NAME_ARRAY.length);
mEditUserName.setText(getString(CUSTOM_NAME_ARRAY[customNameIndex]));
String text = mEditUserName.getText().toString();
if (!TextUtils.isEmpty(text)) {
mEditUserName.setSelection(text.length());
}
mEditUserName.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence text, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence text, int start, int before, int count) {
mButtonRegister.setEnabled(text.length() != 0);
String editable = mEditUserName.getText().toString();
//匹配字母,数字,中文,下划线,以及限制输入长度为2-20.
Pattern p = Pattern.compile("^[a-z0-9A-Z\\u4e00-\\u9fa5\\_]{2,20}$");
Matcher m = p.matcher(editable);
if (!m.matches()) {
mTvInputTips.setTextColor(getResources().getColor(R.color.color_input_no_match));
} else {
mTvInputTips.setTextColor(getResources().getColor(R.color.text_color_hint));
}
}
@Override
public void afterTextChanged(Editable s) {
}
});
}
private void setProfile() {
final String userName = mEditUserName.getText().toString().trim();
if (TextUtils.isEmpty(userName)) {
ToastUtils.showLong(getString(R.string.app_hint_user_name));
return;
}
String reg = "^[a-z0-9A-Z\\u4e00-\\u9fa5\\_]{2,20}$";
if (!userName.matches(reg)) {
mTvInputTips.setTextColor(getResources().getColor(R.color.color_input_no_match));
return;
}
mTvInputTips.setTextColor(getResources().getColor(R.color.text_color_hint));
V2TIMUserFullInfo v2TIMUserFullInfo = new V2TIMUserFullInfo();
v2TIMUserFullInfo.setFaceUrl(mAvatarUrl);
v2TIMUserFullInfo.setNickname(userName);
V2TIMManager.getInstance().setSelfInfo(v2TIMUserFullInfo, new V2TIMCallback() {
@Override
public void onError(int code, String desc) {
Log.e(TAG, "set profile failed errorCode : " + code + " errorMsg : " + desc);
//头像和昵称设置失败,也可以进入到主界面(头像和昵称都用默认值),不影响功能
ToastUtils.showLong(getString(R.string.app_toast_failed_to_set, desc));
startMainActivity();
finish();
}
@Override
public void onSuccess() {
Log.i(TAG, "set profile success.");
ToastUtils.showLong(getString(R.string.app_toast_register_success_and_logging_in));
//成功后保存用户数据
UserModel userModel = UserModelManager.getInstance().getUserModel();
userModel.userName = userName;
userModel.userAvatar = mAvatarUrl;
UserModelManager.getInstance().setUserModel(userModel);
startMainActivity();
finish();
}
});
}
private void initStatusBar() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
}
}
package com.ydl.component.rtc;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.tencent.qcloud.tuicore.calling.videocall.Constant;
import com.tencent.qcloud.tuicore.calling.videocall.VideoCallingActivity;
import com.ydl.component.R;
/**
* TRTC视频通话的入口页面(可以设置房间id和用户id)
*
* - 可跳转TRTC视频通话页面{@link VideoCallingActivity}
*/
/**
* Video Call Entrance View (set room ID and user ID)
*
* - Direct to the video call view: {@link VideoCallingActivity}
*/
public class VideoCallingEnterActivity extends AppCompatActivity {
private EditText mEditInputUserId;
private EditText mEditInputRoomId;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.videocall_activit_enter);
mEditInputUserId = findViewById(R.id.et_input_username);
mEditInputRoomId = findViewById(R.id.et_input_room_id);
findViewById(R.id.btn_enter_room).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startEnterRoom();
}
});
findViewById(R.id.rl_entrance_main).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hideInput();
}
});
findViewById(R.id.iv_back).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
mEditInputRoomId.setText("1256732");
String time = String.valueOf(System.currentTimeMillis());
String userId = time.substring(time.length() - 8);
mEditInputUserId.setText(userId);
}
private void startEnterRoom() {
if (TextUtils.isEmpty(mEditInputUserId.getText().toString().trim())
|| TextUtils.isEmpty(mEditInputRoomId.getText().toString().trim())) {
Toast.makeText(VideoCallingEnterActivity.this, "房间号和用户名不能为空", Toast.LENGTH_LONG).show();
return;
}
Intent intent = new Intent(VideoCallingEnterActivity.this, VideoCallingActivity.class);
intent.putExtra(Constant.ROOM_ID, mEditInputRoomId.getText().toString().trim());
intent.putExtra(Constant.USER_ID, mEditInputUserId.getText().toString().trim());
startActivity(intent);
}
protected void hideInput() {
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
View v = getWindow().peekDecorView();
if (null != v) {
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
}
}
}
package com.ydl.component.rtc.bean
/**
* 获取用户密钥
* */
data class UserSigBean(
var appId: String,
var region: String,
var secretId: String,
var userSig: String
)
package com.ydl.component.rtc.bean
/**
* @Author: 刘鹏
* @Description:
* @CreateDate: 2022/4/15 16:37
* -------------------------------
* @UpdateUser:
* @UpdateDate: 2022/4/15 16:37
* @UpdateRemark:
* @Version:
*/
class UserSigResponse(var key: String, var channel: String = "tencent")
\ No newline at end of file
package com.ydl.component.rtc.debug;
import android.text.TextUtils;
import android.util.Base64;
import org.json.JSONException;
import org.json.JSONObject;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.zip.Deflater;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
/*
* Module: GenerateTestUserSig
*
* Function: 用于生成测试用的 UserSig,UserSig 是腾讯云为其云服务设计的一种安全保护签名。
* 其计算方法是对 SDKAppID、UserID 和 EXPIRETIME 进行加密,加密算法为 HMAC-SHA256。
*
* Attention: 请不要将如下代码发布到您的线上正式版本的 App 中,原因如下:
*
* 本文件中的代码虽然能够正确计算出 UserSig,但仅适合快速调通 SDK 的基本功能,不适合线上产品,
* 这是因为客户端代码中的 SECRETKEY 很容易被反编译逆向破解,尤其是 Web 端的代码被破解的难度几乎为零。
* 一旦您的密钥泄露,攻击者就可以计算出正确的 UserSig 来盗用您的腾讯云流量。
*
* 正确的做法是将 UserSig 的计算代码和加密密钥放在您的业务服务器上,然后由 App 按需向您的服务器获取实时算出的 UserSig。
* 由于破解服务器的成本要高于破解客户端 App,所以服务器计算的方案能够更好地保护您的加密密钥。
*
* Reference:https://cloud.tencent.com/document/product/269/32688#Server
*/
public class GenerateTestUserSig {
/**
* 腾讯云 SDKAppId,需要替换为您自己账号下的 SDKAppId。
* <p>
* 进入腾讯云云通信[控制台](https://console.cloud.tencent.com/avc ) 创建应用,即可看到 SDKAppId,
* 它是腾讯云用于区分客户的唯一标识。
*/
public static final int SDKAPPID = 1400646402;
/**
* 签名过期时间,建议不要设置的过短
* <p>
* 时间单位:秒
* 默认时间:7 x 24 x 60 x 60 = 604800 = 7 天
*/
private static final int EXPIRETIME = 604800;
/**
* 向后台请求推拉流地址
* <p>
* key:url_push 获取RTMP推流地址
* key:url_play_flv 获取FLV播放地址
*/
public static final String URL_FETCH_PUSH_URL = "PLACEHOLDER";
/**
* 计算签名用的加密密钥,获取步骤如下:
* <p>
* step1. 进入腾讯云云通信[控制台](https://console.cloud.tencent.com/avc ) ,如果还没有应用就创建一个,
* step2. 单击“应用配置”进入基础配置页面,并进一步找到“帐号体系集成”部分。
* step3. 点击“查看密钥”按钮,就可以看到计算 UserSig 使用的加密的密钥了,请将其拷贝并复制到如下的变量中
* <p>
* 注意:该方案仅适用于调试Demo,正式上线前请将 UserSig 计算代码和密钥迁移到您的后台服务器上,以避免加密密钥泄露导致的流量盗用。
* 文档:https://cloud.tencent.com/document/product/269/32688#Server
*/
private static final String SECRETKEY = "84ed667420eee66e4d99de8d7f76b40ca6b9f8fffacb885068aaa9493cae7a0a";
/**
* 计算 UserSig 签名
* <p>
* 函数内部使用 HMAC-SHA256 非对称加密算法,对 SDKAPPID、userId 和 EXPIRETIME 进行加密。
*
* @note: 请不要将如下代码发布到您的线上正式版本的 App 中,原因如下:
* <p>
* 本文件中的代码虽然能够正确计算出 UserSig,但仅适合快速调通 SDK 的基本功能,不适合线上产品,
* 这是因为客户端代码中的 SECRETKEY 很容易被反编译逆向破解,尤其是 Web 端的代码被破解的难度几乎为零。
* 一旦您的密钥泄露,攻击者就可以计算出正确的 UserSig 来盗用您的腾讯云流量。
* <p>
* 正确的做法是将 UserSig 的计算代码和加密密钥放在您的业务服务器上,然后由 App 按需向您的服务器获取实时算出的 UserSig。
* 由于破解服务器的成本要高于破解客户端 App,所以服务器计算的方案能够更好地保护您的加密密钥。
* <p>
* 文档:https://cloud.tencent.com/document/product/269/32688#Server
*/
public static String genTestUserSig(String userId) {
// return GenTLSSignature(SDKAPPID, userId, EXPIRETIME, null, SECRETKEY);
return "eJyrVgrxCdZLrSjILEpVsjIzMLEwMNABi5WlFilZKRnpGShB*MUp2YkFBZkpSlaGJgYGZiZmJgZGEJnMlNS8ksy0TLAGQ2MDS1NjSzNLmLbMdKCoiVNEmHl6lpt2kEtVoUdaUl5iWGSgV3JuuIVjiYebRZ6XdklEpktquFtJpC1UY0lmLtBFhmYmlpaGppbGprUAOugw0Q__";
}
/**
* 生成 tls 票据
*
* @param sdkappid 应用的 appid
* @param userId 用户 id
* @param expire 有效期,单位是秒
* @param userbuf 默认填写null
* @param priKeyContent 生成 tls 票据使用的私钥内容
* @return 如果出错,会返回为空,或者有异常打印,成功返回有效的票据
*/
private static String GenTLSSignature(long sdkappid, String userId, long expire, byte[] userbuf, String priKeyContent) {
if (TextUtils.isEmpty(priKeyContent)) {
return "";
}
long currTime = System.currentTimeMillis() / 1000;
JSONObject sigDoc = new JSONObject();
try {
sigDoc.put("TLS.ver", "2.0");
sigDoc.put("TLS.identifier", userId);
sigDoc.put("TLS.sdkappid", sdkappid);
sigDoc.put("TLS.expire", expire);
sigDoc.put("TLS.time", currTime);
} catch (JSONException e) {
e.printStackTrace();
}
String base64UserBuf = null;
if (null != userbuf) {
base64UserBuf = Base64.encodeToString(userbuf, Base64.NO_WRAP);
try {
sigDoc.put("TLS.userbuf", base64UserBuf);
} catch (JSONException e) {
e.printStackTrace();
}
}
String sig = hmacsha256(sdkappid, userId, currTime, expire, priKeyContent, base64UserBuf);
if (sig.length() == 0) {
return "";
}
try {
sigDoc.put("TLS.sig", sig);
} catch (JSONException e) {
e.printStackTrace();
}
Deflater compressor = new Deflater();
compressor.setInput(sigDoc.toString().getBytes(Charset.forName("UTF-8")));
compressor.finish();
byte[] compressedBytes = new byte[2048];
int compressedBytesLength = compressor.deflate(compressedBytes);
compressor.end();
return new String(base64EncodeUrl(Arrays.copyOfRange(compressedBytes, 0, compressedBytesLength)));
}
private static String hmacsha256(long sdkappid, String userId, long currTime, long expire, String priKeyContent, String base64Userbuf) {
String contentToBeSigned = "TLS.identifier:" + userId + "\n"
+ "TLS.sdkappid:" + sdkappid + "\n"
+ "TLS.time:" + currTime + "\n"
+ "TLS.expire:" + expire + "\n";
if (null != base64Userbuf) {
contentToBeSigned += "TLS.userbuf:" + base64Userbuf + "\n";
}
try {
byte[] byteKey = priKeyContent.getBytes("UTF-8");
Mac hmac = Mac.getInstance("HmacSHA256");
SecretKeySpec keySpec = new SecretKeySpec(byteKey, "HmacSHA256");
hmac.init(keySpec);
byte[] byteSig = hmac.doFinal(contentToBeSigned.getBytes("UTF-8"));
return new String(Base64.encode(byteSig, Base64.NO_WRAP));
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
private static byte[] base64EncodeUrl(byte[] input) {
byte[] base64 = new String(Base64.encode(input, Base64.NO_WRAP)).getBytes();
for (int i = 0; i < base64.length; ++i) {
switch (base64[i]) {
case '+':
base64[i] = '*';
break;
case '/':
base64[i] = '-';
break;
case '=':
base64[i] = '_';
break;
default:
break;
}
}
return base64;
}
}
package com.ydl.component.rtc.http
import com.ydl.component.rtc.bean.UserSigBean
import com.ydl.component.rtc.bean.UserSigResponse
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import io.reactivex.Observable
interface MDTHttp {
fun getSecret(bean: UserSigResponse): Observable<BaseAPIResponse<UserSigBean>>
}
\ No newline at end of file
package com.ydl.component.rtc.http
import com.google.gson.Gson
import com.ydl.component.rtc.bean.UserSigBean
import com.ydl.component.rtc.bean.UserSigResponse
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlnet.YDLHttpUtils
import io.reactivex.Observable
import okhttp3.MediaType
import okhttp3.RequestBody
class MDTHttpImpl :MDTHttp {
private var mdtService: MDTService? = null
object Holder {
val INSTANCE = MDTHttpImpl()
}
companion object {
fun getInstance(): MDTHttpImpl {
return Holder.INSTANCE
}
}
private fun getMdtService(): MDTService {
if (mdtService == null) {
mdtService = YDLHttpUtils.obtainApi(MDTService::class.java)
}
return mdtService!!
}
//获取登录信息
override fun getSecret(bean: UserSigResponse): Observable<BaseAPIResponse<UserSigBean>> {
val str = Gson().toJson(bean)
val body: RequestBody =
RequestBody.create(MediaType.parse("application/json; charset=utf-8"), str)
return getMdtService().getSecret(body)
}
}
\ No newline at end of file
package com.ydl.component.rtc.http
import com.ydl.component.rtc.bean.UserSigBean
import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import io.reactivex.Observable
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.Headers
import retrofit2.http.POST
interface MDTService {
//获取用户密钥
@POST("video/secret")
@Headers(
YDL_DOMAIN + YDL_DOMAIN_JAVA,
"Content-Type:application/json"
)
fun getSecret(@Body body: RequestBody): Observable<BaseAPIResponse<UserSigBean>>
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/color_blue" />
<corners android:radius="20dp" />
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#F4F5F9" />
<corners android:radius="26dp" />
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/color_white" />
<corners android:radius="10dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FF999999" />
<corners android:radius="15dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true">
<shape android:shape="rectangle"
android:useLevel="false">
<solid android:color="#006EFF" />
<corners android:radius="28dp"/>
<padding android:left="5dp" android:right="5dp" android:top="3dp" android:bottom="3dp"/>
</shape>
</item>
<item android:state_enabled="false">
<shape android:shape="rectangle"
android:useLevel="false">
<solid android:color="#0F000000" />
<corners android:radius="28dp"/>
<padding android:left="5dp" android:right="5dp" android:top="3dp" android:bottom="3dp"/>
</shape>
</item>
</selector>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#EFEFEF" />
<corners
android:bottomLeftRadius="2dip"
android:bottomRightRadius="2dip"
android:topLeftRadius="2dip"
android:topRightRadius="2dip" />
<stroke
android:width="5px"
android:color="@color/white" />
</shape>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_white"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:layout_marginTop="28dp"
android:layout_marginEnd="10dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navigationIcon="@drawable/ic_back">
<TextView
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:singleLine="true"
android:text="@string/app_name"
android:textColor="@color/color_black"
android:textSize="18sp"
android:textStyle="bold" />
<Button
android:id="@+id/btn_ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:background="@android:color/transparent"
android:text="@string/btn_confirm"
android:textColor="@color/black"
android:visibility="gone" />
<ImageButton
android:id="@+id/btn_link"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="right|center_vertical"
android:background="@color/color_transparent"
android:padding="10dp"
android:src="@drawable/ic_question_link" />
</androidx.appcompat.widget.Toolbar>
<LinearLayout
android:id="@+id/ll_list"
android:layout_width="match_parent"
android:layout_height="200dp"
android:orientation="vertical"
android:padding="20dp"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toolbar">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_added_member"
android:textColor="@color/black"
android:textSize="18sp"
android:textStyle="bold" />
<ListView
android:id="@+id/list_member"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="10dp"
android:background="@drawable/bg_edit_text"
android:padding="8dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_search"
app:layout_constraintTop_toBottomOf="@+id/ll_list">
<TextView
android:id="@+id/tv_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="ID"
android:textColor="@color/color_black"
app:layout_constraintBaseline_toBaselineOf="@id/et_search_user"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="@+id/et_search_user"
android:layout_width="210dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:background="@null"
android:hint="@string/search_call_hint"
android:imeOptions="actionSearch"
android:inputType="number"
android:maxLength="11"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/color_black"
android:textColorHint="@color/text_color_hint"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="@id/cl_edit"
app:layout_constraintLeft_toRightOf="@id/tv_id" />
<ImageView
android:id="@+id/iv_clear_search"
android:layout_width="22dp"
android:layout_height="22dp"
android:background="@drawable/ic_clear_search"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/cl_edit"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/cl_edit" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/tv_search"
android:layout_width="76dp"
android:layout_height="38dp"
android:layout_marginEnd="20dp"
android:background="@drawable/bg_btn_search"
android:gravity="center"
android:text="@string/trtccalling_search"
android:textColor="@color/color_white"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="@id/cl_edit"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/cl_edit" />
<TextView
android:id="@+id/line_seperate"
android:layout_width="3dp"
android:layout_height="12dp"
android:layout_marginTop="21dp"
android:layout_marginEnd="22dp"
android:background="@drawable/bg_line_radius"
app:layout_constraintLeft_toLeftOf="@id/cl_edit"
app:layout_constraintTop_toBottomOf="@id/cl_edit" />
<TextView
android:id="@+id/tv_self_userid"
android:layout_width="wrap_content"
android:layout_height="22dp"
android:layout_marginStart="8dp"
android:layout_marginTop="17dp"
android:text="@string/self_userId"
android:textColor="#333333"
android:textSize="14sp"
app:layout_constraintStart_toEndOf="@id/line_seperate"
app:layout_constraintTop_toBottomOf="@id/cl_edit" />
<LinearLayout
android:id="@+id/ll_contract"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:gravity="center_vertical"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="@id/tv_search"
app:layout_constraintStart_toStartOf="@+id/cl_edit"
app:layout_constraintTop_toBottomOf="@+id/tv_self_userid"
tools:visibility="visible">
<com.tencent.qcloud.tuicore.calling.trtccalling.ui.common.RoundCornerImageView
android:id="@+id/img_avatar"
android:layout_width="44dp"
android:layout_height="44dp"
android:src="@drawable/ic_avatar"
app:trtc_radius="15dp" />
<TextView
android:id="@+id/tv_user_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1"
android:textColor="@color/color_black"
android:textSize="16sp" />
<Button
android:id="@+id/btn_start_call"
android:layout_width="56dp"
android:layout_height="26dp"
android:background="@drawable/bg_btn_search"
android:gravity="center"
android:text="@string/trtccalling_start_call"
android:textAllCaps="false"
android:textColor="@color/color_white" />
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_tips"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="120dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cl_edit">
<ImageView
android:id="@+id/iv_contacts_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_contacts_search"
app:layout_constraintBottom_toBottomOf="@id/cl_tips"
app:layout_constraintLeft_toLeftOf="@id/cl_tips"
app:layout_constraintRight_toRightOf="@id/cl_tips"
app:layout_constraintTop_toTopOf="@id/cl_tips" />
<TextView
android:id="@+id/tv_contacts_tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="11dp"
android:layout_marginTop="10dp"
android:text="@string/tips_search"
android:textColor="@color/color_input_normal"
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="@id/cl_tips"
app:layout_constraintRight_toRightOf="@id/cl_tips"
app:layout_constraintTop_toBottomOf="@id/iv_contacts_search" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="16dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/item_cl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_item_main_list">
<ImageView
android:id="@+id/img_item"
android:layout_width="170dp"
android:layout_height="136dp"
android:layout_marginStart="14dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_audio_call" />
<TextView
android:id="@+id/tv_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="34dp"
android:layout_marginEnd="10dp"
android:textColor="@color/color_black"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintLeft_toRightOf="@id/img_item"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_description"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="10dp"
android:paddingBottom="20dp"
android:textColor="#666666"
android:textSize="14sp"
app:layout_constraintLeft_toRightOf="@id/img_item"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title" />
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:id="@+id/bottom_line"
android:layout_width="match_parent"
android:layout_height="25dp"
android:visibility="gone" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_white">
<TextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="120dp"
android:text="@string/welcome_tips"
android:textColor="@color/color_black"
android:textSize="32sp"
app:layout_constraintBottom_toTopOf="@id/cl_edit"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="30dp"
android:background="@drawable/bg_edit_text"
android:padding="16dp"
app:layout_constraintBottom_toTopOf="@id/tv_login"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent">
<TextView
android:id="@+id/tv_phone_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/user_id"
android:textColor="@color/color_black"
android:textSize="16sp"
app:layout_constraintLeft_toLeftOf="@id/cl_edit"
app:layout_constraintTop_toTopOf="@id/cl_edit" />
<EditText
android:id="@+id/et_userId"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:background="@null"
android:hint="@string/hint_user_id"
android:inputType="number"
android:maxLength="11"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/color_black"
android:textColorHint="@color/color_input_normal"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="@id/tv_phone_number"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toRightOf="@id/tv_phone_number"
app:layout_constraintStart_toEndOf="@+id/tv_phone_number" />
</androidx.constraintlayout.widget.ConstraintLayout>
<Button
android:id="@+id/tv_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="@drawable/btn_border"
android:text="@string/btn_login"
android:textColor="@color/color_white"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_white">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="28dp"
android:text="@string/app_title_register"
android:textColor="@color/color_black"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.tencent.qcloud.tuicore.calling.trtccalling.ui.common.RoundCornerImageView
android:id="@+id/iv_user_avatar"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginTop="30dp"
android:layout_centerHorizontal="true"
app:trtc_radius="50dp"
android:src="@mipmap/ic_avatar"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title"
tools:ignore="MissingConstraints" />
<EditText
android:id="@+id/et_user_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="30dp"
android:layout_marginRight="20dp"
android:background="@drawable/bg_edit_text"
android:hint="@string/app_hint_user_name"
android:maxLines="1"
android:padding="20dp"
android:singleLine="true"
android:textColor="@color/color_black"
android:textColorHint="#BBBBBB"
android:textSize="16sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_user_avatar" />
<TextView
android:id="@+id/tv_tips_user_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:text="@string/app_tips_user_name"
android:textColor="@color/text_color_hint"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/et_user_name" />
<Button
android:id="@+id/tv_register"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="30dp"
android:layout_marginRight="20dp"
android:background="@drawable/btn_border"
android:text="@string/app_title_register"
android:textColor="@color/color_white"
android:textSize="16sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_tips_user_name" />
</androidx.constraintlayout.widget.ConstraintLayout>
......@@ -218,6 +218,14 @@
android:layout_marginRight="10dp"
android:text="我的" />
<Button
android:id="@+id/bt_mdt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="10dp"
android:text="mdt" />
</LinearLayout>
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_white">
<RelativeLayout
android:id="@+id/rl_title"
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_marginTop="28dp"
android:background="@color/color_white">
<TextView
android:id="@+id/main_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/app_name"
android:textColor="@color/color_black"
android:textSize="18sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/img_logout"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerVertical="true"
android:layout_marginStart="15dp"
android:src="@mipmap/ic_avatar"
android:visibility="gone" />
<TextView
android:id="@+id/tv_login_out"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerInParent="true"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:text="@string/app_login_out"
android:textColor="@color/color_black"
android:textSize="16sp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/rl_title"
android:background="@color/color_main_bg"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/main_recycler_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_weight="1" />
</LinearLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="270dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/bg_item_main_list">
<TextView
android:id="@+id/tv_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:text="aa"
android:textColor="@color/color_main_text"
android:textSize="16sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/view_divide"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="20dp"
android:background="@color/color_line"
app:layout_constraintTop_toBottomOf="@id/tv_message" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_button_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/view_divide">
<Button
android:id="@+id/btn_cancel"
android:layout_width="match_parent"
android:layout_height="44dp"
android:background="@android:color/transparent"
android:gravity="center"
android:text="@string/btn_confirm"
android:textColor="@color/color_blue"
android:textSize="17sp"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:padding="5dp">
<com.tencent.qcloud.tuicore.calling.trtccalling.ui.common.RoundCornerImageView
android:id="@+id/img_avatar"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/ic_avatar"
app:trtc_radius="12dp" />
<TextView
android:id="@+id/tv_user_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1"
android:textColor="@color/color_black"
android:textSize="16sp" />
<Button
android:id="@+id/btn_remove"
android:layout_width="56dp"
android:layout_height="26dp"
android:background="@drawable/bg_btn_search"
android:gravity="center"
android:text="@string/app_remove"
android:textAllCaps="false"
android:textColor="@color/color_white" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="270dp"
android:layout_height="142dp"
android:layout_gravity="center"
android:background="@drawable/bg_edit_text">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:text="@string/dialog_log_out"
android:textColor="@color/color_black"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/view_divide"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="43dp"
android:background="@color/text_color_hint"
app:layout_constraintBottom_toBottomOf="parent" />
<View
android:layout_width="1dp"
android:layout_height="43dp"
android:background="@color/text_color_hint"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_button_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent">
<Button
android:id="@+id/btn_cancel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:text="@string/btn_cancel"
android:textColor="@color/color_blue"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/cl_button_panel"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toLeftOf="@id/cl_button_panel"
app:layout_constraintRight_toLeftOf="@+id/btn_sure" />
<Button
android:id="@+id/btn_sure"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:text="@string/btn_confirm"
android:textColor="@color/color_blue"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="@id/cl_button_panel"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toRightOf="@id/btn_cancel"
app:layout_constraintRight_toRightOf="@id/cl_button_panel" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
......@@ -9,8 +9,8 @@
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin">
android:paddingLeft="16dp"
android:paddingRight="16dp">
<TextView
android:id="@+id/tv_current_time"
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rl_entrance_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#1B1B1B">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/iv_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="15dp"
android:background="@drawable/common_ic_back" />
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="15dp"
android:gravity="center_horizontal"
android:text="TRTC 视频通话示例"
android:textColor="@android:color/white"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_room_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginLeft="60dp"
android:layout_marginTop="100dp"
android:layout_marginRight="60dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="请输入房间号(必填项)"
android:textColor="@android:color/white" />
<EditText
android:id="@+id/et_input_room_id"
android:layout_width="match_parent"
android:layout_height="34dp"
android:layout_marginTop="5dp"
android:background="@drawable/common_edit_bg"
android:inputType="number" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ll_room_info"
android:layout_centerHorizontal="true"
android:layout_marginLeft="60dp"
android:layout_marginTop="30dp"
android:layout_marginRight="60dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="请输入用户名(必填项)"
android:textColor="@android:color/white" />
<EditText
android:id="@+id/et_input_username"
android:layout_width="match_parent"
android:layout_height="34dp"
android:layout_marginTop="5dp"
android:background="@drawable/common_edit_bg" />
</LinearLayout>
<Button
android:id="@+id/btn_enter_room"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_margin="60dp"
android:background="@drawable/common_button_bg"
android:text="进入房间"
android:textColor="@android:color/white" />
</RelativeLayout>
\ No newline at end of file
......@@ -12,7 +12,17 @@
<color name="blue">#2196F3</color>
<color name="grey">#9E9E9E</color>
<color name="color_white">#ffffff</color>
<color name="color_black">#000000</color>
<color name="color_transparent">#00000000</color>
<color name="text_color_hint">#BBBBBB</color>
<color name="color_blue">#006EFF</color>
<color name="color_bg_dialog">#66000000</color>
<color name="color_line">#DDDDDD</color>
<color name="color_input_normal">#BBBBBB</color>
<color name="color_input_no_match">#FA585E</color>
<color name="color_main_bg">#F1F3F8</color>
<color name="color_main_text">#333333</color>
<!-- ============ 标准颜色 ============ -->
<!--主题色 - 用于TabBar、突出文字、按钮和icon-->
......
......@@ -4,4 +4,65 @@
<string name="mode_loop">列表循环</string>
<string name="mode_shuffle">随机播放</string>
<string name="mode_one">单曲循环</string>
<string name="app_toast_login_success">登录成功</string>
<string name="app_toast_login_fail">登录IM失败,所有功能不可用[%d]%s</string>
<string name="working">正在运行中</string>
<string name="self_userId">您的userId:</string>
<string name="tips_search">搜索添加已注册用户\n\t\t\t以发起通话</string>
<string name="toast_video_call">视频呼叫:%s</string>
<string name="toast_voice_call">语音呼叫:%s</string>
<string name="toast_not_call_myself">不能呼叫自己</string>
<string name="call_self_format">您的userId: %s</string>
<string name="audio_call">语音通话</string>
<string name="video_call">视频通话</string>
<string name="btn_cancel">取消</string>
<string name="btn_confirm">确定</string>
<string name="search_call_hint">搜索 userId</string>
<string name="user_id">用户名</string>
<string name="hint_user_id">请输入登录的userId</string>
<string name="btn_login">登录</string>
<string name="welcome_tips">欢迎使用\n腾讯云实时音视频</string>
<string name="dialog_log_out">确定要退出登录吗?</string>
<string name="user_sig_expired">您的用户签名信息已过期,请重新登录</string>
<string name="user_id_is_empty">userId 不能为空</string>
<string name="app_title_register">注册</string>
<string name="app_text_user_name">用户名</string>
<string name="app_hint_user_name">请输入用户名</string>
<string name="app_tips_user_name">仅限中文、字母、数字和下划线,2–20个字</string>
<string name="app_toast_register_success_and_logging_in">注册成功</string>
<string name="app_toast_failed_to_set">设置失败: %s</string>
<string name="app_item_multi_audio_call">多人语音通话</string>
<string name="app_item_multi_video_call">多人视频通话</string>
<string name="app_added_member">已添加成员</string>
<string name="app_toast_no_member">无通话成员</string>
<string name="app_toast_multi_call_num_exceed">添加失败,人数超出限制</string>
<string name="app_toast_user_added">用户已添加</string>
<string name="app_tips_search">搜索添加已注册用户\n\t\t\t以发起通话</string>
<string name="app_self_userid">您的ID:</string>
<string name="app_search">搜索</string>
<string name="app_start_call">呼叫</string>
<string name="app_user_not_exist">用户不存在</string>
<string name="app_add">添加</string>
<string name="app_remove">移除</string>
<string name="app_tv_voice_call_tips">丢包率>70%可正常语音通话</string>
<string name="app_tv_video_call_tips">丢包率>50%可正常视频通话</string>
<string name="app_login_out">退出登录</string>
<string name="app_permission_hint">为了应用在后台时响应通话请求,请到设置中打开应用“后台拉起界面”权限</string>
<!--自定义随机登录名-->
<string name="app_custom_name_1">路飞</string>
<string name="app_custom_name_2">山治</string>
<string name="app_custom_name_3">娜美</string>
<string name="app_custom_name_4">乌索普</string>
<string name="app_custom_name_5">香克斯</string>
<string name="app_custom_name_6">弗兰奇</string>
<string name="app_custom_name_7">罗宾</string>
<string name="app_custom_name_8">钢铁侠</string>
<string name="app_custom_name_9">蜘蛛侠</string>
<string name="app_custom_name_10">乔巴</string>
<string name="app_custom_name_11">鸣人</string>
<string name="app_custom_name_12">艾斯</string>
</resources>
<resources>
<!-- Base application theme. -->
<style name="logoutDialogStyle" parent="@android:style/Theme.Holo.Dialog">
<item name="android:windowIsFloating">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowCloseOnTouchOutside">true</item>
<item name="android:windowBackground">@color/color_bg_dialog</item>
<item name="android:windowSoftInputMode">adjustResize</item>
</style>
</resources>
{
"tpns": {
"access_id": "",
"access_key": ""
},
"com.tencent.trtc": {
"channel": {
"enable": true,
"xiaomi": {
"app_id": "",
"app_key": ""
},
"vivo": {
"app_id": "",
"app_key": ""
},
"oppo": {
"app_id": "",
"app_key": ""
},
"meizu": {
"app_id": "",
"app_key": ""
}
}
},
"debug": true,
"version": "1.3.2.1-release",
"upgrade": false
}
\ No newline at end of file
apply from: "config.gradle"
buildscript {
ext.kotlin_version = '1.3.50'
ext {
kotlin_version = '1.3.21'
kotlin_version = '1.3.50'
support_version = '26.1.0'
minSdkVersion = 21
targetSdkVersion = 28
......@@ -16,50 +15,27 @@ buildscript {
constrait_support_version = '1.0.2'
}
repositories {
google()
//壹点灵android maven私服 开发版
maven {
url 'http://nexus.yidianling.com/repository/AndroidRepository/'
credentials {
username "admin"
password "fjoi#1+#@"
}
}
maven {
url 'http://nexus.yidianling.com/repository/AndroidReleases/'
url 'http://nexus.yidianling.com/repository/android/'
credentials {
username "admin"
password "fjoi#1+#@"
}
}
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
// maven {
// url 'https://dl.bintray.com/zouyuhan/maven'
// }
mavenCentral()
google()
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
//Umeng sdk maven 地址
maven { url 'https://repo1.maven.org/maven2/'}
mavenLocal()
// maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
classpath 'com.meituan.android.walle:plugin:1.1.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.meituan.robust:gradle-plugin:0.4.87'
classpath 'com.meituan.robust:auto-patch-plugin:0.4.87'
//bugly 符号表
classpath 'com.tencent.bugly:symtabfileuploader:2.2.1'
//微信资源混淆
classpath 'com.tencent.mm:AndResGuard-gradle-plugin:1.2.16'
classpath 'com.ydl.plugins:modular:1.0.3'
classpath 'com.ydl:notracepoint-gradle-plugin:0.0.3'
classpath 'com.ydl.plugins:restools:0.0.1'
classpath 'com.ydl.plugins:restools:1.0.1'
classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-rc1'
}
}
......@@ -68,34 +44,16 @@ allprojects {
repositories {
//壹点灵android maven私服 开发版
maven {
url 'http://nexus.yidianling.com/repository/AndroidRepository/'
credentials {
username "admin"
password "fjoi#1+#@"
}
}
maven {
url 'http://nexus.yidianling.com/repository/AndroidReleases/'
url 'http://nexus.yidianling.com/repository/android/'
credentials {
username "admin"
password "fjoi#1+#@"
}
}
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
// maven { url'http://developer.huawei.com/repo/' }
maven { url "https://jitpack.io" }
maven {
// url 'https://maven.google.com'
url'https://dl.google.com/dl/android/maven2/'
}
// maven {
// url 'https://dl.bintray.com/zouyuhan/maven'
// }
mavenCentral()
google()
jcenter()
maven { url 'https://maven.aliyun.com/repository/releases' }
//Umeng sdk maven 地址
maven { url 'https://repo1.maven.org/maven2/'}
mavenLocal()
}
}
......
......@@ -5,18 +5,18 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.49.64",
"m-consultant" : "0.0.60.11",
"m-fm" : "0.0.30.04",
"m-user" : "0.0.62.03",
"m-home" : "0.0.23.17",
"m-im" : "0.0.21.21",
"m-confide" : "0.0.49.69",
"m-consultant" : "0.0.60.20",
"m-fm" : "0.0.30.08",
"m-user" : "0.0.62.04",
"m-home" : "0.0.23.36",
"m-im" : "0.0.21.30",
"m-dynamic" : "0.0.7.35",
"m-article" : "0.0.0.10",
"m-muse" : "0.0.28.27",
"m-muse" : "0.0.28.28",
"m-tests" : "0.0.24.18",
"m-course" : "0.0.43.36",
"m-course" : "0.0.43.37",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
......@@ -32,23 +32,25 @@ ext {
"m-dynamic-api" : "0.0.3.71",
//-------------- 功能组件 --------------
//mdt 组件
"ydl-tuicore" : "0.0.22",
//第一步
"ydl-platform" : "0.0.40.92",
"ydl-platform" : "0.0.40.96",
//第二步 若干
"ydl-webview" : "0.0.38.61",
"ydl-media" : "0.0.21.42",
"ydl-media" : "0.0.21.44",
"ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.84",
"m-audioim" : "0.0.49.29.85",
"ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动
"router" : "0.0.1",
"ydl-net" : "0.0.3.92",
"ydl-utils" : "0.0.3.2",
"ydl-net" : "0.0.3.93",
"ydl-utils" : "0.0.3.3",
]
ydl_app = [
appName : "心理咨询壹点灵",
appName : "壹点灵心理咨询",
applicationId: "com.cxzapp.yidianling",
versionName : "4.0.99",
versionCode : 4099,
......@@ -89,18 +91,18 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.49.64",
"m-consultant" : "0.0.60.11",
"m-fm" : "0.0.30.07",
"m-user" : "0.0.62.03",
"m-home" : "0.0.23.17",
"m-im" : "0.0.21.21",
"m-confide" : "0.0.49.69",
"m-consultant" : "0.0.60.20",
"m-fm" : "0.0.30.08",
"m-user" : "0.0.62.04",
"m-home" : "0.0.23.36",
"m-im" : "0.0.21.30",
"m-dynamic" : "0.0.7.35",
"m-article" : "0.0.0.8",
"m-muse" : "0.0.28.27",
"m-muse" : "0.0.28.28",
"m-tests" : "0.0.24.18",
"m-course" : "0.0.43.36",
"m-course" : "0.0.43.37",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.11",
......@@ -114,21 +116,22 @@ ext {
"m-im-api" : "0.0.12.23",
"m-dynamic-api" : "0.0.3.71",
//-------------- 功能组件 --------------
//mdt组件
"ydl-tuicore" : "0.0.22",
//第一步
"ydl-platform" : "0.0.40.92",
"ydl-platform" : "0.0.40.96",
//第二步 若干
"ydl-webview" : "0.0.38.61",
"ydl-media" : "0.0.21.42",
"ydl-media" : "0.0.21.44",
"ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.84",
"m-audioim" : "0.0.49.29.85",
"ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动
"router" : "0.0.1",
"ydl-net" : "0.0.3.92",
"ydl-utils" : "0.0.3.1",
"ydl-net" : "0.0.3.93",
"ydl-utils" : "0.0.3.3",
]
dependencies = [
......@@ -205,7 +208,7 @@ ext {
"androideventbus" : "org.simple:androideventbus:1.0.5.1",
"otto" : "com.squareup:otto:1.3.8",
"gson" : "com.google.code.gson:gson:2.8.5",
"aliyun" : "com.aliyun.openservices:aliyun-log-android-sdk:2.5.13",
"aliyun" : "com.aliyun.openservices:aliyun-log-android-sdk:2.5.13",
"javax.annotation" : "javax.annotation:jsr250-api:1.0",
"arouter" : "com.alibaba:arouter-api:1.4.1",
"progressmanager" : "me.jessyan:progressmanager:1.5.0",
......@@ -237,7 +240,7 @@ ext {
"androidanimations" : "com.daimajia.androidanimations:library:2.3@aar",
//友盟统计
"umeng-common" : "com.umeng.umsdk:common:9.3.8",
"umeng-asms" :"com.umeng.umsdk:asms:1.2.2",
"umeng-asms" : "com.umeng.umsdk:asms:1.2.2",
//友盟社会化分享
"umeng-share-core" : "com.umeng.umsdk:share-core:7.1.4",
"umeng-share-qq" : "com.umeng.umsdk:share-qq:7.1.4",
......@@ -283,7 +286,7 @@ ext {
//基础组件 <<--- 先发这个,发完改这里的版本号
"ydl-platform" : "com.ydl:ydl-platform:${ydlCompileVersion["ydl-platform"]}@aar",
"ydl-tuicore" : "com.ydl:ydl-tuicore:${ydlCompileVersion["ydl-tuicore"]}@aar",
//功能组件 <<--- 再发这些,发完改这里的版本号
"ydl-webview" : "com.ydl:ydl-webview:${ydlCompileVersion["ydl-webview"]}@aar",
"ydl-media" : "com.ydl:ydl-media:${ydlCompileVersion["ydl-media"]}@aar",
......
......@@ -75,9 +75,8 @@ dependencies {
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
api "com.alibaba:arouter-api:$arouter_api"
api ('com.ydl:ydl-av:1.3.8@aar'){
transitive = true
}
implementation "com.ydl:ydl-av:1.3.9"
implementation 'com.volcengine:apm_insight:1.4.6.cn'
if (rootProject.ext.dev_mode){
//开发时使用
......
......@@ -34,6 +34,7 @@ import com.ydl.audioim.player.AudioPlayer
import com.ydl.audioim.presenter.AudioHomePresenterImpl
import com.ydl.audioim.utils.AudioLogUtils
import com.ydl.audioim.utils.DateUtils
import com.ydl.audioim.utils.onConfideEvent
import com.ydl.audioim.widget.AxbConfirmDialog
import com.ydl.audioim.widget.ZDialog
import com.ydl.webview.H5Params
......@@ -55,7 +56,6 @@ import com.ydl.ydlcommon.utils.log.AliYunLogConfig
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.api.service.IUserService
import de.greenrobot.event.EventBus
import io.agora.rtc.Constants
......@@ -262,6 +262,7 @@ class AudioHomeActivity :
override fun onJoinChannelSuccess(channel: String?, uid: Int, elapsed: Int) {
super.onJoinChannelSuccess(channel, uid, elapsed)
onMeJoined()
callEventSave("20", "$uid 用户声网加入频道成功:channel=$channel")
LogUtil.e("[agora]$uid 用户声网加入频道成功:channel=$channel")
......@@ -349,6 +350,7 @@ class AudioHomeActivity :
super.onUserJoined(uid, elapsed)
callEventSave("20", "${uid}加入频道回调")
LogUtil.e("[agora]远端用户/主播加入频道回调")
onPeerJoined()
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "远端用户/主播加入频道回调")
}
......@@ -795,6 +797,7 @@ class AudioHomeActivity :
fun rtcCall() {
YDLavManager.instances.rtcCall(listenerUid, channelId, sendDoctocrMsg)
onStartCall()
}
/**
......@@ -807,7 +810,7 @@ class AudioHomeActivity :
* param mRtcEventHandler 事件回调(SDK 通过指定的事件通知应用程序 SDK 的运行事件,如: 加入或离开频道,新用户加入频道等)
*/
voiceManage = YDLVoiceManager(this, BuildConfig.AGORA_APPID, mRtcEventHandler)
voiceManage?.init()
voiceManage!!.init()
}
/**
......@@ -1411,4 +1414,24 @@ class AudioHomeActivity :
) {
YDLavManager.instances.callEventSave(status,res , session, line)
}
private fun onStartCall() {
val dimension = hashMapOf("conversation" to "start_call", "call" to "call_start")
onConfideEvent(dimension, channelId)
}
private fun onMeJoined() {
val dimension = hashMapOf("conversation" to "me_joined")
onConfideEvent(dimension, channelId)
}
fun onPeerAccepted() {
val dimension = hashMapOf("conversation" to "peer_accepted", "call" to "call_accepted")
onConfideEvent(dimension, channelId)
}
private fun onPeerJoined() {
val dimension = hashMapOf("conversation" to "peer_joined")
onConfideEvent(dimension, channelId)
}
}
......@@ -6,6 +6,7 @@ import android.os.Handler
import android.text.TextUtils
import android.util.Log
import com.alibaba.android.arouter.launcher.ARouter
import com.bytedance.apm.insight.ApmInsightAgent
import com.google.gson.Gson
import com.ydl.audioim.bean.AgoraInvitationBean
import com.ydl.audioim.http.AudioApiRequestUtil
......@@ -13,6 +14,7 @@ import com.ydl.audioim.http.command.ConnectExceptionCommand
import com.ydl.audioim.router.AudioImIn
import com.ydl.audioim.utils.AudioLogUtils
import com.ydl.audioim.utils.AudioLogUtils.Companion.writeAgoraLog
import com.ydl.audioim.utils.onConfideEvent
import com.ydl.consultantim.ConsultantAudioHomeActivity
import com.ydl.ydl_av.messge_service.YDLRTMClient
import com.ydl.ydl_av.messge_service.bean.RTMMesssage
......@@ -41,6 +43,7 @@ import io.agora.rtm.RtmStatusCode.ConnectionChangeReason.CONNECTION_CHANGE_REASO
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import org.json.JSONObject
import java.util.*
import java.util.concurrent.TimeUnit
......@@ -67,9 +70,7 @@ class YDLavManager {
fun init(context: Context, appId: String) {
YDLRTMClient.instances.init(context, appId, listener)
if (EventBus.getDefault().isRegistered(this)) {
EventBus.getDefault().unregister(this)
}
EventBus.getDefault().register(this)
//设置回调
setCallback()
......@@ -101,6 +102,8 @@ class YDLavManager {
"${response?.calleeId}已收到呼叫邀请,频道号${response?.ChannelId}"
)
val dimension = hashMapOf("call" to "call_received_by_peer")
onConfideEvent(dimension, response?.ChannelId)
val act = ActivityManager.getInstance().getTopTaskActivity()
if (act is AudioHomeActivity) {
act.runOnUiThread {
......@@ -122,6 +125,7 @@ class YDLavManager {
if (act is AudioHomeActivity) {
act.runOnUiThread {
act.joinChannel()
act.onPeerAccepted()
}
}
}
......@@ -133,6 +137,8 @@ class YDLavManager {
AliYunLogConfig.AGORA,
"${response?.calleeId}已拒绝呼叫邀请"
)
val dimension = hashMapOf("call" to "call_refused")
onConfideEvent(dimension, response?.ChannelId)
val act = ActivityManager.getInstance().getTopTaskActivity()
if (act is AudioHomeActivity) {
act.runOnUiThread {
......@@ -154,6 +160,8 @@ class YDLavManager {
AliYunLogConfig.AGORA,
"主叫已取消呼叫邀请"
)
val dimension = hashMapOf("call" to "call_canceled")
onConfideEvent(dimension, response?.ChannelId)
val act = ActivityManager.getInstance().getTopTaskActivity()
if (act is AudioHomeActivity) {
act.runOnUiThread {
......@@ -170,6 +178,11 @@ class YDLavManager {
AliYunLogConfig.AGORA,
"呼叫${response?.calleeId}用户失败:${response?.response}"
)
val dimension = hashMapOf(
"call" to "call_fail",
"call_fail" to "code${errorCode}"
)
onConfideEvent(dimension, response?.ChannelId)
val act = ActivityManager.getInstance().getTopTaskActivity()
//专家离线或者30 秒后仍未收到专家响应,重新再邀请一次
when (errorCode) {
......
package com.ydl.audioim.utils
import com.apm.insight.log.VLog
import com.bytedance.apm.insight.ApmInsightAgent
import com.ydl.ydlcommon.modular.ModularServiceManager
import org.json.JSONObject
internal fun onConfideEvent(dimension: HashMap<String, String>, channel: String?) {
try {
val uid = ModularServiceManager.getPlatformUserService()?.getUser()?.userId
val ext = JSONObject(mapOf("uid" to uid, "channelId" to (channel ?: "unknown")))
ApmInsightAgent.monitorEvent("confide", dimension, hashMapOf(), ext)
} catch (throwable: Throwable) {
VLog.e("onConfideEvent", throwable.message)
}
}
\ No newline at end of file
......@@ -7,13 +7,8 @@ import android.animation.PropertyValuesHolder
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.drm.DrmStore
import android.graphics.Typeface
import android.os.Build
import androidx.core.content.ContextCompat
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import android.text.TextUtils
import android.view.Gravity
import android.view.View
......@@ -22,6 +17,10 @@ import android.view.inputmethod.InputMethodManager
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.google.android.material.appbar.AppBarLayout
......@@ -391,7 +390,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private fun initData(mIntent: Intent) {
fromPageType = mIntent.getIntExtra(EXTRA_FROM_PAGE, -1)
initCategory = mIntent.getStringExtra(EXTRA_CATEGORY)?:""
initCategory = mIntent.getStringExtra(EXTRA_CATEGORY) ?: ""
initShowType = mIntent.getIntExtra(EXTRA_SHOW_TYPE, 0)
tv_search_content.text = mIntent.getStringExtra(EXTRA_SEARCH_WORD)
keyWord = mIntent.getStringExtra(EXTRA_CATEGORY_NAME) ?: ""
......@@ -485,7 +484,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
val popWidth = RxDeviceTool.getScreenWidth(mContext)
val mWidth = (popWidth - RxImageTool.dp2px(10f)) / hotData.size
for ((index, hot) in hotData!!.withIndex()) {
val tv = View.inflate(mContext, R.layout.consultant_item_filter_online, null) as TextView
val tv =
View.inflate(mContext, R.layout.consultant_item_filter_online, null) as TextView
val textView = tv.tvFree
val params = LinearLayout.LayoutParams(0, RxImageTool.dp2px(22f))
params.weight = 1f
......@@ -644,7 +644,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
}
}
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0) {
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.title.size > 0) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
......@@ -664,7 +664,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
}
}
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0) {
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.title.size > 0) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
......@@ -684,7 +684,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
}
}
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0) {
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.title.size > 0) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
......@@ -704,7 +704,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
}
}
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0) {
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.title.size > 0) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
......@@ -1011,6 +1011,9 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
tempFilter.showType = allFilter.showType
tempFilter.ages.clear()
tempFilter.ages.addAll(allFilter.ages)
//学历
tempFilter.doctorEdu.clear()
tempFilter.doctorEdu.addAll(allFilter.doctorEdu)
tempFilter.enquiries.clear()
tempFilter.enquiries.addAll(allFilter.enquiries)
// 擅长人群添加数据
......@@ -1026,7 +1029,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
filterPopupWindow.setOnDismissListener {
// viewDim.visibility = View.INVISIBLE
viewDim_filter.visibility = View.GONE
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0 || !TextUtils.isEmpty(
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.title.size > 0 || !TextUtils.isEmpty(
allFilter.priceRanges?.minPrice
) || !TextUtils.isEmpty(allFilter.priceRanges?.maxPrice)
) {
......@@ -1052,14 +1055,18 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
//筛选确认回调
override fun onFilterConfirmed() {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_OPEN)
LogUtil.d("filter: " + tempFilter.showType.value + "," + tempFilter.enquiries.map { it.value }
.joinToString(",") + "," + tempFilter.ages.map { it.value }
.joinToString(",") + "," + tempFilter.others.map { it.value }.joinToString(","))
LogUtil.d("filter: " + tempFilter.showType.value + ","
+ tempFilter.enquiries.map { it.value }.joinToString(",") + ","
+ tempFilter.ages.map { it.value }.joinToString(",") + ","
+ tempFilter.others.map { it.value }.joinToString(",")+ ","
+ tempFilter.doctorEdu.map { it.value }.joinToString(","))
props1.put(
"filtrate_second",
tempFilter.showType.value + "," + tempFilter.enquiries.map { it.value }
.joinToString(",") + "," + tempFilter.ages.map { it.value }
.joinToString(",") + "," + tempFilter.others.map { it.value }.joinToString(",")
tempFilter.showType.value + ","
+ tempFilter.enquiries.map { it.value }.joinToString(",") + ","
+ tempFilter.ages.map { it.value }.joinToString(",") + ","
+ tempFilter.others.map { it.value }.joinToString(",") +","
+ tempFilter.doctorEdu.map { it.value }.joinToString(",")
)
BuryPointUtils.buryPoint("Filtrate", props1)
......@@ -1069,6 +1076,9 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
allFilter.enquiries.addAll(tempFilter.enquiries)
allFilter.ages.clear()
allFilter.ages.addAll(tempFilter.ages)
//学历
allFilter.doctorEdu.clear()
allFilter.doctorEdu.addAll(tempFilter.doctorEdu)
// 擅长人群
allFilter.specialityCrowd.clear()
allFilter.specialityCrowd.addAll(tempFilter.specialityCrowd)
......@@ -1176,7 +1186,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
//筛选标题显示处理
private fun filterLabelSet() {
if ((allFilter.others.size + allFilter.ages.size + allFilter.enquiries.size + allFilter.title.size+allFilter.specialityCrowd.size) == 1) {
if ((allFilter.others.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.enquiries.size + allFilter.title.size + allFilter.specialityCrowd.size) == 1) {
var text: String? = ""
if (allFilter.others.size == 1) {
text = allFilter.others[0].value
......@@ -1186,8 +1196,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
text = allFilter.enquiries[0].value
} else if (allFilter.title.size == 1) {
text = allFilter.title[0].value
}else if (allFilter.specialityCrowd.size==1){
} else if (allFilter.specialityCrowd.size == 1) {
text = allFilter.specialityCrowd[0].value
}else if(allFilter.doctorEdu.size == 1){
//学历
text = allFilter.doctorEdu[0].value
} else {
text = "筛选"
}
......@@ -1488,6 +1501,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
allFilter.sub = SubItem()
allFilter.enquiries.clear()
allFilter.ages.clear()
allFilter.doctorEdu.clear()
allFilter.others.clear()
updateFilterTextViewStatus(tvSubject, FILTER_STATUS_NORMAL)
updateFilterTextViewStatus(tvArea, FILTER_STATUS_NORMAL)
......
......@@ -7,18 +7,17 @@ import android.animation.PropertyValuesHolder
import android.content.Context
import android.graphics.Typeface
import android.os.Build
import androidx.core.content.ContextCompat
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import android.text.TextUtils
import android.view.Gravity
import android.view.View
import android.view.inputmethod.InputMethodManager
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.google.android.material.appbar.AppBarLayout
......@@ -59,12 +58,7 @@ import kotlinx.android.synthetic.main.consultant_item_filter_online.view.*
import kotlinx.android.synthetic.main.consultant_layout_search_content.*
import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.*
import org.json.JSONObject
import java.util.*
import java.util.concurrent.Executors
import kotlin.collections.ArrayList
import kotlin.collections.LinkedHashSet
import kotlin.properties.Delegates
import kotlin.reflect.jvm.internal.impl.load.kotlin.JvmType
@Route(path = "/consultant/consultant")
class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPresenter>(),
......@@ -241,18 +235,15 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} else if (newState == RecyclerView.SCROLL_STATE_IDLE) {
//没有滚动
showConsultAssistantDialog()
if (sIsScrolling) {
}
sIsScrolling = false;
sIsScrolling = false
}
}
override fun onScrollTop() {
var alpha = PropertyValuesHolder.ofFloat("alpha", 1f, 0f)
var scaleX = PropertyValuesHolder.ofFloat("scaleX", 1f, 0f)
var scaleY = PropertyValuesHolder.ofFloat("scaleY", 1f, 0f)
var animator =
val alpha = PropertyValuesHolder.ofFloat("alpha", 1f, 0f)
val scaleX = PropertyValuesHolder.ofFloat("scaleX", 1f, 0f)
val scaleY = PropertyValuesHolder.ofFloat("scaleY", 1f, 0f)
val animator =
ObjectAnimator.ofPropertyValuesHolder(image_scroll_top, alpha, scaleX, scaleY)
.setDuration(200)
animator.addListener(object : AnimatorListenerAdapter() {
......@@ -268,10 +259,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
if (isBtnShow) {
return
}
var alpha = PropertyValuesHolder.ofFloat("alpha", 0f, 1f)
var scaleX = PropertyValuesHolder.ofFloat("scaleX", 0f, 1f)
var scaleY = PropertyValuesHolder.ofFloat("scaleY", 0f, 1f)
var animator =
val alpha = PropertyValuesHolder.ofFloat("alpha", 0f, 1f)
val scaleX = PropertyValuesHolder.ofFloat("scaleX", 0f, 1f)
val scaleY = PropertyValuesHolder.ofFloat("scaleY", 0f, 1f)
val animator =
ObjectAnimator.ofPropertyValuesHolder(image_scroll_top, alpha, scaleX, scaleY)
.setDuration(200)
animator.addListener(object : AnimatorListenerAdapter() {
......@@ -287,10 +278,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
if (!isBtnShow) {
return
}
var alpha = PropertyValuesHolder.ofFloat("alpha", 1f, 0f)
var scaleX = PropertyValuesHolder.ofFloat("scaleX", 1f, 0f)
var scaleY = PropertyValuesHolder.ofFloat("scaleY", 1f, 0f)
var animator =
val alpha = PropertyValuesHolder.ofFloat("alpha", 1f, 0f)
val scaleX = PropertyValuesHolder.ofFloat("scaleX", 1f, 0f)
val scaleY = PropertyValuesHolder.ofFloat("scaleY", 1f, 0f)
val animator =
ObjectAnimator.ofPropertyValuesHolder(image_scroll_top, alpha, scaleX, scaleY)
.setDuration(200)
animator.addListener(object : AnimatorListenerAdapter() {
......@@ -608,7 +599,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
}
}
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size+allFilter.specialityCrowd.size > 0) {
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size+allFilter.doctorEdu.size + allFilter.title.size+allFilter.specialityCrowd.size > 0) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
......@@ -973,6 +964,9 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
tempFilter.showType = allFilter.showType
tempFilter.ages.clear()
tempFilter.ages.addAll(allFilter.ages)
//学历
tempFilter.doctorEdu.clear()
tempFilter.doctorEdu.addAll(allFilter.doctorEdu)
tempFilter.enquiries.clear()
tempFilter.enquiries.addAll(allFilter.enquiries)
// 擅长人群添加数据
......@@ -988,7 +982,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
filterPopupWindow.setOnDismissListener {
viewDim.visibility = View.INVISIBLE
viewDim_filter.visibility = View.GONE
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size+allFilter.specialityCrowd.size > 0 || !TextUtils.isEmpty(
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.title.size+allFilter.specialityCrowd.size > 0 || !TextUtils.isEmpty(
allFilter.priceRanges?.minPrice
) || !TextUtils.isEmpty(allFilter.priceRanges?.maxPrice)
) {
......@@ -1024,10 +1018,11 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
)
props1.put(
"filtrate_second",
tempFilter.showType.value + "," + tempFilter.enquiries.map { it.value }
.joinToString(",") + "," + tempFilter.ages.map { it.value }.joinToString(
","
) + "," + tempFilter.others.map { it.value }.joinToString(",")
tempFilter.showType.value + ","
+ tempFilter.enquiries.map { it.value }.joinToString(",") + ","
+ tempFilter.ages.map { it.value }.joinToString(",") + ","
+ tempFilter.doctorEdu.map { it.value }.joinToString(",") + ","
+ tempFilter.others.map { it.value }.joinToString(",")
)
BuryPointUtils.buryPoint("Filtrate", props1)
......@@ -1037,6 +1032,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
allFilter.enquiries.addAll(tempFilter.enquiries)
allFilter.ages.clear()
allFilter.ages.addAll(tempFilter.ages)
allFilter.doctorEdu.clear()
allFilter.doctorEdu.addAll(tempFilter.doctorEdu)
// 擅长人群
allFilter.specialityCrowd.clear()
allFilter.specialityCrowd.addAll(tempFilter.specialityCrowd)
......@@ -1145,7 +1142,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
//筛选标题显示处理
private fun filterLabelSet() {
if ((allFilter.others.size + allFilter.ages.size + allFilter.enquiries.size + allFilter.title.size+allFilter.specialityCrowd.size) == 1) {
if ((allFilter.others.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.enquiries.size + allFilter.title.size+allFilter.specialityCrowd.size) == 1) {
var text: String? = ""
when {
allFilter.others.size == 1 -> {
......@@ -1163,6 +1160,9 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
allFilter.specialityCrowd.size==1 -> {
text = allFilter.specialityCrowd[0].value
}
allFilter.doctorEdu.size==1 -> {
text = allFilter.doctorEdu[0].value
}
else -> {
text = "筛选"
}
......
......@@ -139,6 +139,10 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
if (allFilter.ages.isNotEmpty()) {
sb.append("&ages=").append(allFilter.ages.map { it.key }.joinToString(","))
}
if (allFilter.doctorEdu.isNotEmpty()) {
sb.append("&edus=").append(allFilter.doctorEdu.map { it.key }.joinToString(","))
}
// 擅长人群拼接
if (allFilter.specialityCrowd.isNotEmpty()) {
sb.append("&crowdsTags=")
......
......@@ -15,14 +15,9 @@ import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.URLUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxImageTool
import com.yidianling.consultant.ExpertSearchActivity
import com.yidianling.consultant.IExpertSearchView
import com.yidianling.consultant.R
......@@ -89,14 +84,18 @@ class ExpertSearchAdapter(
holder.imgHead_online.visibility = View.GONE
} else {
//不是服务中且问询人数大于0
if (itemBean.chatNum > 5) {
holder.chat_people_in_question.visibility = View.VISIBLE
holder.chat_people_in_question.text = "多人在问询"
} else if (itemBean.chatNum > 0) {
holder.chat_people_in_question.visibility = View.VISIBLE
holder.chat_people_in_question.text = "${itemBean.chatNum}人在问询"
} else {
holder.chat_people_in_question.visibility = View.GONE
when {
itemBean.chatNum > 5 -> {
holder.chat_people_in_question.visibility = View.VISIBLE
holder.chat_people_in_question.text = "多人在问询"
}
itemBean.chatNum > 0 -> {
holder.chat_people_in_question.visibility = View.VISIBLE
holder.chat_people_in_question.text = "${itemBean.chatNum}人在问询"
}
else -> {
holder.chat_people_in_question.visibility = View.GONE
}
}
//可预约
holder.imgHead_online_server.visibility = View.GONE
......@@ -158,18 +157,22 @@ class ExpertSearchAdapter(
} else {
holder.imgFightEpidemicIcon.visibility = View.GONE
//能力等级标签
if (1 == itemBean.abilityLevel) {
//实习
holder.imgAbilityLevel.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_shixi)
holder.imgAbilityLevel.visibility = View.VISIBLE
} else if (2 == itemBean.abilityLevel) {
//新手
holder.imgAbilityLevel.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_xinshou)
holder.imgAbilityLevel.visibility = View.VISIBLE
} else {
holder.imgAbilityLevel.visibility = View.GONE
when (itemBean.abilityLevel) {
1 -> {
//实习
holder.imgAbilityLevel.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_shixi)
holder.imgAbilityLevel.visibility = View.VISIBLE
}
2 -> {
//新手
holder.imgAbilityLevel.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_xinshou)
holder.imgAbilityLevel.visibility = View.VISIBLE
}
else -> {
holder.imgAbilityLevel.visibility = View.GONE
}
}
//活动图标
if (!TextUtils.isEmpty(itemBean.activityImg)) {
......@@ -223,13 +226,24 @@ class ExpertSearchAdapter(
holder.tvTeamCertifications.text = itemBean.teamCertifications
//咨询师标签
holder.ll_tags.removeAllViews()
if (!TextUtils.isEmpty(itemBean.tags)) {
val tagList = itemBean.tags!!.split("|")
for (tag in tagList) {
if (!TextUtils.isEmpty(tag)) {
val view = LayoutInflater.from(context)
.inflate(R.layout.consultant_item_tag, holder.ll_tags, false)
view.tvTag.text = tag
itemBean.tagList?.let {
if (it.isNotEmpty()){
for (tag in itemBean.tagList){
val view = LayoutInflater.from(context).inflate(R.layout.consultant_item_tag, holder.ll_tags, false)
tag.tagName?.let { name ->
if (name.length>4){
view.tvTag.text = "${name.substring(0,4)}…"
}else{
view.tvTag.text = name
}
}
if (tag.isHigh==1){
view.tvTag.setBackgroundResource(R.drawable.consultant_bg_radius_line_eb892c)
view.tvTag.setTextColor(ContextCompat.getColor(context,R.color.color_EB892C))
}else{
view.tvTag.setBackgroundResource(R.drawable.consultant_bg_radius_line_gray_1)
view.tvTag.setTextColor(ContextCompat.getColor(context,R.color.platform_color_E0E0E0))
}
holder.ll_tags.addView(view)
}
}
......@@ -279,22 +293,26 @@ class ExpertSearchAdapter(
holder.ll_tags,
false
)
if (1 == item.isPackage) {
view.tvTitle.text = "单次"
view.tvTitle.setTextColor(context.resources.getColor(R.color.platform_color_1DA1F2))
view.tvTitle.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_single)
view.tvContent.text = item.name
holder.ll_products.addView(view)
} else if (2 == item.isPackage) {
view.tvTitle.text = "套餐"
view.tvTitle.setTextColor(context.resources.getColor(R.color.consultant_color_FF9500))
view.tvTitle.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_menu)
view.tvContent.text = item.name
holder.ll_products.addView(view)
} else {
when (item.isPackage) {
1 -> {
view.tvTitle.text = "单次"
view.tvTitle.setTextColor(context.resources.getColor(R.color.platform_color_1DA1F2))
view.tvTitle.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_single)
view.tvContent.text = item.name
holder.ll_products.addView(view)
}
2 -> {
view.tvTitle.text = "套餐"
view.tvTitle.setTextColor(context.resources.getColor(R.color.consultant_color_FF9500))
view.tvTitle.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_menu)
view.tvContent.text = item.name
holder.ll_products.addView(view)
}
else -> {
}
}
}
}
......
......@@ -12,6 +12,7 @@ class ConsultBIConstants {
const val POSITION_CONSULT_TYPE_CLICK = "consult_type_click" //咨询方式
const val POSITION_AVERAGE_SERVICE_INPUT = "average_service_input" //服务均价
const val POSITION_AGE_CHOICE_CLICK = "age_choice_click" //年龄选择
const val POSITION_EDU_CHOICE_CLICK = "education_background_click" //学历选择
const val POSITION_QUALIFICATION_CHOICE_CLICK = "qualification_choice_click" //资质选择
const val POSITION_GOOD_AT_CLICK = "good_at_click" // 擅长人群
const val POSITION_OTHER_CHOICE_CLICK = "other_choice_click" //其他选择
......
......@@ -19,6 +19,7 @@ data class AllFilter(
var priceRanges: PriceRangesItem ?= null, //服务均价
var priceRangesView: TextView ?= null, //服务均价
val ages: ArrayList<AgeItem> = ArrayList(), //年龄
val doctorEdu: ArrayList<DoctorEduItem> = ArrayList(), //学历
val others: ArrayList<OtherItem> = ArrayList(),//其他筛选
val title:ArrayList<ReorderItem> = ArrayList(), //资质
......
package com.yidianling.consultant.model.bean
import com.google.gson.annotations.SerializedName
/**
* 搜索条件 学历返回数据
* */
data class DoctorEduItem(
@field:SerializedName("key")
var key: Int? = null,
@field:SerializedName("value")
var value: String? = null
)
\ No newline at end of file
......@@ -130,5 +130,15 @@ data class DoctorServiceItem(
/**
* 私聊按钮的文案(如果不为空则取这个字段的值,如果为空 则默认为:“私聊”)
*/
val chatBtnText: String?
val chatBtnText: String?,
/**
* 新标签分类
*/
val tagList: ArrayList<TagBean>?
)
data class TagBean(
val tagName:String?,
val isHigh:Int
)
\ No newline at end of file
......@@ -4,6 +4,12 @@ import com.google.gson.annotations.SerializedName
data class Filters(
/**
* 学历
*/
@field:SerializedName("doctor_edu")
val doctorEdu: List<DoctorEduItem> = ArrayList(),
/**
* 按服务或者按专家
*/
@field:SerializedName("show_type")
......
......@@ -114,7 +114,7 @@ class ConsultAssistantDialogUtils private constructor() {
object : ConsultAssistantDialog.OnConsultAssistantClickListener {
override fun onClickAction() {
if (Utils.isFastClick()) {
return onClickAction()
return@onClickAction
}
if (ConsultantIn.getUserImpl().isLogin()){
//获取用户uid
......@@ -161,7 +161,7 @@ class ConsultAssistantDialogUtils private constructor() {
object : ConsultAssistantDialog.OnConsultAssistantClickListener {
override fun onClickAction() {
if (Utils.isFastClick()) {
return onClickAction()
return@onClickAction
}
if (ConsultantIn.getUserImpl().isLogin()){
//获取用户uid
......@@ -206,7 +206,7 @@ class ConsultAssistantDialogUtils private constructor() {
object : ConsultAssistantDialog.OnConsultAssistantClickListener {
override fun onClickAction() {
if (Utils.isFastClick()) {
return onClickAction()
return@onClickAction
}
getConsultAssistantUid("", activity, 4)
}
......@@ -262,7 +262,7 @@ class ConsultAssistantDialogUtils private constructor() {
object : ConsultAssistantDialog.OnConsultAssistantClickListener {
override fun onClickAction() {
if (Utils.isFastClick()) {
return onClickAction()
return@onClickAction
}
ActionCountUtils.count("app_consult_list_page|app_consult_list_daoyi_entry_click")
YdlBuryPointUtil.sendClick("assistant_list_click")
......@@ -294,7 +294,7 @@ class ConsultAssistantDialogUtils private constructor() {
object : ConsultAssistantDialog.OnConsultAssistantClickListener {
override fun onClickAction() {
if (Utils.isFastClick()) {
return onClickAction()
return@onClickAction
}
ActionCountUtils.count("app_consult_list_page|app_consult_list_daoyi_entry_click")
YdlBuryPointUtil.sendClick("assistant_list_click")
......@@ -383,7 +383,6 @@ class ConsultAssistantDialogUtils private constructor() {
@SuppressLint("CheckResult")
private fun getConsultAssistantUid(location: Int, activity: Activity, ffrom: String?) {
obtainApi(SearchApi::class.java).getChatRouteConfig(location)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
......
......@@ -90,14 +90,22 @@ class FilterPopupWindow(
// this.animationStyle = R.style.consultant_expert_service_popupwindow_filter_anim_style
initShowTypeViews(view)
//咨询方式
initEnquiryViews(view)
//服务均价
initPriceViews(view)
//年龄选择
initAgeViews(view)
//其他选择
initOtherViews(view)
//擅长人群
initGoodAtCrowd(view)
//资质
initZiZhiViews(view)
initKeyboardListener(view)
//学历选择
initEduViews(view)
initKeyboardListener(view)
updateCount()
view.btnReset.setOnClickListener {
......@@ -137,6 +145,7 @@ class FilterPopupWindow(
private fun reset() {
tempFilter.showType = filterData.showType[0]
tempFilter.ages.clear()
tempFilter.doctorEdu.clear()
tempFilter.enquiries.clear()
// 擅长人群
tempFilter.specialityCrowd.clear()
......@@ -230,6 +239,13 @@ class FilterPopupWindow(
biEventParams = tempFilter.ages.map { it.key }.joinToString(",")
}
}
//学历
if (tempFilter.doctorEdu.isNotEmpty()) {
sb.append("&edus=").append(tempFilter.doctorEdu.map { it.key }.joinToString(","))
if (ConsultBIConstants.POSITION_EDU_CHOICE_CLICK == biEventName) {
biEventParams = tempFilter.doctorEdu.map { it.value }.joinToString(",")
}
}
// 擅长人群拼接
if (tempFilter.specialityCrowd.isNotEmpty()){
sb.append("&crowdsTags=").append(tempFilter.specialityCrowd.map { it.key }.joinToString(","))
......@@ -324,7 +340,9 @@ class FilterPopupWindow(
fun addSubscription(disposable: Disposable) {
mDisposableList.add(disposable)
}
/**
* 其他选择
* */
private fun initOtherViews(view: View) {
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
for ((index, other) in filterData.other.withIndex()) {
......@@ -363,6 +381,9 @@ class FilterPopupWindow(
}
}
/**
* 资质
* */
private fun initZiZhiViews(view: View) {
val mWidth = (popWidth - RxImageTool.dp2px(40f)) / 2
for (other in filterData.title) {
......@@ -455,7 +476,9 @@ class FilterPopupWindow(
}
}
/**
* 年龄
* */
private fun initAgeViews(view: View) {
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
for ((index, age) in filterData.age.withIndex()) {
......@@ -493,6 +516,46 @@ class FilterPopupWindow(
view.flAge.addView(textView)
}
}
/**
* 学历
* */
private fun initEduViews(view: View) {
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
for ((index, edu) in filterData.doctorEdu.withIndex()) {
val textView = View.inflate(context, R.layout.consultant_item_filter, null) as TextView
val params = FrameLayout.LayoutParams(mWidth, RxImageTool.dp2px(36f))
val marginNum = RxImageTool.dp2px(5f)
params.setMargins(
marginNum + (dp10 + mWidth) * (index % enquirySize),
dp46 * (index / enquirySize),
marginNum,
0
)
textView.layoutParams = params
textView.text = edu.value
ageViews.add(textView)
if (tempFilter.doctorEdu.contains(edu)) {
textView.isSelected = true
textView.paint.isFakeBoldText = true
}
textView.text = " " + edu.value + " "
textView.setOnClickListener {
if (textView.isSelected) {
tempFilter.doctorEdu.remove(edu)
textView.isSelected = false
textView.paint.isFakeBoldText = false
} else {
tempFilter.doctorEdu.add(edu)
textView.isSelected = true
textView.paint.isFakeBoldText = true
}
updateCount(ConsultBIConstants.POSITION_EDU_CHOICE_CLICK)
}
view.fl_edu.addView(textView)
}
}
private fun initEnquiryViews(view: View) {
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="1dp"/>
<solid android:color="@color/color_1AEB892C" />
<stroke android:width="0.5dp" android:color="@color/color_EB892C"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="1dp"></corners>
<corners android:radius="1dp"/>
<solid android:color="@color/platform_white" />
<stroke android:width="0.5dp" android:color="@color/platform_color_E0E0E0"/>
......
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tvTag"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:background="@drawable/consultant_bg_radius_line_gray_1"
android:gravity="center"
android:paddingLeft="4dp"
android:layout_marginRight="6dp"
android:textColor="@color/platform_color_999999"
android:paddingRight="4dp"
android:textSize="10dp"
tools:text="恋爱情感" />
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tvTag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/consultant_bg_radius_line_gray_1"
android:gravity="center"
android:layout_marginEnd="6dp"
android:padding="3dp"
android:textColor="@color/platform_color_999999"
android:textSize="10sp"
tools:text="恋爱情感" />
......@@ -119,6 +119,21 @@
android:paddingLeft="5dp"
app:lineSpacing="10dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_28"
android:text="学历选择"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<FrameLayout
android:id="@+id/fl_edu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp" />
<LinearLayout
android:id="@+id/ll_crowd_more"
android:layout_width="match_parent"
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google color-->
<color name="consultant_color_FF9500">#FF9500</color>
<!--app主要颜色-->
<!--最后删除-->
<!-- main bg color -->
<!-- session -->
<!-- image picker -->
<!-- contact -->
<!-- setting -->
<!--云信 end-->
<!--动态-->
<!--动态顶部title背景变色-->
<color name="consultant_colorBg">#f5f5f5</color>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="ResourceName">
<!-- google color-->
<color name="consultant_color_FF9500">#FF9500</color>
<!--app主要颜色-->
<!--最后删除-->
<!-- main bg color -->
<!-- session -->
<!-- image picker -->
<!-- contact -->
<!-- setting -->
<!--云信 end-->
<!--动态-->
<!--动态顶部title背景变色-->
<color name="consultant_colorBg">#f5f5f5</color>
<color name="color_EB892C">#EB892C</color>
<color name="color_1AEB892C">#1AEB892C</color>
</resources>
......@@ -135,7 +135,8 @@ public class DynamicApiUtils {
return YDLHttpUtils.Companion.obtainApi(NetApiStore.class).reportWorry(getMaps(list));
}
//发布动态
//发布
// 动态
public static Observable<BaseResponse<PublishTrendResult>> publishTrend(Command.PublishTrend cmd, File... files) {
Map<String, RequestBody> map = NetworkParamsUtils.getFileMaps(cmd, "FILE", files);
return YDLHttpUtils.Companion.obtainApi(NetApiStore.class).publishTrend(map);
......
package com.yidianling.dynamic.event
data class dynamicFocusEvent (
var focusState:String
)
\ No newline at end of file
......@@ -42,6 +42,7 @@ import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.dialog.CancelFocusDialog;
import com.yidianling.dynamic.event.BlackEvent;
import com.yidianling.dynamic.event.LoginStateEvent;
import com.yidianling.dynamic.event.dynamicFocusEvent;
import com.yidianling.dynamic.model.Command;
import com.yidianling.dynamic.model.MemberInfoBean;
import com.yidianling.dynamic.router.DynamicIn;
......@@ -433,7 +434,9 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
/**
*
*/
@SuppressLint("CheckResult")
private void Focus() {
showProgressDialog("");
Command.FocusCmd cmd = new Command.FocusCmd(mem_id, "1");
DynamicApiUtils.focus(cmd)
......@@ -450,6 +453,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
fans_count = (fans_counti + 1) + "";
members_top_user_fensi_num_tv.setText("粉丝 " + fans_count);
focus_state = "1";
EventBus.getDefault().post(new dynamicFocusEvent(focus_state));
Drawable drawable = getResources().getDrawable(R.drawable.dynamic_ic_expand);
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
members_top_user_focus_ortion_tv.setCompoundDrawablePadding(20);
......@@ -461,6 +465,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
fans_count = (fans_counti - 1) + "";
members_top_user_fensi_num_tv.setText("粉丝 " + fans_count);
focus_state = "2";
EventBus.getDefault().post(new dynamicFocusEvent(focus_state));
members_top_user_focus_ortion_tv.setCompoundDrawables(null, null, null, null);
members_top_user_focus_ortion_tv.setText("+ 关注");
members_top_user_focus_ortion_tv.setTextColor(getResources().getColor(R.color.dynamic_white));
......
......@@ -290,6 +290,11 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD
totalMembers = 0;
topicId = getIntent().getStringExtra("topic_id");
isSplash = getIntent().getBooleanExtra("isSplash", false);
Bundle bundle = getIntent().getBundleExtra("bundle");
if (bundle != null) {
topicId = bundle.getString("topic_id", "44");
isSplash = bundle.getBoolean("isSplash", false);
}
adapter = new TopicDetailMemberAdapter(this);
mFragments = new Fragment[]{TrendListInFragment.newInstance("1", topicId, "default", "0"),
TrendListInFragment.newInstance("2", topicId, "default", "0")};
......
......@@ -24,6 +24,7 @@ import android.text.Html;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.style.ImageSpan;
import android.util.EventLog;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
......@@ -72,6 +73,8 @@ import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.common.browsePictures.BrowsePicturesActivity2;
import com.yidianling.dynamic.common.emoji.EmoticonPickerView;
import com.yidianling.dynamic.common.emoji.IEmoticonSelectedListener;
import com.yidianling.dynamic.event.LoginStateEvent;
import com.yidianling.dynamic.event.dynamicFocusEvent;
import com.yidianling.dynamic.members.MembersActivity;
import com.yidianling.dynamic.model.CommentBean;
import com.yidianling.dynamic.model.Reply;
......@@ -95,6 +98,7 @@ import java.util.concurrent.TimeUnit;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import de.greenrobot.event.EventBus;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
......@@ -374,6 +378,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EventBus.getDefault().register(this);
setContentView(R.layout.dynamic_activity_trend_details);
ButterKnife.bind(this);
initDatas();
......@@ -1451,8 +1456,18 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
if (subscribe != null) {
subscribe.dispose();
}
EventBus.getDefault().unregister(this);
}
public void onEvent(dynamicFocusEvent event) {
// 1已关注 2关注
if (event.getFocusState().equals("1")){
tvGuanzhu.setVisibility(GONE);
tvGuanzhu.setText("已关注");
}else{
tvGuanzhu.setVisibility(VISIBLE);
tvGuanzhu.setText("关注");
}
}
@NonNull
@Override
public ITrendsDetailPresenterImpl createPresenter() {
......
......@@ -39,6 +39,8 @@ class HomeBIConstants {
const val YDL_HOME_DWELL_TIME: String = YDL_USER_MAIN_PAGE + "ydl_user_main_page_stay_visit" // 首页停留时长
const val YDL_HOME_ZHUMIANMINGXIANG: String = YDL_USER_MAIN_PAGE + "ydl_user_sleep_aid_more_click" // 首页助眠冥想
const val YDL_HOME_ZHUMIANICON: String = YDL_USER_MAIN_PAGE + "ydl_user_sleep_aid_type_click" // 首页_助眠_icon
const val YDL_HOME_SEARCH_TAG: String = YDL_USER_MAIN_PAGE + "ydl_user_search_tag" // 首页_定制咨询点击tag
const val YDL_HOME_POPUPWINDOWS_PAGE_POPUP: String = YDL_USER_MAIN_PAGE + "popupwindows_page_popup" // 首页弹窗页面弹出事件(99元3小时弹出事件)
}
......
......@@ -4,10 +4,10 @@ import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.RecyclerView
import android.text.TextUtils
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.media.audio.AudioPlayer
import com.ydl.media.audio.model.Music
......@@ -23,6 +23,7 @@ import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.bean.ShareData
import com.ydl.ydlcommon.data.PlatformRamImpl
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.ModularServiceManager.provide
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.Utils
......@@ -110,6 +111,16 @@ open class HomeBaseImpl : IHomeBaseEvent {
mHomeView!!.getConsultData(type.id.toString(), selectPosition)
}
override fun jumpToTopicDetail(topic_id: String) {
val bundle = Bundle()
bundle.putString("topic_id", topic_id)
bundle.putBoolean("isSplash", false)
//动态详情
ARouter.getInstance().build("/topic/detail")
.withBundle("bundle", bundle)
.navigation()
}
private var headerView: View? = null
var mContext: Context? = null
......
......@@ -185,4 +185,10 @@ interface IHomeBaseEvent {
* @param selectPosition 选中的position
*/
fun getConsultData(type: HomeHeaderBean.ConsultCategoryDateBean, selectPosition: Int)
/*
* 跳转话题详情
*
* */
fun jumpToTopicDetail(topic_id:String)
}
\ No newline at end of file
......@@ -6,6 +6,8 @@ import android.text.TextUtils
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.data.PlatformDataManager
import com.yidianling.home.R
import com.yidianling.home.constract.YdlHomeViewHolderConstract
......@@ -139,7 +141,7 @@ class YdlHomeAdapter(
//底部提示语模块
else -> {
val view = mInflater.inflate(R.layout.home_footer_view, parent, false)
return FooterViewViewHolder(view)
return FooterViewViewHolder(view,viewType)
}
}
}
......@@ -257,5 +259,14 @@ class YdlHomeAdapter(
/**
* 底部提示语模块 ViewHolder
*/
inner class FooterViewViewHolder(val footerView: View) : RecyclerView.ViewHolder(footerView)
inner class FooterViewViewHolder(val footerView: View,val viewType:Int) : RecyclerView.ViewHolder(footerView){
var imageLogoView: ImageView?=null
init {
imageLogoView=footerView.findViewById(R.id.iv_logo_view);
imageLogoView?.let {
GlideApp.with(mContext).load("https://static.yidianling.com/banner/bottombanner@2x.png").into(it);
}
}
}
}
\ No newline at end of file
......@@ -135,33 +135,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
}
}
// val inputLayoutParams = ll_search.layoutParams as CoordinatorLayout.LayoutParams
// val inputOriginMargin = inputLayoutParams.leftMargin
// var inputOffset = DisplayUtils.dp2px(context, 20).toFloat()
//
// appbar_layout.addOnOffsetChangedListener { appBarLayout, i ->
// home_swipe_refresh_layout.isEnabled = i >= 0
//
// val scale = java.lang.Float.valueOf(Math.abs(i).toFloat())!! / java.lang.Float.valueOf(
// appBarLayout.totalScrollRange.toFloat()
// )!!
// view_search_toolbar_bg.alpha = scale
// val leftMargin = inputOriginMargin - inputOffset * scale
// val rightMargin = inputOriginMargin - inputOffset * scale
// inputLayoutParams.setMargins(leftMargin.toInt(), 0, rightMargin.toInt(), 0)
// ll_search.layoutParams = inputLayoutParams
// val zheZhaoAlpha = ((1 - (0.2 * scale)).toFloat())
// //以下判断是因为toolbar和遮罩层拦截住了点击事件,导致banner不好点击
// if (zheZhaoAlpha == 1f) {
// title_layout.visibility = View.GONE
// toolbar.visibility = View.GONE
// } else {
// title_layout.visibility = View.VISIBLE
// toolbar.visibility = View.VISIBLE
// }
// view_search_input_bg.alpha = zheZhaoAlpha
// }
// initStatus()
}
......@@ -236,6 +210,9 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
} else {
YDLRouterManager.router(act.btnLinkurl)
}
//定制咨询点击事件埋点
ActionCountUtils.count(HomeBIConstants.YDL_HOME_SEARCH_TAG,"1")
}
} else {
img_ad.visibility = View.GONE
......@@ -271,6 +248,8 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
location[1] - heig,
location[0]
).show()
//99元3小时弹出事件
ActionCountUtils.count(HomeBIConstants.YDL_HOME_POPUPWINDOWS_PAGE_POPUP,"1")
}
}
}
......
package com.yidianling.home.ui.view
import android.content.Context
import android.graphics.Color
import androidx.recyclerview.widget.RecyclerView
import android.text.TextUtils
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.LinearLayout
import android.widget.RelativeLayout
import com.ydl.ydlcommon.data.PlatformDataManager
import com.yidianling.common.tools.RxImageTool
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeHeaderBean
......@@ -38,6 +34,10 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
layoutParams = params
View.inflate(mContext, R.layout.home_button_banner_view, this)
Glide.with(context)
.load(R.drawable.qingsu_new_free_dynamic)
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.into(qingsuGif)
homeModuleButtonBannerFirst.setOnClickListener {
homeEvent?.reservationExpertsClick()
}
......@@ -45,7 +45,7 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
homeEvent?.askMoreClick()
}
homeModuleButtonBannerThird.setOnClickListener {
homeEvent?.articleMoreClick()
homeEvent?.nowConfideClick()
}
homeModuleButtonBannerFourth.setOnClickListener {
homeEvent?.psychologyTestClick()
......
package com.yidianling.home.ui.view
import android.content.Context
import androidx.constraintlayout.widget.ConstraintLayout
import android.util.AttributeSet
import android.view.View
import com.yidianling.common.tools.RxImageTool
import com.yidianling.home.R
import kotlinx.android.synthetic.xlzx.home_common_title_big_full_view.view.*
/**
* @author liupneg
* @描述: 首页通用标题,富文本样式
* @Company 壹点灵
*/
class HomeCommonTitleBigFullView(private val mContext: Context, private val attributeSet: AttributeSet) :
ConstraintLayout(mContext, attributeSet) {
init {
initView()
}
private fun initView() {
View.inflate(mContext, R.layout.home_common_title_big_full_view, this)
}
fun setTitle(title: String) {
homeModuleCommonTitleViewFullTitle.text = title
}
fun setMoreText(text: String) {
homeModuleCommonTitleViewMorell.visibility = View.VISIBLE
homeModuleCommonTitleViewMoreText.text = text
}
fun setTopMargin(topMargin: Int) {
val params = layoutParams as MarginLayoutParams
params.topMargin = RxImageTool.dp2px(topMargin.toFloat())
layoutParams = params
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.graphics.Color
import android.text.TextUtils
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import androidx.core.content.ContextCompat
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydlcommon.utils.URLUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.RxImageTool
import com.yidianling.home.R
import com.yidianling.home.constants.HomeBIConstants
import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeConsultBean
import kotlinx.android.synthetic.xlzx.home_consult_item_view.view.*
import java.math.BigDecimal
import kotlinx.android.synthetic.xlzx.home_item_tag.view.*
/**
* @author jiucheng
......@@ -53,12 +50,12 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
setHead(bean)
//设置名称
tv_consult_name.text = bean.name
//咨询师标签
setTag(bean)
//设置接通率文案
setConnection(bean)
//设置向TA咨询人数
setConfideNum(bean)
//设置向TA咨询按钮状态
setConfideButton(bean)
setOnClickListener {
val url = URLUtils.appendParmas(bean.linkUrl, "cateId", cateId)
......@@ -66,6 +63,22 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
}
}
/**咨询师标签*/
private fun setTag(bean: HomeConsultBean.ListBean) {
ll_tags.removeAllViews()
if (!TextUtils.isEmpty(bean.tags)) {
val tagList = bean.tags?.split("|")
tagList.forEachIndexed { index, tag ->
if (index < 2 && !TextUtils.isEmpty(tag)) {
val view = LayoutInflater.from(context)
.inflate(R.layout.home_item_tag, ll_tags, false)
view.tvTag.text = tag
ll_tags.addView(view)
}
}
}
}
/**
* 设置头像
*/
......@@ -79,9 +92,11 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
private fun setConfideNum(bodyBean: HomeConsultBean.ListBean) {
if (TextUtils.isEmpty(bodyBean.zixunOrderNum.toString())) {
tv_consult_num.visibility = View.GONE
tv_tv_consult_num_content.visibility = View.GONE
} else {
tv_consult_num.visibility = View.VISIBLE
tv_consult_num.text = "咨询次数${bodyBean.zixunOrderNum}"
tv_tv_consult_num_content.visibility = View.VISIBLE
tv_consult_num.text = bodyBean.zixunOrderNum.toString()
}
}
......@@ -91,40 +106,18 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
private fun setConnection(bodyBean: HomeConsultBean.ListBean) {
if (TextUtils.isEmpty(bodyBean.feedbackRate.toString())) {
tv_feedback_rate.visibility = View.INVISIBLE
tv_feedback_rate_content.visibility = View.INVISIBLE
} else {
tv_feedback_rate.visibility = View.VISIBLE
tv_feedback_rate_content.visibility = View.VISIBLE
try {
val d = BigDecimal(bodyBean.feedbackRate.toString()).setScale(1, BigDecimal.ROUND_DOWN)
val str = d.toString()
val dd = bodyBean.feedbackRate/5.00f
val str = String.format("%.0f",dd*100f)+"%"
tv_feedback_rate.text = str
} catch (e: Exception) {
}catch (e:Exception){
e.printStackTrace()
}
}
}
/**
* 设置向TA倾诉按钮状态
*/
private fun setConfideButton(bodyBean: HomeConsultBean.ListBean) {
//私聊文案
if (TextUtils.isEmpty(bodyBean.chatBtnText)) {
tv_consult_chat.text = "私聊"
tv_consult_chat.setTextColor(Color.parseColor("#FD9B0A"))
} else {
tv_consult_chat.text = bodyBean.chatBtnText
tv_consult_chat.setTextColor(
ContextCompat.getColor(
context,
R.color.platform_color_999999
)
)
}
tv_consult_chat.setOnClickListener {
homeEvent!!.consultChatClick(bodyBean.uid.toString())
ActionCountUtils.count(HomeBIConstants.YDL_PRIVATE_CHAT_CLICK)
}
}
}
......@@ -4,14 +4,12 @@ import android.content.Context
import android.graphics.Color
import android.graphics.Typeface
import android.os.Build
import com.google.android.material.tabs.TabLayout
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import android.text.Layout
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.tabs.TabLayout
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
......@@ -19,9 +17,7 @@ import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeConsultBean
import com.yidianling.home.model.bean.HomeHeaderBean
import kotlinx.android.synthetic.xlzx.home_confide_view.view.*
import java.lang.Exception
import kotlin.math.ceil
import kotlinx.android.synthetic.xlzx.home_consult_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
......@@ -65,11 +61,11 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
)
layoutParams = params
orientation = VERTICAL
View.inflate(mContext, R.layout.home_confide_view, this)
homeModuleConfideViewHomeCommonTitleView.setTitle("心理咨询")
homeModuleConfideViewHomeCommonTitleView.setMoreText("更多咨询")
homeModuleConfideViewHomeCommonTitleView.setTopMargin(-4)
homeModuleConfideViewHomeCommonTitleView.setOnClickListener {
View.inflate(mContext, R.layout.home_consult_view, this)
homeModuleConfideViewHomeCommonFullTitleView.setTitle("心理咨询")
homeModuleConfideViewHomeCommonFullTitleView.setMoreText("更多")
homeModuleConfideViewHomeCommonFullTitleView.setTopMargin(-4)
homeModuleConfideViewHomeCommonFullTitleView.setOnClickListener {
homeEvent?.consultMoreClick()
}
}
......@@ -219,15 +215,14 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
fun updateText(txtView: TextView, isSelected: Boolean): TextView {
if (!isSelected) {
txtView.textSize = 12f
txtView.setTextColor(Color.parseColor("#999999"))
txtView.setTextColor(Color.parseColor("#929292"))
txtView.typeface = Typeface.DEFAULT
txtView.setPadding(dp10, dp5, dp10, dp7)
txtView.setBackgroundResource(R.drawable.home_consult_tab_item_unselected_bg)
} else {
txtView.textSize = 12f
txtView.setTextColor(Color.parseColor("#FD9B0A"))
txtView.textSize = 14f
txtView.setTextColor(Color.parseColor("#5E5E5E"))
txtView.typeface = Typeface.DEFAULT_BOLD
txtView.setPadding(dp10, dp5, dp10, dp7)
txtView.setBackgroundResource(R.drawable.home_consult_tab_item_selected_bg)
}
return txtView
}
......
......@@ -69,6 +69,7 @@ class HomeModuleCategoryView : FrameLayout {
var dp6: Int = 0
var dp8: Int = 0
var dp12: Int = 0
//左右间距
var dp15: Int = 0
/**
* 倍数
......@@ -116,13 +117,13 @@ class HomeModuleCategoryView : FrameLayout {
dp6 = RxImageTool.dip2px(4f)
dp12 = RxImageTool.dip2px(12f)
categoryEightWidth = ScreenUtil.screenWidth - RxImageTool.dp2px(30f)
categoryEightWidth = ScreenUtil.screenWidth - RxImageTool.dp2px(8f)
textViewWidth = categoryEightWidth / 4
imageEightViewWidth = RxImageTool.dip2px(38f)
textViewHeight = RxImageTool.dip2px(28f)
margin = (categoryEightWidth - 4 * imageEightViewWidth) / 8
dp8 = RxImageTool.dip2px(8f)
dp15 = RxImageTool.dip2px(15f)
dp15 = RxImageTool.dip2px(4f)
}
fun initData(askCategoryDataBean: List<HomeHeaderBean.AskCategoryDataBean>?) {
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="1dp"></corners>
<solid android:color="@color/platform_white" />
<stroke android:width="0.5dp" android:color="@color/platform_color_E0E0E0"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FF4E4E" />
<corners
android:bottomLeftRadius="0dp"
android:bottomRightRadius="7dp"
android:topLeftRadius="7dp"
android:topRightRadius="7dp" />
<stroke
android:width="1dp"
android:color="@color/white" />
<padding
android:left="3dp"
android:right="4dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ll_home_module_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="17dp">
android:layout_marginTop="17dp"
android:orientation="vertical">
<com.yidianling.home.ui.widget.HomeModuleCategoryView
android:id="@+id/home_category_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:gravity="center_horizontal"
android:layout_marginLeft="4dp"
android:layout_marginTop="15dp"
android:layout_marginRight="4dp"
android:gravity="center_horizontal|bottom"
android:orientation="horizontal"
android:paddingBottom="12dp">
......@@ -20,22 +27,23 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center">
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="54dp"
android:layout_height="38dp"
android:src="@drawable/home_banner_first_icon"
android:scaleType="fitXY"/>
android:layout_width="52dp"
android:layout_height="52dp"
android:scaleType="fitXY"
android:src="@drawable/home_banner_first_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="咨询沟通"
android:layout_marginTop="3dp"
android:layout_marginTop="6dp"
android:text="心理咨询"
android:textColor="@color/platform_color_242424"
android:textSize="13dp"/>
android:textSize="13dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
......@@ -43,75 +51,92 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center">
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="54dp"
android:layout_height="38dp"
android:src="@drawable/home_banner_fourth_icon"
android:scaleType="fitXY"/>
android:layout_height="52dp"
android:scaleType="fitXY"
android:src="@drawable/home_banner_fourth_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="心理测试"
android:layout_marginTop="3dp"
android:textColor="@color/platform_color_242424"
android:textSize="13dp"/>
android:textSize="13dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/homeModuleButtonBannerThird"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center">
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="54dp"
android:layout_height="38dp"
android:id="@+id/third_icon"
android:layout_width="71dp"
android:layout_height="64dp"
android:paddingLeft="7dp"
android:paddingTop="12dp"
android:paddingRight="12dp"
android:scaleType="fitXY"
android:src="@drawable/home_banner_third_icon"
android:scaleType="fitXY"/>
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/qingsuGif"
android:layout_width="45dp"
android:layout_height="24dp"
app:layout_constraintRight_toRightOf="@id/third_icon"
app:layout_constraintTop_toTopOf="@id/third_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="主题阅读"
android:layout_marginTop="3dp"
android:layout_below="@id/third_icon"
android:layout_marginTop="6dp"
android:text="倾诉热线"
android:textColor="@color/platform_color_242424"
android:textSize="13dp"/>
</LinearLayout>
android:textSize="13dp"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="@id/third_icon"
app:layout_constraintRight_toRightOf="@id/third_icon"
app:layout_constraintTop_toBottomOf="@id/third_icon" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/homeModuleButtonBannerSecond"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center">
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="54dp"
android:layout_height="38dp"
android:src="@drawable/home_banner_second_icon"
android:scaleType="fitXY"/>
android:layout_width="52dp"
android:layout_height="52dp"
android:scaleType="fitXY"
android:src="@drawable/home_banner_second_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="人生答疑"
android:layout_marginTop="3dp"
android:layout_marginTop="6dp"
android:text="心理问答"
android:textColor="@color/platform_color_242424"
android:textSize="13dp"/>
android:textSize="13dp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<com.yidianling.home.ui.widget.HomeModuleCategoryView
android:id="@+id/home_category_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/platform_dp_30"
android:paddingBottom="@dimen/platform_dp_6">
<TextView
android:id="@+id/homeModuleCommonTitleViewFullTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/platform_dp_16"
android:paddingRight="@dimen/platform_dp_1"
android:textColor="@color/platform_color_242424"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="通用标题" />
<TextView
android:id="@+id/people_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:text="300w+"
android:textColor="#5A8AFF"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBaseline_toBaselineOf="@id/homeModuleCommonTitleViewFullTitle"
app:layout_constraintLeft_toRightOf="@id/homeModuleCommonTitleViewFullTitle" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:text=" 人在这里发生了改变"
android:textColor="@color/platform_color_999999"
android:textSize="13sp"
app:layout_constraintBaseline_toBaselineOf="@id/homeModuleCommonTitleViewFullTitle"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toRightOf="@id/people_num"
app:layout_constraintRight_toLeftOf="@id/homeModuleCommonTitleViewMorell" />
<LinearLayout
android:id="@+id/homeModuleCommonTitleViewMorell"
android:layout_width="wrap_content"
android:layout_height="@dimen/platform_dp_18"
android:layout_marginRight="@dimen/platform_dp_16"
android:background="@drawable/home_show_more_line"
android:gravity="center"
android:orientation="horizontal"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent">
<TextView
android:id="@+id/homeModuleCommonTitleViewMoreText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/platform_dp_2"
android:gravity="center"
android:text="更多"
android:textColor="@color/platform_color_666666"
android:textSize="10sp" />
<ImageView
android:layout_marginLeft="2dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/home_more_icon_gray" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/home_view_shadow_bg"
android:gravity="center"
android:background="@drawable/home_view_shadow_bg">
<RelativeLayout
android:layout_width="wrap_content"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_marginTop="19dp">
<androidx.cardview.widget.CardView
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_centerInParent="true"
app:cardCornerRadius="32dp"
app:cardElevation="0dp"
android:layout_centerHorizontal="true">
<ImageView
android:id="@+id/img_consult_head"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:background="@color/platform_color_E0E0E0"/>
</androidx.cardview.widget.CardView>
</RelativeLayout>
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
app:cardCornerRadius="32dp"
app:cardElevation="0dp">
<ImageView
android:id="@+id/img_consult_head"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/platform_color_E0E0E0"
android:scaleType="centerCrop" />
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/tv_consult_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold"
tools:ignore="SpUsage"
tools:text="姚雨晴" />
<LinearLayout
android:id="@+id/tv_name_layout"
android:layout_marginTop="4dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="13dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_consult_name"
android:id="@+id/tv_tv_consult_num_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold"
tools:ignore="SpUsage"
tools:text="姚雨晴"/>
<ImageView
android:id="@+id/img_sex"
android:layout_width="13dp"
android:layout_height="13dp"
android:layout_marginStart="6dp"
android:layout_marginLeft="3dp"
android:background="@drawable/home_counselor"/>
</LinearLayout>
android:text="咨询次数 "
android:textColor="#888888"
android:textSize="@dimen/platform_dp_10" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_feedback_rate"
android:id="@+id/tv_consult_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF5B46"
android:textSize="15dp"
android:textStyle="bold"
tools:text="9.8"/>
android:textColor="#888888"
android:textSize="@dimen/platform_dp_10"
tools:text="8000" />
<TextView
android:id="@+id/tv_feedback_rate_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF5B46"
android:textSize="14dp"
android:text="分"/>
android:layout_marginLeft="12dp"
android:text="好评率 "
android:textColor="#888888"
android:textSize="@dimen/platform_dp_10" />
<TextView
android:id="@+id/tv_consult_num"
android:id="@+id/tv_feedback_rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_13"
tools:text="8000次咨询"
android:layout_marginLeft="4dp"/>
android:textColor="#888888"
android:textSize="@dimen/platform_dp_10"
tools:text="83%" />
</LinearLayout>
<TextView
android:id="@+id/tv_consult_chat"
android:layout_width="74dp"
android:layout_height="28dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="@drawable/home_consult_chat_rest_bg"
android:gravity="center"
android:paddingLeft="9dp"
android:paddingRight="9dp"
tools:text="休息中"
android:layout_marginTop="10dp"
android:layout_marginBottom="15dp"
android:textColor="@color/platform_color_999999"
android:textSize="12dp"/>
<LinearLayout
android:id="@+id/ll_tags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginBottom="12dp"
android:layout_marginEnd="@dimen/platform_dp_10"
android:layout_marginStart="@dimen/platform_dp_16"
android:gravity="center_vertical"
android:orientation="horizontal"/>
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<merge 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="wrap_content"
android:orientation="vertical"
android:clipChildren="false">
<com.yidianling.home.ui.view.HomeCommonTitleBigFullView
android:id="@+id/homeModuleConfideViewHomeCommonFullTitleView"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:clipChildren="false"
>
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabGravity="fill"
app:tabIndicatorHeight="0dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="8dp"
app:tabMode="scrollable"
app:tabPaddingStart="4dp"
app:tabPaddingEnd="4dp"
app:tabSelectedTextColor="@color/platform_color_242424"
app:tabTextAppearance="@style/TabLayoutTextSize"
app:tabTextColor="#333"/>
</LinearLayout>
<FrameLayout
android:id="@+id/ll_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</merge>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingTop="@dimen/platform_dp_30"
android:paddingBottom="@dimen/platform_dp_16">
android:orientation="horizontal">
<View
android:layout_width="48dp"
android:layout_height="0.5dp"
android:background="@color/platform_color_EBEBEB"
android:layout_marginRight="@dimen/platform_dp_8"/>
<TextView
android:layout_width="wrap_content"
<ImageView
android:id="@+id/iv_logo_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_999999"
android:textSize="@dimen/platform_dp_10"
android:text="我是有底线的"/>
<View
android:layout_width="48dp"
android:layout_height="0.5dp"
android:layout_marginLeft="@dimen/platform_dp_8"
android:background="@color/platform_color_EBEBEB"/>
android:background="@color/baby_blue"
/>
</LinearLayout>
\ No newline at end of file
......@@ -7,60 +7,6 @@
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false">
<!-- <android.support.design.widget.CoordinatorLayout-->
<!-- android:id="@+id/container"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:background="@color/home_colorBg"-->
<!-- android:clipChildren="false"-->
<!-- android:clipToPadding="false"-->
<!-- app:layout_behavior="@string/appbar_scrolling_view_behavior"-->
<!-- >-->
<!-- <android.support.design.widget.AppBarLayout-->
<!-- android:id="@+id/appbar_layout"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:background="@color/home_colorBg"-->
<!-- android:clipChildren="false"-->
<!-- android:clipToPadding="false"-->
<!-- android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"-->
<!-- app:elevation="0dp">-->
<!-- <android.support.design.widget.CollapsingToolbarLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:clipChildren="false"-->
<!-- android:clipToPadding="false"-->
<!-- app:layout_scrollFlags="scroll|exitUntilCollapsed">-->
<!-- <include layout="@layout/home_layout_home_module_head_bg"/>-->
<!-- <include-->
<!-- layout="@layout/home_layout_home_module_head_middle"/>-->
<!-- <android.support.v7.widget.Toolbar-->
<!-- android:id="@+id/toolbar"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="@dimen/home_home_title_bar_height"-->
<!-- android:alpha="0"-->
<!-- android:background="@android:color/white"-->
<!-- android:tag="toolbar"-->
<!-- android:visibility="gone"-->
<!-- app:layout_collapseMode="pin"-->
<!-- app:popupTheme="@style/Widget.AppCompat.Toolbar"/>-->
<!-- <include layout="@layout/home_layout_home_module_toolbar"/>-->
<!-- </android.support.design.widget.CollapsingToolbarLayout>-->
<!-- </android.support.design.widget.AppBarLayout>-->
<!-- </android.support.design.widget.CoordinatorLayout>-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
......@@ -69,7 +15,4 @@
<include layout="@layout/home_layout_home_module_content"/>
</LinearLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tvTag"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginRight="6dp"
android:background="@drawable/home_bg_radius_line_gray_1"
android:gravity="center"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:textColor="@color/platform_color_999999"
android:textSize="10sp"
tools:text="恋爱情感" />
......@@ -326,6 +326,8 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
} else {
YDLRouterManager.router(act.btnLinkurl)
}
//定制咨询点击事件埋点
ActionCountUtils.count(HomeBIConstants.YDL_HOME_SEARCH_TAG,"1")
}
} else {
img_ad.visibility = View.GONE
......@@ -352,6 +354,8 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
//文案不为空才显示引导--李思开
if (!TextUtils.isEmpty(act.title)) {
ActivityGuideDialog(mActivity, act.imageUrl, act.title).show()
//99元3小时弹出事件
ActionCountUtils.count(HomeBIConstants.YDL_HOME_POPUPWINDOWS_PAGE_POPUP,"1")
}
}
}
......
......@@ -67,7 +67,10 @@ class HomeAssuageGriefItemView(private val mContext: Context, private var homeEv
homeModuleAssuageGriefViewTag.text = bean?.askTag
homeModuleAssuageGriefViewCommentsCount.text = bean?.commentsCount.toString()
homeModuleAssuageGriefViewZanCount.text = bean?.zanCount.toString()
ll_topic_detail.setOnClickListener {
//跳转话题详情
homeEvent?.jumpToTopicDetail(bean.topicId.toString())
}
/**
* 点赞
......
......@@ -33,8 +33,10 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
fun setVisibilityFree(boolean: Boolean){
if (boolean){
qingsuGif.visibility=View.VISIBLE
homeModuleButtonBannerSecondTitle.text = "免费倾诉"
}else{
qingsuGif.visibility=View.GONE
homeModuleButtonBannerSecondTitle.text = "倾诉热线"
}
}
private fun initView() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment