Commit 7b03f104 by 徐健

Merge remote-tracking branch 'origin/dev' into feature/test_home_pager

# Conflicts:
#	config.gradle
parents 4f14efc8 0e1135ae
......@@ -18,6 +18,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:networkSecurityConfig="@xml/network_config"
android:theme="@style/platform_CommonTheme"
tools:ignore="GoogleAppIndexingWarning"
tools:replace="android:allowBackup, android:icon, android:label">
......
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>
\ No newline at end of file
......@@ -5,8 +5,8 @@ ext {
ydl_app = [
appName : "心理咨询壹点灵",
applicationId: "com.cxzapp.yidianling",
versionName : "3.9.50",
versionCode : 3950,
versionName : "4.0.00",
versionCode : 4000,
]
xlzx_app = [
......@@ -42,17 +42,17 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.20",
"m-consultant" : "0.0.34",
"m-fm" : "0.0.15",
"m-user" : "0.0.31",
"m-confide" : "0.0.26",
"m-consultant" : "0.0.39",
"m-fm" : "0.0.20",
"m-user" : "0.0.33",
// 接入flutter的模块
"m-tests" : "0.0.10.5",
"m-muse" : "0.0.12.5",
"m-course" : "0.0.23.5",
"m-tests" : "0.0.11.1",
"m-muse" : "0.0.14.1",
"m-course" : "0.0.25.1",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.1",
"m-audioim-api" : "0.0.2",
"m-confide-api" : "0.0.1",
"m-consultant-api": "0.0.3",
"m-course-api" : "0.0.2",
......@@ -63,12 +63,14 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.24",
"ydl-platform" : "0.0.26",
//第二步 若干
"ydl-webview" : "0.0.25",
"ydl-media" : "0.0.12",
"ydl-pay" : "0.0.9",
"m-audioim" : "0.0.15",
"ydl-webview" : "0.0.27",
"ydl-media" : "0.0.13",
"ydl-pay" : "0.0.10",
"m-audioim" : "0.0.26",
//以下 几乎不会动
"router" : "0.0.1",
"ydl-net" : "0.0.2",
......@@ -79,7 +81,7 @@ ext {
ydlCompileVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.15",
"m-confide" : "0.0.23",
"m-consultant" : "0.0.26",
"m-course" : "0.0.22",
"m-fm" : "0.0.15",
......@@ -91,7 +93,7 @@ ext {
"m-muse" : "0.0.7",
"m-tests" : "0.0.4",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.1",
"m-audioim-api" : "0.0.5",
"m-confide-api" : "0.0.1",
"m-consultant-api": "0.0.3",
"m-course-api" : "0.0.2",
......@@ -102,12 +104,14 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.24",
"ydl-platform" : "0.0.26",
//第二步 若干
"ydl-webview" : "0.0.24",
"ydl-media" : "0.0.12",
"ydl-pay" : "0.0.9",
"m-audioim" : "0.0.15",
"ydl-webview" : "0.0.27",
"ydl-media" : "0.0.13",
"ydl-pay" : "0.0.10",
"m-audioim" : "0.0.26",
//以下 几乎不会动
"router" : "0.0.1",
......@@ -268,6 +272,7 @@ ext {
"ydl-m-muse-api" : "com.ydl:m-muse-api:${ydlCompileVersion["m-muse-api"]}",
"ydl-m-fm-api" : "com.ydl:m-fm-api:${ydlCompileVersion["m-fm-api"]}",
"ydl-m-tests-api" : "com.ydl:m-tests-api:${ydlCompileVersion["m-tests-api"]}",
"ydl-m-audioim-api" : "com.ydl:m-audioim-api:${ydlCompileVersion["m-audioim-api"]}",
]
}
......@@ -13,7 +13,7 @@ resConfig {
kapt {
arguments {
arg("AROUTER_MODULE_NAME", project.getName())
arg("AROUTER_MODULE_NAME", "audioim")
}
}
android {
......@@ -35,6 +35,12 @@ android {
consumerProguardFiles 'consumer-rules.pro'
flavorDimensions "versionCode"
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: "audioim"]
}
}
}
//前缀的名字
......
......@@ -6,7 +6,8 @@ modular {
//发布信息 module/api 通用
groupId = "com.ydl"
artifactId = "m-audioim-api"
version = "0.0.1"
// version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
version = "0.0.5"
// API 层打包时需要引入的依赖
apiDependencies {
implementation "com.google.code.gson:gson:2.8.2"
......
package com.ydl.audioim
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.audioim.api.AudioImApi
/**
* 模块对外提供接口的实现类
*/
@Route(path = "/audioim/audioimapi")
class AudioImImpl: AudioImApi {
override fun init(context: Context?) {
}
override fun loginAgora(userId: String?) {
YDLavManager.instances.login(userId)
}
......
package com.ydl.audioim
import android.annotation.SuppressLint
import android.content.Context
import android.text.TextUtils
import com.ydl.ydl_av.messge_service.YDLRTMClient
import com.ydl.ydl_av.messge_service.bean.RTMMesssage
import com.ydl.ydl_av.messge_service.callback.InitListener
......@@ -32,10 +34,16 @@ class YDLavManager {
YDLRTMClient.instances.init(context,appId,listener)
}
@SuppressLint("CheckResult")
fun login(userId:String?){
if (TextUtils.isEmpty(userId) || userId?:"0" <= "0"){
//如果uid为空或小于等于0 ,则不进行登录,因为uid为0也会登录成功,会导致后面uid正确时无法登录
LogUtil.e("[agora]login-uid:$userId")
return
}
//登录实时消息
//获取token
AudioApiRequestUtil.getAgoraToken(userId)
AudioApiRequestUtil.getAgoraToken()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
......
......@@ -73,8 +73,8 @@ class AudioApiRequestUtil {
/**
* 获取声网登录token
*/
fun getAgoraToken(uid:String?): Observable<BaseAPIResponse<AgoraTokenResponse>>{
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).getAgoraToken(uid)
fun getAgoraToken(): Observable<BaseAPIResponse<AgoraTokenResponse>>{
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).getAgoraToken()
}
}
}
\ No newline at end of file
......@@ -51,5 +51,6 @@ interface AudioNetAPi {
*/
@Headers( YDL_DOMAIN + YDL_DOMAIN_JAVA,"Content-Type:application/json")
@GET("im/getAgoraToken")
fun getAgoraToken(@Query("uid") uid: String?): Observable<BaseAPIResponse<AgoraTokenResponse>>
fun getAgoraToken(): Observable<BaseAPIResponse<AgoraTokenResponse>>
}
\ No newline at end of file
package com.ydl.audioim.api
import com.alibaba.android.arouter.facade.template.IProvider
/**
* 对外api接口
*/
interface AudioImApi {
interface AudioImApi : IProvider {
/**
* 登录声网Im
......
......@@ -12,10 +12,10 @@ class ConnectParamJava : BaseCommand {
var id: String = "0" //倾诉id
var type: String = "1" //1 走AxB 2双呼 3声网
var callType:Int? = null //
var callType:String? = null //
constructor() : super()
constructor(id: String, type: String, callType: Int?) : super() {
constructor(id: String, type: String, callType: String?) : super() {
this.id = id
this.type = type
this.callType = callType
......
......@@ -10,10 +10,10 @@ import android.content.Intent
import android.graphics.Typeface
import android.os.Build
import android.support.v4.content.ContextCompat
import android.support.v4.widget.SwipeRefreshLayout
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
import android.text.TextUtils
import android.util.Log
import android.view.Gravity
import android.view.View
import android.view.WindowManager
......@@ -31,7 +31,6 @@ import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.bean.GlobalInfo
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.ui.LogoLoadingView
......@@ -58,9 +57,6 @@ import com.yidianling.consultant.ui.view.AreaPopupWindow
import com.yidianling.consultant.ui.view.CategoryPopupWindow
import com.yidianling.consultant.ui.view.FilterPopupWindow
import com.yidianling.consultant.ui.view.SortPopupWindow
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.consultant_activity_expert_search_list.*
import kotlinx.android.synthetic.main.consultant_item_filter_online.view.*
import kotlinx.android.synthetic.main.consultant_layout_search_content.*
......@@ -68,11 +64,11 @@ import kotlinx.android.synthetic.main.consultant_layout_search_head_bg.*
import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.*
import org.json.JSONObject
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
@Route(path = "/consult/list")
class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPresenter>(), View.OnClickListener, IExpertSearchView,
OnCategoriesSelectedListener, OnSortItemSelectedListener, OnFilterConfirmListener {
OnCategoriesSelectedListener, OnSortItemSelectedListener, OnFilterConfirmListener,
SwipeRefreshLayout.OnRefreshListener {
override fun showImage(url: String?, imgView: ImageView) {
YDLImageCacheManager.showImage(ExpertSearchActivity@ this, url, imgView)
......@@ -193,7 +189,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
override fun createPresenter(): ExpertSearchPresenter = ExpertSearchPresenter()
private fun initViews() {
srlContainer.isEnabled = false
srlContainer.isEnabled = true
tvSubject.setOnClickListener(this)
tvArea.setOnClickListener(this)
tvSort.setOnClickListener(this)
......@@ -201,6 +197,9 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
btn_call.setOnClickListener(this)
tv_guide.setOnClickListener(this)
rl_search.setOnClickListener(this)
srlContainer.setColorSchemeColors(ContextCompat.getColor(this, R.color.consultant_main_theme))
srlContainer.setProgressViewOffset(false, 0, 200)
srlContainer.setOnRefreshListener(this)
initNetLossView()
......@@ -1371,6 +1370,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
}
override fun onRefresh() {
refresh(false)
}
//刷新列表
private fun refresh(isShowRefresh: Boolean? = true) {
srlContainer.isRefreshing = isShowRefresh!!
......
......@@ -7,12 +7,13 @@ import android.animation.PropertyValuesHolder
import android.content.Context
import android.graphics.Typeface
import android.os.Build
import android.os.Bundle
import android.support.v4.content.ContextCompat
import android.support.v4.widget.SwipeRefreshLayout
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
import android.text.TextUtils
import android.view.*
import android.view.Gravity
import android.view.View
import android.view.inputmethod.InputMethodManager
import android.widget.ImageView
import android.widget.LinearLayout
......@@ -53,19 +54,18 @@ import com.yidianling.consultant.ui.view.CategoryPopupWindow
import com.yidianling.consultant.ui.view.FilterPopupWindow
import com.yidianling.consultant.ui.view.SortPopupWindow
import kotlinx.android.synthetic.main.consultant_activity_expert_search_list.*
import kotlinx.android.synthetic.main.consultant_activity_expert_search_list.view.*
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_content.view.*
import kotlinx.android.synthetic.main.consultant_layout_search_head_bg.*
import kotlinx.android.synthetic.main.consultant_layout_search_head_bg.view.*
import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.*
import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.view.*
import org.json.JSONObject
import java.util.concurrent.Executors
class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPresenter>(), View.OnClickListener, IExpertSearchView,
OnCategoriesSelectedListener, OnSortItemSelectedListener, OnFilterConfirmListener {
OnCategoriesSelectedListener, OnSortItemSelectedListener, OnFilterConfirmListener,
SwipeRefreshLayout.OnRefreshListener {
override fun layoutResId(): Int {
return R.layout.consultant_activity_expert_search_list
}
......@@ -142,7 +142,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
override fun createPresenter(): ExpertSearchPresenter = ExpertSearchPresenter()
private fun initViews() {
srlContainer.isEnabled = false
srlContainer.isEnabled = true
tvSubject.setOnClickListener(this)
tvArea.setOnClickListener(this)
tvSort.setOnClickListener(this)
......@@ -150,7 +150,9 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
btn_call.setOnClickListener(this)
tv_guide.setOnClickListener(this)
rl_search.setOnClickListener(this)
srlContainer.setColorSchemeColors(ContextCompat.getColor(activity, R.color.consultant_main_theme))
srlContainer.setProgressViewOffset(false, 0, 200)
srlContainer.setOnRefreshListener(this)
initNetLossView()
......@@ -303,7 +305,6 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
private fun initData() {
allFilter.showType.key = initShowType
val cat = CateItem()
cat.cateId = initCategory
......@@ -314,7 +315,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
getPresenter().localData(initShowType)
//加载banner
getPresenter().fetchBannerList()
refresh(false)
//refresh(false)
v_loading.visibility = View.VISIBLE
v_loading.setViewType(LogoLoadingView.TYPE_LOADING, null)
......@@ -1301,6 +1302,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
}
override fun onRefresh() {
refresh(false)
}
//刷新列表
private fun refresh(isShowRefresh: Boolean? = true) {
srlContainer.isRefreshing = isShowRefresh!!
......@@ -1313,7 +1318,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
curPage = 1
onScrollListener.resetState()
getPresenter().fetchListData(allFilter, curPage)
rvExperts.scrollToPosition(0)
rvExperts.scrollToPosition(0)
}
//执行搜索
......@@ -1399,6 +1404,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
override fun onResume() {
super.onResume()
refresh(false)
ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_PAGE_VISIT)
}
......
......@@ -61,7 +61,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
* Created by softrice on 15/12/11.
*/
@Route(path = "/fm/detail")
public class FMDetailActivity extends BaseActivity implements View.OnClickListener, OnPlayerEventListener {
public class FMDetailActivity extends BaseActivity implements View.OnClickListener, OnPlayerEventListener{
int id;
boolean isSplash;
......@@ -222,7 +222,6 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
iv_next.setOnClickListener(this);
iv_last.setOnClickListener(this);
iv_share.setOnClickListener(this);
initRefreshAnimate();
init();
initSurfaceView();
......@@ -489,7 +488,7 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
private void share() {
if (fmDetail == null)
return;
YDLShareDialog dialog = YDLShareDialog.Companion.style1(this, fmDetail.getTitle(), fmDetail.getShare_url(), null, fmDetail.getImage_url());
YDLShareDialog dialog = YDLShareDialog.Companion.style1(this, fmDetail.getTitle(), fmDetail.getShare_url(), "", fmDetail.getImage_url());
dialog.setCallBack(type -> {
if (1 == type) {
if (!FMIn.INSTANCE.isLogin()) {
......@@ -590,7 +589,6 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
anim.cancel();
EventBus.getDefault().unregister(this);
AudioPlayer.Companion.get().removeOnPlayEventListener(this);
}
......@@ -601,12 +599,14 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
@Override
public void onPlayerStart() {
iv_play.setImageResource(R.drawable.fm_stop_2);
fmSurfaceView.playTimer();
}
@Override
public void onPlayerPause() {
iv_play.setImageResource(R.drawable.fm_play_2);
fmSurfaceView.stopTimer();
}
@Override
......
......@@ -84,9 +84,11 @@ dependencies {
api project(':ydl-webview')
api project(':ydl-platform')
implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-audioim-api')
}else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-audioim-api"]
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
......
......@@ -8,6 +8,7 @@ import com.yidianling.router.im.IMLoginInfo
import com.yidianling.router.im.IMRequestCallback
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.event.UserLoginEvent
import com.yidianling.user.api.event.UserLogoutEvent
import com.yidianling.user.http.UserHttpImpl
import com.yidianling.user.http.request.Logout
import com.yidianling.user.route.UserIn
......@@ -35,22 +36,12 @@ object LoginUtils {
loginIm(userInfo)
//设置极光注册id
LoginHelper.setChannelId()
//设置声网登录
UserIn.getAvImApi().loginAgora(userInfo?.uid)
val loginEvent = UserLoginEvent("login", userInfo?.uid!!)
EventBus.getDefault().post(loginEvent)
BuryPointUtils.bindUid(userInfo?.uid ?: "")
// val channelId = JPushUtils.getRegistrationID()
// UserHttpImpl.getInstance().channelId(ChannelIdParam(channelId))
// .compose(RxUtils.resultData())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(Consumer {
// if (it["upload_log"] == "1") {
// LogHelper.getInstance().uploadLog(false)
// }
// }, object : ThrowableConsumer() {
// override fun accept(msg: String) {
// // ToastHelper.show(msg)
// }
// })
}
private fun loginIm(userInfo: UserResponseBean?) {
......@@ -76,6 +67,7 @@ object LoginUtils {
@JvmStatic
fun logout() {
EventBus.getDefault().post(UserLogoutEvent())
UserHttpImpl.getInstance().logout(Logout())
.compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
......
......@@ -3,6 +3,8 @@ package com.yidianling.user.route
import android.app.Activity
import android.content.Context
import android.content.Intent
import com.ydl.audioim.api.AudioImApi
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.router.RouterManager
import com.yidianling.router.im.IMLoginInfo
import com.yidianling.router.im.IMRequestCallback
......@@ -57,5 +59,9 @@ object UserIn {
fun clearImData() {
RouterManager.getImRouter().clear()
}
// 获取 声网 api
fun getAvImApi(): AudioImApi{
return ModularServiceManager.provide(AudioImApi::class.java)
}
}
\ No newline at end of file
......@@ -97,8 +97,6 @@ class PrivacyDialog : Dialog {
//清除UserInfo
UserHelper.setUserinfo(null)
LoginUtils.logout()
EventBus.getDefault().post(UserLogoutEvent())
activity!!.startActivity(Intent(activity, RegisterAndLoginActivity::class.java))
}
......
......@@ -6,6 +6,7 @@ import android.content.Intent
import android.graphics.PixelFormat
import android.graphics.Point
import android.os.Bundle
import android.support.v4.view.ViewCompat
import android.text.TextUtils
import android.view.Gravity
import android.view.View
......@@ -141,7 +142,12 @@ class PlayerFloatHelper {
private fun addFloatToWm(context: Context) {
if (wm != null && !TextUtils.isEmpty(showingPageName)) {
wm?.removeViewImmediate(mPlayerFloatView)
if (ViewCompat.isAttachedToWindow(mPlayerFloatView)){
// if (context is Activity && !(context.isFinishing)){
// wm?.removeViewImmediate(mPlayerFloatView)
// }
wm?.removeViewImmediate(mPlayerFloatView)
}
wm = null
}
//获取WindowManager
......
......@@ -123,7 +123,7 @@ class H5JsBean {
var selectTab:Int = 0
//倾诉拨打电话使用参数
var callType:Int?=null
var callType:String?=null
}
}
}
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