Commit 58b9b0fb by 刘鹏

Merge branch 'darren_confide_2.0' into 'd/v_confide_2.0'

fix bug 通话界面UI调整&svga

See merge request app_android_lib/YDL-Component!90
parents f78b1177 06c65bdd
...@@ -189,10 +189,13 @@ class AudioHomeActivity : ...@@ -189,10 +189,13 @@ class AudioHomeActivity :
private var mPlayer: AudioPlayer? = null private var mPlayer: AudioPlayer? = null
private var vibrator: Vibrator? = null private var vibrator: Vibrator? = null
private var handler: Handler? = null private var handler: Handler? = null
private var phone_handler: Handler? = null
//声网 //声网
private var voiceManage: YDLVoiceManager? = null private var voiceManage: YDLVoiceManager? = null
//频道管理器 //频道管理器
// private var channelManager: ChannelManager? = null // private var channelManager: ChannelManager? = null
...@@ -381,8 +384,12 @@ class AudioHomeActivity : ...@@ -381,8 +384,12 @@ class AudioHomeActivity :
//另一方离开频道 //另一方离开频道
updateExpertStatus(false, 1) updateExpertStatus(false, 1)
}, 500) }, 500)
} }
//本地音频状态变化 //本地音频状态变化
override fun onLocalAudioStateChanged(localVideoState: Int, error: Int) { override fun onLocalAudioStateChanged(localVideoState: Int, error: Int) {
super.onLocalAudioStateChanged(localVideoState, error) super.onLocalAudioStateChanged(localVideoState, error)
...@@ -540,7 +547,24 @@ class AudioHomeActivity : ...@@ -540,7 +547,24 @@ class AudioHomeActivity :
.sendRichLog(AliYunLogConfig.AGORA, "主叫方发送的邀请通话消息内容:$content") .sendRichLog(AliYunLogConfig.AGORA, "主叫方发送的邀请通话消息内容:$content")
localRemainTime = (totalDuration?:1500).minus(remainTime?.toInt()?:1500) localRemainTime = (totalDuration?:1500).minus(remainTime?.toInt()?:1500)
handler = Handler() handler = Handler()
phone_handler = Handler()
vibrator = getSystemService(Service.VIBRATOR_SERVICE) as Vibrator? vibrator = getSystemService(Service.VIBRATOR_SERVICE) as Vibrator?
var count = 0
phone_handler!!.postDelayed(object : Runnable {
override fun run() {
if(count % 2 == 0){
tv_tips.text = "正在发送倾诉请求…"
}else{
tv_tips.text = "正在等待聆听者接受邀请…"
}
count++
phone_handler!!.postDelayed({ this.run() }, 3000)
}
}, 3000)
} }
private fun reLoginRTM() { private fun reLoginRTM() {
...@@ -577,7 +601,7 @@ class AudioHomeActivity : ...@@ -577,7 +601,7 @@ class AudioHomeActivity :
iv_hands_free.isSelected = false iv_hands_free.isSelected = false
tv_name.text = expertName tv_name.text = expertName
tv_tips.text = expertTips // tv_tips.text = expertTips
var time = totalDuration?.minus(remainTime!!.toInt()) var time = totalDuration?.minus(remainTime!!.toInt())
tv_remain_time.text = DateUtils.formatTime((time).toString()) tv_remain_time.text = DateUtils.formatTime((time).toString())
...@@ -1085,7 +1109,7 @@ class AudioHomeActivity : ...@@ -1085,7 +1109,7 @@ class AudioHomeActivity :
*/ */
private fun connectSuccess() { private fun connectSuccess() {
isConnectSuccess = true isConnectSuccess = true
handler!!.removeCallbacksAndMessages(null)
//通知服务端,此次通话已经接通,服务端开始订单 //通知服务端,此次通话已经接通,服务端开始订单
updateExpertStatus(false, 0) updateExpertStatus(false, 0)
...@@ -1105,7 +1129,7 @@ class AudioHomeActivity : ...@@ -1105,7 +1129,7 @@ class AudioHomeActivity :
//等待状态的相关ui隐藏(挂断按钮的倒计时不清除,挂断按钮必须在30s后才能点击) //等待状态的相关ui隐藏(挂断按钮的倒计时不清除,挂断按钮必须在30s后才能点击)
tv_change_doctor.visibility = View.GONE tv_change_doctor.visibility = View.GONE
tv_waiting.visibility = View.GONE tv_tips.visibility = View.GONE
//显示通话相关ui //显示通话相关ui
rl_remain_time.visibility = View.VISIBLE rl_remain_time.visibility = View.VISIBLE
...@@ -1361,6 +1385,7 @@ class AudioHomeActivity : ...@@ -1361,6 +1385,7 @@ class AudioHomeActivity :
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
uploadLog() uploadLog()
phone_handler?.removeCallbacksAndMessages(null)
if (isConnectSuccess) { if (isConnectSuccess) {
uploadException("", "zhu", "108", callback = null) uploadException("", "zhu", "108", callback = null)
} }
...@@ -1368,6 +1393,10 @@ class AudioHomeActivity : ...@@ -1368,6 +1393,10 @@ class AudioHomeActivity :
handler = null handler = null
} }
if (phone_handler != null){
phone_handler = null
}
hasUpLoadLog = false hasUpLoadLog = false
if (waitDisposable != null) { if (waitDisposable != null) {
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<RelativeLayout <RelativeLayout
android:id="@+id/rl_head" android:id="@+id/rl_head"
android:layout_width="250dp" android:layout_width="250dp"
android:layout_height="250dp" android:layout_height="270dp"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="60dp"> android:layout_marginTop="60dp">
...@@ -65,6 +65,22 @@ ...@@ -65,6 +65,22 @@
android:textSize="22sp" android:textSize="22sp"
tools:text="留意" /> tools:text="留意" />
<TextView
android:id="@+id/tv_tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_name"
android:layout_centerHorizontal="true"
android:layout_marginLeft="25dp"
android:layout_marginTop="@dimen/platform_dp_10"
android:layout_marginRight="25dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="2"
android:textColor="@color/platform_color_70FFFFFF"
android:textSize="12sp"
android:text="正在等待聆听者接受邀请…" />
</RelativeLayout> </RelativeLayout>
<!-- 倾诉剩余时间--> <!-- 倾诉剩余时间-->
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
...@@ -114,7 +130,7 @@ ...@@ -114,7 +130,7 @@
<TextView <TextView
android:id="@+id/tv_tips" android:id="@+id/tv_tips1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/rl_remain_time" android:layout_below="@+id/rl_remain_time"
...@@ -127,7 +143,7 @@ ...@@ -127,7 +143,7 @@
android:maxLines="2" android:maxLines="2"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="15sp" android:textSize="15sp"
tools:text="你存在的本身就是值得被爱的你存在的本身就是值得被爱的" /> />
...@@ -153,7 +169,7 @@ ...@@ -153,7 +169,7 @@
android:text="正在等待聆听者接受邀请…" android:text="正在等待聆听者接受邀请…"
android:textColor="@color/platform_color_70FFFFFF" android:textColor="@color/platform_color_70FFFFFF"
android:textSize="12sp" android:textSize="12sp"
android:visibility="visible" android:visibility="gone"
tools:visibility="gone" /> tools:visibility="gone" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -290,7 +306,7 @@ ...@@ -290,7 +306,7 @@
android:id="@+id/tv_toast" android:id="@+id/tv_toast"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/tv_tips" android:layout_below="@+id/tv_tips1"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="34dp" android:layout_marginTop="34dp"
android:background="@drawable/audioim_toast_view_background" android:background="@drawable/audioim_toast_view_background"
...@@ -309,7 +325,7 @@ ...@@ -309,7 +325,7 @@
android:id="@+id/tv_nte_status" android:id="@+id/tv_nte_status"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/tv_tips" android:layout_below="@+id/tv_tips1"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="70dp" android:layout_marginTop="70dp"
android:background="@drawable/audioim_toast_view_background" android:background="@drawable/audioim_toast_view_background"
......
...@@ -15,6 +15,9 @@ import android.widget.ImageView ...@@ -15,6 +15,9 @@ import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import com.alibaba.android.arouter.launcher.ARouter import com.alibaba.android.arouter.launcher.ARouter
import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.drawee.interfaces.DraweeController
import com.facebook.drawee.view.SimpleDraweeView
import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.google.android.material.bottomsheet.BottomSheetDialogFragment
...@@ -65,7 +68,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -65,7 +68,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
lateinit var tvCall: TextView lateinit var tvCall: TextView
lateinit var ivCall: ImageView lateinit var ivCall: ImageView
lateinit var tvTime: TextView lateinit var tvTime: TextView
lateinit var first_order: View lateinit var first_order: SimpleDraweeView
lateinit var confideProgress: View lateinit var confideProgress: View
lateinit var layout_change_text: View lateinit var layout_change_text: View
lateinit var layoutBottom: View lateinit var layoutBottom: View
...@@ -100,6 +103,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -100,6 +103,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setStyle(STYLE_NORMAL, R.style.AppBottomSheet) setStyle(STYLE_NORMAL, R.style.AppBottomSheet)
EventBus.getDefault().register(this) EventBus.getDefault().register(this)
} }
override fun onCreateView( override fun onCreateView(
...@@ -166,10 +170,21 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -166,10 +170,21 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
tvCall = itemView.findViewById<TextView>(R.id.tvCall) tvCall = itemView.findViewById<TextView>(R.id.tvCall)
ivCall = itemView.findViewById<ImageView>(R.id.ivCall) ivCall = itemView.findViewById<ImageView>(R.id.ivCall)
tvTime = itemView.findViewById<TextView>(R.id.tvTime) tvTime = itemView.findViewById<TextView>(R.id.tvTime)
first_order = itemView.findViewById<TextView>(R.id.first_order) first_order = itemView.findViewById<SimpleDraweeView>(R.id.first_order)
val userService = findRouteService(IUserService::class.java) val userService = findRouteService(IUserService::class.java)
val isLogin = userService.isLogin() val isLogin = userService.isLogin()
first_order.visibility = if (isLogin) View.GONE else View.VISIBLE first_order.visibility = if (isLogin) View.GONE else View.VISIBLE
val controller: DraweeController = Fresco.newDraweeControllerBuilder()
.setUri(Uri.parse("res://drawable/"+R.drawable.first_order))
.setOldController(first_order.controller)
.setAutoPlayAnimations(true) // 是否自动播放Gif动画
.build()
first_order.controller = controller
layoutCall.setOnClickListener { layoutCall.setOnClickListener {
ActionCountUtils.record( ActionCountUtils.record(
"ydl_experts_detail_popupwindows_page", "ydl_experts_detail_popupwindows_page",
......
...@@ -4,6 +4,7 @@ import android.annotation.SuppressLint ...@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import android.graphics.Color import android.graphics.Color
import android.net.Uri
import android.os.Build import android.os.Build
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
...@@ -12,6 +13,8 @@ import androidx.fragment.app.FragmentActivity ...@@ -12,6 +13,8 @@ import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.SimpleItemAnimator import androidx.recyclerview.widget.SimpleItemAnimator
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.drawee.interfaces.DraweeController
import com.jcodecraeer.xrecyclerview.ProgressStyle import com.jcodecraeer.xrecyclerview.ProgressStyle
import com.jcodecraeer.xrecyclerview.XRecyclerView import com.jcodecraeer.xrecyclerview.XRecyclerView
import com.ydl.confide.R import com.ydl.confide.R
...@@ -234,12 +237,23 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -234,12 +237,23 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
private fun handleFree() { private fun handleFree() {
//登录了回来之后就不显示了 //登录了回来之后就不显示了
val isLogin = (findRouteService(IUserService::class.java).isLogin()) val isLogin = (findRouteService(IUserService::class.java).isLogin())
findViewById<View>(R.id.confide_Free).visibility = if (isLogin) View.GONE else View.VISIBLE findViewById<View>(R.id.confide_Free).visibility = if (isLogin) View.GONE else View.VISIBLE
if (!isLogin){
val controller: DraweeController = Fresco.newDraweeControllerBuilder()
.setUri(Uri.parse("res://drawable/"+R.drawable.first_order))
.setOldController(confide_Free.controller)
.setAutoPlayAnimations(true) // 是否自动播放Gif动画
.build()
confide_Free.controller = controller
}
if (isLogin) { if (isLogin) {
findViewById<View>(R.id.confideRed).visibility = if (listenFree) View.VISIBLE else View.GONE findViewById<View>(R.id.confideRed).visibility = if (listenFree) View.VISIBLE else View.GONE
(quick_consult_btn.layoutParams as? ViewGroup.MarginLayoutParams)?.rightMargin = (quick_consult_btn.layoutParams as? ViewGroup.MarginLayoutParams)?.rightMargin =
if (listenFree) dp48 / 2 else 0 if (listenFree) dp48 / 2 else 0
} }
} }
/** /**
......
package com.ydl.confide.intro package com.ydl.confide.intro
import android.app.Activity import android.app.Activity
import android.net.Uri
import android.util.Log import android.util.Log
import android.view.View import android.view.View
import android.widget.SeekBar import android.widget.SeekBar
...@@ -11,6 +12,9 @@ import androidx.databinding.ViewDataBinding ...@@ -11,6 +12,9 @@ import androidx.databinding.ViewDataBinding
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.dou361.ijkplayer.widget.IjkVideoView import com.dou361.ijkplayer.widget.IjkVideoView
import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.drawee.interfaces.DraweeController
import com.ydl.confide.R
import com.ydl.confide.api.ConfideRoute import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.databinding.ItemExpertIntroBinding import com.ydl.confide.databinding.ItemExpertIntroBinding
import com.ydl.confide.home.ConfideBottomSheetDialogFragment import com.ydl.confide.home.ConfideBottomSheetDialogFragment
...@@ -27,6 +31,7 @@ import io.reactivex.Observable ...@@ -27,6 +31,7 @@ import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.confide_home_activity.*
import tv.danmaku.ijk.media.player.IjkMediaPlayer import tv.danmaku.ijk.media.player.IjkMediaPlayer
import java.net.URLEncoder import java.net.URLEncoder
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
...@@ -194,6 +199,15 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) : ...@@ -194,6 +199,15 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
binding.voicePlay.start() binding.voicePlay.start()
} }
} }
val controller: DraweeController = Fresco.newDraweeControllerBuilder()
.setUri(Uri.parse("res://drawable/"+ R.drawable.first_order))
.setOldController(binding.confideFirstFree.controller)
.setAutoPlayAnimations(true) // 是否自动播放Gif动画
.build()
binding.confideFirstFree.controller = controller
binding.seekbar.progress = 0 binding.seekbar.progress = 0
binding.seekbar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener { binding.seekbar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) { override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
...@@ -249,6 +263,8 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) : ...@@ -249,6 +263,8 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
if (vm?.isVideo == false && !vm?.playUrl.isNullOrBlank()) { if (vm?.isVideo == false && !vm?.playUrl.isNullOrBlank()) {
binding.voicePlay.start() binding.voicePlay.start()
} }
} }
private fun startTiming() { private fun startTiming() {
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
tools:text="剩余1分40秒" /> tools:text="剩余1分40秒" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<TextView <!--<TextView
android:id="@+id/first_order" android:id="@+id/first_order"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -74,13 +74,21 @@ ...@@ -74,13 +74,21 @@
android:paddingTop="2dp" android:paddingTop="2dp"
android:paddingRight="5dp" android:paddingRight="5dp"
android:paddingBottom="2dp" android:paddingBottom="2dp"
android:text="首单免费" android:text="首单免费1111111"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="11sp" android:textSize="11sp"
android:visibility="gone" android:visibility="gone"
app:layout_constraintCircle="@+id/layoutCall" app:layout_constraintCircle="@+id/layoutCall"
app:layout_constraintCircleAngle="70" app:layout_constraintCircleAngle="70"
app:layout_constraintCircleRadius="70dp" /> app:layout_constraintCircleRadius="70dp" />-->
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/first_order"
android:layout_width="@dimen/platform_dp_64"
android:layout_height="@dimen/platform_dp_34"
app:layout_constraintCircle="@+id/layoutCall"
app:layout_constraintCircleAngle="70"
app:layout_constraintCircleRadius="70dp"/>
<LinearLayout <LinearLayout
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
android:src="@drawable/confide__free" /> android:src="@drawable/confide__free" />
<TextView <!--<TextView
android:id="@+id/confide_Free" android:id="@+id/confide_Free"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -111,7 +111,20 @@ ...@@ -111,7 +111,20 @@
android:text="首单免费" android:text="首单免费"
android:visibility="gone" android:visibility="gone"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="11sp" /> android:textSize="11sp" />-->
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/confide_Free"
android:layout_width="@dimen/platform_dp_64"
android:layout_height="@dimen/platform_dp_34"
app:layout_constraintCircle="@+id/layoutCall"
android:paddingLeft="5dp"
android:layout_marginTop="-7dp"
android:paddingRight="5dp"
android:paddingBottom="2dp"
android:layout_gravity="right|top"
android:visibility="gone"
/>
</FrameLayout> </FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
......
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
tools:text="剩余1分40秒" /> tools:text="剩余1分40秒" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<TextView <!--<TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_confide_free" android:background="@drawable/bg_confide_free"
...@@ -158,7 +158,16 @@ ...@@ -158,7 +158,16 @@
android:visibility="@{item.showFreeTag?View.VISIBLE:View.GONE}" android:visibility="@{item.showFreeTag?View.VISIBLE:View.GONE}"
app:layout_constraintCircle="@+id/layoutCall" app:layout_constraintCircle="@+id/layoutCall"
app:layout_constraintCircleAngle="70" app:layout_constraintCircleAngle="70"
app:layout_constraintCircleRadius="70dp" /> app:layout_constraintCircleRadius="70dp" />-->
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/confide_first_free"
android:layout_width="@dimen/platform_dp_64"
android:layout_height="@dimen/platform_dp_34"
app:layout_constraintCircle="@+id/layoutCall"
app:layout_constraintCircleAngle="70"
android:visibility="@{item.showFreeTag?View.VISIBLE:View.GONE}"
app:layout_constraintCircleRadius="70dp"/>
<TextView <TextView
android:id="@+id/tvTag" android:id="@+id/tvTag"
......
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