Commit d1f35585 by 刘鹏

Merge branch 'd/v4.4.07' into 'release'

D/v4.4.07

See merge request app_android_lib/YDL-Component!307
parents cebfc34e 97eb30e1
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "com.alibaba:arouter-api:$arouter_api"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ydl.audioim.api">
</manifest>
\ No newline at end of file
package com.ydl.audioim.api
import android.app.Activity
import android.content.Context
import com.alibaba.android.arouter.facade.template.IProvider
/**
* Created by Ykai on 2022/7/26.
*/
interface IAudioImService : IProvider{
/**
* YDLavManager初始化方法
*/
fun yDLAvManagerInit(context: Context, appId: String)
/**
* 获取rtm是否在线
*/
fun getIsOnlineRtm(): Boolean
/**
* rtm登录返回并登录状态
*/
fun loginRtm(userId:String?,event: (isSuccess: Boolean, msg: String?) -> Unit)
/**
* rtm登录
*/
fun loginRtm(userId:String?)
/**
* 拨打语音电话转axb弹窗
*/
fun openAxbDialog(activity: Activity?, type:Int, phoneNumber: String?)
/**
* 事件上报
*/
fun callEventSave(status: String, res: String, session: String?, line: String)
}
\ No newline at end of file
...@@ -18,7 +18,7 @@ public class ExpertInfoBean { ...@@ -18,7 +18,7 @@ public class ExpertInfoBean {
public String listenerIsOpen; public String listenerIsOpen;
public String listenOrderStatus; public String listenOrderStatus;
public String channelId; public String channelId;
public ExpertInfoBean.ListenRemainingTime remainingTime; public ListenRemainingTime remainingTime;
public String totalDuration; public String totalDuration;
public String commentUrl; public String commentUrl;
......
package com.ydl.audioim; package com.ydl.audioim.listener;
/** /**
* @author jiucheng * @author jiucheng
......
...@@ -38,7 +38,5 @@ interface IConfideService : IProvider { ...@@ -38,7 +38,5 @@ interface IConfideService : IProvider {
uid: String uid: String
) )
fun isOnlineRtm():Boolean
fun requestConfidePermission(activity: FragmentActivity, call: ((Boolean) -> Unit)?) fun requestConfidePermission(activity: FragmentActivity, call: ((Boolean) -> Unit)?)
} }
\ No newline at end of file
package com.ydl.confide.home.event package com.ydl.confide.event
data class ChangeAnotherExpertEvent( data class ChangeAnotherExpertEvent(
var doctorID: String, var doctorID: String,
var title: String, var title: String,
var uid: String, var uid: String,
var linkUrl: String var linkUrl: String
) )
\ No newline at end of file
class ConfideDialogEvent(val show: Int)
\ No newline at end of file
package com.ydl.confide.event
class ConfideDialogEvent(val show: Int)
\ No newline at end of file
...@@ -30,4 +30,6 @@ android { ...@@ -30,4 +30,6 @@ android {
dependencies { dependencies {
implementation "com.alibaba:arouter-api:$arouter_api" implementation "com.alibaba:arouter-api:$arouter_api"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
compileOnly(project(":ydl-webview"))
} }
\ No newline at end of file
...@@ -4,9 +4,10 @@ import android.app.Activity ...@@ -4,9 +4,10 @@ import android.app.Activity
import android.content.Context import android.content.Context
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.template.IProvider import com.alibaba.android.arouter.facade.template.IProvider
import com.ydl.webview.H5JsBean
import com.yidianling.consultant.OnBottomWordListener
import com.yidianling.consultant.bean.GuideBean import com.yidianling.consultant.bean.GuideBean
import com.yidianling.consultant.bean.Keyworks import com.yidianling.consultant.bean.Keyworks
import com.yidianling.consultant.OnBottomWordListener
/** /**
* Created by xj on 2019/11/14. * Created by xj on 2019/11/14.
...@@ -51,4 +52,7 @@ interface IConsultantService: IProvider { ...@@ -51,4 +52,7 @@ interface IConsultantService: IProvider {
//获取底纹词 //获取底纹词
fun getbottomWord(type: Int, listener: OnBottomWordListener) fun getbottomWord(type: Int, listener: OnBottomWordListener)
// 预览资源
fun resourceToPreview(dataList: List<H5JsBean.MediaInfo>?, params: H5JsBean.H5JsCmd.Params, activity: Activity)
} }
\ No newline at end of file
package com.yidianling.im.event package com.yidianling.im.api.event
data class CloseBottomWebviewEvent( var close:Boolean) data class CloseBottomWebviewEvent( var close:Boolean)
\ No newline at end of file
...@@ -188,4 +188,6 @@ interface IImService : IProvider { ...@@ -188,4 +188,6 @@ interface IImService : IProvider {
fun showConsultServiceDialog(activity: Activity, toUid: String, doctorId: String) fun showConsultServiceDialog(activity: Activity, toUid: String, doctorId: String)
fun dismissConsultServiceDialog(); fun dismissConsultServiceDialog();
/**群聊*/
fun startTeamSession(activity: Activity, tid: String, doctorId: String)
} }
\ No newline at end of file
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "com.google.code.gson:gson:2.8.5"
implementation "com.alibaba:arouter-api:$arouter_api"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ydl.js.api">
</manifest>
\ No newline at end of file
package com.ydl.js.api
import com.alibaba.android.arouter.facade.template.IProvider
interface IJsService : IProvider {
fun isH5Open(): Boolean
fun isMainOpen(): Boolean
fun setH5Open(open: Boolean)
fun setMainOpen(open: Boolean)
}
\ No newline at end of file
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "com.google.code.gson:gson:2.8.5"
implementation "com.alibaba:arouter-api:$arouter_api"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ydl.muse.api">
</manifest>
\ No newline at end of file
package com.ydl.muse.api
import android.app.Activity
import com.alibaba.android.arouter.facade.template.IProvider
interface IMuseService : IProvider {
fun switchSound(activity: Activity,
mediaId: Int, meditationId: Long, meditationType: Int, businessType: Int,
buried: String?, mediaUrl: String?, mediaCoverUrl: String?,
title: String?, desc: String?, status: Int
)
}
\ No newline at end of file
...@@ -215,11 +215,14 @@ dependencies { ...@@ -215,11 +215,14 @@ dependencies {
implementation project(":api:im") implementation project(":api:im")
implementation project(':m-dynamic') implementation project(':m-dynamic')
implementation project(':m-course') implementation project(':m-course')
implementation project(":api:course")
implementation project(':m-article') implementation project(':m-article')
implementation project(':m-audioim') implementation project(':m-audioim')
implementation project(':m-fm') implementation project(':m-fm')
implementation project(":api:fm") implementation project(":api:fm")
implementation project(':ydl-tuicore') implementation project(':ydl-tuicore')
implementation project(':m-js')
implementation project(':api:js')
implementation rootProject.ext.dependencies["retrofit-url-manager"] implementation rootProject.ext.dependencies["retrofit-url-manager"]
......
...@@ -16,6 +16,9 @@ import com.umeng.socialize.PlatformConfig; ...@@ -16,6 +16,9 @@ import com.umeng.socialize.PlatformConfig;
import com.umeng.socialize.UMShareAPI; import com.umeng.socialize.UMShareAPI;
import com.ydl.component.route.PlatformTempCommonRouteImpl; import com.ydl.component.route.PlatformTempCommonRouteImpl;
import com.ydl.confide.BuildConfig; import com.ydl.confide.BuildConfig;
import com.ydl.media.audio.AudioPlayer;
import com.ydl.media.audio.manager.MediaSessionManager;
import com.ydl.media.audio.manager.NotifyManager;
import com.ydl.ydl_image.manager.YDLImageCacheManager; import com.ydl.ydl_image.manager.YDLImageCacheManager;
import com.ydl.ydlcommon.base.BaseApp; import com.ydl.ydlcommon.base.BaseApp;
import com.ydl.ydlcommon.router.YdlCommonRouterManager; import com.ydl.ydlcommon.router.YdlCommonRouterManager;
...@@ -26,6 +29,7 @@ import com.yidianling.common.tools.ToastUtil; ...@@ -26,6 +29,7 @@ import com.yidianling.common.tools.ToastUtil;
import com.yidianling.consultant.preview.TestImageLoader; import com.yidianling.consultant.preview.TestImageLoader;
import com.yidianling.consultant.preview.ZoomMediaLoader; import com.yidianling.consultant.preview.ZoomMediaLoader;
import com.yidianling.course.lifeCallback.CoursePlayLifecycle; import com.yidianling.course.lifeCallback.CoursePlayLifecycle;
import com.yidianling.course.widget.AudioPlayView;
/** /**
...@@ -46,6 +50,9 @@ public class ComponentTestApp extends BaseApp { ...@@ -46,6 +50,9 @@ public class ComponentTestApp extends BaseApp {
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
mComponentTestAppContext = this; mComponentTestAppContext = this;
AudioPlayer.Companion.get().init(this);
NotifyManager.Companion.get().init(this);
MediaSessionManager.Companion.get().init(this);
LogUtil.debug = BuildConfig.DEBUG; LogUtil.debug = BuildConfig.DEBUG;
com.ydl.ydlcommon.utils.LogUtil.debug = BuildConfig.DEBUG; com.ydl.ydlcommon.utils.LogUtil.debug = BuildConfig.DEBUG;
......
...@@ -20,8 +20,8 @@ import java.util.List; ...@@ -20,8 +20,8 @@ import java.util.List;
*/ */
public final class DemoGlobalConfig implements IConfigModule { public final class DemoGlobalConfig implements IConfigModule {
String APP_DOMAIN = "https://api.github.com/"; String APP_DOMAIN = "https://api.github.com/";
public static String appEnv = YDLConstants.ENV_TEST; // public static String appEnv = YDLConstants.ENV_TEST;
// public static String appEnv = YDLConstants.ENV_PROD; public static String appEnv = YDLConstants.ENV_PROD;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库 // public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
@Override @Override
......
...@@ -22,7 +22,6 @@ import com.ydl.media.view.PlayTypeEnum; ...@@ -22,7 +22,6 @@ import com.ydl.media.view.PlayTypeEnum;
import com.ydl.media.view.PlayerFloatHelper; import com.ydl.media.view.PlayerFloatHelper;
import com.ydl.ydlcommon.utils.LogUtil; import com.ydl.ydlcommon.utils.LogUtil;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.muse.event.MeditationFloatEvent;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale; import java.util.Locale;
...@@ -92,17 +91,22 @@ public class PlayFragment extends Fragment implements View.OnClickListener, ...@@ -92,17 +91,22 @@ public class PlayFragment extends Fragment implements View.OnClickListener,
} }
@Override @Override
public void onChange(Music music) { public boolean onPreLoad(int playPosition) {
return true;
}
@Override
public void onLoad(Music music) {
onChangeImpl(music); onChangeImpl(music);
} }
@Override @Override
public void onPlayerStart() { public void onStartPlay() {
ivPlay.setSelected(true); ivPlay.setSelected(true);
} }
@Override @Override
public void onPlayerPause() { public void onPausePlay() {
ivPlay.setSelected(false); ivPlay.setSelected(false);
} }
...@@ -147,7 +151,7 @@ public class PlayFragment extends Fragment implements View.OnClickListener, ...@@ -147,7 +151,7 @@ public class PlayFragment extends Fragment implements View.OnClickListener,
} }
private void showFloatView() { private void showFloatView() {
if(!PlayerFloatHelper.Companion.isShow(getActivity())) { if(!PlayerFloatHelper.Companion.isShow()) {
PlayerFloatHelper.Companion.show(getActivity(), PlayTypeEnum.PLAY_TYPE_FM,new HashMap<>()); PlayerFloatHelper.Companion.show(getActivity(), PlayTypeEnum.PLAY_TYPE_FM,new HashMap<>());
}else { }else {
PlayerFloatHelper.Companion.showIfPlaying(getActivity()); PlayerFloatHelper.Companion.showIfPlaying(getActivity());
...@@ -191,7 +195,7 @@ public class PlayFragment extends Fragment implements View.OnClickListener, ...@@ -191,7 +195,7 @@ public class PlayFragment extends Fragment implements View.OnClickListener,
tvTitle.setText(music.getTitle()); tvTitle.setText(music.getTitle());
tvArtist.setText(music.getArtist()); tvArtist.setText(music.getArtist());
sbProgress.setProgress((int) AudioPlayer.Companion.get().getAudioPosition()); sbProgress.setProgress((int) AudioPlayer.Companion.get().getCurrentPosition());
sbProgress.setSecondaryProgress(0); sbProgress.setSecondaryProgress(0);
// sbProgress.setMax((int) AudioPlayer.Companion.get().getDuration()); // sbProgress.setMax((int) AudioPlayer.Companion.get().getDuration());
...@@ -207,7 +211,7 @@ public class PlayFragment extends Fragment implements View.OnClickListener, ...@@ -207,7 +211,7 @@ public class PlayFragment extends Fragment implements View.OnClickListener,
} }
void play() { void play() {
AudioPlayer.Companion.get().playPause(); AudioPlayer.Companion.get().playOrPause();
} }
void next() { void next() {
...@@ -263,7 +267,7 @@ public class PlayFragment extends Fragment implements View.OnClickListener, ...@@ -263,7 +267,7 @@ public class PlayFragment extends Fragment implements View.OnClickListener,
@Override @Override
public void onDestroy() { public void onDestroy() {
AudioPlayer.Companion.get().removeOnPlayEventListener(this); AudioPlayer.Companion.get().removeOnPlayEventListener(this);
PlayerFloatHelper.Companion.onDestroy(); PlayerFloatHelper.Companion.removeResetView();
super.onDestroy(); super.onDestroy();
} }
......
package com.ydl.component.service;
import android.app.Activity;
import android.content.Context;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.tencent.smtt.sdk.WebView;
import com.ydl.component.service.web.WVClickAbstractListener;
import com.ydl.component.service.web.WebJavascriptHandler;
import com.ydl.webview.IJavascriptHandler;
import com.ydl.webview.IWebService;
import com.ydl.webview.TellData;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Created by haorui on 2019-10-10.
* Des:
*/
@Route(path = "/web/webservice")
public class WebServiceImpl implements IWebService {
@Override
public void init(Context context) {
}
@NotNull
@Override
public IJavascriptHandler getJavascripHandler(@NotNull Activity activity, @Nullable WebView webView, @NotNull TellData tellData) {
return new WebJavascriptHandler(webView, new WVClickAbstractListener(activity));
}
}
/build
\ No newline at end of file
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.cxzapp.yidianling"
minSdk 21
targetSdk 28
versionCode 1
versionName "1.0"
flavorDimensions "versionCode"
ndk {
abiFilters "arm64-v8a"
}
manifestPlaceholders = [
JPUSH_PKGNAME : applicationId,
JPUSH_APPKEY : "e4b0d0bb7ef01053c93e25ba", //JPush上注册的包名对应的appkey.
JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
XIAOMI_APPKEY : "MI-5241743243980",//小米平台注册的appkey
XIAOMI_APPID : "MI-2882303761517432980",//小米平台注册的appid
HUAWEI_APPID : "10444675",//华为平台注册的appid
OPPO_APPKEY : "OP-afk71f35VogGw0w0wKsookksc", // OPPO平台注册的appkey
OPPO_APPID : "OP-3245516", // OPPO平台注册的appid
OPPO_APPSECRET: "OP-691184F044acA7a6851F578451f67616",//OPPO平台注册的appsecret
VIVO_APPKEY : '67d79734-c9c5-4916-a6f4-ba2ef4df09a4',
VIVO_APPID : '14298',
MEIZU_APPKEY : "MZ-00d268d7228748479036f202d45b4ef2",//魅族平台注册的appkey
MEIZU_APPID : "MZ-120344",//魅族平台注册的appid
qqappid : "1105070461",
APPLICATIONID : rootProject.ext.ydl_app["applicationId"]
]
}
packagingOptions {
exclude 'META-INF/rxjava.properties'
exclude 'META-INF/proguard/coroutines.pro'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
}
signingConfigs {
release {
storeFile file("../app/keystore.jks")
storePassword "123456"
keyAlias "ydl"
keyPassword "123456"
}
}
buildTypes {
debug{
signingConfig signingConfigs.release
}
release {
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
productFlavors {
ydl{}
xlzx{}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
repositories {
flatDir {
dirs 'aar'
}
}
dependencies {
implementation fileTree(dir: 'aar', include: ['*.aar'])
implementation(project(":ydl-flutter-base"))
implementation(project(":ydl-media"))
implementation(project(":ydl-net"))
implementation(project(":ydl-pay"))
implementation(project(":ydl-platform"))
implementation(project(":ydl-tuicore"))
implementation(project(":ydl-utils"))
implementation(project(":ydl-webview"))
implementation(project(":m-article"))
implementation(project(":m-audioim"))
implementation(project(":m-confide"))
implementation(project(":m-consultant"))
implementation(project(":m-course"))
implementation(project(":m-dynamic"))
implementation(project(":m-fm"))
implementation(project(":m-home"))
implementation(project(":m-im"))
implementation(project(":m-js"))
implementation(project(":m-muse"))
implementation(project(":m-tests"))
implementation(project(":m-user"))
implementation('com.ydl.debugkit:debugkit:1.0.0')
implementation('com.ydl.aar:heytap:3.0.0')
implementation "com.ydl.lib:smart_spa:0.0.4"
implementation 'com.volcengine:apm_insight:1.4.6.cn'
implementation 'com.volcengine:apm_insight_crash:1.4.5'
implementation 'com.meituan.android.walle:library:1.1.5'
implementation 'com.readystatesoftware.systembartint:systembartint:1.0.3'
// 权限库
implementation 'com.hjq:xxpermissions:10.2'
// 时间选择器
implementation 'com.contrarywind:Android-PickerView:4.1.9'
// sophix hotfix
implementation 'com.aliyun.ams:alicloud-android-hotfix:3.3.5'
implementation 'com.github.feeeei:CircleSeekbar:v1.1.2'
//====================极光推送====================
implementation 'cn.jiguang.sdk:jpush:4.6.4'
implementation 'cn.jiguang.sdk:jcore:3.2.4'
implementation 'cn.jiguang.sdk.plugin:oppo:4.6.4'
implementation 'cn.jiguang.sdk.plugin:vivo:4.6.4'
implementation 'cn.jiguang.sdk.plugin:meizu:4.6.4'
implementation 'cn.jiguang.sdk.plugin:huawei:4.6.4'
implementation 'cn.jiguang.sdk.plugin:meizu:4.6.4'
implementation 'cn.jiguang.sdk.plugin:xiaomi:4.6.4'
implementation 'com.huawei.hms:push:5.3.0.304'
//====================云信基础库====================
implementation 'com.ydl:nim-base:1.1.0.7'
implementation 'com.netease.nimlib:basesdk:9.1.1'
implementation 'com.netease.nimlib:avchat:9.1.1'
implementation 'com.netease.nimlib:nrtc:9.1.1'
//OPPO推送需要单独引入
implementation 'com.google.code.gson:gson:2.6.2'
implementation 'commons-codec:commons-codec:1.6'
implementation 'androidx.annotation:annotation:1.1.0'
//====================YDL 功能库====================
implementation "com.ydl.aar:resource:0.0.1-ydl"
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.cxzapp.yidianling">
</manifest>
\ No newline at end of file
...@@ -14,7 +14,7 @@ buildscript { ...@@ -14,7 +14,7 @@ buildscript {
ydlrouter_version = '1.2.3' ydlrouter_version = '1.2.3'
constrait_support_version = '1.0.2' constrait_support_version = '1.0.2'
componentVersion = "0.3.0.18" componentVersion = "0.3.0.31"
} }
repositories { repositories {
mavenCentral() mavenCentral()
......
...@@ -167,7 +167,7 @@ ext { ...@@ -167,7 +167,7 @@ ext {
"ydl-user-router" : "com.ydl:router:1.0.0-SNAPSHOT@aar", "ydl-user-router" : "com.ydl:router:1.0.0-SNAPSHOT@aar",
"ydl-device" : "com.ydl:device-id:0.0.31", "ydl-device" : "com.ydl:device-id:0.0.31",
//flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块 //flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块
"ydl-flutter" : "com.ydl:ydl-flutter:0.0.51@aar", //flutter aar "ydl-flutter" : "com.ydl:ydl-flutter:0.0.56@aar", //flutter aar
// "ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar // "ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar
] ]
......
...@@ -75,4 +75,5 @@ dependencies { ...@@ -75,4 +75,5 @@ dependencies {
api project(':ydl-webview') api project(':ydl-webview')
implementation project(":api:user") implementation project(":api:user")
implementation project(":api:im") implementation project(":api:im")
implementation project(":api:audioim")
} }
...@@ -32,6 +32,7 @@ import com.ydl.audioim.http.command.ConnectCommand ...@@ -32,6 +32,7 @@ import com.ydl.audioim.http.command.ConnectCommand
import com.ydl.audioim.http.command.ConnectExceptionCommand import com.ydl.audioim.http.command.ConnectExceptionCommand
import com.ydl.audioim.http.command.NoticePushCommand import com.ydl.audioim.http.command.NoticePushCommand
import com.ydl.audioim.http.command.PayLoad import com.ydl.audioim.http.command.PayLoad
import com.ydl.audioim.listener.IntentConstants
import com.ydl.audioim.player.AudioPlayer import com.ydl.audioim.player.AudioPlayer
import com.ydl.audioim.presenter.AudioHomePresenterImpl import com.ydl.audioim.presenter.AudioHomePresenterImpl
import com.ydl.audioim.router.AudioImIn import com.ydl.audioim.router.AudioImIn
...@@ -673,12 +674,12 @@ class AudioHomeActivity : ...@@ -673,12 +674,12 @@ class AudioHomeActivity :
tv_name.text = expertName tv_name.text = expertName
// tv_tips.text = expertTips // tv_tips.text = expertTips
var time = totalDuration?.minus(remainTime!!.toInt()) val time = totalDuration?.minus(remainTime!!.toInt())
tv_remain_time.text = DateUtils.formatTime((time).toString()) tv_remain_time.text = DateUtils.formatTime((time).toString())
val timeTotal= totalDuration?.div(60); val timeTotal= totalDuration?.div(60);
tv_totalDuration.text="(满${timeTotal}分钟自动挂断,限24小时内拨打)" tv_totalDuration.text="(满${timeTotal}分钟自动挂断,限24小时内拨打)"
if (!TextUtils.isEmpty(expertHeadUrl)) { if (!TextUtils.isEmpty(expertHeadUrl)) {
var option = SimpleImageOpConfiger() val option = SimpleImageOpConfiger()
option.errorPic = R.drawable.audioim_head_place_hold_pic option.errorPic = R.drawable.audioim_head_place_hold_pic
option.loadingPic = R.drawable.audioim_head_place_hold_pic option.loadingPic = R.drawable.audioim_head_place_hold_pic
option.transform = 0 option.transform = 0
...@@ -1425,7 +1426,7 @@ class AudioHomeActivity : ...@@ -1425,7 +1426,7 @@ class AudioHomeActivity :
null, null,
channelId channelId
) )
var cmd = NoticePushCommand() val cmd = NoticePushCommand()
cmd.data = msgBean cmd.data = msgBean
cmd.pushId = listenerUid cmd.pushId = listenerUid
if (isCall) { if (isCall) {
...@@ -1452,6 +1453,8 @@ class AudioHomeActivity : ...@@ -1452,6 +1453,8 @@ class AudioHomeActivity :
LogUtil.e("播放结束音频") LogUtil.e("播放结束音频")
//播放结束音频 //播放结束音频
playFinishMusic() playFinishMusic()
// 声网离开房间
voiceManage?.getVoiceApi()?.leaveChannel()
} }
} }
...@@ -1577,11 +1580,11 @@ class AudioHomeActivity : ...@@ -1577,11 +1580,11 @@ class AudioHomeActivity :
eventType: String = "99", eventType: String = "99",
callback: YDLavManager.UploadExceptionCallback? callback: YDLavManager.UploadExceptionCallback?
) { ) {
var time: String = (System.currentTimeMillis() / 1000).toString() val time: String = (System.currentTimeMillis() / 1000).toString()
var uid: String = val uid: String =
ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid!! ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid!!
var payLoad = PayLoad(channelId ?: "0", time, uid, "1", "999", message) val payLoad = PayLoad(channelId ?: "0", time, uid, "1", "999", message)
var connectException = val connectException =
ConnectExceptionCommand(time + zhu, "2", eventType, payLoad, callStatus) ConnectExceptionCommand(time + zhu, "2", eventType, payLoad, callStatus)
YDLavManager.instances.uploadException(connectException, callback) YDLavManager.instances.uploadException(connectException, callback)
} }
...@@ -1597,10 +1600,6 @@ class AudioHomeActivity : ...@@ -1597,10 +1600,6 @@ class AudioHomeActivity :
} }
} }
override fun finishActivity() {
leaveChannel()
}
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
findRouteService(IImService::class.java).unregisterObserveCustomNotification(notificationCallback) findRouteService(IImService::class.java).unregisterObserveCustomNotification(notificationCallback)
...@@ -1640,7 +1639,10 @@ class AudioHomeActivity : ...@@ -1640,7 +1639,10 @@ class AudioHomeActivity :
localPowerManager = null localPowerManager = null
if (null != voiceManage && null != voiceManage?.getVoiceApi()) { if (null != voiceManage && null != voiceManage?.getVoiceApi()) {
voiceManage?.getVoiceApi()?.leaveChannel() if (!isLeavelChannel) {
// 声网离开房间
voiceManage?.getVoiceApi()?.leaveChannel()
}
voiceManage?.getVoiceApi()?.destroy() voiceManage?.getVoiceApi()?.destroy()
voiceManage = null voiceManage = null
} }
......
...@@ -398,7 +398,7 @@ class YDLavManager { ...@@ -398,7 +398,7 @@ class YDLavManager {
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
fun login(userId: String?, event: (isSuccess: Boolean, msg: String?) -> Unit) { fun login(userId: String?, event: (isSuccess: Boolean, msg: String?) -> Unit) {
if (TextUtils.isEmpty(userId) || userId ?: "0" <= "0") { if (TextUtils.isEmpty(userId) || (userId ?: "0") <= "0") {
//如果uid为空或小于等于0 ,则不进行登录,因为uid为0也会登录成功,会导致后面uid正确时无法登录 //如果uid为空或小于等于0 ,则不进行登录,因为uid为0也会登录成功,会导致后面uid正确时无法登录
LogUtil.e("[agora]login-uid:$userId") LogUtil.e("[agora]login-uid:$userId")
AliYunRichLogsHelper.getInstance() AliYunRichLogsHelper.getInstance()
......
...@@ -4,7 +4,6 @@ import com.ydl.audioim.bean.ConnectBean ...@@ -4,7 +4,6 @@ import com.ydl.audioim.bean.ConnectBean
import com.ydl.audioim.http.command.* import com.ydl.audioim.http.command.*
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.ydl.ydlcommon.mvp.base.IModel import com.ydl.ydlcommon.mvp.base.IModel
import com.ydl.ydlcommon.mvp.base.IPresenter import com.ydl.ydlcommon.mvp.base.IPresenter
import com.ydl.ydlcommon.mvp.base.IView import com.ydl.ydlcommon.mvp.base.IView
...@@ -29,10 +28,6 @@ interface IAudioHomeActivityContract { ...@@ -29,10 +28,6 @@ interface IAudioHomeActivityContract {
*/ */
fun dismissProgressView() fun dismissProgressView()
/**
* 关闭窗口
*/
fun finishActivity()
/** /**
*切换axb回调 *切换axb回调
......
package com.ydl.audioim.modular
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.net.Uri
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.audioim.YDLavManager
import com.ydl.audioim.api.IAudioImService
import com.ydl.audioim.widget.AxbConfirmDialog
/**
* Created by Ykai on 2022/7/26.
*/
@Route(path = "/audioim/AudioImService")
class AudioImServiceImp : IAudioImService {
override fun yDLAvManagerInit(context: Context, appId: String) {
YDLavManager.instances.init(context, appId)
}
override fun getIsOnlineRtm(): Boolean {
return YDLavManager.isOnlineRtm
}
override fun loginRtm(userId: String?, event: (isSuccess: Boolean, msg: String?) -> Unit) {
YDLavManager.instances.login(userId, event)
}
override fun loginRtm(userId: String?) {
YDLavManager.instances.login(userId)
}
override fun openAxbDialog(activity: Activity?, type: Int, phoneNumber: String?) {
val dialog = AxbConfirmDialog(activity, type, object : AxbConfirmDialog.OnClickEnsureListener {
override fun onClickEnsure() {
phoneNumber?.let {
val phoneIntent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:$phoneNumber"))
activity?.startActivity(phoneIntent)
}
}
override fun onClose() {
}
})
dialog.show()
}
override fun callEventSave(status: String, res: String, session: String?, line: String) {
YDLavManager.instances.callEventSave(status, res, session, line)
}
override fun init(context: Context?) {
}
}
\ No newline at end of file
# 声网module
\ No newline at end of file
...@@ -71,10 +71,10 @@ dependencies { ...@@ -71,10 +71,10 @@ dependencies {
api rootProject.ext.dependencies["ydl-user-router"] api rootProject.ext.dependencies["ydl-user-router"]
api project(':ydl-media') api project(':ydl-media')
api project(':ydl-platform') api project(':ydl-platform')
api project(':m-audioim')
api project(":ydl-pay") api project(":ydl-pay")
api project(':ydl-webview') api project(':ydl-webview')
api project(':ydl-utils') api project(':ydl-utils')
implementation project(":api:audioim")
implementation project(":api:im") implementation project(":api:im")
implementation project(":api:user") implementation project(":api:user")
implementation project(":api:consultant") implementation project(":api:consultant")
......
...@@ -27,8 +27,8 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment ...@@ -27,8 +27,8 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.tencent.smtt.export.external.interfaces.JsResult import com.tencent.smtt.export.external.interfaces.JsResult
import com.tencent.smtt.sdk.* import com.tencent.smtt.sdk.*
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.home.event.ChangeAnotherExpertEvent import com.ydl.confide.event.ConfideDialogEvent
import com.ydl.confide.home.event.ConfideDialogEvent import com.ydl.confide.event.ChangeAnotherExpertEvent
import com.ydl.confide.home.http.ConfideHomeApi import com.ydl.confide.home.http.ConfideHomeApi
import com.ydl.confide.router.PhoneCallIn import com.ydl.confide.router.PhoneCallIn
import com.ydl.utils.WebUrlParamsUtils import com.ydl.utils.WebUrlParamsUtils
......
...@@ -24,7 +24,7 @@ import com.facebook.drawee.backends.pipeline.Fresco ...@@ -24,7 +24,7 @@ import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.drawee.interfaces.DraweeController import com.facebook.drawee.interfaces.DraweeController
import com.jcodecraeer.xrecyclerview.ProgressStyle import com.jcodecraeer.xrecyclerview.ProgressStyle
import com.jcodecraeer.xrecyclerview.XRecyclerView import com.jcodecraeer.xrecyclerview.XRecyclerView
import com.ydl.audioim.YDLavManager import com.ydl.audioim.api.IAudioImService
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.api.ConfideRoute import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.home.adapter.ConfideHomeAdapter import com.ydl.confide.home.adapter.ConfideHomeAdapter
...@@ -248,10 +248,8 @@ class ConfideHomeActivity : ...@@ -248,10 +248,8 @@ class ConfideHomeActivity :
} }
if (!confidedId.isNullOrBlank() && !doctorId.isNullOrBlank()) { if (!confidedId.isNullOrBlank() && !doctorId.isNullOrBlank()) {
if (!YDLavManager.isOnlineRtm) { if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
YDLavManager.instances.login( findRouteService(IAudioImService::class.java).loginRtm(PhoneCallIn.getUserService().getUserInfo()?.uid) { _: Boolean, _ ->
PhoneCallIn.getUserService().getUserInfo()?.uid
) { _: Boolean, _ ->
showPayOrDetail(confidedId, doctorId) showPayOrDetail(confidedId, doctorId)
} }
} else { } else {
......
...@@ -148,7 +148,7 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo ...@@ -148,7 +148,7 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
override fun videoShowClick(index: Int, data: List<ConfideHomeBodyBean>?) { override fun videoShowClick(index: Int, data: List<ConfideHomeBodyBean>?) {
val dataJson = if (data != null) JSON.toJSONString(data) else null val dataJson = if (data != null) JSON.toJSONString(data) else null
AudioPlayer.get().playPause() AudioPlayer.get().playOrPause()
PlayerFloatHelper.updatePlayState() PlayerFloatHelper.updatePlayState()
route(mContext, ConfideRoute.R_VIDEO_SHOW, "initPos" to index, "initData" to dataJson) route(mContext, ConfideRoute.R_VIDEO_SHOW, "initPos" to index, "initData" to dataJson)
} }
...@@ -184,9 +184,9 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo ...@@ -184,9 +184,9 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
mu.path = playUrl mu.path = playUrl
mu.coverPath=confideIcon mu.coverPath=confideIcon
AudioPlayer.get().singlePlay(mu) AudioPlayer.get().singlePlay(mu)
if (PlayerFloatHelper.isShow(mContext!!)) { if (PlayerFloatHelper.isShow()) {
if (AudioPlayer.get().playMode.value() == 1) { if (AudioPlayer.get().playMode.value() == 1) {
PlayerFloatHelper.removeView(mContext!!) PlayerFloatHelper.removeView()
PlayerFloatHelper.show(mContext!!) PlayerFloatHelper.show(mContext!!)
} else { } else {
...@@ -255,7 +255,7 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo ...@@ -255,7 +255,7 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
if (TextUtils.isEmpty(cachePlayUrl)) { if (TextUtils.isEmpty(cachePlayUrl)) {
return return
} }
AudioPlayer.get().playPause() AudioPlayer.get().playOrPause()
confideHomeView.updataPlayStatu(cacheType, cacheIndex!!, cacheSubIndex, true) confideHomeView.updataPlayStatu(cacheType, cacheIndex!!, cacheSubIndex, true)
} }
...@@ -263,16 +263,14 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo ...@@ -263,16 +263,14 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
* 暂停播放音频文件 * 暂停播放音频文件
*/ */
override fun pauseVoice() { override fun pauseVoice() {
AudioPlayer.get().playPause() AudioPlayer.get().playOrPause()
PlayerFloatHelper.updatePlayState() PlayerFloatHelper.updatePlayState()
//因为9999 类型不存在 所以就能把状态全部置为暂停状态了 偷个懒 //因为9999 类型不存在 所以就能把状态全部置为暂停状态了 偷个懒
confideHomeView.updataPlayStatu(9999, 0, 0, false) confideHomeView.updataPlayStatu(9999, 0, 0, false)
} }
override fun destoryPlayer() { override fun destoryPlayer() {
PlayerFloatHelper.hide() PlayerFloatHelper.removeResetView()
PlayerFloatHelper.playTempData = hashMapOf<String,String>()
AudioPlayer.get().stopPlayer()
floatViewClickListener?.let { PlayerFloatHelper.removeClickListener(it) }; floatViewClickListener?.let { PlayerFloatHelper.removeClickListener(it) };
} }
......
...@@ -4,14 +4,12 @@ import android.app.Activity ...@@ -4,14 +4,12 @@ import android.app.Activity
import android.app.Application import android.app.Application
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.net.Uri
import android.text.TextUtils import android.text.TextUtils
import androidx.fragment.app.DialogFragment import androidx.fragment.app.DialogFragment
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson import com.google.gson.Gson
import com.ydl.audioim.YDLavManager import com.ydl.audioim.api.IAudioImService
import com.ydl.audioim.widget.AxbConfirmDialog
import com.ydl.confide.api.IConfideService import com.ydl.confide.api.IConfideService
import com.ydl.confide.home.ConfideBottomSheetDialogFragment import com.ydl.confide.home.ConfideBottomSheetDialogFragment
import com.ydl.confide.home.ConfideHomeActivity import com.ydl.confide.home.ConfideHomeActivity
...@@ -20,6 +18,7 @@ import com.ydl.confide.home.bean.ConfideConnectResponse ...@@ -20,6 +18,7 @@ import com.ydl.confide.home.bean.ConfideConnectResponse
import com.ydl.webview.TellData import com.ydl.webview.TellData
import com.ydl.ydlcommon.base.BaseApp import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.YDLConstants import com.ydl.ydlcommon.base.config.YDLConstants
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.YDLCacheUtils import com.ydl.ydlcommon.utils.YDLCacheUtils
/** /**
...@@ -73,7 +72,7 @@ class ConfdieServiceImpl : IConfideService { ...@@ -73,7 +72,7 @@ class ConfdieServiceImpl : IConfideService {
override fun ydlAvManagerLogin(uid: String?) { override fun ydlAvManagerLogin(uid: String?) {
YDLavManager.instances.login(uid) findRouteService(IAudioImService::class.java).loginRtm(uid)
} }
override fun startCondifeHomePage(context: Context, isSplash: Boolean) { override fun startCondifeHomePage(context: Context, isSplash: Boolean) {
...@@ -91,17 +90,17 @@ class ConfdieServiceImpl : IConfideService { ...@@ -91,17 +90,17 @@ class ConfdieServiceImpl : IConfideService {
//debug包根据url判断使用正式或者测试key //debug包根据url判断使用正式或者测试key
val cacheAppEnv = YDLCacheUtils.getCacheApi() val cacheAppEnv = YDLCacheUtils.getCacheApi()
if (!TextUtils.isEmpty(cacheAppEnv)) { avManagerKey = if (!TextUtils.isEmpty(cacheAppEnv)) {
if (YDLConstants.ENV_TEST == cacheAppEnv) { if (YDLConstants.ENV_TEST == cacheAppEnv) {
avManagerKey = "13b1536698f64905a1e7e5bb978ba821" "13b1536698f64905a1e7e5bb978ba821"
} else { } else {
avManagerKey = "3387e9b251f3491e9221a9877e8f7830" "3387e9b251f3491e9221a9877e8f7830"
} }
} else { } else {
if (YDLConstants.ENV_TEST == appEnv || YDLConstants.ENV_AUTO_TEST == appEnv) { if (YDLConstants.ENV_TEST == appEnv || YDLConstants.ENV_AUTO_TEST == appEnv) {
avManagerKey = "13b1536698f64905a1e7e5bb978ba821" "13b1536698f64905a1e7e5bb978ba821"
} else { } else {
avManagerKey = "3387e9b251f3491e9221a9877e8f7830" "3387e9b251f3491e9221a9877e8f7830"
} }
} }
} else { } else {
...@@ -109,27 +108,11 @@ class ConfdieServiceImpl : IConfideService { ...@@ -109,27 +108,11 @@ class ConfdieServiceImpl : IConfideService {
avManagerKey = "3387e9b251f3491e9221a9877e8f7830" avManagerKey = "3387e9b251f3491e9221a9877e8f7830"
} }
YDLavManager.instances.init(app, avManagerKey) findRouteService(IAudioImService::class.java).yDLAvManagerInit(app, avManagerKey)
}
override fun isOnlineRtm(): Boolean {
return YDLavManager.isOnlineRtm
} }
override fun showAxbConfirmDialog(activity: Activity?, type: Int, phoneNumber: String?) { override fun showAxbConfirmDialog(activity: Activity?, type: Int, phoneNumber: String?) {
val dialog = AxbConfirmDialog(activity, type, object : AxbConfirmDialog.OnClickEnsureListener { findRouteService(IAudioImService::class.java).openAxbDialog(activity, type, phoneNumber)
override fun onClickEnsure() {
phoneNumber?.let {
val phoneIntent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + phoneNumber!!))
activity?.startActivity(phoneIntent)
}
}
override fun onClose() {
}
})
dialog.show()
} }
override fun closePlayer() { override fun closePlayer() {
......
...@@ -3,15 +3,12 @@ package com.ydl.confide.home.modular.service ...@@ -3,15 +3,12 @@ package com.ydl.confide.home.modular.service
import android.annotation.SuppressLint import android.annotation.SuppressLint
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.text.TextUtils import android.text.TextUtils
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import com.alibaba.android.arouter.launcher.ARouter import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.audioim.IntentConstants import com.ydl.audioim.api.IAudioImService
import com.ydl.audioim.YDLavManager
import com.ydl.audioim.bean.ExpertInfoBean import com.ydl.audioim.bean.ExpertInfoBean
import com.ydl.audioim.widget.AxbConfirmDialog import com.ydl.audioim.listener.IntentConstants
import com.ydl.confide.home.ConfidePermissionDialog import com.ydl.confide.home.ConfidePermissionDialog
import com.ydl.confide.home.bean.ConfideConnectResponse import com.ydl.confide.home.bean.ConfideConnectResponse
import com.ydl.confide.home.bean.ConnectParamJava import com.ydl.confide.home.bean.ConnectParamJava
...@@ -109,7 +106,7 @@ class ConfideWebServiceImpl { ...@@ -109,7 +106,7 @@ class ConfideWebServiceImpl {
data: ConfideConnectResponse? data: ConfideConnectResponse?
) { ) {
val expertInfo = data?.dialDetail?.agoraExpertInfo ?: return val expertInfo = data?.dialDetail?.agoraExpertInfo ?: return
if (!YDLavManager.isOnlineRtm) { // 判断如果账号在其它设备登录rtm是否在线 if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) { // 判断如果账号在其它设备登录rtm是否在线
ToastUtil.toastShort("网络通话错误代码001") ToastUtil.toastShort("网络通话错误代码001")
return return
} }
...@@ -128,21 +125,9 @@ class ConfideWebServiceImpl { ...@@ -128,21 +125,9 @@ class ConfideWebServiceImpl {
* axb 通话 * axb 通话
* */ * */
fun axb(activity: Activity, phone: String?) { fun axb(activity: Activity, phone: String?) {
if (phone.isNullOrEmpty()) return if (phone.isNullOrEmpty())
val dialog = AxbConfirmDialog( return
activity, findRouteService(IAudioImService::class.java).openAxbDialog(activity,1,phone)
1,
object : AxbConfirmDialog.OnClickEnsureListener {
override fun onClickEnsure() {
val phoneIntent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:${phone}"))
activity.startActivity(phoneIntent)
}
override fun onClose() {
}
})
dialog.show()
} }
//java版axb和声网接口 //java版axb和声网接口
...@@ -154,8 +139,8 @@ class ConfideWebServiceImpl { ...@@ -154,8 +139,8 @@ class ConfideWebServiceImpl {
tellData: TellData?, tellData: TellData?,
callType: String? callType: String?
) { ) {
if (!YDLavManager.isOnlineRtm) { if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
YDLavManager.instances.login(PhoneCallIn.getUserService().getUserInfo()?.uid) { isSuccess: Boolean, _ -> findRouteService(IAudioImService::class.java).loginRtm(PhoneCallIn.getUserService().getUserInfo()?.uid) { isSuccess: Boolean, _ ->
if (isSuccess) { if (isSuccess) {
toDial(id, type, callType, activity, tellData) toDial(id, type, callType, activity, tellData)
} else { } else {
...@@ -340,7 +325,7 @@ class ConfideWebServiceImpl { ...@@ -340,7 +325,7 @@ class ConfideWebServiceImpl {
expertInfo.remainingTime = expertInfo.remainingTime =
ExpertInfoBean.ListenRemainingTime(expertInfo.totalDuration); ExpertInfoBean.ListenRemainingTime(expertInfo.totalDuration);
} }
YDLavManager.instances.callEventSave("10", "用户点击拨打", expertInfo.channelId, "7") findRouteService(IAudioImService::class.java).callEventSave("10", "用户点击拨打", expertInfo.channelId, "7")
Loading.close() Loading.close()
ARouter.getInstance().build("/av/AudioHomeActivity") ARouter.getInstance().build("/av/AudioHomeActivity")
.withString(IntentConstants.INTENT_EXPERT_HEAD_URL, expertInfo.expertHeadUrl) .withString(IntentConstants.INTENT_EXPERT_HEAD_URL, expertInfo.expertHeadUrl)
......
...@@ -398,8 +398,10 @@ class ConfideHomeUtils { ...@@ -398,8 +398,10 @@ class ConfideHomeUtils {
} }
} }
} else { } else {
for (bodyItem in item.body!!) { if (item.body != null) {
bodyItem.confideIsPlay = false for (bodyItem in item.body) {
bodyItem.confideIsPlay = false
}
} }
} }
} }
......
...@@ -16,7 +16,7 @@ import com.alibaba.android.arouter.launcher.ARouter ...@@ -16,7 +16,7 @@ import com.alibaba.android.arouter.launcher.ARouter
import com.dou361.ijkplayer.widget.IjkVideoView import com.dou361.ijkplayer.widget.IjkVideoView
import com.facebook.drawee.backends.pipeline.Fresco import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.drawee.interfaces.DraweeController import com.facebook.drawee.interfaces.DraweeController
import com.ydl.audioim.YDLavManager import com.ydl.audioim.api.IAudioImService
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.api.ConfideRoute import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.databinding.ItemExpertIntroBinding import com.ydl.confide.databinding.ItemExpertIntroBinding
...@@ -36,7 +36,6 @@ import io.reactivex.Observable ...@@ -36,7 +36,6 @@ import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.confide_home_activity.*
import tv.danmaku.ijk.media.player.IjkMediaPlayer import tv.danmaku.ijk.media.player.IjkMediaPlayer
import java.io.UnsupportedEncodingException import java.io.UnsupportedEncodingException
import java.net.URLDecoder import java.net.URLDecoder
...@@ -123,8 +122,8 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) : ...@@ -123,8 +122,8 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
} }
else -> { else -> {
if (!item.confideId.isNullOrBlank()) { if (!item.confideId.isNullOrBlank()) {
if (!YDLavManager.isOnlineRtm) { if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
YDLavManager.instances.login( findRouteService(IAudioImService::class.java).loginRtm(
PhoneCallIn.getUserService().getUserInfo()?.uid PhoneCallIn.getUserService().getUserInfo()?.uid
) { _: Boolean, _ -> ) { _: Boolean, _ ->
showPayOrDetail(item, it) showPayOrDetail(item, it)
......
...@@ -8,6 +8,7 @@ import com.ydl.ydlcommon.data.http.RxUtils ...@@ -8,6 +8,7 @@ import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.base.SimplePresenter import com.ydl.ydlcommon.mvp.base.SimplePresenter
import com.ydl.ydlcommon.utils.AnimUtils
import com.ydl.ydlcommon.utils.RxLifecycleUtils import com.ydl.ydlcommon.utils.RxLifecycleUtils
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.yidianling.common.tools.RxAppTool import com.yidianling.common.tools.RxAppTool
...@@ -63,7 +64,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -63,7 +64,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
} }
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
fun fetchListData(allFilter: AllFilter, extras: Extras?) { fun fetchListData(allFilter: AllFilter, extras: Extras?, mapFilter: Map<String, Any>?) {
//是否亲子教育字段 //是否亲子教育字段
// ConsultAssistantDialogUtils.REALATION_EDUCATION = allFilter.categories.size == 1 && allFilter.categories[0].cateId == "23" // ConsultAssistantDialogUtils.REALATION_EDUCATION = allFilter.categories.size == 1 && allFilter.categories[0].cateId == "23"
...@@ -75,8 +76,13 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -75,8 +76,13 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
filterMap["__keywords"] = allFilter.searchWord filterMap["__keywords"] = allFilter.searchWord
} }
val categoryList = ArrayList<Any>() val categoryList = ArrayList<Any>()
//首页金刚位传过来的搜索MAP结果集
if (mapFilter != null) {
filterMap.putAll(mapFilter)
}
map["filter"] = filterMap
// 八大类一级标签 // 八大类一级标签
if (allFilter.categoryId2List.size>0){ if (allFilter.categoryId2List.size > 0) {
val categoryMap2 = HashMap<String, Any>() val categoryMap2 = HashMap<String, Any>()
val categoryIdMap2 = HashMap<String, Any>() val categoryIdMap2 = HashMap<String, Any>()
categoryIdMap2["in"] = allFilter.categoryId2List.toSortedSet().toList() categoryIdMap2["in"] = allFilter.categoryId2List.toSortedSet().toList()
...@@ -84,7 +90,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -84,7 +90,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
categoryList.add(categoryMap2) categoryList.add(categoryMap2)
} }
// 八大类二级标签 // 八大类二级标签
if (allFilter.categoryId3List.size>0){ if (allFilter.categoryId3List.size > 0) {
val categoryMap3 = HashMap<String, Any>() val categoryMap3 = HashMap<String, Any>()
val categoryIdMap3 = HashMap<String, Any>() val categoryIdMap3 = HashMap<String, Any>()
categoryIdMap3["in"] = allFilter.categoryId3List.toSortedSet().toList() categoryIdMap3["in"] = allFilter.categoryId3List.toSortedSet().toList()
...@@ -197,13 +203,13 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -197,13 +203,13 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
} }
} }
} }
if (gender.size>0){ if (gender.size > 0) {
val genderMap = HashMap<String, Any>() val genderMap = HashMap<String, Any>()
genderMap["in"] = gender genderMap["in"] = gender
filterMap["gender"] = genderMap filterMap["gender"] = genderMap
} }
} }
map["filter"] = filterMap
// sorts // sorts
if (allFilter.reorder.key != null) { if (allFilter.reorder.key != null) {
......
...@@ -33,6 +33,7 @@ import com.yidianling.consultant.api.IConsultantService ...@@ -33,6 +33,7 @@ import com.yidianling.consultant.api.IConsultantService
import com.yidianling.consultant.bean.* import com.yidianling.consultant.bean.*
import com.yidianling.consultant.constants.ConsultBIConstants import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.constants.ConsultBIConstants.ConsultEvent.Companion.SEARCH_BANNERWORD_CLICK import com.yidianling.consultant.constants.ConsultBIConstants.ConsultEvent.Companion.SEARCH_BANNERWORD_CLICK
import com.yidianling.consultant.constants.ConsultBIConstants.ConsultEvent.Companion.YDL_USER_CONSULT_SEARCH_CONFIRM_CLICK
import com.yidianling.consultant.contract.IHotSearchContract import com.yidianling.consultant.contract.IHotSearchContract
import com.yidianling.consultant.model.bean.FunctionWordBean import com.yidianling.consultant.model.bean.FunctionWordBean
import com.yidianling.consultant.modular.utils.ConsultAssistantEntryUtils import com.yidianling.consultant.modular.utils.ConsultAssistantEntryUtils
...@@ -110,6 +111,12 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -110,6 +111,12 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
} }
etSearch.setOnEditorActionListener { _, actionId, _ -> etSearch.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH) { if (actionId == EditorInfo.IME_ACTION_SEARCH) {
//埋点
ActionCountUtils.count(
YDL_USER_CONSULT_SEARCH_CONFIRM_CLICK,
etSearch.text.toString(),
etSearch.hint.toString()
)
// 搜索的关联词 // 搜索的关联词
var relatedWords = "" var relatedWords = ""
var isRecommendWords = false var isRecommendWords = false
......
...@@ -30,7 +30,6 @@ import com.yidianling.consultant.listener.OnExpertClickListener ...@@ -30,7 +30,6 @@ import com.yidianling.consultant.listener.OnExpertClickListener
import com.yidianling.consultant.model.bean.ExpertServiceItem import com.yidianling.consultant.model.bean.ExpertServiceItem
import com.yidianling.consultant.modular.utils.TempH5RouteUtils import com.yidianling.consultant.modular.utils.TempH5RouteUtils
import com.yidianling.consultant.router.ConsultantIn import com.yidianling.consultant.router.ConsultantIn
import kotlinx.android.synthetic.main.consultant_activity_hot_search.*
import kotlinx.android.synthetic.main.consultant_expert_search_feedbackrate.view.* import kotlinx.android.synthetic.main.consultant_expert_search_feedbackrate.view.*
import kotlinx.android.synthetic.main.consultant_expert_search_header_view.view.* import kotlinx.android.synthetic.main.consultant_expert_search_header_view.view.*
import kotlinx.android.synthetic.main.consultant_expert_search_item_view.view.* import kotlinx.android.synthetic.main.consultant_expert_search_item_view.view.*
...@@ -38,7 +37,6 @@ import kotlinx.android.synthetic.main.consultant_expert_search_products_item.vie ...@@ -38,7 +37,6 @@ import kotlinx.android.synthetic.main.consultant_expert_search_products_item.vie
import kotlinx.android.synthetic.main.consultant_item_empty.view.* import kotlinx.android.synthetic.main.consultant_item_empty.view.*
import kotlinx.android.synthetic.main.consultant_item_footer.view.* import kotlinx.android.synthetic.main.consultant_item_footer.view.*
import kotlinx.android.synthetic.main.consultant_item_tag.view.* import kotlinx.android.synthetic.main.consultant_item_tag.view.*
import kotlinx.android.synthetic.main.consultant_layout_search_content.*
import java.math.BigDecimal import java.math.BigDecimal
/** /**
......
...@@ -16,7 +16,8 @@ import kotlinx.android.synthetic.main.consultant_item_region.view.* ...@@ -16,7 +16,8 @@ import kotlinx.android.synthetic.main.consultant_item_region.view.*
* 省份列表适配器 * 省份列表适配器
* Created by zqk on 17-7-21. * Created by zqk on 17-7-21.
*/ */
class RegionRecyclerViewAdapter(val context: Context, val regionList: ArrayList<RegionItem>, var selectedRegion: RegionItem class RegionRecyclerViewAdapter(
val context: Context, var regionList: ArrayList<RegionItem>, var selectedRegion: RegionItem
) : RecyclerView.Adapter<RegionRecyclerViewAdapter.ViewHolder>() { ) : RecyclerView.Adapter<RegionRecyclerViewAdapter.ViewHolder>() {
var onItemClickListener: MyBaseAdapter.OnItemClickListener<RegionItem>? = null var onItemClickListener: MyBaseAdapter.OnItemClickListener<RegionItem>? = null
...@@ -29,11 +30,14 @@ class RegionRecyclerViewAdapter(val context: Context, val regionList: ArrayList< ...@@ -29,11 +30,14 @@ class RegionRecyclerViewAdapter(val context: Context, val regionList: ArrayList<
holder.itemView.tvRegionName.setTypeface(Typeface.DEFAULT_BOLD) holder.itemView.tvRegionName.setTypeface(Typeface.DEFAULT_BOLD)
holder.itemView.tvRegionName.setTextColor(context.resources.getColor(R.color.platform_main_theme)) holder.itemView.tvRegionName.setTextColor(context.resources.getColor(R.color.platform_main_theme))
holder.itemView.view_select.visibility = View.VISIBLE holder.itemView.view_select.visibility = View.VISIBLE
holder.itemView.setBackgroundColor(context.resources.getColor(R.color.white))
} else { } else {
//未选中状态 //未选中状态
holder.itemView.tvRegionName.setTypeface(Typeface.DEFAULT) holder.itemView.tvRegionName.setTypeface(Typeface.DEFAULT)
holder.itemView.tvRegionName.setTextColor(context.resources.getColor(R.color.platform_default_text_color)) holder.itemView.tvRegionName.setTextColor(context.resources.getColor(R.color.platform_default_text_color))
holder.itemView.view_select.visibility = View.INVISIBLE holder.itemView.view_select.visibility = View.INVISIBLE
holder.itemView.setBackgroundColor(context.resources.getColor(R.color.platform_color_F7F7F7))
} }
} }
......
...@@ -10,7 +10,8 @@ import com.yidianling.consultant.model.bean.ChildrenBean ...@@ -10,7 +10,8 @@ import com.yidianling.consultant.model.bean.ChildrenBean
/** /**
* Created by Ykai on 2022/5/18. * Created by Ykai on 2022/5/18.
*/ */
class SortAdapter(data: List<ChildrenBean>) : BaseMultiItemQuickAdapter<ChildrenBean, BaseViewHolder>(data) { class SortAdapter(data: List<ChildrenBean>) :
BaseMultiItemQuickAdapter<ChildrenBean, BaseViewHolder>(data) {
var isVisible = false var isVisible = false
init { init {
...@@ -19,25 +20,37 @@ class SortAdapter(data: List<ChildrenBean>) : BaseMultiItemQuickAdapter<Children ...@@ -19,25 +20,37 @@ class SortAdapter(data: List<ChildrenBean>) : BaseMultiItemQuickAdapter<Children
} }
override fun convert(holder: BaseViewHolder, item: ChildrenBean) { override fun convert(holder: BaseViewHolder, item: ChildrenBean) {
when(holder.itemViewType){ when (holder.itemViewType) {
1 ->{ 1 -> {
holder.setGone(R.id.ll_sort_item,item.isVisible) holder.setGone(R.id.ll_sort_item, item.isVisible)
holder.setText(R.id.tv_sort_name, item.cate_name) holder.setText(R.id.tv_sort_name, item.cate_name)
holder.getView<TextView>(R.id.tv_sort_name).isSelected = item.isSelected holder.getView<TextView>(R.id.tv_sort_name).isSelected = item.isSelected
if (item.isSelected){ if (item.isSelected) {
holder.setTextColor(R.id.tv_sort_name,ContextCompat.getColor(mContext,R.color.platform_main_theme)) holder.setTextColor(
}else{ R.id.tv_sort_name,
holder.setTextColor(R.id.tv_sort_name,ContextCompat.getColor(mContext,R.color.platform_color_242424)) ContextCompat.getColor(mContext, R.color.platform_main_theme)
)
} else {
holder.setTextColor(
R.id.tv_sort_name,
ContextCompat.getColor(mContext, R.color.platform_color_242424)
)
} }
} }
2->{ 2 -> {
holder.setGone(R.id.ll_sort_item,item.isVisible) holder.setGone(R.id.ll_sort_item, item.isVisible)
holder.setText(R.id.tv_sort_name, item.cate_name) holder.setText(R.id.tv_sort_name, item.cate_name)
holder.getView<TextView>(R.id.tv_sort_name).isSelected = item.isSelected holder.getView<TextView>(R.id.tv_sort_name).isSelected = item.isSelected
if (item.isSelected){ if (item.isSelected) {
holder.setTextColor(R.id.tv_sort_name,ContextCompat.getColor(mContext,R.color.platform_main_theme)) holder.setTextColor(
}else{ R.id.tv_sort_name,
holder.setTextColor(R.id.tv_sort_name,ContextCompat.getColor(mContext,R.color.platform_color_242424)) ContextCompat.getColor(mContext, R.color.platform_main_theme)
)
} else {
holder.setTextColor(
R.id.tv_sort_name,
ContextCompat.getColor(mContext, R.color.platform_color_242424)
)
} }
} }
} }
...@@ -47,7 +60,7 @@ class SortAdapter(data: List<ChildrenBean>) : BaseMultiItemQuickAdapter<Children ...@@ -47,7 +60,7 @@ class SortAdapter(data: List<ChildrenBean>) : BaseMultiItemQuickAdapter<Children
/** /**
* 设置大于第12个之后的标签全部显示 * 设置大于第12个之后的标签全部显示
*/ */
fun setAllVisible(){ fun setAllVisible() {
mData.forEach { bean -> mData.forEach { bean ->
bean.isVisible = true bean.isVisible = true
} }
...@@ -58,9 +71,9 @@ class SortAdapter(data: List<ChildrenBean>) : BaseMultiItemQuickAdapter<Children ...@@ -58,9 +71,9 @@ class SortAdapter(data: List<ChildrenBean>) : BaseMultiItemQuickAdapter<Children
/** /**
* 设置大于第12个之后的标签全部隐藏 * 设置大于第12个之后的标签全部隐藏
*/ */
fun setGone(){ fun setGone() {
mData.forEachIndexed { index, bean -> mData.forEachIndexed { index, bean ->
if (index>12){ if (index > 12) {
bean.isVisible = false bean.isVisible = false
} }
} }
......
...@@ -16,31 +16,81 @@ import kotlinx.android.synthetic.main.consultant_item_consult_type.view.* ...@@ -16,31 +16,81 @@ import kotlinx.android.synthetic.main.consultant_item_consult_type.view.*
* 城市列表适配器 * 城市列表适配器
* Created by zqk on 17-7-21. * Created by zqk on 17-7-21.
*/ */
class SubRecyclerViewAdapter(val context: Context, val subList: ArrayList<SubItem>, var selectedSub: SubItem) : RecyclerView.Adapter<SubRecyclerViewAdapter.ViewHolder>() { class SubRecyclerViewAdapter(
val context: Context, val subList: ArrayList<SubItem>,
var selectedSub: SubItem, val locationCode: String
) : RecyclerView.Adapter<SubRecyclerViewAdapter.ViewHolder>() {
var onItemClickListener: MyBaseAdapter.OnItemClickListener<SubItem>? = null var onItemClickListener: MyBaseAdapter.OnItemClickListener<SubItem>? = null
private lateinit var mOnAuthClickLister: OnAuthClickLister
override fun onBindViewHolder(holder: ViewHolder, position: Int) { override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val subItem = subList[position] val subItem = subList[position]
holder.itemView.tvConsultTypeName.text = subItem.value holder.itemView.tvConsultTypeName.text = subItem.value
if (selectedSub.code == subItem.code) { if (subItem.locationCode == locationCode) {
//选中状态 holder.itemView.reLocation.visibility = View.GONE
holder.itemView.tvConsultTypeName.setTypeface(Typeface.DEFAULT_BOLD) holder.itemView.location_img.visibility = View.VISIBLE
holder.itemView.tvConsultTypeName.setTextColor(ContextCompat.getColor(context,R.color.platform_main_theme)) holder.itemView.location_img.drawable.setTint(context.resources.getColor(R.color.platform_color_black_333333))
} else {
holder.itemView.isEnabled = true
} else if (subItem.locationCode == "NotAuth") {
//未选中状态 //未选中状态
holder.itemView.reLocation.visibility = View.VISIBLE
holder.itemView.reLocation.setOnClickListener {
mOnAuthClickLister.onAuthClick()
}
holder.itemView.location_img.visibility = View.VISIBLE
holder.itemView.tvConsultTypeName.setTypeface(Typeface.DEFAULT) holder.itemView.tvConsultTypeName.setTypeface(Typeface.DEFAULT)
holder.itemView.tvConsultTypeName.setTextColor(ContextCompat.getColor(context,R.color.platform_default_text_color)) holder.itemView.tvConsultTypeName.setTextColor(
ContextCompat.getColor(
context,
R.color.platform_default_text_color
)
)
holder.itemView.location_img.drawable.setTint(context.resources.getColor(R.color.platform_color_black_333333))
holder.itemView.isEnabled = false
} else {
holder.itemView.reLocation.visibility = View.GONE
holder.itemView.isEnabled = true
holder.itemView.location_img.visibility = View.GONE
if (selectedSub.code == subItem.code) {
//选中状态
holder.itemView.tvConsultTypeName.setTypeface(Typeface.DEFAULT_BOLD)
holder.itemView.tvConsultTypeName.setTextColor(
ContextCompat.getColor(
context,
R.color.platform_main_theme
)
)
} else {
//未选中状态
holder.itemView.tvConsultTypeName.setTypeface(Typeface.DEFAULT)
holder.itemView.tvConsultTypeName.setTextColor(
ContextCompat.getColor(
context,
R.color.platform_default_text_color
)
)
}
} }
} }
override fun getItemCount(): Int = subList.size override fun getItemCount(): Int = subList.size
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(context).inflate(R.layout.consultant_item_consult_type, parent, false) val view = LayoutInflater.from(context)
.inflate(R.layout.consultant_item_consult_type, parent, false)
return ViewHolder(view) return ViewHolder(view)
} }
interface OnAuthClickLister {
fun onAuthClick()
}
fun setOnAuthClickLister(lister: OnAuthClickLister) {
mOnAuthClickLister = lister
}
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
init { init {
itemView.setOnClickListener { itemView.setOnClickListener {
......
package com.yidianling.consultant.bean
import android.os.Parcelable
import com.yidianling.consultant.model.bean.SubItem
import kotlinx.android.parcel.Parcelize
@Parcelize
data class ConsultantRecentCity(
var recentCity: MutableList<SubItem> = arrayListOf()
) : Parcelable
\ No newline at end of file
package com.yidianling.consultant.bean
data class ConsultantRegionBean(
val country_code: String?,
val country_name: String?,
val province_code: String?,
val province_name: String?,
val city_code: String?,
val city_name: String?
)
\ No newline at end of file
...@@ -27,6 +27,7 @@ class ConsultBIConstants { ...@@ -27,6 +27,7 @@ class ConsultBIConstants {
const val POSITION_YDL_USER_ASSOCIATE_WORD_CLICK="ydl_user_associate_word_click" // 联想词点击position const val POSITION_YDL_USER_ASSOCIATE_WORD_CLICK="ydl_user_associate_word_click" // 联想词点击position
// 咨询师列表页 banner 点击事件 // 咨询师列表页 banner 点击事件
const val POSITION_CONSULT_COUNSELOR_LIST_BANNER_CLICK = "consult_counselor_list_banner_click" const val POSITION_CONSULT_COUNSELOR_LIST_BANNER_CLICK = "consult_counselor_list_banner_click"
} }
//====================APP咨询列表页(app_consult_list_page)==================== //====================APP咨询列表页(app_consult_list_page)====================
...@@ -57,7 +58,8 @@ class ConsultBIConstants { ...@@ -57,7 +58,8 @@ class ConsultBIConstants {
APP_CONSULT_LIST_PAGE + "ydl_user_consult_search_click"//咨询师页搜索框点击事件 APP_CONSULT_LIST_PAGE + "ydl_user_consult_search_click"//咨询师页搜索框点击事件
const val YDL_USER_CONSULT_TYPE_CLICK: String = const val YDL_USER_CONSULT_TYPE_CLICK: String =
APP_CONSULT_LIST_PAGE + "ydl_user_consult_type_click"//咨询师顶部ICON 厌学专题、限时特惠、精神心理 APP_CONSULT_LIST_PAGE + "ydl_user_consult_type_click"//咨询师顶部ICON 厌学专题、限时特惠、精神心理
const val YDL_USER_CONSULT_SEARCH_CONFIRM_CLICK: String =
APP_CONSULT_LIST_PAGE + "YDL_USER_CONSULT_SEARCH_CONFIRM_CLICK"//搜索词、底纹词点击埋点
const val POSITION_CONSULT_COUNSELOR_CARD_CLICK = const val POSITION_CONSULT_COUNSELOR_CARD_CLICK =
"consult_counselor_card_click" // 咨询师列表点击position "consult_counselor_card_click" // 咨询师列表点击position
const val POSITION_CHOICE_FILTER_CLICK = const val POSITION_CHOICE_FILTER_CLICK =
...@@ -68,6 +70,15 @@ class ConsultBIConstants { ...@@ -68,6 +70,15 @@ class ConsultBIConstants {
"goodat_crowd_click" // 擅长人群埋点 "goodat_crowd_click" // 擅长人群埋点
const val SEARCH_BANNERWORD_CLICK = const val SEARCH_BANNERWORD_CLICK =
"$PART_ID_YDL_USER_MAIN_PAGE|search_bannerword_click" //历史搜索、热门搜索、本周热门专家搜索 "$PART_ID_YDL_USER_MAIN_PAGE|search_bannerword_click" //历史搜索、热门搜索、本周热门专家搜索
const val CONSULT_FILTER_CITY_PAGE = "consult_filter_city_page"
const val POPUP_ICON_CLICK = "$CONSULT_FILTER_CITY_PAGE|popup_icon_click"
const val AUTHORIZATION_ICON_CLICK =
"$CONSULT_FILTER_CITY_PAGE|authorization_icon_click"
const val CITY_NAME_CLICK = "$CONSULT_FILTER_CITY_PAGE|city_name_click"
const val CONSULT_FILTER_PRICE_PAGE = "consult_filter_price_page"
const val PRICE_CHOICE_CLICK = "$CONSULT_FILTER_PRICE_PAGE|price_choice_click"
const val PRICE_SLIDE_CLICK = "$CONSULT_FILTER_PRICE_PAGE|price_slide_click"
const val BOTTOM_ICON_CLICK = "$CONSULT_FILTER_PRICE_PAGE|bottom_icon_click"
} }
} }
class ConsultSearchListEvent { class ConsultSearchListEvent {
...@@ -94,4 +105,12 @@ class ConsultBIConstants { ...@@ -94,4 +105,12 @@ class ConsultBIConstants {
YDL_USER_MAIN_PAGE + "private_chat_click" // 点击私聊按钮 YDL_USER_MAIN_PAGE + "private_chat_click" // 点击私聊按钮
} }
} }
class ConsultantLocationAuth {
companion object {
const val WHETHER_LOCATION_AUTH = "whether_location_auth"
const val REFUSE_ALREADY = "refuse_already"
const val RECENT_CITY = "recent_city"
}
}
} }
\ No newline at end of file
package com.yidianling.consultant.listener
import com.yidianling.consultant.model.bean.PriceRangesItem
/**
* Created by zqk on 17-9-20.
*/
interface OnPriceItemSelectedListener {
fun onPriceItemSelected(priceRangesItem: PriceRangesItem)
}
\ No newline at end of file
...@@ -106,12 +106,17 @@ interface SearchApi { ...@@ -106,12 +106,17 @@ interface SearchApi {
* 100 有配置接口 * 100 有配置接口
* */ * */
@GET("consult/assistant/chat-route-config") @GET("consult/assistant/chat-route-config")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA,"Content-Type:application/json") @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
fun getChatRouteConfig( fun getChatRouteConfig(
@Query("location") location: Int, @Query("location") location: Int,
@Query("naviType") naviType: String = "1" @Query("naviType") naviType: String = "1"
): Observable<BaseAPIResponse<Long>> ): Observable<BaseAPIResponse<Long>>
//根据IP地址获取城市
@GET("region/ip-region")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
fun getCityByIp(): Observable<BaseAPIResponse<ConsultantRegionBean>>
//搜索条件 //搜索条件
@GET("consult/user/order/promptPayment") @GET("consult/user/order/promptPayment")
......
...@@ -8,45 +8,47 @@ import android.widget.TextView ...@@ -8,45 +8,47 @@ import android.widget.TextView
* Created by zqk on 17-9-20. * Created by zqk on 17-9-20.
*/ */
data class AllFilter( data class AllFilter(
var searchWord: String? = null, var searchWord: String? = null,
val categories: ArrayList<CateItem> = ArrayList(), //主题 val categories: ArrayList<CateItem> = ArrayList(), //主题
var reorder: ReorderItem = ReorderItem(), //排序 var reorder: ReorderItem = ReorderItem(), //排序
var region: RegionItem = RegionItem(), //省 var region: RegionItem = RegionItem(), //省
var sub: SubItem = SubItem(), //市 var sub: SubItem = SubItem(), //市
var showType: ShowTypeItem = ShowTypeItem(), //显示方式 var showType: ShowTypeItem = ShowTypeItem(), //显示方式
val enquiries: ArrayList<EnquiryItem> = ArrayList(), //咨询方式 val enquiries: ArrayList<EnquiryItem> = ArrayList(), //咨询方式
var priceRanges: PriceRangesItem ?= null, //服务均价 var priceRanges: PriceRangesItem? = null, //服务均价
var priceRangesView: TextView ?= null, //服务均价 var priceRangesView: TextView? = null, //服务均价
val ages: ArrayList<AgeItem> = ArrayList(), //年龄 var sortRangesView: TextView? = null, //排序均价
val doctorEdu: ArrayList<DoctorEduItem> = ArrayList(), //学历 val ages: ArrayList<AgeItem> = ArrayList(), //年龄
val others: ArrayList<OtherItem> = ArrayList(),//其他筛选 val sorStyle: ArrayList<ReorderItem> = ArrayList(), //排序方式
val doctorEdu: ArrayList<DoctorEduItem> = ArrayList(), //学历
val title:ArrayList<ReorderItem> = ArrayList(), //资质 val others: ArrayList<OtherItem> = ArrayList(),//其他筛选
val specialityCrowd:ArrayList<SpecialityCrowdBean> = ArrayList(), // 擅长人群
val title: ArrayList<ReorderItem> = ArrayList(), //资质
// 八大类标签集合 val specialityCrowd: ArrayList<SpecialityCrowdBean> = ArrayList(), // 擅长人群
val childList:ArrayList<ChildrenBean> = ArrayList(), // 亲子教育
val stressList:ArrayList<ChildrenBean> = ArrayList(), // 情绪压力 // 八大类标签集合
val loveEmotionList:ArrayList<ChildrenBean> = ArrayList(), // 恋爱情感 val childList: ArrayList<ChildrenBean> = ArrayList(), // 亲子教育
val marriedFamilyList:ArrayList<ChildrenBean> = ArrayList(), // 婚姻家庭 val stressList: ArrayList<ChildrenBean> = ArrayList(), // 情绪压力
val personalGrowthList:ArrayList<ChildrenBean> = ArrayList(), // 个人成长 val loveEmotionList: ArrayList<ChildrenBean> = ArrayList(), // 恋爱情感
val interpersonalRelationshipList:ArrayList<ChildrenBean> = ArrayList(), // 人际关系 val marriedFamilyList:ArrayList<ChildrenBean> = ArrayList(), // 婚姻家庭
val careerDevelopmentList:ArrayList<ChildrenBean> = ArrayList(), // 职场发展 val personalGrowthList:ArrayList<ChildrenBean> = ArrayList(), // 个人成长
val mentalHealthList:ArrayList<ChildrenBean> = ArrayList(), // 心理健康 val interpersonalRelationshipList:ArrayList<ChildrenBean> = ArrayList(), // 人际关系
val careerDevelopmentList:ArrayList<ChildrenBean> = ArrayList(), // 职场发展
val mentalHealthList:ArrayList<ChildrenBean> = ArrayList(), // 心理健康
// 八大类已选中标签id集合 // 八大类已选中标签id集合
val categoryId2List:ArrayList<String> = ArrayList(), // 一级类目id集合 val categoryId2List:ArrayList<String> = ArrayList(), // 一级类目id集合
val categoryId3List:ArrayList<String> = ArrayList(), // 二级类目id集合 val categoryId3List:ArrayList<String> = ArrayList(), // 二级类目id集合
// 八大类选中下标集合,重置的时候可以减少循坏,提升性能 // 八大类选中下标集合,重置的时候可以减少循坏,提升性能
val chooseChildIndexList:ArrayList<Int> = ArrayList(), val chooseChildIndexList:ArrayList<Int> = ArrayList(),
val chooseStressIndexList:ArrayList<Int> = ArrayList(), val chooseStressIndexList:ArrayList<Int> = ArrayList(),
val chooseLoveEmotionIndexList:ArrayList<Int> = ArrayList(), val chooseLoveEmotionIndexList:ArrayList<Int> = ArrayList(),
val chooseMarriedFamilyIndexList:ArrayList<Int> = ArrayList(), val chooseMarriedFamilyIndexList:ArrayList<Int> = ArrayList(),
val choosePersonalGrowthIndexList:ArrayList<Int> = ArrayList(), val choosePersonalGrowthIndexList:ArrayList<Int> = ArrayList(),
val chooseInterpersonalRelationshipIndexList:ArrayList<Int> = ArrayList(), val chooseInterpersonalRelationshipIndexList:ArrayList<Int> = ArrayList(),
val chooseCareerDevelopmentIndexList:ArrayList<Int> = ArrayList(), val chooseCareerDevelopmentIndexList:ArrayList<Int> = ArrayList(),
val chooseMentalHealthIndexList:ArrayList<Int> = ArrayList() val chooseMentalHealthIndexList:ArrayList<Int> = ArrayList()
) )
\ No newline at end of file
package com.yidianling.consultant.model.bean package com.yidianling.consultant.model.bean
import android.os.Parcelable
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
import kotlinx.android.parcel.Parcelize
@Parcelize
data class SubItem( data class SubItem(
@field:SerializedName("value") @field:SerializedName("value")
var value: String? = null, var value: String? = null,
@field:SerializedName("key") @field:SerializedName("key")
var key: String? = null, var key: String? = null,
@field:SerializedName("code") @field:SerializedName("code")
var code: String?=null var code: String? = null,
) var locationCode: String? = ""
\ No newline at end of file ) : Parcelable
\ No newline at end of file
...@@ -4,25 +4,30 @@ import android.annotation.SuppressLint ...@@ -4,25 +4,30 @@ import android.annotation.SuppressLint
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 androidx.fragment.app.Fragment import android.graphics.Rect
import android.text.TextUtils import android.text.TextUtils
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.blankj.utilcode.util.ScreenUtils
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import com.ydl.webview.H5JsBean
import com.ydl.ydlcommon.base.BaseApp import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.SharedPreferencesEditor import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.yidianling.consultant.ExpertSearchActivity import com.yidianling.consultant.ExpertSearchActivity
import com.yidianling.consultant.ExpertSearchFragment import com.yidianling.consultant.ExpertSearchFragment
import com.yidianling.consultant.OnBottomWordListener
import com.yidianling.consultant.api.IConsultantService import com.yidianling.consultant.api.IConsultantService
import com.yidianling.consultant.bean.GuideBean import com.yidianling.consultant.bean.GuideBean
import com.yidianling.consultant.bean.Keyworks import com.yidianling.consultant.bean.Keyworks
import com.yidianling.consultant.data.ConsultantDataManager import com.yidianling.consultant.data.ConsultantDataManager
import com.yidianling.consultant.OnBottomWordListener
import com.yidianling.consultant.model.SearchApi import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
import com.yidianling.consultant.modular.utils.ConsultAssistantEntryUtils import com.yidianling.consultant.modular.utils.ConsultAssistantEntryUtils
import com.yidianling.consultant.preview.GPreviewBuilder
import com.yidianling.consultant.preview.UserViewInfo
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
...@@ -149,6 +154,32 @@ class ConsultantServiceImp : IConsultantService { ...@@ -149,6 +154,32 @@ class ConsultantServiceImp : IConsultantService {
}) })
} }
override fun resourceToPreview(dataList: List<H5JsBean.MediaInfo>?, params: H5JsBean.H5JsCmd.Params, activity: Activity) {
val mThumbViewInfoList: MutableList<UserViewInfo> = ArrayList()
dataList?.let {
for (mediaInfo in it) {
val userViewInfo =
UserViewInfo(mediaInfo.cover, mediaInfo.url, mediaInfo.sourcesType)
val bounds = Rect()
bounds.left = ScreenUtils.getScreenWidth() / 2
bounds.top = ScreenUtils.getScreenHeight() / 2
bounds.right = ScreenUtils.getScreenWidth() / 2
bounds.bottom = ScreenUtils.getScreenHeight() / 2
userViewInfo.bounds = bounds
mThumbViewInfoList.add(userViewInfo)
}
GPreviewBuilder.form(activity)
.setData(mThumbViewInfoList)
.setCurrentIndex(params.preview_index)
.setFullscreen(true)
.setToUid(params.info?.toUid.toString() + "")
.setDoctorId(params.info?.doctorId)
.setType(GPreviewBuilder.IndicatorType.Dot)
.start()
}
}
override fun resetConsultAssistantDialogStatus() { override fun resetConsultAssistantDialogStatus() {
ConsultAssistantDialogUtils.INSTANCE.resetStatus() ConsultAssistantDialogUtils.INSTANCE.resetStatus()
} }
......
package com.yidianling.consultant.ui.view package com.yidianling.consultant.ui.view
import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.graphics.Region
import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.BitmapDrawable
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.LinearSnapHelper
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.PopupWindow import android.widget.PopupWindow
import com.tencent.mmkv.MMKV
import com.ydl.ydlcommon.adapter.MyBaseAdapter import com.ydl.ydlcommon.adapter.MyBaseAdapter
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.yidianling.common.tools.RxDeviceTool import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.R import com.yidianling.consultant.R
import com.yidianling.consultant.adapter.RegionRecyclerViewAdapter import com.yidianling.consultant.adapter.RegionRecyclerViewAdapter
import com.yidianling.consultant.adapter.SubRecyclerViewAdapter import com.yidianling.consultant.adapter.SubRecyclerViewAdapter
import com.yidianling.consultant.bean.ConsultantRecentCity
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.constants.ConsultBIConstants.ConsultEvent.Companion.CITY_NAME_CLICK
import com.yidianling.consultant.constants.ConsultBIConstants.ConsultantLocationAuth.Companion.RECENT_CITY
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.model.bean.RegionItem import com.yidianling.consultant.model.bean.RegionItem
import com.yidianling.consultant.model.bean.SubItem import com.yidianling.consultant.model.bean.SubItem
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.consultant_ui_region_popup_window.view.* import kotlinx.android.synthetic.main.consultant_ui_region_popup_window.view.*
/** /**
* 地区选择弹窗 * 地区选择弹窗
*/ */
class AreaPopupWindow(val context: Context, regionList: ArrayList<RegionItem>, private var selectedRegion: RegionItem, private var selectedSub: SubItem) class AreaPopupWindow(
: PopupWindow(null, ViewGroup.LayoutParams.MATCH_PARENT, RxImageTool.dp2px(369f)) { val context: Context,
regionList: ArrayList<RegionItem>,
private var selectedRegion: RegionItem,
private var selectedSub: SubItem,
private val isAgree: Boolean
) : PopupWindow(null, ViewGroup.LayoutParams.MATCH_PARENT, RxImageTool.dp2px(369f)) {
private val subList = ArrayList<SubItem>() private val subList = ArrayList<SubItem>()
private val regionAdapter = RegionRecyclerViewAdapter(context, regionList, selectedRegion) private val regionAdapter = RegionRecyclerViewAdapter(context, regionList, selectedRegion)
private var subAdapter:SubRecyclerViewAdapter private var subAdapter: SubRecyclerViewAdapter
private var recentCityBean: ConsultantRecentCity? = ConsultantRecentCity(arrayListOf())
var onRegionSelectedListener: OnRegionSelectedListener? = null var onRegionSelectedListener: OnRegionSelectedListener? = null
private var subLocationItem: SubItem? = SubItem()
private val locationCode = "-1"
private var locationList: ArrayList<SubItem>? = arrayListOf()
private var locationHistoryList = regionList
init { init {
val view = LayoutInflater.from(context).inflate(R.layout.consultant_ui_region_popup_window, null) val view =
LayoutInflater.from(context).inflate(R.layout.consultant_ui_region_popup_window, null)
this.contentView = view this.contentView = view
this.isFocusable = true this.isFocusable = true
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
this.setBackgroundDrawable(BitmapDrawable()) this.setBackgroundDrawable(BitmapDrawable())
this.isOutsideTouchable = true this.isOutsideTouchable = true
this.height = ((RxDeviceTool.getScreenHeight(context) - RxImageTool.dp2px(90f)) * 0.618).toInt() //设置高度为屏幕的80% this.height =
((RxDeviceTool.getScreenHeight(context) - RxImageTool.dp2px(90f)) * 0.618).toInt() //设置高度为屏幕的80%
if (selectedRegion.sub.isNotEmpty()){ regionAdapter.regionList = regionList
if (selectedRegion.sub.isNotEmpty()) {
subList.addAll(selectedRegion.sub) subList.addAll(selectedRegion.sub)
}else{ } else {
subList.addAll(regionList[0].sub) subList.addAll(regionList[0].sub)
} }
subAdapter = SubRecyclerViewAdapter(context, subList, selectedSub) recentCityBean =
MMKV.defaultMMKV().decodeParcelable(
RECENT_CITY,
ConsultantRecentCity::class.java
)
if (recentCityBean == null) recentCityBean = ConsultantRecentCity(arrayListOf())
subAdapter = SubRecyclerViewAdapter(context, subList, selectedSub, locationCode)
subAdapter.setOnAuthClickLister(object : SubRecyclerViewAdapter.OnAuthClickLister {
override fun onAuthClick() {
val dialog = CommonDialog(context)
.setTitle("温馨提示")
.setMessage("建议您授权定位权限,就能轻松获取周边优秀咨询师和其他服务")
.setLeftOnclick("暂不") { v1 ->
ActionCountUtils.count(
ConsultBIConstants.ConsultEvent.AUTHORIZATION_ICON_CLICK,
"暂不"
)
}.setRightClick("授权") { v12 ->
ActionCountUtils.count(
ConsultBIConstants.ConsultEvent.AUTHORIZATION_ICON_CLICK,
"授权"
)
MMKV.defaultMMKV().encode(
ConsultBIConstants.ConsultantLocationAuth.WHETHER_LOCATION_AUTH,
true
)
getRegionByIp(true, true)
}
dialog.show()
}
})
view.rvRegion.layoutManager = view.rvRegion.layoutManager =
LinearLayoutManager( LinearLayoutManager(
context, context,
...@@ -60,8 +116,8 @@ class AreaPopupWindow(val context: Context, regionList: ArrayList<RegionItem>, p ...@@ -60,8 +116,8 @@ class AreaPopupWindow(val context: Context, regionList: ArrayList<RegionItem>, p
} }
view.rvRegion.adapter = regionAdapter view.rvRegion.adapter = regionAdapter
val i = regionList val i = regionList
.takeWhile { it.key != selectedRegion.key } .takeWhile { it.key != selectedRegion.key }
.count() .count()
view.rvRegion.scrollToPosition(i) view.rvRegion.scrollToPosition(i)
...@@ -72,13 +128,75 @@ class AreaPopupWindow(val context: Context, regionList: ArrayList<RegionItem>, p ...@@ -72,13 +128,75 @@ class AreaPopupWindow(val context: Context, regionList: ArrayList<RegionItem>, p
false false
) )
subAdapter.onItemClickListener = MyBaseAdapter.OnItemClickListener { _, _, data -> subAdapter.onItemClickListener = MyBaseAdapter.OnItemClickListener { _, _, data ->
saveCitySearchRecord(data)
selectedSub = data selectedSub = data
ActionCountUtils.count(CITY_NAME_CLICK, data.value.toString())
onRegionSelectedListener?.onRegionSelected(selectedRegion, selectedSub) onRegionSelectedListener?.onRegionSelected(selectedRegion, selectedSub)
} }
view.rvSub.adapter = subAdapter view.rvSub.adapter = subAdapter
view.rvSub.scrollToPosition(subList.indexOf(selectedSub) + 1) view.rvSub.scrollToPosition(subList.indexOf(selectedSub) + 1)
} }
//倒序保留最近五次的搜索历史记录并去重
private fun saveCitySearchRecord(data: SubItem) {
if (data.value == "不限") return
recentCityBean?.let {
if (it.recentCity.size < 5) {
it.recentCity.add(0, data)
it.recentCity = it.recentCity.toMutableSet().toMutableList()
MMKV.defaultMMKV().encode(RECENT_CITY, recentCityBean)
} else {
it.recentCity.removeAt(it.recentCity.size - 1)
it.recentCity.add(0, data)
it.recentCity = it.recentCity.toMutableSet().toMutableList()
MMKV.defaultMMKV().encode(RECENT_CITY, recentCityBean)
}
}
}
@SuppressLint("CheckResult")
fun getRegionByIp(agreeLocation: Boolean, refreshAdapter: Boolean) {
if (agreeLocation) {
SearchApi.getSearchApi().getCityByIp()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
if (it.code == "200") {
subLocationItem?.code = it.data.city_code
subLocationItem?.key = it.data.city_code
subLocationItem?.value = it.data.city_name
subLocationItem?.locationCode = locationCode
locationList?.clear()
subLocationItem?.let { locationList?.add(it) }
locationHistoryList.get(0).code = it.data.province_code
locationHistoryList.get(0).key = it.data.province_code
locationHistoryList.get(0).value = "定位"
locationList?.let { locationHistoryList.get(0).sub = it }
subList.clear()
locationList?.let { it1 -> subList.addAll(it1) }
subAdapter.notifyDataSetChanged()
regionAdapter.notifyDataSetChanged()
} else {
subLocationItem?.code = null
subLocationItem?.key = null
subLocationItem?.value = "定位失败,请稍后再试"
subLocationItem?.locationCode = "NotAuth"
subAdapter.notifyDataSetChanged()
regionAdapter.notifyDataSetChanged()
}
}, {})
} else {
subLocationItem?.code = null
subLocationItem?.key = null
subLocationItem?.value = "开启授权,获得定位城市"
subLocationItem?.locationCode = "NotAuth"
subAdapter.notifyDataSetChanged()
regionAdapter.notifyDataSetChanged()
}
}
interface OnRegionSelectedListener { interface OnRegionSelectedListener {
fun onRegionSelected(region: RegionItem, sub: SubItem) fun onRegionSelected(region: RegionItem, sub: SubItem)
} }
......
package com.yidianling.consultant.ui.view.rangeseekbar;
/**
* ================================================
* 作 者:JayGoo
* 版 本:
* 创建日期:2018/5/8
* 描 述:
* ================================================
*/
public interface OnRangeChangedListener {
void onRangeChanged(RangeSeekBar view, float leftValue, float rightValue, boolean isFromUser);
void onStartTrackingTouch(RangeSeekBar view, boolean isLeft);
void onStopTrackingTouch(RangeSeekBar view, boolean isLeft);
}
package com.yidianling.consultant.ui.view.rangeseekbar;
import android.os.Parcel;
import android.os.Parcelable;
import android.view.View;
/**
* ================================================
* 作 者:JayGoo
* 版 本:
* 创建日期:2018/5/8
* 描 述:
* ================================================
*/
public class SavedState extends View.BaseSavedState {
public static final Creator<SavedState> CREATOR = new Creator<SavedState>() {
public SavedState createFromParcel(Parcel in) {
return new SavedState(in);
}
public SavedState[] newArray(int size) {
return new SavedState[size];
}
};
public float minValue;
public float maxValue;
public float rangeInterval;
public int tickNumber;
public float currSelectedMin;
public float currSelectedMax;
public SavedState(Parcelable superState) {
super(superState);
}
private SavedState(Parcel in) {
super(in);
minValue = in.readFloat();
maxValue = in.readFloat();
rangeInterval = in.readFloat();
tickNumber = in.readInt();
currSelectedMin = in.readFloat();
currSelectedMax = in.readFloat();
}
@Override
public void writeToParcel(Parcel out, int flags) {
super.writeToParcel(out, flags);
out.writeFloat(minValue);
out.writeFloat(maxValue);
out.writeFloat(rangeInterval);
out.writeInt(tickNumber);
out.writeFloat(currSelectedMin);
out.writeFloat(currSelectedMax);
}
}
package com.yidianling.consultant.ui.view.rangeseekbar;
/**
* ================================================
* 作 者:JayGoo
* 版 本:
* 创建日期:2018/5/9
* 描 述: it works for draw indicator text
* ================================================
*/
public class SeekBarState {
public String indicatorText;
public float value; //now progress value
public boolean isMin;
public boolean isMax;
@Override
public String toString() {
return "indicatorText: " + indicatorText + " ,isMin: " + isMin + " ,isMax: " + isMax;
}
}
package com.yidianling.consultant.ui.view.rangeseekbar;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.NinePatch;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.Log;
import androidx.annotation.ColorRes;
import androidx.core.content.ContextCompat;
/**
* ================================================
* 作 者:JayGoo
* 版 本:
* 创建日期:2018/5/8
* 描 述:
* ================================================
*/
public class Utils {
private static final String TAG = "RangeSeekBar";
public static void print(String log) {
Log.d(TAG, log);
}
public static void print(Object... logs) {
StringBuilder stringBuilder = new StringBuilder();
for (Object log : logs) {
stringBuilder.append(log);
}
Log.d(TAG, stringBuilder.toString());
}
public static Bitmap drawableToBitmap(Context context, int width, int height, int drawableId) {
if (context == null || width <= 0 || height <= 0 || drawableId == 0) return null;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
return Utils.drawableToBitmap(width, height, context.getResources().getDrawable(drawableId, null));
} else {
return Utils.drawableToBitmap(width, height, context.getResources().getDrawable(drawableId));
}
}
/**
* make a drawable to a bitmap
*
* @param drawable drawable you want convert
* @return converted bitmap
*/
public static Bitmap drawableToBitmap(int width, int height, Drawable drawable) {
Bitmap bitmap = null;
try {
if (drawable instanceof BitmapDrawable) {
BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
bitmap = bitmapDrawable.getBitmap();
if (bitmap != null && bitmap.getHeight() > 0) {
Matrix matrix = new Matrix();
float scaleWidth = width * 1.0f / bitmap.getWidth();
float scaleHeight = height * 1.0f / bitmap.getHeight();
matrix.postScale(scaleWidth, scaleHeight);
bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
return bitmap;
}
}
bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);
} catch (Exception e) {
e.printStackTrace();
}
return bitmap;
}
/**
* draw 9Path
*
* @param canvas Canvas
* @param bmp 9path bitmap
* @param rect 9path rect
*/
public static void drawNinePath(Canvas canvas, Bitmap bmp, Rect rect) {
NinePatch.isNinePatchChunk(bmp.getNinePatchChunk());
NinePatch patch = new NinePatch(bmp, bmp.getNinePatchChunk(), null);
patch.draw(canvas, rect);
}
public static void drawBitmap(Canvas canvas, Paint paint, Bitmap bmp, Rect rect) {
try {
if (NinePatch.isNinePatchChunk(bmp.getNinePatchChunk())) {
drawNinePath(canvas, bmp, rect);
return;
}
} catch (Exception e) {
}
canvas.drawBitmap(bmp, rect.left, rect.top, paint);
}
public static int dp2px(Context context, float dpValue) {
if (context == null || compareFloat(0f, dpValue) == 0) return 0;
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
}
/**
* Compare the size of two floating point numbers
*
* @param a
* @param b
* @return 1 is a > b
* -1 is a < b
* 0 is a == b
*/
public static int compareFloat(float a, float b) {
int ta = Math.round(a * 1000000);
int tb = Math.round(b * 1000000);
if (ta > tb) {
return 1;
} else if (ta < tb) {
return -1;
} else {
return 0;
}
}
/**
* Compare the size of two floating point numbers with accuracy
*
* @param a
* @param b
* @return 1 is a > b
* -1 is a < b
* 0 is a == b
*/
public static int compareFloat(float a, float b, int degree) {
if (Math.abs(a - b) < Math.pow(0.1, degree)) {
return 0;
} else {
if (a < b) {
return -1;
} else {
return 1;
}
}
}
public static float parseFloat(String s) {
try {
return Float.parseFloat(s);
} catch (NumberFormatException e) {
return 0f;
}
}
public static Rect measureText(String text, float textSize) {
Paint paint = new Paint();
Rect textRect = new Rect();
paint.setTextSize(textSize);
paint.getTextBounds(text, 0, text.length(), textRect);
paint.reset();
return textRect;
}
public static boolean verifyBitmap(Bitmap bitmap) {
if (bitmap == null || bitmap.isRecycled() || bitmap.getWidth() <= 0 || bitmap.getHeight() <= 0) {
return false;
}
return true;
}
public static int getColor(Context context, @ColorRes int colorId) {
if (context != null) {
return ContextCompat.getColor(context.getApplicationContext(), colorId);
}
return Color.WHITE;
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/platform_color_F7F7F7" />
<corners android:radius="4dp" />
</shape>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#1DA1F2"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13c0,-3.87 -3.13,-7 -7,-7zM12,11.5c-1.38,0 -2.5,-1.12 -2.5,-2.5s1.12,-2.5 2.5,-2.5 2.5,1.12 2.5,2.5 -1.12,2.5 -2.5,2.5z" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/dp_4" />
<solid android:color="@color/platform_main_theme_bright" />
<stroke
android:width="0.5dp"
android:color="@color/platform_main_theme" />
</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="oval">
<solid android:color="@color/platform_gray7" />
<stroke
android:width="1dp"
android:color="@color/platform_gray7" />
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@android:color/white" />
<stroke
android:width="3.5dp"
android:color="@color/platform_main_theme" />
</shape>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
android:layout_width="307dp" android:layout_width="307dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/white" android:background="@color/white"
app:cardCornerRadius="12dp" app:cardCornerRadius="12dp"
android:layout_centerInParent="true"> android:layout_centerInParent="true">
...@@ -64,7 +65,7 @@ ...@@ -64,7 +65,7 @@
android:id="@+id/ll_content" android:id="@+id/ll_content"
android:layout_below="@+id/ll_time" android:layout_below="@+id/ll_time"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="66dp" android:layout_height="wrap_content"
android:background="@drawable/consultant_bg_sub_pay" android:background="@drawable/consultant_bg_sub_pay"
android:layout_marginTop="@dimen/platform_dp_16" android:layout_marginTop="@dimen/platform_dp_16"
android:layout_marginLeft="@dimen/platform_dp_16" android:layout_marginLeft="@dimen/platform_dp_16"
...@@ -76,7 +77,9 @@ ...@@ -76,7 +77,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/platform_dp_12" android:layout_marginLeft="@dimen/platform_dp_12"
android:layout_marginTop="8dp"
android:layout_marginRight="@dimen/platform_dp_8" android:layout_marginRight="@dimen/platform_dp_8"
android:layout_marginBottom="8dp"
app:cardCornerRadius="4dp"> app:cardCornerRadius="4dp">
<ImageView <ImageView
...@@ -88,33 +91,33 @@ ...@@ -88,33 +91,33 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/nameTv" android:id="@+id/nameTv"
android:layout_marginTop="@dimen/platform_dp_11"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_14" android:layout_marginTop="@dimen/platform_dp_11"
android:textColor="#1C1F28"
android:maxLines="1"
android:ellipsize="end"
android:layout_marginRight="@dimen/platform_dp_12" android:layout_marginRight="@dimen/platform_dp_12"
/> android:ellipsize="end"
android:maxLines="1"
android:textColor="#1C1F28"
android:textSize="@dimen/platform_sp_14"
tools:text="fadjjfladj" />
<TextView <TextView
android:id="@+id/desTv" android:id="@+id/desTv"
android:layout_marginTop="@dimen/platform_dp_6"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_14" android:layout_marginTop="@dimen/platform_dp_6"
android:textColor="#62636F"
android:maxLines="1"
android:ellipsize="end"
android:layout_marginBottom="@dimen/platform_dp_11"
android:layout_marginRight="@dimen/platform_dp_12" android:layout_marginRight="@dimen/platform_dp_12"
/> android:layout_marginBottom="@dimen/platform_dp_11"
android:ellipsize="end"
android:maxLines="2"
android:textColor="#62636F"
android:textSize="@dimen/platform_sp_14"
tools:text="fadjjfladjfljasf;ljdsl;fj;fadjjfladjfljasffadjfadjjfladjfljasffadjjfladjfljasffadjjfladjfljasffadjjfladjfljasfjfladjfljasf" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
...@@ -2,13 +2,22 @@ ...@@ -2,13 +2,22 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground" android:background="@color/white"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingTop="@dimen/platform_dp_15"
android:paddingBottom="@dimen/platform_dp_15"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingLeft="16dp" android:paddingLeft="16dp"
android:paddingRight="16dp"> android:paddingRight="16dp">
<ImageView
android:id="@+id/location_img"
android:layout_width="@dimen/platform_dp_15"
android:layout_height="@dimen/platform_dp_15"
android:src="@drawable/consultant_baseline_location_on_24"
android:visibility="gone" />
<TextView <TextView
android:id="@+id/tvConsultTypeName" android:id="@+id/tvConsultTypeName"
android:layout_width="0dp" android:layout_width="0dp"
...@@ -16,14 +25,25 @@ ...@@ -16,14 +25,25 @@
android:layout_weight="1" android:layout_weight="1"
android:textColor="@color/platform_color_black_333333" android:textColor="@color/platform_color_black_333333"
android:textSize="14sp" android:textSize="14sp"
android:includeFontPadding="false"
tools:text="咨询方式" /> tools:text="咨询方式" />
<TextView
android:id="@+id/reLocation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="授权"
android:includeFontPadding="false"
android:textColor="@color/platform_main_theme"
android:textSize="@dimen/platform_sp_14"
android:visibility="gone" />
<ImageView <ImageView
android:id="@+id/ivCheckCircle" android:id="@+id/ivCheckCircle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@null" android:contentDescription="@null"
android:src="@drawable/consultant_ic_check" android:src="@drawable/consultant_ic_check"
android:visibility="invisible"/> android:visibility="invisible" />
</LinearLayout> </LinearLayout>
...@@ -14,5 +14,5 @@ ...@@ -14,5 +14,5 @@
android:paddingTop="6dp" android:paddingTop="6dp"
android:paddingBottom="6dp" android:paddingBottom="6dp"
android:textColor="@color/consultant_color_search_filter_selector" android:textColor="@color/consultant_color_search_filter_selector"
android:textSize="13dp" android:textSize="14sp"
tools:text="按专家显示" /> tools:text="按专家显示" />
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:gravity="center_vertical"
android:background="@color/platform_white"> android:background="@color/platform_color_F7F7F7">
<View <View
android:id="@+id/view_select" android:id="@+id/view_select"
android:layout_width="4dp" android:layout_width="4dp"
android:layout_height="21dp" android:layout_height="21dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:background="@color/platform_main_theme" android:background="@color/platform_main_theme"
android:visibility="invisible"/> android:visibility="invisible" />
<TextView <TextView
android:id="@+id/tvRegionName" android:id="@+id/tvRegionName"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="wrap_content"
android:includeFontPadding="false"
android:paddingTop="@dimen/platform_dp_17"
android:paddingBottom="@dimen/platform_dp_17"
android:gravity="center" android:gravity="center"
android:text="地区" android:text="地区"
android:textColor="@color/platform_default_text_color" android:textColor="@color/platform_default_text_color"
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1" android:layout_weight="1"
android:width="0dp" android:width="0dp"
android:ellipsize="end"
android:singleLine="true"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp" android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp" android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:text="困扰" android:text="困扰"
...@@ -44,7 +46,7 @@ ...@@ -44,7 +46,7 @@
android:width="0dp" android:width="0dp"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp" android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp" android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:text="@string/platform_area" android:text="城市"
android:textColor="@color/platform_color_242424" /> android:textColor="@color/platform_color_242424" />
<com.ydl.ydlcommon.view.DrawableRightTextView <com.ydl.ydlcommon.view.DrawableRightTextView
...@@ -55,7 +57,7 @@ ...@@ -55,7 +57,7 @@
android:width="0dp" android:width="0dp"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp" android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp" android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:text="@string/platform_sort" android:text="价格"
android:textColor="@color/platform_color_242424" /> android:textColor="@color/platform_color_242424" />
<com.ydl.ydlcommon.view.DrawableRightTextView <com.ydl.ydlcommon.view.DrawableRightTextView
...@@ -64,8 +66,8 @@ ...@@ -64,8 +66,8 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1" android:layout_weight="1"
android:width="0dp" android:width="0dp"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp" android:drawableEnd="@drawable/filter_up_grey"
android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp" android:drawableRight="@drawable/filter_up_grey"
android:text="@string/platform_filter" android:text="@string/platform_filter"
android:textColor="@color/platform_color_242424" /> android:textColor="@color/platform_color_242424" />
</LinearLayout> </LinearLayout>
...@@ -80,7 +82,7 @@ ...@@ -80,7 +82,7 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="6dp" android:layout_height="2dp"
android:background="@drawable/consult_fillter_bg" /> android:background="@drawable/consult_fillter_bg" />
</LinearLayout> </LinearLayout>
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="@dimen/platform_dp_10"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
...@@ -44,13 +44,14 @@ ...@@ -44,13 +44,14 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_28" android:layout_marginTop="@dimen/platform_dp_28"
android:text="咨询方式" android:text="排序"
android:layout_marginStart="@dimen/platform_dp_4"
android:textColor="@color/platform_color_242424" android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" /> android:textStyle="bold" />
<FrameLayout <FrameLayout
android:id="@+id/flEnquiryType" android:id="@+id/flSortType"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp" /> android:layout_marginTop="12dp" />
...@@ -59,22 +60,23 @@ ...@@ -59,22 +60,23 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_28" android:layout_marginTop="@dimen/platform_dp_28"
android:text="价格" android:text="咨询方式"
android:layout_marginStart="@dimen/platform_dp_4"
android:textColor="@color/platform_color_242424" android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" /> android:textStyle="bold" />
<FrameLayout <FrameLayout
android:id="@+id/flPriceRange" android:id="@+id/flEnquiryType"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp" /> android:layout_marginTop="12dp" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_28" android:layout_marginTop="@dimen/platform_dp_28"
android:text="年龄选择" android:text="年龄选择"
android:layout_marginStart="@dimen/platform_dp_4"
android:textColor="@color/platform_color_242424" android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" /> android:textStyle="bold" />
...@@ -90,6 +92,7 @@ ...@@ -90,6 +92,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_28" android:layout_marginTop="@dimen/platform_dp_28"
android:text="资质选择" android:text="资质选择"
android:layout_marginStart="@dimen/platform_dp_4"
android:textColor="@color/platform_color_242424" android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" /> android:textStyle="bold" />
...@@ -109,6 +112,7 @@ ...@@ -109,6 +112,7 @@
android:text="擅长人群" android:text="擅长人群"
android:textColor="@color/platform_color_242424" android:textColor="@color/platform_color_242424"
android:textSize="16sp" android:textSize="16sp"
android:layout_marginStart="@dimen/platform_dp_4"
android:textStyle="bold" /> android:textStyle="bold" />
<cn.lankton.flowlayout.FlowLayout <cn.lankton.flowlayout.FlowLayout
...@@ -126,6 +130,7 @@ ...@@ -126,6 +130,7 @@
android:text="学历选择" android:text="学历选择"
android:textColor="@color/platform_color_242424" android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:layout_marginStart="@dimen/platform_dp_4"
android:textStyle="bold" /> android:textStyle="bold" />
<FrameLayout <FrameLayout
...@@ -169,6 +174,7 @@ ...@@ -169,6 +174,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_28" android:layout_marginTop="@dimen/platform_dp_28"
android:text="其他选择" android:text="其他选择"
android:layout_marginStart="@dimen/platform_dp_4"
android:textColor="@color/platform_color_242424" android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" /> android:textStyle="bold" />
...@@ -182,6 +188,7 @@ ...@@ -182,6 +188,7 @@
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
......
<?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="wrap_content"
android:background="@color/white"
android:paddingTop="@dimen/platform_dp_15">
<FrameLayout
android:id="@+id/flPriceRangeView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="50dp"
android:paddingStart="@dimen/platform_dp_12"
android:paddingEnd="@dimen/platform_dp_12"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_start_end_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0-不限"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginTop="@dimen/platform_dp_30"
android:textColor="@color/platform_color_black_333333"
android:textSize="@dimen/platform_sp_14"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/flPriceRangeView" />
<com.yidianling.consultant.ui.view.rangeseekbar.RangeSeekBar
android:id="@+id/range_price_seekbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/platform_dp_20"
android:layout_marginEnd="@dimen/platform_dp_20"
android:layout_marginTop="@dimen/platform_dp_15"
app:rsb_progress_height="3.5dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_start_end_price"
app:rsb_gravity="bottom"
app:rsb_mode="range"
app:rsb_progress_color="@color/platform_main_theme"
app:rsb_step_auto_bonding="true"
app:rsb_step_color="#c3c4ca"
app:rsb_step_height="3.5dp"
app:rsb_step_width="0.5dp"
app:rsb_steps="6"
app:rsb_thumb_drawable="@drawable/thumb_yellow_stroke"
app:rsb_thumb_height="@dimen/platform_dp_15"
app:rsb_thumb_width="@dimen/platform_dp_15"
app:rsb_tick_mark_layout_gravity="bottom"
app:rsb_tick_mark_mode="other"
app:rsb_tick_mark_text_array="@array/wordsArray"
app:rsb_tick_mark_text_margin="20dp" />
<View
android:id="@+id/seperate_line"
android:layout_width="wrap_content"
android:layout_height="0.5dp"
android:layout_marginTop="@dimen/platform_dp_30"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/range_price_seekbar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="68dp"
android:layout_marginTop="@dimen/platform_dp_8"
android:background="@color/white"
android:orientation="horizontal"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="16dp"
app:layout_constraintTop_toBottomOf="@id/seperate_line">
<TextView
android:id="@+id/price_reset"
android:layout_width="0dp"
android:layout_height="44dp"
android:layout_weight="1"
android:background="@drawable/consultant_stroke_ebebeb_r_8"
android:gravity="center"
android:text="@string/platform_reset"
android:textColor="@color/platform_color_242424"
android:textSize="16sp" />
<TextView
android:id="@+id/price_Confirm"
android:layout_width="0dp"
android:layout_height="44dp"
android:layout_marginStart="13dp"
android:layout_weight="1"
android:background="@drawable/consultant_solid_main_theme_color_r_8"
android:gravity="center"
android:text="@string/platform_confirm"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -8,17 +8,15 @@ ...@@ -8,17 +8,15 @@
android:id="@+id/rvRegion" android:id="@+id/rvRegion"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/platform_white" android:background="@color/platform_color_F7F7F7"
android:layout_weight="1" android:layout_weight="1"
android:paddingTop="10dp"
android:overScrollMode="never"/> android:overScrollMode="never"/>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvSub" android:id="@+id/rvSub"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/platform_color_F7F7F7" android:background="@color/white"
android:layout_weight="2" android:layout_weight="2"
android:paddingTop="10dp"
android:overScrollMode="never"/> android:overScrollMode="never"/>
</LinearLayout> </LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="wordsArray">
<item>0</item>
<item>100</item>
<item>200</item>
<item>300</item>
<item>400</item>
<item>500</item>
<item>不限</item>
</string-array>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="RangeSeekBar">
<!--RangeSeekBar common attrs-->
<!--The maximum-->
<attr name="rsb_max" format="float" />
<!--The minimum-->
<attr name="rsb_min" format="float" />
<!--RangeSeekBar mode, single is normal seekBar, range is RangeSeekBar-->
<attr name="rsb_mode" format="enum">
<enum name="single" value="1" />
<enum name="range" value="2" />
</attr>
<!--RangeSeekBar gravity-->
<attr name="rsb_gravity" format="enum">
<enum name="top" value="0" />
<enum name="bottom" value="1" />
<enum name="center" value="2" />
</attr>
<!--The min interval of the thumbs -->
<attr name="rsb_min_interval" format="float" />
<!-- 0 for the normal mode, greater than 1 to switch to scale mode-->
<attr name="rsb_tick_mark_number" format="integer" />
<!--Scale mode
Number according to the scale of the actual proportion of the distribution of the location (markTextArray must be a number)
Other bisects the current layout (markTextArray can be any character)
-->
<attr name="rsb_tick_mark_mode" format="enum">
<enum name="number" value="0" />
<enum name="other" value="1" />
</attr>
<!--The tick mark text gravity -->
<attr name="rsb_tick_mark_gravity" format="enum">
<enum name="left" value="0" />
<enum name="center" value="1" />
<enum name="right" value="2" />
</attr>
<!--The tick mark text layout gravity -->
<attr name="rsb_tick_mark_layout_gravity" format="enum">
<enum name="top" value="0" />
<enum name="bottom" value="1" />
</attr>
<!--The tick mark text array -->
<attr name="rsb_tick_mark_text_array" format="reference" />
<!--The tick mark text margin bottom to progress -->
<attr name="rsb_tick_mark_text_margin" format="dimension" />
<attr name="rsb_tick_mark_text_size" format="dimension" />
<attr name="rsb_tick_mark_text_color" format="color" />
<!--it just work in range && number mode now-->
<attr name="rsb_tick_mark_in_range_text_color" format="color" />
<attr name="rsb_progress_height" format="dimension" />
<attr name="rsb_progress_radius" format="dimension" />
<!--the color of progress bar when in progress-->
<attr name="rsb_progress_color" format="color" />
<!--the default color of the progress bar-->
<attr name="rsb_progress_default_color" format="color" />
<attr name="rsb_progress_drawable" format="reference" />
<attr name="rsb_progress_drawable_default" format="reference" />
<!--SeekBar attrs-->
<attr name="rsb_indicator_show_mode" format="enum">
<enum name="showWhenTouch" value="0" />
<enum name="alwaysHide" value="1" />
<enum name="alwaysShowAfterTouch" value="2" />
<enum name="alwaysShow" value="3" />
</attr>
<attr name="rsb_indicator_height" format="dimension">
<enum name="wrap_content" value="-1" />
</attr>
<attr name="rsb_indicator_width" format="dimension">
<enum name="wrap_content" value="-1" />
</attr>
<!--indicator margin bottom to progress bar-->
<attr name="rsb_indicator_margin" format="dimension" />
<attr name="rsb_indicator_text_size" format="dimension" />
<attr name="rsb_indicator_text_color" format="color" />
<!--indicator arrow size, it just work when you not use rsb_indicator_drawable -->
<attr name="rsb_indicator_arrow_size" format="dimension" />
<!-- must use 9 path !!!-->
<attr name="rsb_indicator_drawable" format="reference" />
<attr name="rsb_indicator_background_color" format="color" />
<attr name="rsb_indicator_padding_left" format="dimension" />
<attr name="rsb_indicator_padding_right" format="dimension" />
<attr name="rsb_indicator_padding_top" format="dimension" />
<attr name="rsb_indicator_padding_bottom" format="dimension" />
<attr name="rsb_indicator_radius" format="dimension" />
<attr name="rsb_thumb_drawable" format="reference" />
<!--the thumb inactivated is when you don't touch the thumb button-->
<attr name="rsb_thumb_inactivated_drawable" format="reference" />
<attr name="rsb_thumb_width" format="dimension" />
<attr name="rsb_thumb_height" format="dimension" />
<attr name="rsb_thumb_scale_ratio" format="float" />
<!--steps SeekBar-->
<attr name="rsb_steps" format="integer" />
<attr name="rsb_step_color" format="color" />
<attr name="rsb_step_width" format="dimension" />
<attr name="rsb_step_height" format="dimension" />
<attr name="rsb_step_radius" format="dimension" />
<attr name="rsb_step_auto_bonding" format="boolean" />
<attr name="rsb_step_drawable" format="reference" />
</declare-styleable>
<declare-styleable name="VerticalRangeSeekBar">
<!--the vertical RangeSeekBar draw orientation-->
<attr name="rsb_orientation" format="enum">
<enum name="left" value="1" />
<enum name="right" value="2" />
</attr>
<attr name="rsb_tick_mark_orientation" format="enum">
<enum name="vertical" value="1" />
<enum name="horizontal" value="2" />
</attr>
<attr name="rsb_indicator_text_orientation" format="enum">
<enum name="vertical" value="1" />
<enum name="horizontal" value="2" />
</attr>
</declare-styleable>
</resources>
...@@ -14,6 +14,7 @@ tv.danmaku.ijk.media.player_arm64 ...@@ -14,6 +14,7 @@ tv.danmaku.ijk.media.player_arm64
"/> "/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application> <application>
<!--课程首页--> <!--课程首页-->
...@@ -38,6 +39,12 @@ tv.danmaku.ijk.media.player_arm64 ...@@ -38,6 +39,12 @@ tv.danmaku.ijk.media.player_arm64
android:launchMode="singleTask" android:launchMode="singleTask"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/CourseTheme" /> android:theme="@style/CourseTheme" />
<activity
android:name=".coursePlay.AudioPlayActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/CourseTheme" />
<!--课程课后笔记列表--> <!--课程课后笔记列表-->
<activity <activity
android:name=".coursePlay.CourseReplyListActivity" android:name=".coursePlay.CourseReplyListActivity"
......
...@@ -60,6 +60,6 @@ public class CourseActivity extends BaseActivity { ...@@ -60,6 +60,6 @@ public class CourseActivity extends BaseActivity {
@Override @Override
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
PlayerFloatHelper.Companion.onDestroy(); PlayerFloatHelper.Companion.removeResetView();
} }
} }
This diff is collapsed. Click to expand it.
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