Commit 612b796e by 洪国微

stash

parent f961eb92
...@@ -9,13 +9,17 @@ kapt { ...@@ -9,13 +9,17 @@ kapt {
} }
} }
android { android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"] // compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"] // buildToolsVersion rootProject.ext.android["buildToolsVersion"]
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig { defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"] // minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"] // targetSdkVersion rootProject.ext.android["targetSdkVersion"]
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
...@@ -30,13 +34,13 @@ android { ...@@ -30,13 +34,13 @@ android {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField "String", "AGORA_APPID", "3387e9b251f3491e9221a9877e8f7830" buildConfigField "String", "AGORA_APPID", '"3387e9b251f3491e9221a9877e8f7830"'
} }
debug { debug {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField "String", "AGORA_APPID", "13b1536698f64905a1e7e5bb978ba821" buildConfigField "String", "AGORA_APPID", '"13b1536698f64905a1e7e5bb978ba821"'
} }
} }
publishNonDefault true publishNonDefault true
...@@ -57,10 +61,19 @@ dependencies { ...@@ -57,10 +61,19 @@ dependencies {
// 注意此处的依赖方式:kotlin中使用和java中使用方式有不同 // 注意此处的依赖方式:kotlin中使用和java中使用方式有不同
kapt "com.alibaba:arouter-compiler:$arouter_compiler" kapt "com.alibaba:arouter-compiler:$arouter_compiler"
implementation project(":ydl-platform")
api "com.alibaba:arouter-api:$arouter_api" api "com.alibaba:arouter-api:$arouter_api"
implementation ('com.ydl:ydl-av:1.1.8@aar'){ implementation ('com.ydl:ydl-av:1.1.8@aar'){
transitive = true transitive = true
} }
implementation project(":ydl-webview") // implementation project(":ydl-webview")
// implementation project(":ydl-platform")
implementation 'com.ydl:ydl-webview:0.0.14@aar'
implementation('com.ydl:ydl-platform:0.0.11@aar') {
transitive = true
// exclude group: 'com.ydl', module: 'ydl-utils'
// exclude group: 'com.ydl', module: 'ydl-js'
// exclude group: 'com.ydl', module: 'ydl-pushagent'
}
} }
package com.ydl.audioim package com.ydl.audioim
import com.ydl.audioim.api.IAVRouter //import com.ydl.audioim.api.IAVRouter
class AVRouterImpl: IAVRouter { //class AVRouterImpl: IAVRouter {
override fun loginAgora(userId: String?) { // override fun loginAgora(userId: String?) {
YDLavManager.instances.login(userId) // YDLavManager.instances.login(userId)
} // }
//
} //}
\ No newline at end of file \ No newline at end of file
...@@ -8,17 +8,31 @@ package com.ydl.audioim.bean; ...@@ -8,17 +8,31 @@ package com.ydl.audioim.bean;
* @date 2018/11/10 * @date 2018/11/10
*/ */
public class ExpertInfoBean { public class ExpertInfoBean {
public String expertHeadUrl;//专家头像地址 public String expertHeadUrl;
public String expertName;//专家姓名 public String expertName;
public String expertTips;//专家文案 public String expertTips;
public String token;//token public String token;
public String signalToken;//信令 public String signalToken;
public String listenerUid;//聆听者UID public String listenerUid;
public int listenerStatus;//1 空闲 2 倾听中(只用这个字段判断老师状态,下面两个字段都不用) public int listenerStatus;
public String listenerIsOpen;//1 开启 2 关闭 public String listenerIsOpen;
public String listenOrderStatus;//1未链接2连接中3连接失败4连接成功 public String listenOrderStatus;
public String channelId;//声网点对点聊天房间id public String channelId;
public String remainingTime;//倾诉剩余时长(时长单位s,eg:剩余2min15s,返回135) public ExpertInfoBean.ListenRemainingTime remainingTime;
public String totalDuration;//总时长 public String totalDuration;
public String commentUrl;//评价页URL public String commentUrl;
public ExpertInfoBean() {
}
public static class ListenRemainingTime {
public String remainingTime;
public ListenRemainingTime() {
}
public ListenRemainingTime(String remainingTime) {
this.remainingTime = remainingTime;
}
}
} }
...@@ -9,13 +9,18 @@ kapt { ...@@ -9,13 +9,18 @@ kapt {
} }
android { android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"] // compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"] // buildToolsVersion rootProject.ext.android["buildToolsVersion"]
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig { defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"] // minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"] // targetSdkVersion rootProject.ext.android["targetSdkVersion"]
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro' consumerProguardFiles 'consumer-rules.pro'
...@@ -24,9 +29,17 @@ android { ...@@ -24,9 +29,17 @@ android {
} }
buildTypes { buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField "String", "AGORA_APPID", '"13b1536698f64905a1e7e5bb978ba821"'
}
release { release {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField "String", "AGORA_APPID", '"3387e9b251f3491e9221a9877e8f7830"'
} }
} }
...@@ -36,6 +49,12 @@ android { ...@@ -36,6 +49,12 @@ android {
xlzx {} xlzx {}
} }
//设置JDK1.8
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets { sourceSets {
main { main {
res.srcDirs = [ res.srcDirs = [
...@@ -62,6 +81,18 @@ dependencies { ...@@ -62,6 +81,18 @@ dependencies {
api "com.alibaba:arouter-api:$arouter_api" api "com.alibaba:arouter-api:$arouter_api"
// 注意此处的依赖方式:kotlin中使用和java中使用方式有不同 // 注意此处的依赖方式:kotlin中使用和java中使用方式有不同
kapt "com.alibaba:arouter-compiler:$arouter_compiler" kapt "com.alibaba:arouter-compiler:$arouter_compiler"
implementation project(":ydl-platform")
implementation 'com.alibaba:fastjson:1.2.38' implementation 'com.alibaba:fastjson:1.2.38'
api project(':m-audioim')
implementation'com.ydl:router:1.0.0-SNAPSHOT@aar'
// implementation project(":ydl-platform")
implementation('com.ydl:ydl-platform:0.0.11@aar') {
transitive = true
// exclude group: 'com.ydl', module: 'ydl-utils'
// exclude group: 'com.ydl', module: 'ydl-js'
// exclude group: 'com.ydl', module: 'ydl-pushagent'
}
api 'com.ydl:ydl-media:0.0.1@aar'
} }
...@@ -2,13 +2,9 @@ ...@@ -2,13 +2,9 @@
package="com.ydl.confide" > package="com.ydl.confide" >
<application> <application>
<activity android:name=".PhoneCallActivity"
android:screenOrientation="portrait"/>
<activity android:name=".home.ConfideHomeActivity" <activity android:name=".home.ConfideHomeActivity"
android:screenOrientation="portrait"> android:screenOrientation="portrait">
</activity> </activity>
<activity android:name="com.yidianling.phonecall.order.DownOrderActivity"
android:screenOrientation="portrait"/>
</application> </application>
</manifest> </manifest>
...@@ -24,10 +24,15 @@ import com.ydl.confide.home.listener.ConfideHomeRecycleViewListener ...@@ -24,10 +24,15 @@ import com.ydl.confide.home.listener.ConfideHomeRecycleViewListener
import com.ydl.confide.home.listener.ConfideHomeRecyleSuspendListener import com.ydl.confide.home.listener.ConfideHomeRecyleSuspendListener
import com.ydl.confide.home.presenter.ConfideHomePresenterImpl import com.ydl.confide.home.presenter.ConfideHomePresenterImpl
import com.ydl.confide.home.util.ConfideHomeUtils import com.ydl.confide.home.util.ConfideHomeUtils
import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.ydl.ydlcommon.utils.UMEventUtils import com.ydl.ydlcommon.utils.UMEventUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.ydl.ydlcommon.view.DrawableRightTextView import com.ydl.ydlcommon.view.DrawableRightTextView
import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager
import com.yidianling.router.RouterManager
import kotlinx.android.synthetic.main.confidehome_home_activity.*
import kotlinx.android.synthetic.main.confidehome_title_bar.*
/** /**
* @author yuanwai * @author yuanwai
...@@ -37,12 +42,21 @@ import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager ...@@ -37,12 +42,21 @@ import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager
* @date 2018/8/10 * @date 2018/8/10
*/ */
@Route(path = "/confide/home") @Route(path = "/confide/home")
class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHomeContract.Presenter>(),XRecyclerView.LoadingListener { class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHomeContract.Presenter>(),IConfideHomeContract.View,XRecyclerView.LoadingListener {
override fun loadData() { override fun getContentViewId(): Int {
return R.id.rv_list
}
override fun getStateViewId(): Int {
}
override fun reLoadData() {
} }
//是否从启动页直接进入 //是否从启动页直接进入
var isSplash: Boolean = false var isSplash: Boolean = false
/** /**
...@@ -96,7 +110,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -96,7 +110,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
} }
override fun createPresenter(): IConfideHomeContract.Presenter { override fun createPresenter(): IConfideHomeContract.Presenter {
return ConfideHomePresenterImpl(this) return ConfideHomePresenterImpl()
} }
override fun layoutResId(): Int { override fun layoutResId(): Int {
...@@ -110,7 +124,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -110,7 +124,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
//重置页 //重置页
page = 2 page = 2
allFiltersBean!!.page = page allFiltersBean!!.page = page
presenter.confideHomeRequest() mPresenter.confideHomeRequest()
} }
/** /**
...@@ -129,7 +143,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -129,7 +143,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
//显示加载中 //显示加载中
showProgressDialog() showProgressDialog()
allFiltersBean!!.notInUid = ArrayList() allFiltersBean!!.notInUid = ArrayList()
presenter.recommendList(ConfideHomeUtils.createParam(allFiltersBean!!)) mPresenter.recommendList(ConfideHomeUtils.createParam(allFiltersBean!!))
} else if (page > 1) { } else if (page > 1) {
var listData = mConfideAdapter?.getList() var listData = mConfideAdapter?.getList()
var notUidList = ArrayList<Int>() var notUidList = ArrayList<Int>()
...@@ -144,7 +158,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -144,7 +158,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
} }
} }
allFiltersBean!!.notInUid = notUidList allFiltersBean!!.notInUid = notUidList
presenter.recommendListMore(ConfideHomeUtils.createParam(allFiltersBean!!)) mPresenter.recommendListMore(ConfideHomeUtils.createParam(allFiltersBean!!))
} }
} }
...@@ -160,7 +174,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -160,7 +174,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
//显示加载中 //显示加载中
// showProgressDialog() // showProgressDialog()
//加载本地缓存 //加载本地缓存
presenter.loadLocalData(this) mPresenter.loadLocalData(this)
initClick() initClick()
initQuickConsultDialog() initQuickConsultDialog()
...@@ -479,7 +493,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -479,7 +493,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
rv_list.visibility = View.VISIBLE rv_list.visibility = View.VISIBLE
} }
override fun showError(msg: String?) { override fun showError1(msg: String?){
rv_list.loadMoreComplete() rv_list.loadMoreComplete()
msg?.let { msg?.let {
......
package com.ydl.confide.home.bean
import com.ydl.audioim.bean.ExpertInfoBean
/**
* 倾诉连接响应数据
*/
class ConfideConnectResponse{
var dialDetail : DialDetail? = null
var listenOrderId : Long? = 0 //订单ID
var callId : String? = null //
var payId : String?=null //支付ID
var payTitle : String? = null //支付标题
var listenOrderPrice : Double? = null //订单金额
var userBaseInfoRespDto : UserBaseInfoRespDto?=null
var coupon :CouponData? = null //优惠信息
}
class DialDetail{
var agoraExpertInfo: ExpertInfoBean? = null
var callConnectType :Int ? = null
var dialReason : String? = null //连接失败原因
var dialStatus : Int? = null //连接状态
var phoneNu : String ?= null //axb号码
}
class UserBaseInfoRespDto{
var availableMoney : Double ? = null
var companyMoney : Double ? = null
var doctorId : Long ? = null
var phone : Long ? = null
var userType : String?=null
}
class CouponData{
var couponMoney:Double? = 0.00
}
\ No newline at end of file
package com.ydl.confide.home.bean
import com.ydl.ydlcommon.data.http.BaseCommand
/**
* author : harvie
* e-mail : zhangwch@yidianling.com
* time : 2018/03/08
*/
class ConnectParamJava : BaseCommand {
var id: String = "0" //倾诉id
var type: String = "1" //1 走AxB 2双呼 3声网
constructor() : super()
constructor(id: String, type: String) : super() {
this.id = id
this.type = type
}
}
...@@ -77,7 +77,7 @@ interface IConfideHomeContract{ ...@@ -77,7 +77,7 @@ interface IConfideHomeContract{
/** /**
* 显示错误信息 * 显示错误信息
*/ */
fun showError(msg : String?) fun showError1(msg : String?)
fun getContext() : Context fun getContext() : Context
......
...@@ -2,10 +2,12 @@ package com.ydl.confide.home.event ...@@ -2,10 +2,12 @@ package com.ydl.confide.home.event
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import android.content.Intent
import android.net.Uri import android.net.Uri
import android.support.v7.app.AppCompatActivity import android.support.v7.app.AppCompatActivity
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import com.ydl.confide.home.ConfideHomeActivity
import com.ydl.ydl_router.manager.YDLRouterManager import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams import com.ydl.ydl_router.manager.YDLRouterParams
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
...@@ -21,9 +23,16 @@ import com.ydl.confide.home.popwindow.ConfideHomeSortPopupWindow ...@@ -21,9 +23,16 @@ import com.ydl.confide.home.popwindow.ConfideHomeSortPopupWindow
import com.ydl.confide.home.util.ConfideHomeUtils import com.ydl.confide.home.util.ConfideHomeUtils
import com.ydl.confide.home.widget.ConfideHomeFilterView import com.ydl.confide.home.widget.ConfideHomeFilterView
import com.ydl.confide.router.PhoneCallIn import com.ydl.confide.router.PhoneCallIn
import com.ydl.media.audio.AudioPlayer
import com.ydl.media.audio.model.Music
import com.ydl.media.view.PlayerFloatHelper
import com.ydl.media.view.PlayerFloatView
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.router.IYDLRouterConstant import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.UMEventUtils import com.ydl.ydlcommon.utils.UMEventUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.router.RouterManager
import com.yidianling.router.im.IMRequestCallback
/** /**
* @author yuanwai * @author yuanwai
...@@ -152,7 +161,9 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo ...@@ -152,7 +161,9 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
//埋点 //埋点
UMEventUtils.umEvent("听声寻人点击", "图片点击", "图片点击") UMEventUtils.umEvent("听声寻人点击", "图片点击", "图片点击")
YDLMusicHelper.confidePlay(playUrl) val mu = Music()
mu.path = playUrl
AudioPlayer.get().singlePlay(mu)
umengPlayVoice(type) umengPlayVoice(type)
confideHomeView.updataPlayStatu(type, index!!, 0, true) confideHomeView.updataPlayStatu(type, index!!, 0, true)
initCache(type, index!!, 0, playUrl) initCache(type, index!!, 0, playUrl)
...@@ -160,10 +171,12 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo ...@@ -160,10 +171,12 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
} }
override fun playVoice(type: Int?, index: Int?, recommendId: Int, playUrl: String?, name: String?) { override fun playVoice(type: Int?, index: Int?, recommendId: Int, playUrl: String?, name: String?) {
YDLMusicHelper.name = name val mu = Music()
YDLMusicHelper.confidePlay(playUrl) mu.title = name
mu.path = playUrl
AudioPlayer.get().singlePlay(mu)
if (PlayerFloatHelper.isShow(mContext!!)) { if (PlayerFloatHelper.isShow(mContext!!)) {
if (YDLMusicHelper.playType == 1) { if (AudioPlayer.get().playMode.value() == 1) {
PlayerFloatHelper.removeView(mContext!!) PlayerFloatHelper.removeView(mContext!!)
PlayerFloatHelper.show(mContext!!) PlayerFloatHelper.show(mContext!!)
...@@ -242,7 +255,7 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo ...@@ -242,7 +255,7 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
if (TextUtils.isEmpty(cachePlayUrl)) { if (TextUtils.isEmpty(cachePlayUrl)) {
return return
} }
YDLMusicHelper.start() AudioPlayer.get().playPause()
confideHomeView.updataPlayStatu(cacheType, cacheIndex!!, cacheSubIndex, true) confideHomeView.updataPlayStatu(cacheType, cacheIndex!!, cacheSubIndex, true)
} }
...@@ -250,7 +263,7 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo ...@@ -250,7 +263,7 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
* 暂停播放音频文件 * 暂停播放音频文件
*/ */
override fun pauseVoice() { override fun pauseVoice() {
YDLMusicHelper.pause() AudioPlayer.get().playPause()
PlayerFloatHelper.updatePlayState() PlayerFloatHelper.updatePlayState()
//因为9999 类型不存在 所以就能把状态全部置为暂停状态了 偷个懒 //因为9999 类型不存在 所以就能把状态全部置为暂停状态了 偷个懒
confideHomeView.updataPlayStatu(9999, 0, 0, false) confideHomeView.updataPlayStatu(9999, 0, 0, false)
...@@ -258,8 +271,8 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo ...@@ -258,8 +271,8 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
override fun destoryPlayer() { override fun destoryPlayer() {
PlayerFloatHelper.hide() PlayerFloatHelper.hide()
YDLMusicHelper.clearTempData() PlayerFloatHelper.playTempData = hashMapOf<String,String>()
YDLMusicHelper.stop() AudioPlayer.get().stopPlayer()
floatViewClickListener?.let { PlayerFloatHelper.removeClickListener(it) }; floatViewClickListener?.let { PlayerFloatHelper.removeClickListener(it) };
} }
...@@ -310,9 +323,11 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo ...@@ -310,9 +323,11 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
if ("listen" == uri.host) { if ("listen" == uri.host) {
var tabIndex = uri.getQueryParameter("type") var tabIndex = uri.getQueryParameter("type")
if (TextUtils.isEmpty(tabIndex)) { if (TextUtils.isEmpty(tabIndex)) {
PhoneCallActivity.start(mContext!!) val intent1 = Intent(mContext, ConfideHomeActivity::class.java)
mContext?.startActivity(intent1)
} else { } else {
PhoneCallActivity.start(mContext!!, tabIndex.toInt()) val intent1 = Intent(mContext, ConfideHomeActivity::class.java)
mContext?.startActivity(intent1)
} }
} }
} else if (linkUrl.startsWith("http")) { } else if (linkUrl.startsWith("http")) {
......
package com.ydl.confide.home.http package com.ydl.confide.home.http
import com.ydl.confide.home.bean.ConfideConnectResponse
import com.ydl.confide.home.bean.ConfideHomeDataBean import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.ydlcommon.base.config.YDL_DOMAIN import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
...@@ -7,6 +8,7 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse ...@@ -7,6 +8,7 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
import io.reactivex.Observable import io.reactivex.Observable
import retrofit2.http.GET import retrofit2.http.GET
import retrofit2.http.Headers import retrofit2.http.Headers
import retrofit2.http.QueryMap
import retrofit2.http.Url import retrofit2.http.Url
/** /**
...@@ -26,4 +28,9 @@ interface ConfideHomeApi{ ...@@ -26,4 +28,9 @@ interface ConfideHomeApi{
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json") @Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json")
@GET @GET
fun recommedChange(@Url url: String): Observable<BaseAPIResponse<ConfideHomeDataBean>> fun recommedChange(@Url url: String): Observable<BaseAPIResponse<ConfideHomeDataBean>>
//连接-java接口
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json")
@GET("auth/listen/dial")
fun connectJava(@QueryMap params: Map<String, String>): Observable<BaseAPIResponse<ConfideConnectResponse>>
} }
\ No newline at end of file
package com.ydl.confide.home.http package com.ydl.confide.home.http
import com.ydl.confide.home.bean.ConfideConnectResponse
import com.ydl.confide.home.bean.ConfideHomeDataBean import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.bean.ConnectParamJava
import com.ydl.ydlcommon.base.config.HttpConfig import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
...@@ -62,4 +64,12 @@ class ConfideHomeHttpImpl private constructor(): IConfideHomeHttp{ ...@@ -62,4 +64,12 @@ class ConfideHomeHttpImpl private constructor(): IConfideHomeHttp{
confideHomeApi.recommedChange(HttpConfig.SERVER_API_JAVA_URL + "auth/listen/search?"+confideParam) confideHomeApi.recommedChange(HttpConfig.SERVER_API_JAVA_URL + "auth/listen/search?"+confideParam)
} }
} }
override fun connectionJava(connectParam: ConnectParamJava): Observable<BaseAPIResponse<ConfideConnectResponse>> {
return RxUtils.mapObservable(connectParam)
.flatMap {
it->
YDLHttpUtils.obtainApi(ConfideHomeApi::class.java).connectJava(it)
}
}
} }
\ No newline at end of file
package com.ydl.confide.home.http package com.ydl.confide.home.http
import com.ydl.confide.home.bean.ConfideConnectResponse
import com.ydl.confide.home.bean.ConfideHomeDataBean import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.bean.ConnectParamJava
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import io.reactivex.Observable import io.reactivex.Observable
...@@ -21,4 +23,7 @@ interface IConfideHomeHttp{ ...@@ -21,4 +23,7 @@ interface IConfideHomeHttp{
* 为你推荐列表 * 为你推荐列表
*/ */
fun recommendList(param : ConfideRecommendParam): Observable<BaseAPIResponse<ConfideHomeDataBean>> fun recommendList(param : ConfideRecommendParam): Observable<BaseAPIResponse<ConfideHomeDataBean>>
//倾诉链接,java接口,支持axb和声网
fun connectionJava(connectParam: ConnectParamJava) : Observable<BaseAPIResponse<ConfideConnectResponse>>
} }
\ No newline at end of file
...@@ -119,7 +119,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid ...@@ -119,7 +119,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid
*/ */
override fun recommendList(param : ConfideRecommendParam) { override fun recommendList(param : ConfideRecommendParam) {
if (!RxNetTool.isConnected(mView.getContext())){ if (!RxNetTool.isConnected(mView.getContext())){
mView.showError("网络不给力") mView.showError1("网络不给力")
return return
} }
val disposable = mModel.recommendList(param) val disposable = mModel.recommendList(param)
...@@ -130,7 +130,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid ...@@ -130,7 +130,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid
mView.recommendListResponse(it) mView.recommendListResponse(it)
}, object : ThrowableConsumer() { }, object : ThrowableConsumer() {
override fun accept(msg: String) { override fun accept(msg: String) {
mView.showError(msg) mView.showError1(msg)
} }
}) })
} }
...@@ -140,7 +140,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid ...@@ -140,7 +140,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid
*/ */
override fun recommendListMore(param: ConfideRecommendParam) { override fun recommendListMore(param: ConfideRecommendParam) {
if (!RxNetTool.isConnected(mView.getContext())){ if (!RxNetTool.isConnected(mView.getContext())){
mView.showError("网络不给力") mView.showError1("网络不给力")
return return
} }
val disposable = mModel.recommendList(param) val disposable = mModel.recommendList(param)
...@@ -151,7 +151,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid ...@@ -151,7 +151,7 @@ class ConfideHomePresenterImpl : BasePresenter<IConfideHomeContract.View,IConfid
mView.recommendListMoreResponse(it) mView.recommendListMoreResponse(it)
}, object : ThrowableConsumer() { }, object : ThrowableConsumer() {
override fun accept(msg: String) { override fun accept(msg: String) {
mView.showError(msg) mView.showError1(msg)
} }
}) })
} }
......
...@@ -82,7 +82,7 @@ class ConfideHomeFilterView(mContext: Context, @Nullable attrs: AttributeSet?, d ...@@ -82,7 +82,7 @@ class ConfideHomeFilterView(mContext: Context, @Nullable attrs: AttributeSet?, d
} }
private fun setDrawableRight(textView: DrawableRightTextView){ private fun setDrawableRight(textView: DrawableRightTextView){
var drawable = context.resources.getDrawable(R.drawable.ic_arrow_drop_down_grey_500_18dp) var drawable = context.resources.getDrawable(R.drawable.platform_ic_arrow_drop_down_grey_500_18dp)
// 这一步必须要做,否则不会显示. // 这一步必须要做,否则不会显示.
drawable.setBounds(0, 0, drawable.minimumWidth, drawable.minimumHeight) drawable.setBounds(0, 0, drawable.minimumWidth, drawable.minimumHeight)
textView.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null) textView.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null)
......
...@@ -3,10 +3,21 @@ package com.ydl.confide.router ...@@ -3,10 +3,21 @@ package com.ydl.confide.router
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import com.ydl.confide.api.IPhoneCallRouter import android.support.v4.app.DialogFragment
import com.ydl.confide.home.ConfideHomeActivity import com.ydl.confide.home.ConfideHomeActivity
import com.yidianling.router.phoneCall.IPhoneCallRouter
class PhoneCallImp : IPhoneCallRouter { class PhoneCallImp : IPhoneCallRouter {
override fun phoneCallFragment(head: String, callId: String): DialogFragment {
//废弃
return DialogFragment()
}
override fun phoneCallIntent(activity: Activity): Intent {
//废弃
val intent = Intent(activity, ConfideHomeActivity::class.java)
return intent
}
override fun openConfideHome(context: Context) { override fun openConfideHome(context: Context) {
val intent = Intent(context, ConfideHomeActivity::class.java) val intent = Intent(context, ConfideHomeActivity::class.java)
......
...@@ -3,6 +3,8 @@ package com.ydl.confide.router ...@@ -3,6 +3,8 @@ package com.ydl.confide.router
import android.app.Activity import android.app.Activity
import android.content.Intent import android.content.Intent
import android.support.v7.app.AppCompatActivity import android.support.v7.app.AppCompatActivity
import com.yidianling.router.RouterManager
import com.yidianling.router.user.UserResponse
/** /**
* author : Zhangwenchao * author : Zhangwenchao
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.Space
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="0px"/>
\ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white"> android:background="@color/white">
<com.yidianling.ydlcommon.view.banner.Banner <com.ydl.ydlcommon.view.banner.Banner
android:id="@+id/confide_home_banner" android:id="@+id/confide_home_banner"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="145dp" android:layout_height="145dp"
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
android:layout_marginTop="@dimen/dp_10" android:layout_marginTop="@dimen/dp_10"
android:layout_height="160dp" android:layout_height="160dp"
android:layout_marginBottom="20dp"> android:layout_marginBottom="20dp">
<com.yidianling.ydlcommon.view.banner.Banner <com.ydl.ydlcommon.view.banner.Banner
android:id="@+id/banner" android:id="@+id/banner"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<merge android:layout_width="match_parent" <merge android:layout_width="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<com.yidianling.phonecall.home.widget.ConfideHomeCategoryItemView <com.ydl.confide.home.widget.ConfideHomeCategoryItemView
android:id="@+id/v_item1" android:id="@+id/v_item1"
android:layout_width="0px" android:layout_width="0px"
android:layout_marginLeft="@dimen/dp_15" android:layout_marginLeft="@dimen/dp_15"
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
android:layout_weight="1" android:layout_weight="1"
app:cardCornerRadius="6dp" app:cardCornerRadius="6dp"
app:cardElevation="1dp" /> app:cardElevation="1dp" />
<com.yidianling.phonecall.home.widget.ConfideHomeCategoryItemView <com.ydl.confide.home.widget.ConfideHomeCategoryItemView
android:id="@+id/v_item2" android:id="@+id/v_item2"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginTop="@dimen/dp_19" android:layout_marginTop="@dimen/dp_19"
......
...@@ -60,11 +60,12 @@ ...@@ -60,11 +60,12 @@
android:background="#80000000" android:background="#80000000"
android:visibility="gone" /> android:visibility="gone" />
<com.yidianling.phonecall.home.widget.ConfideHomeFilterView <com.ydl.confide.home.widget.ConfideHomeFilterView
android:id="@+id/v_filterView" android:id="@+id/v_filterView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_marginTop="48dp" android:layout_marginTop="48dp"
android:background="@color/white" android:background="@color/white"
android:visibility="gone" /> android:visibility="gone" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="color_242424">#242424</color>
<color name="new_divide_color">#f0f0f0</color>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<resources>
<!--分割线粗细-->
<dimen name="divide_line_stroke_width">0.5dp</dimen>
<!--距离部分-->
<dimen name="default_dis_size_nano">2dp</dimen>
<dimen name="default_dis_size_micro">4dp</dimen>
<dimen name="default_dis_size_small">6dp</dimen>
<dimen name="default_dis_size">8dp</dimen>
<dimen name="default_dis_size_big">10dp</dimen>
<dimen name="default_dis_size_large">12dp</dimen>
<dimen name="default_dis_size_huge">14dp</dimen>
<dimen name="default_dis_size_huge_more">16dp</dimen>
<!--字体大小部分-->
<dimen name="default_text_size_micro">8sp</dimen>
<dimen name="default_text_size_little">10sp</dimen>
<dimen name="default_text_size_small">12sp</dimen>
<dimen name="default_text_size">14sp</dimen>
<dimen name="default_text_size_big">16sp</dimen>
<dimen name="default_text_size_large">18sp</dimen>
<!--TitleBar高度-->
<dimen name="title_bar_height">45dp</dimen>
<dimen name="action_bar_height">48dip</dimen>
<!--JumpTextView部分-->
<dimen name="jump_text_view_min_height">55dp</dimen>
<dimen name="jump_text_view_icon_size">25dp</dimen>
<!-- dialog -->
<dimen name="normal_text_size">16sp</dimen>
<dimen name="big_text_size">17sp</dimen>
<dimen name="light_line_size">1px</dimen>
<dimen name="dialog_padding_vertical">20dip</dimen>
<dimen name="custom_dialog_padding_vertical">15dip</dimen>
<dimen name="dark_line_size">3px</dimen>
<dimen name="dialog_text_margin_horizontal">15dip</dimen>
<dimen name="very_samll_text_size">9sp</dimen>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<!--动态-->
<!--顶部title Size-->
<dimen name="title_height">45dp</dimen>
<dimen name="title_txt_sp">20sp</dimen>
<!-- map -->
<dimen name="chatroom_head_height">200dp</dimen>
<dimen name="dp_1">1dp</dimen>
<dimen name="dp_2">2dp</dimen>
<dimen name="dp_3">3dp</dimen>
<dimen name="dp_4">4dp</dimen>
<dimen name="dp_5">5dp</dimen>
<dimen name="dp_6">6dp</dimen>
<dimen name="dp_7">7dp</dimen>
<dimen name="dp_8">8dp</dimen>
<dimen name="dp_9">9dp</dimen>
<dimen name="dp_10">10dp</dimen>
<dimen name="dp_11">11dp</dimen>
<dimen name="dp_12">12dp</dimen>
<dimen name="dp_13">13dp</dimen>
<dimen name="dp_14">14dp</dimen>
<dimen name="dp_15">15dp</dimen>
<dimen name="dp_16">16dp</dimen>
<dimen name="dp_17">17dp</dimen>
<dimen name="dp_18">18dp</dimen>
<dimen name="dp_19">19dp</dimen>
<dimen name="dp_20">20dp</dimen>
<dimen name="dp_21">21dp</dimen>
<dimen name="dp_22">22dp</dimen>
<dimen name="dp_23">23dp</dimen>
<dimen name="dp_24">24dp</dimen>
<dimen name="dp_25">25dp</dimen>
<dimen name="dp_26">26dp</dimen>
<dimen name="dp_27">27dp</dimen>
<dimen name="dp_28">28dp</dimen>
<dimen name="dp_29">29dp</dimen>
<dimen name="dp_30">30dp</dimen>
<dimen name="dp_31">31dp</dimen>
<dimen name="dp_32">32dp</dimen>
<dimen name="dp_33">33dp</dimen>
<dimen name="dp_34">34dp</dimen>
<dimen name="dp_35">35dp</dimen>
<dimen name="dp_36">36dp</dimen>
<dimen name="dp_37">37dp</dimen>
<dimen name="dp_38">38dp</dimen>
<dimen name="dp_48">48dp</dimen>
<dimen name="dp_60">60dp</dimen>
<dimen name="dp_64">64dp</dimen>
<dimen name="dp_88">88dp</dimen>
<dimen name="dp_99">99dp</dimen>
<dimen name="dp_115">115dp</dimen>
<dimen name="dp_127">127dp</dimen>
</resources>
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