Commit 82e6e82c by 王佳洋

Merge remote-tracking branch 'origin/d/v4.4.08' into feat/wjy/合规

# Conflicts:
#	build.gradle
#	m-consultant/src/main/java/com/yidianling/consultant/adapter/ExpertSearchAdapter.kt
#	m-dynamic/src/main/java/com/yidianling/dynamic/members/MembersActivity.java
#	m-muse/src/main/java/com/yidianling/muse/activity/PlayMeditationActivity.kt
parents 2c89a4bc 218bbcc6
......@@ -3,7 +3,6 @@ package com.ydl.component.base
import android.app.Application
import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Looper
import android.os.Process
......@@ -22,18 +21,15 @@ import com.ydl.component.MainActivity
import com.ydl.component.R
import com.ydl.ydlcommon.actions.crash.Cockroach
import com.ydl.ydlcommon.actions.crash.ExceptionHandler
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.base.config.YDLConstants
import com.ydl.ydlcommon.base.delegate.IAppLifecycles
import com.ydl.ydlcommon.utils.AppProgressUtils
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.YdlBuryPointUtil
import com.ydl.ydlcommon.utils.log.LogHelper
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.api.bean.IMInitConfigBean
import com.yidianling.im.config.NimApplication
import io.flutter.view.FlutterMain
import io.reactivex.functions.Action
/**
* Created by haorui on 2019-09-02.
......@@ -146,10 +142,7 @@ class DemoAppLifecycles : IAppLifecycles {
//开启友盟集成测试
UMConfigure.setLogEnabled(BuildConfig.DEBUG)
HttpConfig.getInstance().initSocketConfig(Action {
//数据埋点初始化 (一定要放在主进程中/因为用到了umeng统计,需要放在umeng初始化后)
YdlBuryPointUtil.init(application, true)
})
//安全检测
//YDLAppProtector.init();
......
......@@ -4,11 +4,10 @@ package com.ydl.component.base;
import android.content.Context;
import com.ydl.component.BuildConfig;
import com.ydl.ydlcommon.base.config.GlobalConfig;
import com.ydl.ydlcommon.base.config.IConfigModule;
import com.ydl.ydlcommon.base.config.YDLConstants;
import com.ydl.ydlcommon.base.delegate.IAppLifecycles;
import com.ydl.ydlcommon.base.config.GlobalConfig;
import com.ydl.ydlcommon.utils.YDLCacheUtils;
import org.jetbrains.annotations.NotNull;
......@@ -20,7 +19,7 @@ import java.util.List;
*/
public final class DemoGlobalConfig implements IConfigModule {
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_NEW_TEST;//配置未上传到maven库
......
......@@ -3,7 +3,6 @@ package com.ydl.component.rtc
import android.annotation.SuppressLint
import android.content.Intent
import android.graphics.Color
import android.os.Build
import android.os.Bundle
import android.text.TextUtils
import android.util.Log
......@@ -23,11 +22,9 @@ import com.ydl.component.rtc.bean.UserSigResponse
import com.ydl.component.rtc.http.MDTHttpImpl.Companion.getInstance
import com.ydl.ydlcommon.modular.ModularServiceManager.provide
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.service.IUserService
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import java.util.*
class MDTLoginActivity : AppCompatActivity() {
private var mEditUserId: EditText? = null
......@@ -157,16 +154,12 @@ class MDTLoginActivity : AppCompatActivity() {
}
private fun initStatusBar() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
val window = window
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE)
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
window.statusBarColor = Color.TRANSPARENT
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
}
val window = window
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE)
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
window.statusBarColor = Color.TRANSPARENT
}
companion object {
......
......@@ -4,7 +4,6 @@ import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
......@@ -63,16 +62,12 @@ public class MDTMainActivity extends AppCompatActivity {
}
private void initStatusBar() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
Window window = getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
}
private void login() {
......
......@@ -2,7 +2,6 @@ package com.ydl.component.rtc;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
......@@ -158,15 +157,11 @@ public class ProfileActivity extends AppCompatActivity {
}
private void initStatusBar() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
Window window = getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
}
}
......@@ -111,16 +111,12 @@ public class TUICallingEntranceActivity extends Activity {
}
private void initStatusBar() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
Window window = getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
}
private void initView() {
......@@ -401,11 +397,9 @@ public class TUICallingEntranceActivity extends Activity {
return;
}
//其他厂商
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
intent.setData(Uri.parse("package:" + getPackageName()));
startActivityForResult(intent, PERMISSION_RESULT_CODE);
}
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
intent.setData(Uri.parse("package:" + getPackageName()));
startActivityForResult(intent, PERMISSION_RESULT_CODE);
} else {
//已经有权限
PermissionUtil.mHasPermissionOrHasHinted = true;
......
......@@ -8,7 +8,7 @@ android {
defaultConfig {
applicationId "com.cxzapp.yidianling"
minSdk 21
minSdk 23
targetSdk 28
versionCode 1
versionName "1.0"
......@@ -64,15 +64,7 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
signingConfigs {
release {
storeFile file("keystore.jks")
storePassword "123456"
keyAlias "ydl"
keyPassword "123456"
}
}
productFlavors {
ydl{}
xlzx{}
......@@ -144,7 +136,7 @@ dependencies {
implementation 'com.huawei.hms:push:5.3.0.304'
//====================云信基础库====================
implementation 'com.ydl:nim-base:1.1.0.7'
implementation 'com.ydl:nim-base:1.1.1.2'
implementation 'com.netease.nimlib:basesdk:9.1.1'
implementation 'com.netease.nimlib:avchat:9.1.1'
implementation 'com.netease.nimlib:nrtc:9.1.1'
......
......@@ -5,7 +5,7 @@ buildscript {
ext {
kotlin_version = '1.6.10'
support_version = '26.1.0'
minSdkVersion = 21
minSdkVersion = 23
targetSdkVersion = 28
compileSdkVersion = 28
buildToolsVersion = '28.0.3'
......@@ -14,7 +14,7 @@ buildscript {
ydlrouter_version = '1.2.3'
constrait_support_version = '1.0.2'
componentVersion = "0.3.0.26-wjy-SNAPSHOT"
componentVersion = "0.3.0.42.2-SNAPSHOT"
}
repositories {
mavenCentral()
......
......@@ -16,7 +16,7 @@ ext {
android = [
compileSdkVersion: 28,
buildToolsVersion: "28.0.3",
minSdkVersion : 21,
minSdkVersion : 23,
targetSdkVersion : 28,
versionCode : 1000,
versionName : "1.0.00",
......@@ -131,8 +131,8 @@ ext {
"flowlayout" : "cn.lankton:flowlayout:3.1.0",
"androidanimations" : "com.daimajia.androidanimations:library:2.3@aar",
//友盟统计
"umeng-common" : "com.umeng.umsdk:common:9.3.8",
"umeng-asms" : "com.umeng.umsdk:asms:1.2.2",
"umeng-common" : "com.umeng.umsdk:common:9.5.1",
"umeng-asms" : "com.umeng.umsdk:asms:1.6.3",
//友盟社会化分享
"umeng-share-core" : "com.umeng.umsdk:share-core:7.1.4",
"umeng-share-qq" : "com.umeng.umsdk:share-qq:7.1.4",
......@@ -150,7 +150,6 @@ ext {
"bugly-nativecrashreport" : "com.tencent.bugly:nativecrashreport:3.6.0.1",
"ydl-image" : "com.ydl:ydl-image:1.0.10-SNAPSHOT@aar",
"ydl-pushagent" : "com.ydl:pushagent:0.1.1",
"ydl-notracepoint" : "com.ydl:notracepoint-lib:0.2.3.3@aar",
"ydl-js" : "com.ydl:ydl-js:1.0.7-SNAPSHOT@aar",
"ydl-router" : "com.ydl:ydl-router:1.4.4",
"xrecyclerview" : "com.ydl:xrecyclerview:1.0.0-SNAPSHOT@aar",
......@@ -160,15 +159,16 @@ ext {
"exoplayer" : "com.google.android.exoplayer:exoplayer:2.9.0",
"free_reflection" : "me.weishu:free_reflection:2.0.0",
"imagepicker" : "com.ydl:imagepicker:1.0.8.2",
"pictureselector" : "com.ydl:pictureselector:1.2.0",
"pictureselector" : "com.ydl:pictureselector:1.2.2",
"protector" : "com.ydl:protector:1.0.12@aar",
"blankUtil" : "com.blankj:utilcode:1.25.9",
"ydl-hnet" : "com.ydl:h-net:0.0.8",
"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.34",
//flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块
"ydl-flutter" : "com.ydl:ydl-flutter:0.0.56@aar", //flutter aar
"ydl-flutter" : "com.ydl:ydl-flutter:0.0.57@aar", //flutter aar
// "ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar
"tbssdk" : "com.tencent.tbs:tbssdk:44216"
]
}
......@@ -14,7 +14,6 @@ android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
......
......@@ -15,10 +15,7 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
// minSdkVersion rootProject.ext.android["minSdkVersion"]
// targetSdkVersion rootProject.ext.android["targetSdkVersion"]
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
......@@ -68,7 +65,7 @@ dependencies {
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
api "com.alibaba:arouter-api:$arouter_api"
api "com.ydl:ydl-av:1.4.4"
api "com.ydl:ydl-av:1.4.6"
implementation 'com.volcengine:apm_insight:1.4.6.cn'
api project(':ydl-platform')
......
......@@ -17,5 +17,7 @@
android:launchMode="singleTask"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
android:screenOrientation="portrait" />
<service android:name=".AudioService"/>
</application>
</manifest>
......@@ -55,7 +55,6 @@ import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.log.AliYunLogConfig
......@@ -234,7 +233,6 @@ class AudioHomeActivity :
private var canChangeRoute: Boolean = false
private var hasHandleRefused = false
private val notificationCallback = object : IMRegisterObserverCustomNotificationCallBack {
override fun onObserverCustomNotification(fromUid: String, toUid: String, content: String) {
if (fromUid == listenerUid) {
......@@ -530,7 +528,10 @@ class AudioHomeActivity :
writeAgoraLog("通话页面打开的时候,RTM登录状态码:${YDLavManager.sdkStatus}")
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.RTM, "通话页面打开的时候,RTM登录状态码:${YDLavManager.sdkStatus} channelId:${channelId}")
.sendRichLog(
AliYunLogConfig.RTM,
"通话页面打开的时候,RTM登录状态码:${YDLavManager.sdkStatus} channelId:${channelId}"
)
if (YDLavManager.sdkStatus != Constants.CONNECTION_STATE_CONNECTED) {
//再次登录声网,确保声网登录状态
reLoginRTM()
......@@ -548,18 +549,14 @@ class AudioHomeActivity :
private fun setWindowStatusBarColor() {
if (Build.VERSION.SDK_INT >= 21) {
val decorView = window.decorView
val option = (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE)
decorView.systemUiVisibility = option
window.statusBarColor = Color.TRANSPARENT
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
window.attributes?.layoutInDisplayCutoutMode =
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
}
} else {
StatusBarUtils.setWindowStatusBarColor(this, R.color.audioim_color_40353535)
val decorView = window.decorView
val option = (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE)
decorView.systemUiVisibility = option
window.statusBarColor = Color.TRANSPARENT
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
window.attributes?.layoutInDisplayCutoutMode =
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
}
}
......
package com.ydl.audioim
import android.app.*
import android.content.Context
import android.content.Intent
import android.os.Build
class AudioService : Service() {
override fun onCreate() {
val createNotification = createNotification(this)
startForeground(12001, createNotification)
}
override fun onBind(intent: Intent?) = null
private fun createNotification(context: Context): Notification = when {
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O -> {
// 创建消息渠道
val channel =
NotificationChannel("EasyFloat", "系统悬浮窗", NotificationManager.IMPORTANCE_MIN)
val manager =
context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
manager.createNotificationChannel(channel)
Notification.Builder(context, "EasyFloat")
.setCategory(Notification.CATEGORY_SERVICE)
}
Build.VERSION.SDK_INT >= Build.VERSION_CODES.N ->
Notification.Builder(context)
.setCategory(Notification.CATEGORY_SERVICE)
.setPriority(Notification.PRIORITY_MIN)
else -> Notification.Builder(context)
}
// .setSmallIcon(R.drawable.audioim_audio_home_img_answer)
// .setContentText("正在通话中")
// .setContentIntent(PendingIntent.getActivity(context, 0, Intent(context, MainActivity::class.java), 0))
.setAutoCancel(true)
.setOngoing(true)
.build()
}
\ No newline at end of file
......@@ -4,7 +4,6 @@ import android.content.Context
import android.media.AudioAttributes
import android.media.AudioManager
import android.media.MediaPlayer
import android.os.Build
/**
......@@ -23,14 +22,10 @@ class AudioPlayer {
this.mContext = mContext
mPlayer = MediaPlayer()
if (isSpeakerphoneOn) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
var attributes = AudioAttributes.Builder()
.setLegacyStreamType(AudioManager.STREAM_MUSIC)
.build()
mPlayer?.setAudioAttributes(attributes)
} else {
mPlayer?.setAudioStreamType(AudioManager.STREAM_MUSIC)
}
var attributes = AudioAttributes.Builder()
.setLegacyStreamType(AudioManager.STREAM_MUSIC)
.build()
mPlayer?.setAudioAttributes(attributes)
audioManager = mContext!!.getSystemService(Context.AUDIO_SERVICE) as AudioManager?
audioManager?.setStreamVolume(
......@@ -41,14 +36,10 @@ class AudioPlayer {
} else {
mPlayer?.setAudioStreamType(AudioManager.STREAM_VOICE_CALL)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
var attributes = AudioAttributes.Builder()
.setLegacyStreamType(AudioManager.STREAM_VOICE_CALL)
.build()
mPlayer?.setAudioAttributes(attributes)
} else {
mPlayer?.setAudioStreamType(AudioManager.STREAM_VOICE_CALL)
}
var attributes = AudioAttributes.Builder()
.setLegacyStreamType(AudioManager.STREAM_VOICE_CALL)
.build()
mPlayer?.setAudioAttributes(attributes)
audioManager = mContext!!.getSystemService(Context.AUDIO_SERVICE) as AudioManager?
audioManager?.setStreamVolume(
......
......@@ -498,7 +498,6 @@ class ConsultantAudioHomeActivity :
override fun initDataAndEvent() {
EventBus.getDefault().register(this)
callEventSave("30", "进入接听界面")
//状态栏颜色
setWindowStatusBarColor()
//点亮屏幕 并解锁
......
......@@ -14,7 +14,6 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
......@@ -53,7 +52,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
......@@ -61,7 +60,6 @@ dependencies {
implementation 'com.daimajia.androidanimations:library:2.3@aar'
api 'fr.tvbarthel.blurdialogfragment:lib:2.1.5'
api "com.alibaba:arouter-api:$arouter_api"
api 'com.tencent.tbs.tbssdk:sdk:43903'
// 注意此处的依赖方式:kotlin中使用和java中使用方式有不同
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
implementation 'com.alibaba:fastjson:1.2.38'
......
......@@ -5,7 +5,6 @@ import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.net.Uri
import android.os.Build
import android.text.TextUtils
import android.view.View
import android.view.ViewGroup
......@@ -310,12 +309,10 @@ class ConfideHomeActivity :
* 初始化状态栏位置
*/
private fun initStatusBar() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
window?.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
window?.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
window?.statusBarColor = Color.WHITE
window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
}
window?.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
window?.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
window?.statusBarColor = Color.WHITE
window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
}
/**
......
package com.ydl.confide.home.widget
import android.content.Context
import android.os.Build
import androidx.cardview.widget.CardView
import androidx.recyclerview.widget.RecyclerView
import android.text.TextUtils
import android.view.View
import android.view.ViewGroup
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydl_image.transform.GlideRoundTransform
import com.yidianling.common.tools.RxImageTool
import androidx.cardview.widget.CardView
import androidx.recyclerview.widget.RecyclerView
import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.event.IConfideHomeEvent
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydl_image.transform.GlideRoundTransform
import com.yidianling.common.tools.RxImageTool
import kotlinx.android.synthetic.main.confide_recent_view.view.*
/**
......@@ -46,9 +45,7 @@ class ConfideHomeRecentView(mContext: Context, private var confideHomeEvent: ICo
params.setMargins(dp15, RxImageTool.dip2px(28f), dp15, RxImageTool.dip2px(24f))
radius = RxImageTool.dip2px(23f).toFloat()
layoutParams = params
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
elevation = RxImageTool.dip2px(1f).toFloat()
}
elevation = RxImageTool.dip2px(1f).toFloat()
}
/**
......
package com.ydl.confide.intro
import android.graphics.Color
import android.os.Build
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
......@@ -64,16 +63,14 @@ class ExpertIntroActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
ARouter.getInstance().inject(this)
binding = DataBindingUtil.setContentView(this, R.layout.activity_expert_intro)
if (Build.VERSION.SDK_INT >= 21) {
val decorView = window.decorView
val option = (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE)
decorView.systemUiVisibility = option
window.statusBarColor = Color.TRANSPARENT
}
val decorView = window.decorView
val option = (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE)
decorView.systemUiVisibility = option
window.statusBarColor = Color.TRANSPARENT
if (initData != null) {
val beans = JSON.parseArray(initData, ConfideHomeBodyBean::class.java)
val isLogin = findRouteService(IUserService::class.java).isLogin()
val isLogin = findRouteService(IUserService::class.java).isLogin()
val vms = beans.map {
VideoViewModel().mapOf(it).apply { showFreeTag.set(!isLogin) }
}
......
......@@ -39,7 +39,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
......
......@@ -7,17 +7,22 @@
android:name=".ExpertSearchActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/consultant_NoTitleTheme"/>
android:theme="@style/consultant_NoTitleTheme" />
<activity
android:name=".ExpertEightCategoryActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/consultant_NoTitleTheme" />
<activity
android:name=".HotSearchActivity"
android:screenOrientation="portrait"
android:theme="@style/consultant_NoTitleTheme"/>
android:theme="@style/consultant_NoTitleTheme" />
<activity
android:name=".ConsultAssistantCenterActivity"
android:screenOrientation="portrait"
android:theme="@style/consultant_Transparent"/>
android:theme="@style/consultant_Transparent" />
<activity android:name=".preview.GridPreviewActivity"
android:screenOrientation="portrait"
......
package com.yidianling.consultant
import android.annotation.SuppressLint
import android.view.WindowManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.model.bean.ChildrenBean
import com.yidianling.consultant.router.ConsultantIn
import com.yidianling.consultant.ui.view.topView.EightCategoryView
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.consultant_layout_eight_category.*
import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.*
@Route(path = "/consult/eightcategory")
class ExpertEightCategoryActivity : BaseActivity() {
override fun layoutResId(): Int {
return R.layout.consultant_layout_eight_category
}
override fun getStatusViewOptions(): StatusBarOptions {
return StatusBarOptions(true, true)
}
@SuppressLint("CheckResult")
override fun initDataAndEvent() {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE or WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN)
showProgressDialog()
SearchApi.getSearchApi()
.searchEightCategoryHotWord()
.compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ resp ->
dismissProgressDialog()
var mutableList = mutableListOf<MutableList<ChildrenBean>>()
resp.forEach {
it.children?.let { it1 -> mutableList.add(it1) }
}
mutableList.forEachIndexed { index, item ->
item.forEachIndexed { inin, childrenBean ->
if (inin < 8) {
childrenBean.isVisible = true
}
if (inin == 8) {
return@forEachIndexed
}
}
}
val eightCategoryView = EightCategoryView(this, true)
eightCategoryView.setData(mutableList, null, null, true)
eight_view_ll.addView(eightCategoryView)
}, { t ->
dismissProgressDialog()
})
btn_back.setOnClickListener {
onBackPressed()
}
btn_call.setOnClickListener {
ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_ONLINE_CUSTOMER_CLICK)
ConsultantIn.startP2PXiaoYi(this)
}
tv_guide.setOnClickListener {
ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_CONSULT_GUIDE_CLICK)
val h5param = H5Params(HttpConfig.H5_URL + "help/consultation/", "咨询指南")
h5param.isShowMenu = true
NewH5Activity.start(this, h5param)
}
rl_search.setOnClickListener {
ActionCountUtils.count(
ConsultBIConstants.ConsultEvent.YDL_USER_CONSULT_SEARCH_CLICK,
tv_search_content.hint.toString()
)
ARouter.getInstance()
.build("/consult/hot_search")
.withString(
ExpertSearchActivity.HOT_SEARCH_DOCTOR_NAME,
tv_search_content.text.toString()
)
.navigation()
}
}
}
\ No newline at end of file
......@@ -8,6 +8,7 @@ import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.base.SimplePresenter
import com.ydl.ydlcommon.utils.AnimUtils
import com.ydl.ydlcommon.utils.RxLifecycleUtils
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.yidianling.common.tools.RxAppTool
......@@ -63,7 +64,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
}
@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"
......@@ -75,8 +76,13 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
filterMap["__keywords"] = allFilter.searchWord
}
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 categoryIdMap2 = HashMap<String, Any>()
categoryIdMap2["in"] = allFilter.categoryId2List.toSortedSet().toList()
......@@ -84,7 +90,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
categoryList.add(categoryMap2)
}
// 八大类二级标签
if (allFilter.categoryId3List.size>0){
if (allFilter.categoryId3List.size > 0) {
val categoryMap3 = HashMap<String, Any>()
val categoryIdMap3 = HashMap<String, Any>()
categoryIdMap3["in"] = allFilter.categoryId3List.toSortedSet().toList()
......@@ -121,6 +127,9 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
}
if (allFilter.sub.code != null&&allFilter.sub.code!=allFilter.region.code) {
filterMap["city_code"] = allFilter.sub.code
if (allFilter.sub.provinceCode.isNotEmpty()) {
filterMap["province_code"] = allFilter.sub.provinceCode
}
}
}
// 咨询方式
......@@ -197,13 +206,13 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
}
}
}
if (gender.size>0){
if (gender.size > 0) {
val genderMap = HashMap<String, Any>()
genderMap["in"] = gender
filterMap["gender"] = genderMap
}
}
map["filter"] = filterMap
// sorts
if (allFilter.reorder.key != null) {
......
......@@ -33,6 +33,7 @@ import com.yidianling.consultant.api.IConsultantService
import com.yidianling.consultant.bean.*
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.YDL_USER_CONSULT_SEARCH_CONFIRM_CLICK
import com.yidianling.consultant.contract.IHotSearchContract
import com.yidianling.consultant.model.bean.FunctionWordBean
import com.yidianling.consultant.modular.utils.ConsultAssistantEntryUtils
......@@ -110,6 +111,12 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
}
etSearch.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
//埋点
ActionCountUtils.count(
YDL_USER_CONSULT_SEARCH_CONFIRM_CLICK,
etSearch.text.toString(),
etSearch.hint.toString()
)
// 搜索的关联词
var relatedWords = ""
var isRecommendWords = false
......
package com.yidianling.consultant.adapter
import android.annotation.SuppressLint
import android.content.Context
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.yidianling.consultant.R
import com.yidianling.consultant.model.bean.ChildrenBean
import com.yidianling.consultant.model.bean.EightCategoryBean
import kotlinx.android.synthetic.main.consultant_layout_category_view.*
import kotlinx.android.synthetic.main.eight_category_detail_list_item.view.*
import kotlinx.android.synthetic.main.eight_category_list_item.view.*
/**
* Created by zqk on 17-9-20.
*/
class CategoryDetailAdapter(
private val context: Context,
private val categoryDetailList: MutableList<MutableList<ChildrenBean>>,
private val categoryNamelList: MutableList<EightCategoryBean>,
) : RecyclerView.Adapter<CategoryDetailAdapter.ViewHolder>() {
lateinit var outAdapterClicklistener: OutAdapterClicklistener
override fun getItemCount(): Int = categoryNamelList.size
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val itemView =
LayoutInflater.from(context)
.inflate(R.layout.eight_category_detail_list_item, parent, false)
return ViewHolder(itemView)
}
override fun onBindViewHolder(holder: ViewHolder, @SuppressLint("RecyclerView") position: Int) {
holder.category_name.text = categoryNamelList[position].string
val eightCategoryAdapter = CategoryDetailTextAdapter(context, categoryDetailList[position])
eightCategoryAdapter.setOnClick(object :
CategoryDetailTextAdapter.TextAdapterOnclickListener {
override fun textOnClick(textPosition: Int) {
outAdapterClicklistener.outAdapterClick(position, textPosition)
}
})
if (categoryDetailList[position].size > 9) {
holder.collapse_hide.visibility = View.VISIBLE
holder.arrow_collapse_hide.visibility = View.VISIBLE
} else {
holder.collapse_hide.visibility = View.GONE
holder.arrow_collapse_hide.visibility = View.GONE
}
if (categoryNamelList[position].collapse) {
eightCategoryAdapter.setAllVisible()
holder.collapse_hide.text = "收起"
holder.arrow_collapse_hide.background =
context.resources.getDrawable(R.drawable.consult_hide_arrow)
} else {
eightCategoryAdapter.setGone()
holder.collapse_hide.text = "展开"
holder.arrow_collapse_hide.background =
context.resources.getDrawable(R.drawable.consult_collapse_arrow)
}
holder.collapse_hide.setOnClickListener {
if (categoryNamelList[position].collapse) {
//显示 展开
categoryNamelList[position].collapse = false
holder.collapse_hide.text = "展开"
holder.arrow_collapse_hide.background =
context.resources.getDrawable(R.drawable.consult_collapse_arrow)
eightCategoryAdapter.setGone()
} else {
//显示收起
categoryNamelList[position].collapse = true
holder.collapse_hide.text = "收起"
holder.arrow_collapse_hide.background =
context.resources.getDrawable(R.drawable.consult_hide_arrow)
eightCategoryAdapter.setAllVisible()
}
}
holder.category_list_detail.layoutManager = GridLayoutManager(context, 3)
holder.category_list_detail.adapter = eightCategoryAdapter
}
interface OutAdapterClicklistener {
fun outAdapterClick(outPosition: Int, inPosition: Int)
}
fun setOutClicklistener(listener: OutAdapterClicklistener) {
this.outAdapterClicklistener = listener
}
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val category_name = itemView.category_name
val category_list_detail = itemView.category_list_detail
val collapse_hide = itemView.collapse_hide
val arrow_collapse_hide = itemView.arrow_collapse_hide
}
}
\ No newline at end of file
package com.yidianling.consultant.adapter
import android.annotation.SuppressLint
import android.content.Context
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.yidianling.consultant.R
import com.yidianling.consultant.model.bean.ChildrenBean
import kotlinx.android.synthetic.main.consultant_layout_category_view.*
import kotlinx.android.synthetic.main.eight_category_detail_item_item.view.*
import kotlinx.android.synthetic.main.eight_category_detail_list_item.view.*
import kotlinx.android.synthetic.main.eight_category_list_item.view.*
/**
* Created by zqk on 17-9-20.
*/
class CategoryDetailTextAdapter(
private val context: Context,
private val categoryDetailList: MutableList<ChildrenBean>,
) : RecyclerView.Adapter<CategoryDetailTextAdapter.ViewHolder>() {
var isVisible = false
lateinit var textAdapterOnclickListener: TextAdapterOnclickListener
override fun getItemCount(): Int = categoryDetailList.size
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val itemView =
LayoutInflater.from(context)
.inflate(R.layout.eight_category_detail_item_item, parent, false)
return ViewHolder(itemView)
}
@SuppressLint("UseCompatLoadingForDrawables")
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
var param = RecyclerView.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
);
if (categoryDetailList[position].isVisible) {
param.height = ViewGroup.LayoutParams.WRAP_CONTENT
param.width = ViewGroup.LayoutParams.MATCH_PARENT
param.setMargins(0, 0, 10, 10)
holder.itemView.visibility = View.VISIBLE
} else {
param.height = 0
param.width = 0
holder.itemView.visibility = View.GONE;
}
holder.itemView.layoutParams = param
holder.category_name_detail.text = categoryDetailList[position].cate_name
holder.category_name_detail.isSelected = categoryDetailList[position].isSelected
if (categoryDetailList[position].isSelected) {
holder.category_name_detail.setTextColor(context.resources.getColor(R.color.platform_main_theme))
holder.category_name_detail.background =
context.getDrawable(R.drawable.consult_price_expert_selected)
} else {
holder.category_name_detail.background =
context.getDrawable(R.drawable.consult_price_expert_unseleted)
holder.category_name_detail.setTextColor(context.resources.getColor(R.color.platform_color_333333))
}
holder.itemView.setOnClickListener {
textAdapterOnclickListener.textOnClick(position)
}
}
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val category_name_detail = itemView.category_name_detail
}
interface TextAdapterOnclickListener {
fun textOnClick(position: Int)
}
fun setOnClick(adapterOnclickListener: TextAdapterOnclickListener) {
this.textAdapterOnclickListener = adapterOnclickListener
}
fun setAllVisible() {
categoryDetailList.forEach { bean ->
bean.isVisible = true
}
notifyDataSetChanged()
isVisible = true
}
fun setGone() {
categoryDetailList.forEachIndexed { index, bean ->
if (index > 8) {
bean.isVisible = false
}
}
notifyDataSetChanged()
isVisible = false
}
}
\ No newline at end of file
package com.yidianling.consultant.adapter
import android.annotation.SuppressLint
import android.content.Context
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import com.yidianling.consultant.R
import com.yidianling.consultant.model.bean.EightCategoryBean
import kotlinx.android.synthetic.main.eight_category_list_item.view.*
/**
* Created by zqk on 17-9-20.
*/
class EightCategoryAdapter(
private val context: Context,
private val eightCateList: MutableList<EightCategoryBean>,
private val singleMultiple: Boolean
) : RecyclerView.Adapter<EightCategoryAdapter.ViewHolder>() {
lateinit var onLeftClickListener: OnLeftClickListener
override fun getItemCount(): Int = eightCateList.size
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val itemView =
LayoutInflater.from(context).inflate(R.layout.eight_category_list_item, parent, false)
return ViewHolder(itemView)
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.eight_name.text = eightCateList[position].string
holder.itemView.setOnClickListener {
onLeftClickListener.onLeftClick(position)
}
if (eightCateList[position].selected) {
holder.itemView.setBackgroundColor(ContextCompat.getColor(context, R.color.white))
holder.eight_name.setTextColor(
ContextCompat.getColor(
context,
R.color.platform_main_theme
)
)
if (singleMultiple) {
holder.single_selected_tag.visibility = View.VISIBLE
} else {
holder.single_selected_tag.visibility = View.INVISIBLE
}
} else {
holder.eight_name.setTextColor(
ContextCompat.getColor(
context,
R.color.platform_color_242424
)
)
holder.single_selected_tag.visibility = View.INVISIBLE
holder.itemView.setBackgroundColor(
ContextCompat.getColor(
context,
R.color.platform_color_F7F7F7
)
)
}
if (eightCateList[position].hasData) {
holder.multiple_choise.visibility = View.VISIBLE
} else {
holder.multiple_choise.visibility = View.INVISIBLE
}
}
interface OnLeftClickListener {
fun onLeftClick(leftPosition: Int)
}
fun setleftClick(leftListener: OnLeftClickListener) {
this.onLeftClickListener = leftListener
}
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val eight_name = itemView.eight_name
val multiple_choise = itemView.multiple_choise
val single_selected_tag = itemView.single_selected_tag
}
}
\ No newline at end of file
......@@ -42,7 +42,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_footer.view.*
import kotlinx.android.synthetic.main.consultant_item_tag.view.*
import kotlinx.android.synthetic.main.consultant_layout_search_content.*
import java.math.BigDecimal
/**
......
......@@ -16,7 +16,8 @@ import kotlinx.android.synthetic.main.consultant_item_region.view.*
* 省份列表适配器
* 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>() {
var onItemClickListener: MyBaseAdapter.OnItemClickListener<RegionItem>? = null
......@@ -29,11 +30,14 @@ class RegionRecyclerViewAdapter(val context: Context, val regionList: ArrayList<
holder.itemView.tvRegionName.setTypeface(Typeface.DEFAULT_BOLD)
holder.itemView.tvRegionName.setTextColor(context.resources.getColor(R.color.platform_main_theme))
holder.itemView.view_select.visibility = View.VISIBLE
holder.itemView.setBackgroundColor(context.resources.getColor(R.color.white))
} else {
//未选中状态
holder.itemView.tvRegionName.setTypeface(Typeface.DEFAULT)
holder.itemView.tvRegionName.setTextColor(context.resources.getColor(R.color.platform_default_text_color))
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
/**
* 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
init {
......@@ -19,25 +20,37 @@ class SortAdapter(data: List<ChildrenBean>) : BaseMultiItemQuickAdapter<Children
}
override fun convert(holder: BaseViewHolder, item: ChildrenBean) {
when(holder.itemViewType){
1 ->{
holder.setGone(R.id.ll_sort_item,item.isVisible)
when (holder.itemViewType) {
1 -> {
holder.setGone(R.id.ll_sort_item, item.isVisible)
holder.setText(R.id.tv_sort_name, item.cate_name)
holder.getView<TextView>(R.id.tv_sort_name).isSelected = item.isSelected
if (item.isSelected){
holder.setTextColor(R.id.tv_sort_name,ContextCompat.getColor(mContext,R.color.platform_main_theme))
}else{
holder.setTextColor(R.id.tv_sort_name,ContextCompat.getColor(mContext,R.color.platform_color_242424))
if (item.isSelected) {
holder.setTextColor(
R.id.tv_sort_name,
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->{
holder.setGone(R.id.ll_sort_item,item.isVisible)
2 -> {
holder.setGone(R.id.ll_sort_item, item.isVisible)
holder.setText(R.id.tv_sort_name, item.cate_name)
holder.getView<TextView>(R.id.tv_sort_name).isSelected = item.isSelected
if (item.isSelected){
holder.setTextColor(R.id.tv_sort_name,ContextCompat.getColor(mContext,R.color.platform_main_theme))
}else{
holder.setTextColor(R.id.tv_sort_name,ContextCompat.getColor(mContext,R.color.platform_color_242424))
if (item.isSelected) {
holder.setTextColor(
R.id.tv_sort_name,
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
/**
* 设置大于第12个之后的标签全部显示
*/
fun setAllVisible(){
fun setAllVisible() {
mData.forEach { bean ->
bean.isVisible = true
}
......@@ -58,9 +71,9 @@ class SortAdapter(data: List<ChildrenBean>) : BaseMultiItemQuickAdapter<Children
/**
* 设置大于第12个之后的标签全部隐藏
*/
fun setGone(){
fun setGone() {
mData.forEachIndexed { index, bean ->
if (index>12){
if (index > 12) {
bean.isVisible = false
}
}
......
......@@ -16,31 +16,81 @@ import kotlinx.android.synthetic.main.consultant_item_consult_type.view.*
* 城市列表适配器
* 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
private lateinit var mOnAuthClickLister: OnAuthClickLister
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val subItem = subList[position]
holder.itemView.tvConsultTypeName.text = subItem.value
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 {
if (subItem.locationCode == locationCode) {
holder.itemView.reLocation.visibility = View.GONE
holder.itemView.location_img.visibility = View.VISIBLE
holder.itemView.location_img.drawable.setTint(context.resources.getColor(R.color.platform_color_black_333333))
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.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 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)
}
interface OnAuthClickLister {
fun onAuthClick()
}
fun setOnAuthClickLister(lister: OnAuthClickLister) {
mOnAuthClickLister = lister
}
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
init {
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 {
const val POSITION_YDL_USER_ASSOCIATE_WORD_CLICK="ydl_user_associate_word_click" // 联想词点击position
// 咨询师列表页 banner 点击事件
const val POSITION_CONSULT_COUNSELOR_LIST_BANNER_CLICK = "consult_counselor_list_banner_click"
}
//====================APP咨询列表页(app_consult_list_page)====================
......@@ -57,7 +58,8 @@ class ConsultBIConstants {
APP_CONSULT_LIST_PAGE + "ydl_user_consult_search_click"//咨询师页搜索框点击事件
const val YDL_USER_CONSULT_TYPE_CLICK: String =
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 =
"consult_counselor_card_click" // 咨询师列表点击position
const val POSITION_CHOICE_FILTER_CLICK =
......@@ -68,6 +70,16 @@ class ConsultBIConstants {
"goodat_crowd_click" // 擅长人群埋点
const val 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"
const val PRICE_TYPE_CLICK = "$CONSULT_FILTER_PRICE_PAGE|price_type_click"
}
}
class ConsultSearchListEvent {
......@@ -94,4 +106,32 @@ class ConsultBIConstants {
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"
}
}
class Experts {
companion object {
//part_id
const val EXPERTS_DETAIL = "ydl_experts_detail|"
//2.专家主页_背景图私聊点击 sign1: 咨询师id
const val EXPERT_BANNER_PRIVATE_CHAT_CLICK =
EXPERTS_DETAIL + "expert_banner_private_chat_click"
//3.专家主页_背景图预约点击 sign1: 咨询师id
const val EXPERT_BANNER_IMMEDIATELY_BOOKING_CLICK = EXPERTS_DETAIL +
"expert_banner_immediately_booking_click"
//3.专家主页_背景图预约点击 sign1: 咨询师id
const val BOOKING_PRODUCT_POPUP_PAGE_CLICK = EXPERTS_DETAIL +
"booking_product_popup_page_click"
}
}
}
\ No newline at end of file
......@@ -13,11 +13,6 @@ import android.view.View
import android.view.WindowManager
import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.drawee.interfaces.DraweeController
import com.facebook.imagepipeline.common.ResizeOptions
import com.facebook.imagepipeline.common.RotationOptions
import com.facebook.imagepipeline.postprocessors.IterativeBoxBlurPostProcessor
import com.facebook.imagepipeline.request.ImageRequest
import com.facebook.imagepipeline.request.ImageRequestBuilder
import com.yidianling.common.tools.RxImageTool
import com.yidianling.consultant.R
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
......@@ -33,7 +28,6 @@ class ConsultAssistantDialog(
mContext: Context,
val consultAssistantClickListener: OnConsultAssistantClickListener?
) : Dialog(mContext, R.style.consultant_expert_dialog_default_style) {
private var animate: ObjectAnimator? = null
private var minWidth: Int? = null
......@@ -41,16 +35,16 @@ class ConsultAssistantDialog(
super.onCreate(savedInstanceState)
setContentView(R.layout.consultant_expert_consult_assistant_popup_window)
val params = window.attributes
params.width = WindowManager.LayoutParams.WRAP_CONTENT
params.height = WindowManager.LayoutParams.WRAP_CONTENT
params.gravity = Gravity.RIGHT + Gravity.BOTTOM
params.verticalMargin = 0.07f
params.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE //不拦截外部点击事件
window.attributes = params
window.setDimAmount(0f)
val params = window?.attributes
params?.width = WindowManager.LayoutParams.WRAP_CONTENT
params?.height = WindowManager.LayoutParams.WRAP_CONTENT
params?.gravity = Gravity.RIGHT + Gravity.BOTTOM
params?.verticalMargin = 0.07f
params?.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE //不拦截外部点击事件
window?.attributes = params
window?.setDimAmount(0f)
window.setWindowAnimations(R.style.consultant_expert_consult_assistant_dialog_animate)
window?.setWindowAnimations(R.style.consultant_expert_consult_assistant_dialog_animate)
if (!ConsultAssistantDialogUtils.INSTANCE.canShowDesc()) {
consultant_assistant_dialog_desc_ll.visibility = View.GONE
......@@ -84,12 +78,14 @@ class ConsultAssistantDialog(
}
override fun onAnimationEnd(animation: Animator?) {
ConsultAssistantDialogUtils.INSTANCE.setDescHide()
hide()
// show()
Handler().postDelayed({
show()
}, 10)
if (ownerActivity != null) {
ConsultAssistantDialogUtils.INSTANCE.setDescHide()
hide()
Handler().postDelayed({
show()
}, 10)
}
}
override fun onAnimationCancel(animation: Animator?) {
......@@ -130,21 +126,21 @@ class ConsultAssistantDialog(
// 刷新dialog布局,减小拦截点击区域
fun refreshDialogLayout(width: Int) {
val params = window.attributes
val params = window?.attributes
if (width != 0) {
minWidth = width
minWidth = if (width != 0) {
width
} else {
minWidth = (RxImageTool.dp2px(60f) * 1.5).toInt()
(RxImageTool.dp2px(60f) * 1.5).toInt()
}
params.width = minWidth!!
params.height = WindowManager.LayoutParams.WRAP_CONTENT
params.gravity = Gravity.RIGHT + Gravity.BOTTOM
params.verticalMargin = 0.07f
params.horizontalMargin = 0.01f
window.setWindowAnimations(0)
window.attributes = params
params?.width = minWidth
params?.height = WindowManager.LayoutParams.WRAP_CONTENT
params?.gravity = Gravity.RIGHT + Gravity.BOTTOM
params?.verticalMargin = 0.07f
params?.horizontalMargin = 0.01f
window?.setWindowAnimations(0)
window?.attributes = params
}
interface OnConsultAssistantClickListener {
......
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
......@@ -7,10 +7,7 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.consultant.bean.*
import com.yidianling.consultant.model.bean.ExpertBean
import com.yidianling.consultant.model.bean.FunctionWordBean
import com.yidianling.consultant.model.bean.HeadData
import com.yidianling.consultant.model.bean.PromptPaymentBean
import com.yidianling.consultant.model.bean.*
import io.reactivex.Observable
import retrofit2.http.*
......@@ -42,6 +39,11 @@ interface SearchApi {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun searchConditions(@Query("cateSource") cateSource: Int): Observable<BaseAPIResponse<HeadData>>
//查询八大类目包括
@GET("consult/search/v3/mix-cates")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun searchEightCategoryHotWord(): Observable<BaseAPIResponse<MutableList<CateItem>>>
//查询功能词、底纹词
//(1热门词,2底纹词,3跳转词)
@POST("function/word/queryList")
......@@ -106,12 +108,17 @@ interface SearchApi {
* 100 有配置接口
* */
@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(
@Query("location") location: Int,
@Query("naviType") naviType: String = "1"
): 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")
......
......@@ -8,45 +8,47 @@ import android.widget.TextView
* Created by zqk on 17-9-20.
*/
data class AllFilter(
var searchWord: String? = null,
val categories: ArrayList<CateItem> = ArrayList(), //主题
var reorder: ReorderItem = ReorderItem(), //排序
var region: RegionItem = RegionItem(), //省
var sub: SubItem = SubItem(), //市
var showType: ShowTypeItem = ShowTypeItem(), //显示方式
val enquiries: ArrayList<EnquiryItem> = ArrayList(), //咨询方式
var priceRanges: PriceRangesItem ?= null, //服务均价
var priceRangesView: TextView ?= null, //服务均价
val ages: ArrayList<AgeItem> = ArrayList(), //年龄
val doctorEdu: ArrayList<DoctorEduItem> = ArrayList(), //学历
val others: ArrayList<OtherItem> = ArrayList(),//其他筛选
val title:ArrayList<ReorderItem> = ArrayList(), //资质
val specialityCrowd:ArrayList<SpecialityCrowdBean> = ArrayList(), // 擅长人群
// 八大类标签集合
val childList:ArrayList<ChildrenBean> = ArrayList(), // 亲子教育
val stressList:ArrayList<ChildrenBean> = ArrayList(), // 情绪压力
val loveEmotionList:ArrayList<ChildrenBean> = ArrayList(), // 恋爱情感
val marriedFamilyList:ArrayList<ChildrenBean> = ArrayList(), // 婚姻家庭
val personalGrowthList:ArrayList<ChildrenBean> = ArrayList(), // 个人成长
val interpersonalRelationshipList:ArrayList<ChildrenBean> = ArrayList(), // 人际关系
val careerDevelopmentList:ArrayList<ChildrenBean> = ArrayList(), // 职场发展
val mentalHealthList:ArrayList<ChildrenBean> = ArrayList(), // 心理健康
var searchWord: String? = null,
val categories: ArrayList<CateItem> = ArrayList(), //主题
var reorder: ReorderItem = ReorderItem(), //排序
var region: RegionItem = RegionItem(), //省
var sub: SubItem = SubItem(), //市
var showType: ShowTypeItem = ShowTypeItem(), //显示方式
val enquiries: ArrayList<EnquiryItem> = ArrayList(), //咨询方式
var priceRanges: PriceRangesItem? = null, //服务均价
var priceRangesView: TextView? = null, //服务均价
var sortRangesView: TextView? = null, //排序均价
val ages: ArrayList<AgeItem> = ArrayList(), //年龄
val sorStyle: ArrayList<ReorderItem> = ArrayList(), //排序方式
val doctorEdu: ArrayList<DoctorEduItem> = ArrayList(), //学历
val others: ArrayList<OtherItem> = 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 marriedFamilyList:ArrayList<ChildrenBean> = ArrayList(), // 婚姻家庭
val personalGrowthList:ArrayList<ChildrenBean> = ArrayList(), // 个人成长
val interpersonalRelationshipList:ArrayList<ChildrenBean> = ArrayList(), // 人际关系
val careerDevelopmentList:ArrayList<ChildrenBean> = ArrayList(), // 职场发展
val mentalHealthList:ArrayList<ChildrenBean> = ArrayList(), // 心理健康
// 八大类已选中标签id集合
val categoryId2List:ArrayList<String> = ArrayList(), // 一级类目id集合
val categoryId3List:ArrayList<String> = ArrayList(), // 二级类目id集合
val categoryId2List:ArrayList<String> = ArrayList(), // 一级类目id集合
val categoryId3List:ArrayList<String> = ArrayList(), // 二级类目id集合
// 八大类选中下标集合,重置的时候可以减少循坏,提升性能
val chooseChildIndexList:ArrayList<Int> = ArrayList(),
val chooseStressIndexList:ArrayList<Int> = ArrayList(),
val chooseLoveEmotionIndexList:ArrayList<Int> = ArrayList(),
val chooseMarriedFamilyIndexList:ArrayList<Int> = ArrayList(),
val choosePersonalGrowthIndexList:ArrayList<Int> = ArrayList(),
val chooseInterpersonalRelationshipIndexList:ArrayList<Int> = ArrayList(),
val chooseCareerDevelopmentIndexList:ArrayList<Int> = ArrayList(),
val chooseMentalHealthIndexList:ArrayList<Int> = ArrayList()
val chooseChildIndexList:ArrayList<Int> = ArrayList(),
val chooseStressIndexList:ArrayList<Int> = ArrayList(),
val chooseLoveEmotionIndexList:ArrayList<Int> = ArrayList(),
val chooseMarriedFamilyIndexList:ArrayList<Int> = ArrayList(),
val choosePersonalGrowthIndexList:ArrayList<Int> = ArrayList(),
val chooseInterpersonalRelationshipIndexList:ArrayList<Int> = ArrayList(),
val chooseCareerDevelopmentIndexList:ArrayList<Int> = ArrayList(),
val chooseMentalHealthIndexList:ArrayList<Int> = ArrayList()
)
\ No newline at end of file
package com.yidianling.consultant.model.bean
data class EightCategoryBean(
val string: String,
var collapse: Boolean = false,
var selected: Boolean = false,
var hasData: Boolean = false
)
\ No newline at end of file
package com.yidianling.consultant.model.bean
import android.os.Parcelable
import com.google.gson.annotations.SerializedName
import kotlinx.android.parcel.Parcelize
@Parcelize
data class SubItem(
@field:SerializedName("value")
var value: String? = null,
@field:SerializedName("value")
var value: String? = null,
@field:SerializedName("key")
var key: String? = null,
@field:SerializedName("key")
var key: String? = null,
@field:SerializedName("code")
var code: String?=null
)
\ No newline at end of file
@field:SerializedName("code")
var code: String? = null,
var locationCode: String? = "",
var provinceCode: String = ""
) : Parcelable
\ No newline at end of file
......@@ -8,9 +8,7 @@ import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.YdlBuryPointUtil
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlnet.YDLHttpUtils.Companion.obtainApi
import com.yidianling.consultant.ConsultAssistantCenterActivity
......@@ -126,14 +124,12 @@ class ConsultAssistantDialogUtils private constructor() {
if (ConsultantIn.getUserImpl().isLogin()){
//获取用户uid
ActionCountUtils.count("main_page|main_daoyi_entry_click")
YdlBuryPointUtil.sendClick("home_page_assistant_click")
getConsultAssistantUid("", activity, 1)
}else{
ConsultantIn.getUserImpl().loginByOneKeyLoginCallBack(activity,true,object :LoginCallBackListener{
override fun loginSuccess() {
//获取用户uid
ActionCountUtils.count("main_page|main_daoyi_entry_click")
YdlBuryPointUtil.sendClick("home_page_assistant_click")
getConsultAssistantUid("", activity, 1)
}
override fun notLogin() {
......@@ -284,7 +280,6 @@ class ConsultAssistantDialogUtils private constructor() {
return@onClickAction
}
ActionCountUtils.count("app_consult_list_page|app_consult_list_daoyi_entry_click")
YdlBuryPointUtil.sendClick("assistant_list_click")
if (ConsultantIn.getUserImpl().isLogin()){
//获取用户uid
......@@ -316,7 +311,6 @@ class ConsultAssistantDialogUtils private constructor() {
return@onClickAction
}
ActionCountUtils.count("app_consult_list_page|app_consult_list_daoyi_entry_click")
YdlBuryPointUtil.sendClick("assistant_list_click")
// 咨询师列表页面且未登录情况下,跳转登录页面
if (ConsultantIn.loginByOneKeyLogin(activity, true)) {
//获取用户uid
......
......@@ -13,13 +13,14 @@ import androidx.fragment.app.FragmentStatePagerAdapter
import androidx.viewpager.widget.ViewPager
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.consultant.R
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.preview.GPreviewBuilder.IndicatorType
import com.yidianling.consultant.preview.SmoothImageView.onTransformListener
import com.yidianling.im.api.listener.ApiStringResponseCallback
import com.yidianling.im.api.service.IImService
import kotlinx.android.synthetic.main.consultant_image_preview_photo.*
import kotlinx.android.synthetic.main.fragment_image_photo_layout.*
import java.util.*
/**
......@@ -88,6 +89,7 @@ class GPreviewActivity : AppCompatActivity() {
titleBar = findViewById(R.id.titleBar)
chatBtn.setOnClickListener {
//私聊
if (!toUid.isNullOrBlank()) {
ModularServiceManager.provide(IImService::class.java)
.startChat(this@GPreviewActivity, toUid.toString(), 0x001, 0, 0, false)
......@@ -102,14 +104,32 @@ class GPreviewActivity : AppCompatActivity() {
}
}, 2000)
ActionCountUtils.count(
ConsultBIConstants.Experts.EXPERT_BANNER_PRIVATE_CHAT_CLICK,
toUid.toString()
)
}
}
bookingBtn.setOnClickListener {
ModularServiceManager.provide(IImService::class.java)
.showConsultServiceDialog(activity = this, toUid = toUid!!, doctorId = doctorId!!)
toUid?.let { toUid ->
doctorId?.let { doctorId ->
ModularServiceManager.provide(IImService::class.java)
.showConsultServiceDialog(
activity = this,
toUid = toUid,
doctorId = doctorId
)
}
ActionCountUtils.count(
ConsultBIConstants.Experts.EXPERT_BANNER_IMMEDIATELY_BOOKING_CLICK,
toUid
)
}
}
......
......@@ -17,7 +17,6 @@ package com.yidianling.consultant.preview;
*******************************************************************************/
import android.content.Context;
import android.os.Build;
/**
* @author rainb
......@@ -26,16 +25,8 @@ public final class VersionedGestureDetector {
public static GestureDetector newInstance(Context context,
OnGestureListener listener) {
final int sdkVersion = Build.VERSION.SDK_INT;
GestureDetector detector;
if (sdkVersion < Build.VERSION_CODES.ECLAIR) {
detector = new CupcakeGestureDetector(context);
} else if (sdkVersion < Build.VERSION_CODES.FROYO) {
detector = new EclairGestureDetector(context);
} else {
detector = new FroyoGestureDetector(context);
}
detector = new FroyoGestureDetector(context);
detector.setOnGestureListener(listener);
......
package com.yidianling.consultant.ui.view
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Region
import android.graphics.drawable.BitmapDrawable
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.LinearSnapHelper
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.PopupWindow
import com.tencent.mmkv.MMKV
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.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.R
import com.yidianling.consultant.adapter.RegionRecyclerViewAdapter
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.SubItem
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
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)
: PopupWindow(null, ViewGroup.LayoutParams.MATCH_PARENT, RxImageTool.dp2px(369f)) {
class AreaPopupWindow(
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 regionAdapter = RegionRecyclerViewAdapter(context, regionList, selectedRegion)
private var subAdapter:SubRecyclerViewAdapter
private var subAdapter: SubRecyclerViewAdapter
private var recentCityBean: ConsultantRecentCity? = ConsultantRecentCity(arrayListOf())
var onRegionSelectedListener: OnRegionSelectedListener? = null
private var subLocationItem: SubItem? = SubItem()
private val locationCode = "-1"
private var locationList: ArrayList<SubItem>? = arrayListOf()
private var locationHistoryList = regionList
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.isFocusable = true
@Suppress("DEPRECATION")
this.setBackgroundDrawable(BitmapDrawable())
this.isOutsideTouchable = true
this.height = ((RxDeviceTool.getScreenHeight(context) - RxImageTool.dp2px(90f)) * 0.618).toInt() //设置高度为屏幕的80%
if (selectedRegion.sub.isNotEmpty()){
this.height =
((RxDeviceTool.getScreenHeight(context) - RxImageTool.dp2px(90f)) * 0.618).toInt() //设置高度为屏幕的80%
regionAdapter.regionList = regionList
if (selectedRegion.sub.isNotEmpty()) {
subList.addAll(selectedRegion.sub)
}else{
} else {
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 =
LinearLayoutManager(
context,
......@@ -60,8 +116,8 @@ class AreaPopupWindow(val context: Context, regionList: ArrayList<RegionItem>, p
}
view.rvRegion.adapter = regionAdapter
val i = regionList
.takeWhile { it.key != selectedRegion.key }
.count()
.takeWhile { it.key != selectedRegion.key }
.count()
view.rvRegion.scrollToPosition(i)
......@@ -72,13 +128,78 @@ class AreaPopupWindow(val context: Context, regionList: ArrayList<RegionItem>, p
false
)
subAdapter.onItemClickListener = MyBaseAdapter.OnItemClickListener { _, _, data ->
saveCitySearchRecord(data)
selectedSub = data
ActionCountUtils.count(CITY_NAME_CLICK, data.value.toString())
onRegionSelectedListener?.onRegionSelected(selectedRegion, selectedSub)
}
view.rvSub.adapter = subAdapter
view.rvSub.scrollToPosition(subList.indexOf(selectedSub) + 1)
}
//倒序保留最近五次的搜索历史记录并去重
private fun saveCitySearchRecord(data: SubItem) {
if (data.value == "不限") return
if (selectedRegion.code.toString() != "0") data.provinceCode =
selectedRegion.code.toString()
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 {
fun onRegionSelected(region: RegionItem, sub: SubItem)
}
......
package com.yidianling.consultant.ui.view
import android.content.Context
import android.graphics.drawable.BitmapDrawable
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.PopupWindow
import androidx.fragment.app.FragmentActivity
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.asFragmentActivity
import com.yidianling.consultant.R
import com.yidianling.consultant.adapter.SortAdapter
import com.yidianling.consultant.layoutmanager.FlowLayoutManager
import com.yidianling.consultant.listener.OnCategoriesSelectedListener
import com.yidianling.consultant.model.bean.AllFilter
import com.yidianling.consultant.model.bean.ChildrenBean
import com.yidianling.consultant.ui.view.topView.EightCategoryView
import kotlinx.android.synthetic.main.consultant_ui_eight_category_popup_window.view.*
import kotlinx.android.synthetic.main.consultant_ui_subject_popup_window.view.*
import kotlinx.android.synthetic.main.consultant_ui_subject_popup_window.view.btnConfirm
import kotlinx.android.synthetic.main.consultant_ui_subject_popup_window.view.btn_reset
/**
* 主题弹窗
* Created by zqk on 17-9-15.
*/
class EightCategoryPopupWindow(context: Context, allFilter: AllFilter) :
PopupWindow(ViewGroup.LayoutParams.MATCH_PARENT, RxImageTool.dp2px(566f)) {
private var view: View = LayoutInflater.from(context)
.inflate(R.layout.consultant_ui_eight_category_popup_window, null)
var mAllFilter: AllFilter
private var context: Context
var onSubjectsSelectedListener: OnCategoriesSelectedListener? = null
lateinit var mutableList: MutableList<MutableList<ChildrenBean>>
private val signList = ArrayList<String>() // 用于埋点
init {
this.contentView = view
this.isFocusable = true
this.context = context
@Suppress("DEPRECATION")
this.setBackgroundDrawable(BitmapDrawable())
this.isOutsideTouchable = true
mAllFilter = allFilter
initView()
}
fun setListener(onSubjectsSelectedListener: OnCategoriesSelectedListener) {
this.onSubjectsSelectedListener = onSubjectsSelectedListener
val eightCategoryView = EightCategoryView(context, false)
eightCategoryView.setData(mutableList, mAllFilter, onSubjectsSelectedListener, false)
view.eight_category_fl.addView(eightCategoryView)
}
private fun initView() {
inputMethodMode = INPUT_METHOD_NEEDED
mutableList = mutableListOf<MutableList<ChildrenBean>>()
mutableList.add(mAllFilter.childList)
mutableList.add(mAllFilter.stressList)
mutableList.add(mAllFilter.loveEmotionList)
mutableList.add(mAllFilter.marriedFamilyList)
mutableList.add(mAllFilter.personalGrowthList)
mutableList.add(mAllFilter.interpersonalRelationshipList)
mutableList.add(mAllFilter.careerDevelopmentList)
mutableList.add(mAllFilter.mentalHealthList)
// val fragmentTransaction = context?.asFragmentActivity()?.supportFragmentManager?.beginTransaction()
// val searchFragment=ConsultCategoryFragment()
// fragmentTransaction?.add(R.id.eight_category_fl,searchFragment)?.commit()
}
}
\ No newline at end of file
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.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;
return Utils.drawableToBitmap(width, height, context.getResources().getDrawable(drawableId, null));
}
/**
* 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;
}
}
package com.yidianling.consultant.ui.view.topView
import android.content.Context
import androidx.recyclerview.widget.LinearSmoothScroller
class LinearTopSmoothScroller(context: Context?) : LinearSmoothScroller(context) {
override fun getVerticalSnapPreference(): Int {
return SNAP_TO_START
}
}
\ No newline at end of file
<?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
......@@ -2,13 +2,22 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="?android:attr/selectableItemBackground"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center_vertical"
android:paddingTop="@dimen/platform_dp_17"
android:paddingBottom="@dimen/platform_dp_17"
android:orientation="horizontal"
android:paddingLeft="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
android:id="@+id/tvConsultTypeName"
android:layout_width="0dp"
......@@ -16,14 +25,25 @@
android:layout_weight="1"
android:textColor="@color/platform_color_black_333333"
android:textSize="14sp"
android:includeFontPadding="false"
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
android:id="@+id/ivCheckCircle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@null"
android:src="@drawable/consultant_ic_check"
android:visibility="invisible"/>
android:visibility="invisible" />
</LinearLayout>
......@@ -14,5 +14,5 @@
android:paddingTop="6dp"
android:paddingBottom="6dp"
android:textColor="@color/consultant_color_search_filter_selector"
android:textSize="13dp"
android:textSize="14sp"
tools:text="按专家显示" />
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:background="@color/platform_white">
android:background="@color/platform_color_F7F7F7">
<View
android:id="@+id/view_select"
android:layout_width="4dp"
android:layout_height="21dp"
android:layout_gravity="center_vertical"
android:background="@color/platform_main_theme"
android:visibility="invisible"/>
android:visibility="invisible" />
<TextView
android:id="@+id/tvRegionName"
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:text="地区"
android:textColor="@color/platform_default_text_color"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:id="@+id/ll_view"
android:layout_height="wrap_content">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/eight_category"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:background="@color/platform_color_F7F7F7"
android:orientation="vertical" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/category_detail"
android:layout_width="0dp"
android:layout_weight="3"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="68dp"
android:background="@color/white"
android:orientation="horizontal"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="16dp">
<TextView
android:id="@+id/btn_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/btnConfirm"
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>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
layout="@layout/consultant_layout_search_toolbar"
android:layout_width="match_parent"
android:layout_height="48dp" />
<LinearLayout
android:id="@+id/eight_view_ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -31,6 +31,8 @@
android:layout_width="0dp"
android:layout_weight="1"
android:width="0dp"
android:ellipsize="end"
android:singleLine="true"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:text="困扰"
......@@ -44,7 +46,7 @@
android:width="0dp"
android:drawableEnd="@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" />
<com.ydl.ydlcommon.view.DrawableRightTextView
......@@ -55,7 +57,7 @@
android:width="0dp"
android:drawableEnd="@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" />
<com.ydl.ydlcommon.view.DrawableRightTextView
......@@ -64,8 +66,8 @@
android:layout_width="0dp"
android:layout_weight="1"
android:width="0dp"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableEnd="@drawable/filter_up_grey"
android:drawableRight="@drawable/filter_up_grey"
android:text="@string/platform_filter"
android:textColor="@color/platform_color_242424" />
</LinearLayout>
......@@ -80,7 +82,7 @@
<View
android:layout_width="match_parent"
android:layout_height="6dp"
android:layout_height="2dp"
android:background="@drawable/consult_fillter_bg" />
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/eight_category_fl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" />
</LinearLayout>
\ No newline at end of file
......@@ -19,7 +19,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginStart="@dimen/platform_dp_10"
android:orientation="vertical">
<TextView
......@@ -44,13 +44,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
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:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<FrameLayout
android:id="@+id/flEnquiryType"
android:id="@+id/flSortType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp" />
......@@ -59,22 +60,23 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
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:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<FrameLayout
android:id="@+id/flPriceRange"
android:id="@+id/flEnquiryType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_28"
android:text="年龄选择"
android:layout_marginStart="@dimen/platform_dp_4"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
......@@ -90,6 +92,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_28"
android:text="资质选择"
android:layout_marginStart="@dimen/platform_dp_4"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
......@@ -109,6 +112,7 @@
android:text="擅长人群"
android:textColor="@color/platform_color_242424"
android:textSize="16sp"
android:layout_marginStart="@dimen/platform_dp_4"
android:textStyle="bold" />
<cn.lankton.flowlayout.FlowLayout
......@@ -126,6 +130,7 @@
android:text="学历选择"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16"
android:layout_marginStart="@dimen/platform_dp_4"
android:textStyle="bold" />
<FrameLayout
......@@ -169,6 +174,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_28"
android:text="其他选择"
android:layout_marginStart="@dimen/platform_dp_4"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
......@@ -182,6 +188,7 @@
</LinearLayout>
</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 @@
android:id="@+id/rvRegion"
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="@color/platform_white"
android:background="@color/platform_color_F7F7F7"
android:layout_weight="1"
android:paddingTop="10dp"
android:overScrollMode="never"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvSub"
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="@color/platform_color_F7F7F7"
android:layout_weight="2"
android:paddingTop="10dp"
android:background="@color/white"
android:layout_weight="3"
android:overScrollMode="never"/>
</LinearLayout>
......@@ -9,6 +9,7 @@
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/scroll_nested"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
......
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/category_name_detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/platform_dp_5"
android:layout_marginBottom="@dimen/platform_dp_5"
android:background="@drawable/consult_price_expert_unseleted"
android:gravity="center"
android:minHeight="@dimen/platform_dp_40"
android:paddingStart="@dimen/platform_dp_10"
android:paddingTop="@dimen/platform_dp_6"
android:paddingRight="@dimen/platform_dp_10"
android:paddingBottom="@dimen/platform_dp_6"
android:textColor="@color/platform_color_333333"
android:textSize="@dimen/platform_sp_12"
tools:text="aaaaaaaaa">
</TextView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginEnd="@dimen/platform_dp_12"
android:orientation="vertical"
android:paddingTop="@dimen/platform_dp_12"
android:paddingBottom="@dimen/platform_dp_13">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/platform_dp_12"
android:gravity="center">
<TextView
android:id="@+id/category_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="恋爱情感"
android:textColor="#1c212d"
android:textSize="@dimen/sp_14" />
<TextView
android:id="@+id/collapse_hide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:padding="@dimen/platform_dp_5"
android:text="展开"
android:textColor="@color/platform_main_theme"
android:textSize="@dimen/platform_sp_12" />
<ImageView
android:id="@+id/arrow_collapse_hide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/consult_collapse_arrow">
</ImageView>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/category_list_detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="3">
</androidx.recyclerview.widget.RecyclerView>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:gravity="center"
android:orientation="horizontal">
<View
android:id="@+id/single_selected_tag"
android:layout_width="3dp"
android:layout_height="@dimen/platform_dp_15"
android:background="@color/platform_main_theme"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/multiple_choise"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/alert_selected"
android:backgroundTint="@color/platform_main_theme"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone">
</ImageView>
<TextView
android:id="@+id/eight_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/platform_dp_3"
android:layout_marginTop="@dimen/platform_dp_15"
android:layout_marginBottom="@dimen/platform_dp_15"
android:textColor="@color/color_242424"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:textSize="@dimen/sp_14"
tools:text="情绪压力">
</TextView>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?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>
......@@ -8,7 +8,6 @@ android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
......
......@@ -5,9 +5,7 @@ import android.app.AlertDialog
import android.content.Intent
import android.content.res.Configuration
import android.graphics.Color
import android.os.Build
import android.os.Handler
import androidx.recyclerview.widget.LinearLayoutManager
import android.text.TextUtils
import android.view.View
import android.view.ViewGroup
......@@ -15,6 +13,7 @@ import android.view.WindowManager
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.bumptech.glide.Glide
import com.dou361.ijkplayer.widget.PlayStateParams
......@@ -52,7 +51,6 @@ import com.yidianling.ydl_pay.common.CommonPayDialog
import kotlinx.android.synthetic.main.activity_course_play.*
import org.json.JSONException
import org.json.JSONObject
import java.util.*
/**
* 课程播放页面
......@@ -324,28 +322,22 @@ class CoursePlayActivity : BaseActivity() {
}
private fun initWindows() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
val window = window
//获取状态栏高度
var statusBarheight: Int = ScreenUtil.getStatusBarHeight(mContext)
//设置边距
setMargins(
title_bar_layout,
RxImageTool.dp2px(15f),
statusBarheight,
RxImageTool.dp2px(15f),
0
)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor = Color.TRANSPARENT
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
window.decorView.systemUiVisibility =
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
} else {
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
}
}
val window = window
//获取状态栏高度
var statusBarheight: Int = ScreenUtil.getStatusBarHeight(mContext)
//设置边距
setMargins(
title_bar_layout,
RxImageTool.dp2px(15f),
statusBarheight,
RxImageTool.dp2px(15f),
0
)
window.statusBarColor = Color.TRANSPARENT
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
window.decorView.systemUiVisibility =
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
}
private fun setMargins(v: View?, l: Int, t: Int, r: Int, b: Int) {
......
......@@ -208,10 +208,7 @@ class AudioPlayView(context: Context, attrs: AttributeSet?) :
if (time <= 0) return "00:00"
val min = time / 60000
val ss = (time - min * 60000) / 1000
val m = "" + min
val s = "" + ss
return String.format("%02d:%02d", m, s)
return String.format("%02d:%02d", min, ss)
}
override fun onDetachedFromWindow() {
......
......@@ -2,15 +2,14 @@ package com.yidianling.course.widget
import android.annotation.SuppressLint
import android.app.Activity
import android.os.Build
import android.os.Handler
import androidx.annotation.DrawableRes
import androidx.annotation.Nullable
import androidx.annotation.RawRes
import android.view.View
import android.widget.ImageView
import android.widget.RelativeLayout
import android.widget.SeekBar
import androidx.annotation.DrawableRes
import androidx.annotation.Nullable
import androidx.annotation.RawRes
import com.bumptech.glide.Glide
import com.ydl.media.audio.AudioPlayer
import com.ydl.media.audio.OnPlayerEventListener
......@@ -22,7 +21,6 @@ import com.yidianling.course.listener.HPlayStatusListener
import kotlinx.android.synthetic.main.course_play_music_view.view.*
/**
* Created by hgw on 2018/4/28.
*/
......@@ -279,6 +277,6 @@ class HPlayView : RelativeLayout, OnPlayerEventListener {
* @return
*/
fun isDestroy(): Boolean {
return mContext == null || mContext!!.isFinishing || Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && mContext!!.isDestroyed
return mContext == null || mContext!!.isFinishing || mContext?.isDestroyed == true
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import android.content.Context
import android.content.Intent
import android.view.View
import android.widget.ImageView
import android.widget.RelativeLayout
import com.alibaba.android.arouter.launcher.ARouter
import com.dou361.ijkplayer.widget.PlayStateParams
import com.dou361.ijkplayer.widget.PlayerView
......@@ -18,7 +19,6 @@ import com.yidianling.common.tools.RxImageTool
import com.yidianling.course.R
import com.yidianling.course.coursePlay.CoursePlayActivity
import com.yidianling.course.flutterPlugin.CourseSendPlugin
import com.yidianling.course.uitls.VideoProgressUtil
import java.util.*
/**
......@@ -78,7 +78,7 @@ object VideoFloatHelper {
}
}
val videoLayout = it.findViewById<ImageView>(R.id.app_video_box)
val videoLayout = it.findViewById<RelativeLayout>(R.id.app_video_box)
try {
initVideoPlayer(activity, videoLayout)
......
......@@ -14,7 +14,6 @@ android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
......
......@@ -5,14 +5,10 @@ import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.Parcelable;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
......@@ -20,19 +16,23 @@ import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.luck.picture.lib.photoview.PhotoView;
import com.miracle.view.imageeditor.utils.FileUtils;
import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.ui.ParcelableImage;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R;
import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.common.tool.DownLoadImageService;
import com.yidianling.dynamic.common.tool.ImageDownLoadCallBack;
import com.yidianling.dynamic.model.Command;
import com.ydl.ydlcommon.ui.ParcelableImage;
import java.io.File;
import java.util.ArrayList;
......@@ -226,11 +226,9 @@ public class BrowsePicturesActivity extends BaseActivity implements ViewPager.On
}
private void initWindows() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window window = getWindow();
Window window = getWindow();
// window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
private Handler mHandler = new Handler() {
......
......@@ -3,26 +3,26 @@ package com.yidianling.dynamic.common.browsePictures;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.Parcelable;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.luck.picture.lib.photoview.PhotoView;
import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydlcommon.base.BaseActivity;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R;
import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.common.tool.DownLoadImageService;
import com.yidianling.dynamic.common.tool.ImageDownLoadCallBack;
......@@ -164,11 +164,9 @@ public class BrowsePicturesActivity2 extends BaseActivity implements ViewPager.O
}
private void initWindows() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window window = getWindow();
Window window = getWindow();
// window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
private Handler mHandler=new Handler(){
......
......@@ -7,14 +7,14 @@ import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.os.Build;
import androidx.core.view.ViewCompat;
import android.text.TextPaint;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.MotionEvent;
import android.widget.ImageView;
import androidx.core.view.ViewCompat;
public class NineGridViewWrapper extends ImageView {
private int moreNum = 0; //显示更多的数量
......@@ -56,16 +56,8 @@ public class NineGridViewWrapper extends ImageView {
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
if (moreNum > 0) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
canvas.drawRoundRect(getWidth() / 2, 0f, getRight(), getHeight() / 4, 20f, 20f, mPaint);
}else {
mRectF.left=getWidth() / 2;
mRectF.top=0;
mRectF.bottom=getHeight() / 4;
mRectF.right=getRight();
canvas.drawRoundRect(mRectF,20f, 20f, mPaint);
}
// canvas.drawColor(maskColor);
canvas.drawRoundRect(getWidth() / 2, 0f, getRight(), getHeight() / 4, 20f, 20f, mPaint);
// canvas.drawColor(maskColor);
float baseY = getHeight() / 8 - (textPaint.ascent() + textPaint.descent()) / 2;
canvas.drawText(msg, getWidth() / 2 + 10, baseY, textPaint);
}
......
......@@ -13,10 +13,6 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.Parcelable;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import androidx.appcompat.app.AlertDialog;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.ImageView;
......@@ -24,6 +20,10 @@ import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.alibaba.android.arouter.launcher.ARouter;
import com.google.gson.internal.LinkedTreeMap;
import com.ydl.ydl_image.module.GlideApp;
......@@ -198,17 +198,6 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
});
}
/* @SuppressLint("WrongConstant")
private void initWindows() {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {
Window window = getWindow();
// window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
} else {
members_top_view.setVisibility(View.GONE);
}
}*/
/**
* 获取顶部图片高度后,设置滚动监听
*/
......
......@@ -14,15 +14,6 @@ import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Parcelable;
import androidx.cardview.widget.CardView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import androidx.core.content.ContextCompat;
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.provider.Settings;
import android.text.Editable;
import android.text.InputFilter;
......@@ -41,7 +32,14 @@ import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.blankj.utilcode.util.DeviceUtils;
import androidx.appcompat.app.AlertDialog;
import androidx.cardview.widget.CardView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.luck.picture.lib.entity.LocalMedia;
import com.luck.picture.lib.listener.OnResultCallbackListener;
import com.tbruyelle.rxpermissions2.RxPermissions;
......@@ -55,8 +53,8 @@ import com.ydl.ydlcommon.base.BaseApp;
import com.ydl.ydlcommon.base.BaseFragment;
import com.ydl.ydlcommon.data.http.BaseResponse;
import com.ydl.ydlcommon.router.YdlCommonOut;
import com.ydl.ydlcommon.ui.ParcelableImage;
import com.ydl.ydlcommon.utils.BuryPointUtils;
import com.ydl.ydlcommon.utils.DisplayUtils;
import com.ydl.ydlcommon.utils.MoonUtil;
import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
import com.ydl.ydlcommon.utils.StringUtils;
......@@ -64,9 +62,8 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.ydl.ydlcommon.view.dialog.NormalDialog;
import com.yidianling.common.tools.LogUtil;
import com.yidianling.common.tools.RxFileTool;
import com.yidianling.dynamic.BuildConfig;
import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R;
import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.bean.DynamicDraftBean;
import com.yidianling.dynamic.common.browsePictures.BrowsePicturesActivity;
import com.yidianling.dynamic.common.emoji.EmoticonPickerView;
......@@ -77,7 +74,6 @@ import com.yidianling.dynamic.event.DynamicSaveEvent;
import com.yidianling.dynamic.event.EditContentEvent;
import com.yidianling.dynamic.model.Command;
import com.yidianling.dynamic.model.PublishTrendResult;
import com.ydl.ydlcommon.ui.ParcelableImage;
import com.yidianling.dynamic.publishTrend.DynamicPublishImageAdapter;
import com.yidianling.dynamic.publishTrend.PublishTrendActivity;
import com.yidianling.dynamic.publishTrend.SelecTopicActivity;
......@@ -963,11 +959,52 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
}
if (Build.VERSION.SDK_INT>Build.VERSION_CODES.P){
for (int i = 0; i < list.size(); i++) {
AddImag(list.get(i).getAndroidQToPath());
LocalMedia localMedia = list.get(i);
String path;
if (!TextUtils.isEmpty(localMedia.getAndroidQToPath())) {
//android q路径
path = localMedia.getAndroidQToPath();
} else if (!TextUtils.isEmpty(localMedia.getCutPath())) {
//android 裁剪路径
path = localMedia.getCutPath();
} else if (!TextUtils.isEmpty(localMedia.getOriginalPath())) {
//android 初始路径
path = localMedia.getOriginalPath();
} else if (!TextUtils.isEmpty(localMedia.getCompressPath())) {
//android 压缩路径
path = localMedia.getCompressPath();
} else if (!TextUtils.isEmpty(localMedia.getRealPath())) {
//android 真实路径
path = localMedia.getRealPath();
} else {
path = localMedia.getPath();
}
if (!TextUtils.isEmpty(path)) {
AddImag(path);
}
}
}else{
for (int i = 0; i < list.size(); i++) {
AddImag(list.get(i).getPath());
LocalMedia localMedia = list.get(i);
String path;
if (!TextUtils.isEmpty(localMedia.getPath())) {
path = localMedia.getPath();
} else if (!TextUtils.isEmpty(localMedia.getCutPath())) {
//android 裁剪路径
path = localMedia.getCutPath();
} else if (!TextUtils.isEmpty(localMedia.getOriginalPath())) {
//android 初始路径
path = localMedia.getOriginalPath();
} else if (!TextUtils.isEmpty(localMedia.getCompressPath())) {
//android 压缩路径
path = localMedia.getCompressPath();
} else {
//android 真实路径
path = localMedia.getRealPath();
}
if (!TextUtils.isEmpty(path)) {
AddImag(path);
}
}
}
......
package com.yidianling.dynamic.trendsHome;
import static com.yidianling.dynamic.bean.DynamicConstants.YDL_USER_ASK_PAGE_STAY_VISIT;
import static com.yidianling.dynamic.bean.DynamicConstants.YDL_USER_ASK_PAGE_VISIT;
import static com.yidianling.dynamic.bean.DynamicConstants.YDL_USER_ASK_QUESTIONS_BUTTON_CLICK;
import static com.yidianling.dynamic.bean.DynamicConstants.YDL_USER_ASK_TYPE_CLICK;
import static com.yidianling.dynamic.bean.DynamicConstants.YDL_USER_THOUGHTS_GROUP_MORE_CLICK;
import static com.yidianling.dynamic.bean.DynamicConstants.YDL_USER_THOUGHTS_GROUP_TYPE_CLICK;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import androidx.appcompat.widget.Toolbar;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.widget.Toolbar;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import androidx.viewpager.widget.ViewPager;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydlcommon.base.BaseFragment;
import com.ydl.ydlcommon.utils.BuryPointUtils;
......@@ -43,13 +50,6 @@ import java.util.List;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import static com.yidianling.dynamic.bean.DynamicConstants.YDL_USER_ASK_PAGE_STAY_VISIT;
import static com.yidianling.dynamic.bean.DynamicConstants.YDL_USER_ASK_PAGE_VISIT;
import static com.yidianling.dynamic.bean.DynamicConstants.YDL_USER_ASK_QUESTIONS_BUTTON_CLICK;
import static com.yidianling.dynamic.bean.DynamicConstants.YDL_USER_ASK_TYPE_CLICK;
import static com.yidianling.dynamic.bean.DynamicConstants.YDL_USER_THOUGHTS_GROUP_MORE_CLICK;
import static com.yidianling.dynamic.bean.DynamicConstants.YDL_USER_THOUGHTS_GROUP_TYPE_CLICK;
/**
* Created by Jim on 2017/9/22 0022.
* 首页问答fragment
......@@ -151,14 +151,13 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView,
}
private void initStatus() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {//4.4以下不支持状态栏变色
int statusBarHeight = ScreenUtil.getStatusBarHeight(getActivity());
CollapsingToolbarLayout.LayoutParams layoutParams = (CollapsingToolbarLayout.LayoutParams) mToolBarTv.getLayoutParams();
layoutParams.height = (int) (getResources().getDimension(R.dimen.title_bar_height) + statusBarHeight);
mToolBarTv.setPadding(0, statusBarHeight, 0, 0);
mToolBarTv.setLayoutParams(layoutParams);
//4.4以下不支持状态栏变色
int statusBarHeight = ScreenUtil.getStatusBarHeight(getActivity());
CollapsingToolbarLayout.LayoutParams layoutParams = (CollapsingToolbarLayout.LayoutParams) mToolBarTv.getLayoutParams();
layoutParams.height = (int) (getResources().getDimension(R.dimen.title_bar_height) + statusBarHeight);
mToolBarTv.setPadding(0, statusBarHeight, 0, 0);
mToolBarTv.setLayoutParams(layoutParams);
}
}
private void initDatas() {
......
......@@ -5,9 +5,7 @@ import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import androidx.cardview.widget.CardView;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
......@@ -21,6 +19,8 @@ import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.TextView;
import androidx.cardview.widget.CardView;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.ydl.media.audio.AudioPlayer;
import com.ydl.media.audio.OnPlayerEventListener;
......@@ -269,18 +269,12 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
int changeProgress = 0;
void init() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window window = getWindow();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.setStatusBarColor(Color.TRANSPARENT);
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
} else {
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
}
Window window = getWindow();
window.setStatusBarColor(Color.TRANSPARENT);
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
fm_progress.setMax(max_progress);
tb_title.setDivideVisible(View.GONE);
tb_title.setLeftListener(new View.OnClickListener() {
......
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