[8.0.0]
[fea] [light voice setting]
This commit is contained in:
@@ -38,4 +38,10 @@ public class NumberFormatUtil {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static String percentage(float numver,int decimal){
|
||||
float newNumber = numver*100;
|
||||
return String.format("%."+decimal+"f",newNumber);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,10 +34,13 @@ import com.mogo.och.unmanned.passenger.ui.statusview.StatusBarView
|
||||
import io.reactivex.disposables.Disposable
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.arrivedView
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.bottom
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.cb_setting_light
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.cb_setting_voice
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.chekAndStartAutopilotView
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.infoVideoView
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.itinerary
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.lbv_go2_center
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.light_setting
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.mapBizView
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.mv_music_info
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.overMapView
|
||||
@@ -45,6 +48,7 @@ import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.pcnActionView
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.romaDistanceView
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.romaPView
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.speedView
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.voice_setting
|
||||
|
||||
/**
|
||||
* 网约车基础Fragment,主要负责布局通用界面,处理站点面板和通话面板互斥情况
|
||||
@@ -93,6 +97,24 @@ class TaxiPassengerBaseFragment :
|
||||
}
|
||||
|
||||
private fun settingAndMusicListener() {
|
||||
cb_setting_light.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
if(buttonView.id==cb_setting_light.id){
|
||||
if(isChecked){
|
||||
light_setting.visibility = View.VISIBLE
|
||||
}else{
|
||||
light_setting.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
cb_setting_voice.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
if(buttonView.id==cb_setting_voice.id){
|
||||
if(isChecked){
|
||||
voice_setting.visibility = View.VISIBLE
|
||||
}else{
|
||||
voice_setting.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
lbv_go2_center.setOrderIdCallback(object : LeftBarView.LeftBarCallback{
|
||||
override fun setGo2CenterClick() {
|
||||
when (bottom.getCurrentPage()) {
|
||||
|
||||
@@ -4,121 +4,21 @@ import android.animation.ObjectAnimator
|
||||
import android.content.Context
|
||||
import android.provider.Settings
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.constraintlayout.widget.ConstraintSet
|
||||
import androidx.core.view.marginBottom
|
||||
import androidx.core.view.marginTop
|
||||
import com.mogo.eagle.core.function.call.setting.CallerRequestActivityHandleManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.BrightnessUtils
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.common.module.wigets.map.switchvisual.VisualViewModel
|
||||
import com.mogo.och.unmanned.passenger.ui.setting.TaxiPSettingView.Companion
|
||||
import com.mogo.och.unmanned.taxi.passenger.R
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil
|
||||
import kotlinx.android.synthetic.main.taxi_p_setting_light_view.view.tv_current_value
|
||||
import kotlinx.android.synthetic.main.taxi_p_setting_view.view.sb_light_bar
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
|
||||
class LightSetting @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
private lateinit var draggableButton: ImageView
|
||||
private var marginTop:Int = 0
|
||||
private var marginBottom:Int = 0
|
||||
private var maxHeight = 0
|
||||
) : VerticalSeekBar(context, attrs, defStyleAttr) {
|
||||
|
||||
private val TAG = "LightSetting"
|
||||
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.taxi_p_setting_light_view, this, true)
|
||||
background = resources.getDrawable(R.drawable.taxi_p_voice_bg)
|
||||
initView()
|
||||
}
|
||||
|
||||
override fun onVisibilityAggregated(isVisible: Boolean) {
|
||||
super.onVisibilityAggregated(isVisible)
|
||||
if(isVisible){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
draggableButton = findViewById(R.id.aciv_voice_thum)
|
||||
marginTop = draggableButton.marginTop
|
||||
marginBottom = draggableButton.marginBottom
|
||||
post {
|
||||
maxHeight = height-marginBottom-marginTop-draggableButton.height
|
||||
initLightAndVoice()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private var initialX = 0f
|
||||
private var initialY = 0f
|
||||
private val tempSet = ConstraintSet()
|
||||
|
||||
/**
|
||||
* 为该组件的触碰事件重写事件处理方法
|
||||
*/
|
||||
override fun onTouchEvent(event: MotionEvent?): Boolean {
|
||||
when (event?.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
initialX = event.rawX;
|
||||
initialY = event.rawY;
|
||||
}
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
|
||||
if(draggableButton.translationY<0){
|
||||
draggableButton.translationY = 0f
|
||||
return true
|
||||
}else if (draggableButton.translationY+marginTop>(height)){
|
||||
tempSet.clone(this)
|
||||
tempSet.setTranslationY(draggableButton.id,(height-marginTop).toFloat())
|
||||
tempSet.applyTo(this)
|
||||
return true
|
||||
}
|
||||
|
||||
val dx = event.rawX - initialX;
|
||||
val dy = event.rawY - initialY;
|
||||
initialX = event.rawX;
|
||||
initialY = event.rawY;
|
||||
if(draggableButton.translationY+dy<0){
|
||||
return true
|
||||
}
|
||||
if(draggableButton.translationY+dy+marginBottom+marginTop+draggableButton.height>height){
|
||||
return true
|
||||
}
|
||||
CallerLogger.d(TAG,"旧的dy:${draggableButton.translationY}")
|
||||
|
||||
tempSet.clone(this)
|
||||
tempSet.setTranslationY(draggableButton.id,draggableButton.translationY+dy)
|
||||
tempSet.applyTo(this)
|
||||
CallerLogger.d(TAG,"新的dy:${draggableButton.translationY}")
|
||||
|
||||
|
||||
upDateLight()
|
||||
|
||||
}
|
||||
MotionEvent.ACTION_UP -> {
|
||||
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
private fun upDateLight() {
|
||||
override fun upDateLight(percentaget: Float) {
|
||||
if (!Settings.System.canWrite(context)) {
|
||||
CallerRequestActivityHandleManager.requestPermission(
|
||||
TaxiPSettingView.TAG,
|
||||
@@ -126,41 +26,25 @@ class LightSetting @JvmOverloads constructor(
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
if (BrightnessUtils.isAutoBrightnessEnabled()) {
|
||||
BrightnessUtils.setBrightness((draggableButton.translationY/maxHeight*255).toInt())
|
||||
BrightnessUtils.setBrightness((percentaget*255).toInt())
|
||||
} else {
|
||||
BrightnessUtils.setAutoBrightnessEnabled(true)
|
||||
}
|
||||
setTextValue(NumberFormatUtil.percentage(percentaget,0))
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private fun initLightAndVoice(){
|
||||
CallerLogger.d(TAG,"最大值${maxHeight}---height:${height}---marginBottom:${marginBottom}---marginTop:${marginTop}-----draggableButton.height:${draggableButton.height}")
|
||||
val currentLight = BrightnessUtils.getBrightness().toFloat() / 255 * maxHeight
|
||||
CallerLogger.d(TAG,"当前的亮度:${currentLight}")
|
||||
override fun initLightAndVoice(){
|
||||
val percentaget = BrightnessUtils.getBrightness().toFloat() / 255
|
||||
val currentLight = percentaget * maxHeightValue
|
||||
ObjectAnimator.ofFloat(
|
||||
draggableButton, "translationY", draggableButton.translationY,
|
||||
currentLight
|
||||
).apply {
|
||||
duration = 500
|
||||
}.start()
|
||||
tv_current_value.text = "${(BrightnessUtils.getBrightness() * 100) / 255}"
|
||||
}
|
||||
|
||||
override fun onWindowVisibilityChanged(visibility: Int) {
|
||||
super.onWindowVisibilityChanged(visibility)
|
||||
if (visibility == View.VISIBLE) {
|
||||
initLightAndVoice()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onWindowFocusChanged(hasWindowFocus: Boolean) {
|
||||
super.onWindowFocusChanged(hasWindowFocus)
|
||||
if (hasWindowFocus) {
|
||||
initLightAndVoice()
|
||||
}
|
||||
setTextValue(NumberFormatUtil.percentage(percentaget,0))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
package com.mogo.och.unmanned.passenger.ui.setting
|
||||
|
||||
import android.graphics.*
|
||||
import android.graphics.drawable.Drawable
|
||||
import androidx.core.graphics.toRectF
|
||||
|
||||
/**
|
||||
* 进度条drawable
|
||||
*/
|
||||
class SettingGradientDrawable(colorStart: Int = Color.BLUE, colorEnd:Int = Color.RED, height:Int) : Drawable() {
|
||||
|
||||
private var mPaint: Paint = Paint(Paint.ANTI_ALIAS_FLAG)
|
||||
|
||||
private var colorStart:Int = Color.BLUE
|
||||
private var colorEnd:Int = Color.RED
|
||||
|
||||
private var colorWith = 4f
|
||||
private var transparentWidth = 4f
|
||||
|
||||
private var index = doubleArrayOf(0.53,0.76,0.92)
|
||||
private var tartHeight = 0
|
||||
|
||||
private var heightDex = 0
|
||||
|
||||
private var currendDex = mutableListOf<Double>()
|
||||
|
||||
init {
|
||||
this.colorStart = colorStart
|
||||
this.colorEnd = colorEnd
|
||||
this.tartHeight = height
|
||||
mPaint.isAntiAlias = true
|
||||
index.forEachIndexed { _, d ->
|
||||
currendDex += (1-d)/2
|
||||
}
|
||||
}
|
||||
|
||||
override fun draw(canvas: Canvas) {
|
||||
val rect = bounds
|
||||
mPaint.shader = LinearGradient(0f, 0f, rect.right.toFloat(), rect.bottom.toFloat(), intArrayOf(colorStart,colorEnd), floatArrayOf(0f,1f), Shader.TileMode.CLAMP)
|
||||
var size = (rect.width() / (colorWith + transparentWidth)).toInt()
|
||||
if((colorWith+transparentWidth)*size+colorWith>rect.right){
|
||||
size -= 1
|
||||
}
|
||||
if(rect.height()>tartHeight){
|
||||
//实际高度大于目标高度 上增加高度差 下减去高度差
|
||||
heightDex = (rect.height() - tartHeight) / 2
|
||||
}
|
||||
|
||||
var countstep = 0
|
||||
while (true){
|
||||
val rectF = rect.toRectF()
|
||||
val height: Float = if(rect.height()>tartHeight){
|
||||
tartHeight.toFloat()
|
||||
}else{
|
||||
rectF.bottom - rectF.top
|
||||
}
|
||||
// 计算前几个和后几个特殊高度递增和递减
|
||||
var dex = 0f
|
||||
if(countstep<currendDex.size){
|
||||
dex = (height * currendDex[countstep]).toFloat()
|
||||
}
|
||||
if(size>currendDex.size) {
|
||||
if (size >= countstep && (size - countstep) < currendDex.size) {
|
||||
dex = (height * currendDex[size - countstep]).toFloat()
|
||||
}
|
||||
}
|
||||
rectF.top = dex+heightDex
|
||||
rectF.bottom = rectF.bottom-dex-heightDex
|
||||
rectF.left = (colorWith+transparentWidth)*countstep
|
||||
rectF.right = colorWith+(colorWith+transparentWidth)*countstep
|
||||
if(rectF.right>= rect.right){
|
||||
break
|
||||
}
|
||||
countstep++
|
||||
canvas.drawRoundRect(rectF,48f,48f,mPaint)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setAlpha(alpha: Int) {
|
||||
mPaint.alpha = alpha
|
||||
invalidateSelf()
|
||||
}
|
||||
|
||||
override fun setColorFilter(colorFilter: ColorFilter?) {
|
||||
mPaint.colorFilter = colorFilter
|
||||
invalidateSelf()
|
||||
}
|
||||
|
||||
override fun getOpacity(): Int {
|
||||
return PixelFormat.TRANSLUCENT
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
package com.mogo.och.unmanned.passenger.ui.setting
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.constraintlayout.widget.ConstraintSet
|
||||
import androidx.core.view.marginBottom
|
||||
import androidx.core.view.marginTop
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil
|
||||
import com.mogo.och.unmanned.taxi.passenger.R
|
||||
import kotlinx.android.synthetic.main.taxi_p_setting_light_view.view.tv_current_value
|
||||
|
||||
open class VerticalSeekBar @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
lateinit var draggableButton: ImageView
|
||||
var maxHeightValue = 0
|
||||
|
||||
private var marginTop:Int = 0
|
||||
private var marginBottom:Int = 0
|
||||
|
||||
private val TAG = "VerticalSeekBar"
|
||||
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.taxi_p_setting_light_view, this, true)
|
||||
background = resources.getDrawable(R.drawable.taxi_p_voice_bg)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
draggableButton = findViewById(R.id.aciv_voice_thum)
|
||||
marginTop = draggableButton.marginTop
|
||||
marginBottom = draggableButton.marginBottom
|
||||
}
|
||||
|
||||
override fun onVisibilityAggregated(isVisible: Boolean) {
|
||||
super.onVisibilityAggregated(isVisible)
|
||||
if(isVisible){
|
||||
post {
|
||||
maxHeightValue = height-marginBottom-marginTop-draggableButton.height
|
||||
initLightAndVoice()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var initialX = 0f
|
||||
private var initialY = 0f
|
||||
private val tempSet = ConstraintSet()
|
||||
|
||||
/**
|
||||
* 为该组件的触碰事件重写事件处理方法
|
||||
*/
|
||||
override fun onTouchEvent(event: MotionEvent?): Boolean {
|
||||
when (event?.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
initialX = event.rawX;
|
||||
initialY = event.rawY;
|
||||
}
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
|
||||
if(draggableButton.translationY<0){
|
||||
draggableButton.translationY = 0f
|
||||
return true
|
||||
}else if (draggableButton.translationY+marginTop>(height)){
|
||||
tempSet.clone(this)
|
||||
tempSet.setTranslationY(draggableButton.id,(height-marginTop).toFloat())
|
||||
tempSet.applyTo(this)
|
||||
return true
|
||||
}
|
||||
|
||||
val dx = event.rawX - initialX;
|
||||
val dy = event.rawY - initialY;
|
||||
initialX = event.rawX;
|
||||
initialY = event.rawY;
|
||||
if(draggableButton.translationY+dy<0){
|
||||
return true
|
||||
}
|
||||
if(draggableButton.translationY+dy+marginBottom+marginTop+draggableButton.height>height){
|
||||
return true
|
||||
}
|
||||
CallerLogger.d(TAG,"旧的dy:${draggableButton.translationY}")
|
||||
|
||||
tempSet.clone(this)
|
||||
tempSet.setTranslationY(draggableButton.id,draggableButton.translationY+dy)
|
||||
tempSet.applyTo(this)
|
||||
CallerLogger.d(TAG,"新的dy:${draggableButton.translationY}")
|
||||
|
||||
var percentaget = draggableButton.translationY/maxHeightValue
|
||||
if(percentaget>0.99){
|
||||
percentaget = 1.0f
|
||||
draggableButton.translationY = maxHeightValue.toFloat()
|
||||
}else if(percentaget<0.01){
|
||||
percentaget = 0.0f
|
||||
draggableButton.translationY = 0f
|
||||
}
|
||||
|
||||
upDateLight(percentaget)
|
||||
|
||||
}
|
||||
MotionEvent.ACTION_UP -> {
|
||||
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
open fun upDateLight(percentaget: Float) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
open fun initLightAndVoice(){
|
||||
|
||||
}
|
||||
|
||||
fun setTextValue(value:String){
|
||||
tv_current_value.text = value
|
||||
}
|
||||
|
||||
override fun onWindowVisibilityChanged(visibility: Int) {
|
||||
super.onWindowVisibilityChanged(visibility)
|
||||
if (visibility == View.VISIBLE) {
|
||||
initLightAndVoice()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onWindowFocusChanged(hasWindowFocus: Boolean) {
|
||||
super.onWindowFocusChanged(hasWindowFocus)
|
||||
if (hasWindowFocus) {
|
||||
initLightAndVoice()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.mogo.och.unmanned.passenger.ui.setting
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.media.AudioManager
|
||||
import android.provider.Settings
|
||||
import android.text.TextUtils
|
||||
import android.util.AttributeSet
|
||||
import androidx.core.view.isVisible
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener
|
||||
import com.mogo.commons.module.intent.IntentManager
|
||||
import com.mogo.commons.module.receiver.MogoReceiver
|
||||
import com.mogo.commons.module.receiver.MogoReceiver.ACTION_VOLUME_CHANGE
|
||||
import com.mogo.eagle.core.function.call.setting.CallerRequestActivityHandleManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.BrightnessUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil
|
||||
import kotlinx.android.synthetic.main.taxi_p_setting_light_view.view.tv_current_value
|
||||
import kotlinx.android.synthetic.main.taxi_p_setting_view.view.sb_voice_bar
|
||||
import kotlinx.android.synthetic.main.taxi_p_setting_view.view.tvVoicePer
|
||||
|
||||
|
||||
class VoiceSetting @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : VerticalSeekBar(context, attrs, defStyleAttr), IMogoIntentListener {
|
||||
|
||||
private val TAG = "VoiceSetting"
|
||||
|
||||
private var mAudioManager: AudioManager? = null
|
||||
private var mMaxVolume: Int = -1
|
||||
|
||||
|
||||
override fun upDateLight(percentaget: Float) {
|
||||
context?.let { ctx ->
|
||||
if (mAudioManager == null) {
|
||||
mAudioManager = ctx.getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||
}
|
||||
mAudioManager?.let {
|
||||
if (mMaxVolume < 0) {
|
||||
mMaxVolume = it.getStreamMaxVolume(AudioManager.STREAM_MUSIC)
|
||||
}
|
||||
val currentValue = (percentaget * mMaxVolume).toInt()
|
||||
mAudioManager?.setStreamVolume(
|
||||
AudioManager.STREAM_MUSIC,
|
||||
currentValue,
|
||||
AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE
|
||||
)
|
||||
setTextValue(NumberFormatUtil.percentage(percentaget,0))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun initLightAndVoice(){
|
||||
context?.let {ctx->
|
||||
if(mAudioManager==null) {
|
||||
mAudioManager = ctx.getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||
}
|
||||
mAudioManager?.let {
|
||||
if(mMaxVolume<0) {
|
||||
mMaxVolume = it.getStreamMaxVolume(AudioManager.STREAM_MUSIC)
|
||||
}
|
||||
val mCurrentVolume = it.getStreamVolume(AudioManager.STREAM_MUSIC)
|
||||
val per = mCurrentVolume.toFloat() / mMaxVolume
|
||||
val currentVolume = per * maxHeightValue
|
||||
CallerLogger.d(TAG,"当前的声音:${mCurrentVolume}")
|
||||
ObjectAnimator.ofFloat(
|
||||
draggableButton, "translationY", draggableButton.translationY,
|
||||
currentVolume
|
||||
).apply {
|
||||
duration = 500
|
||||
}.start()
|
||||
tv_current_value.text = "${(BrightnessUtils.getBrightness() * 100) / 255}"
|
||||
setTextValue(NumberFormatUtil.percentage(per,0))
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun onIntentReceived(intentStr: String?, intent: Intent?) {
|
||||
// if (TextUtils.equals(ACTION_VOLUME_CHANGE, intentStr)) {
|
||||
// if (intent!!.getIntExtra(
|
||||
// MogoReceiver.EXTRA_VOLUME_STREAM_TYPE, -1
|
||||
// ) == AudioManager.STREAM_MUSIC
|
||||
// ) {
|
||||
// CallerLogger.d(TAG,"收到信息变更")
|
||||
// ThreadUtils.runOnUiThread {
|
||||
// initLightAndVoice()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,6 +34,7 @@
|
||||
android:layout_marginStart="@dimen/dp_141"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:splitTrack="false"
|
||||
android:orientation="vertical"
|
||||
android:thumb="@drawable/taxi_p_function_voice_right_process_humb"
|
||||
android:thumbOffset="@dimen/dp_2"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
|
||||
@@ -115,29 +115,4 @@
|
||||
app:normalDrawable="@drawable/taxt_p_bottom_music_normal"
|
||||
app:selectedDrawable="@drawable/taxt_p_bottom_music_normal" />
|
||||
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cb_setting_light"
|
||||
android:layout_width="@dimen/dp_70"
|
||||
android:layout_height="@dimen/dp_71"
|
||||
android:background="@drawable/taxt_u_p_setting_light_selector"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginEnd="@dimen/dp_86" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/tv_light_top_02"
|
||||
android:layout_width="@dimen/dp_70"
|
||||
android:layout_height="@dimen/dp_71"
|
||||
android:background="@drawable/taxt_u_p_setting_voice_selector"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
app:layout_constraintEnd_toStartOf="@+id/cb_setting_light"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginEnd="@dimen/dp_86" />
|
||||
|
||||
</merge>
|
||||
@@ -80,14 +80,6 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:roma_change_dis_color="true" />
|
||||
|
||||
<com.mogo.och.unmanned.passenger.ui.setting.LightSetting
|
||||
app:layout_constraintBottom_toTopOf="@+id/bottom"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginEnd="@dimen/dp_50"
|
||||
android:layout_marginBottom="@dimen/dp_50"
|
||||
android:layout_width="@dimen/dp_160"
|
||||
android:layout_height="@dimen/dp_440"/>
|
||||
|
||||
<!-- 红绿灯 -->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
|
||||
android:id="@+id/traffic_light_view"
|
||||
@@ -202,6 +194,52 @@
|
||||
android:layout_height="@dimen/dp_160"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cb_setting_light"
|
||||
android:layout_width="@dimen/dp_70"
|
||||
android:layout_height="@dimen/dp_71"
|
||||
android:background="@drawable/taxt_u_p_setting_light_selector"
|
||||
android:button="@null"
|
||||
android:checked="false"
|
||||
android:gravity="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/bottom"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bottom"
|
||||
android:layout_marginEnd="@dimen/dp_86" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cb_setting_voice"
|
||||
android:layout_width="@dimen/dp_70"
|
||||
android:layout_height="@dimen/dp_71"
|
||||
android:background="@drawable/taxt_u_p_setting_voice_selector"
|
||||
android:button="@null"
|
||||
android:checked="false"
|
||||
android:gravity="center"
|
||||
app:layout_constraintEnd_toStartOf="@+id/cb_setting_light"
|
||||
app:layout_constraintTop_toTopOf="@+id/bottom"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bottom"
|
||||
android:layout_marginEnd="@dimen/dp_86" />
|
||||
|
||||
|
||||
<com.mogo.och.unmanned.passenger.ui.setting.LightSetting
|
||||
android:id="@+id/light_setting"
|
||||
app:layout_constraintStart_toStartOf="@+id/cb_setting_light"
|
||||
app:layout_constraintEnd_toEndOf="@+id/cb_setting_light"
|
||||
app:layout_constraintBottom_toTopOf="@+id/bottom"
|
||||
android:visibility="gone"
|
||||
android:layout_width="@dimen/dp_160"
|
||||
android:layout_height="@dimen/dp_440"/>
|
||||
|
||||
<com.mogo.och.unmanned.passenger.ui.setting.VoiceSetting
|
||||
android:id="@+id/voice_setting"
|
||||
app:layout_constraintStart_toStartOf="@+id/cb_setting_voice"
|
||||
app:layout_constraintEnd_toEndOf="@+id/cb_setting_voice"
|
||||
app:layout_constraintBottom_toTopOf="@+id/bottom"
|
||||
android:visibility="gone"
|
||||
android:layout_width="@dimen/dp_160"
|
||||
android:layout_height="@dimen/dp_440"/>
|
||||
|
||||
<com.mogo.och.unmanned.passenger.ui.arrived.ArrivedView
|
||||
android:id="@+id/arrivedView"
|
||||
android:visibility="gone"
|
||||
|
||||
Reference in New Issue
Block a user