Commit c6554397 by fengquan

fix bug 通话界面UI调整&svga

parent cdd11a9a
......@@ -187,10 +187,13 @@ class AudioHomeActivity :
private var mPlayer: AudioPlayer? = null
private var vibrator: Vibrator? = null
private var handler: Handler? = null
private var phone_handler: Handler? = null
//声网
private var voiceManage: YDLVoiceManager? = null
//频道管理器
// private var channelManager: ChannelManager? = null
......@@ -379,8 +382,12 @@ class AudioHomeActivity :
//另一方离开频道
updateExpertStatus(false, 1)
}, 500)
}
//本地音频状态变化
override fun onLocalAudioStateChanged(localVideoState: Int, error: Int) {
super.onLocalAudioStateChanged(localVideoState, error)
......@@ -526,7 +533,24 @@ class AudioHomeActivity :
.sendRichLog(AliYunLogConfig.AGORA, "主叫方发送的邀请通话消息内容:$content")
localRemainTime = (totalDuration?:1500).minus(remainTime?.toInt()?:1500)
handler = Handler()
phone_handler = Handler()
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() {
......@@ -563,7 +587,7 @@ class AudioHomeActivity :
iv_hands_free.isSelected = false
tv_name.text = expertName
tv_tips.text = expertTips
// tv_tips.text = expertTips
var time = totalDuration?.minus(remainTime!!.toInt())
tv_remain_time.text = DateUtils.formatTime((time).toString())
......@@ -1071,7 +1095,7 @@ class AudioHomeActivity :
*/
private fun connectSuccess() {
isConnectSuccess = true
handler!!.removeCallbacksAndMessages(null)
//通知服务端,此次通话已经接通,服务端开始订单
updateExpertStatus(false, 0)
......@@ -1091,7 +1115,7 @@ class AudioHomeActivity :
//等待状态的相关ui隐藏(挂断按钮的倒计时不清除,挂断按钮必须在30s后才能点击)
tv_change_doctor.visibility = View.GONE
tv_waiting.visibility = View.GONE
tv_tips.visibility = View.GONE
//显示通话相关ui
rl_remain_time.visibility = View.VISIBLE
......@@ -1347,6 +1371,7 @@ class AudioHomeActivity :
override fun onDestroy() {
super.onDestroy()
uploadLog()
phone_handler?.removeCallbacksAndMessages(null)
if (isConnectSuccess) {
uploadException("", "zhu", "108", callback = null)
}
......@@ -1354,6 +1379,10 @@ class AudioHomeActivity :
handler = null
}
if (phone_handler != null){
phone_handler = null
}
hasUpLoadLog = false
if (waitDisposable != null) {
......
......@@ -30,7 +30,7 @@
<RelativeLayout
android:id="@+id/rl_head"
android:layout_width="250dp"
android:layout_height="250dp"
android:layout_height="270dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="60dp">
......@@ -65,6 +65,22 @@
android:textSize="22sp"
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>
<!-- 倾诉剩余时间-->
<androidx.constraintlayout.widget.ConstraintLayout
......@@ -114,7 +130,7 @@
<TextView
android:id="@+id/tv_tips"
android:id="@+id/tv_tips1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/rl_remain_time"
......@@ -127,7 +143,7 @@
android:maxLines="2"
android:textColor="@color/white"
android:textSize="15sp"
tools:text="你存在的本身就是值得被爱的你存在的本身就是值得被爱的" />
/>
......@@ -153,7 +169,7 @@
android:text="正在等待聆听者接受邀请…"
android:textColor="@color/platform_color_70FFFFFF"
android:textSize="12sp"
android:visibility="visible"
android:visibility="gone"
tools:visibility="gone" />
<LinearLayout
android:layout_width="wrap_content"
......@@ -290,7 +306,7 @@
android:id="@+id/tv_toast"
android:layout_width="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_marginTop="34dp"
android:background="@drawable/audioim_toast_view_background"
......@@ -309,7 +325,7 @@
android:id="@+id/tv_nte_status"
android:layout_width="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_marginTop="70dp"
android:background="@drawable/audioim_toast_view_background"
......
......@@ -14,6 +14,9 @@ import android.widget.FrameLayout
import android.widget.TextView
import androidx.fragment.app.FragmentActivity
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.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
......@@ -61,7 +64,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
lateinit var layoutChange: View
lateinit var tvCall: TextView
lateinit var tvTime: TextView
lateinit var first_order: View
lateinit var first_order: SimpleDraweeView
lateinit var confideProgress: View
lateinit var layout_change_text: View
lateinit var layoutBottom: View
......@@ -94,6 +97,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
super.onCreate(savedInstanceState)
setStyle(STYLE_NORMAL, R.style.AppBottomSheet)
EventBus.getDefault().register(this)
}
override fun onCreateView(
......@@ -159,10 +163,21 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
layoutBottom = itemView.findViewById<View>(R.id.layoutBottom)
tvCall = itemView.findViewById<TextView>(R.id.tvCall)
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 isLogin = userService.isLogin()
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 {
ActionCountUtils.record(
"ydl_experts_detail_popupwindows_page",
......
......@@ -3,6 +3,7 @@ package com.ydl.confide.home
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Color
import android.net.Uri
import android.os.Build
import android.view.View
import android.view.WindowManager
......@@ -10,6 +11,8 @@ import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.SimpleItemAnimator
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.XRecyclerView
import com.ydl.confide.R
......@@ -216,10 +219,22 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
private fun handleFree() {
//登录了回来之后就不显示了
val isLogin = (findRouteService(IUserService::class.java).isLogin())
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) {
findViewById<View>(R.id.confideRed).visibility = if (listenFree) View.VISIBLE else View.GONE
}
}
/**
......
package com.ydl.confide.intro
import android.app.Activity
import android.net.Uri
import android.util.Log
import android.view.View
import android.widget.SeekBar
......@@ -11,6 +12,9 @@ import androidx.databinding.ViewDataBinding
import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.RecyclerView
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.databinding.ItemExpertIntroBinding
import com.ydl.confide.home.ConfideBottomSheetDialogFragment
......@@ -26,6 +30,7 @@ import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.confide_home_activity.*
import tv.danmaku.ijk.media.player.IjkMediaPlayer
import java.net.URLEncoder
import java.util.concurrent.TimeUnit
......@@ -190,6 +195,15 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
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.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
......@@ -245,6 +259,8 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
if (vm?.isVideo == false && !vm?.playUrl.isNullOrBlank()) {
binding.voicePlay.start()
}
}
private fun startTiming() {
......
......@@ -64,7 +64,7 @@
tools:text="剩余1分40秒" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
<!--<TextView
android:id="@+id/first_order"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -73,13 +73,21 @@
android:paddingTop="2dp"
android:paddingRight="5dp"
android:paddingBottom="2dp"
android:text="首单免费"
android:text="首单免费1111111"
android:textColor="@color/white"
android:textSize="11sp"
android:visibility="gone"
app:layout_constraintCircle="@+id/layoutCall"
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
......
......@@ -98,7 +98,7 @@
android:layout_marginEnd="10dp"
android:src="@drawable/confide__free" />
<TextView
<!--<TextView
android:id="@+id/confide_Free"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -111,7 +111,20 @@
android:text="首单免费"
android:visibility="gone"
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>
</androidx.constraintlayout.widget.ConstraintLayout>
......
......@@ -143,7 +143,7 @@
tools:text="剩余1分40秒" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
<!--<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_confide_free"
......@@ -157,7 +157,16 @@
android:visibility="@{item.showFreeTag?View.VISIBLE:View.GONE}"
app:layout_constraintCircle="@+id/layoutCall"
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
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