[3.4.0] add func of setting of tacip
This commit is contained in:
@@ -2,10 +2,10 @@ package com.mogo.och.bus.passenger.ui.dialogfragment.fragment
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.animation.ValueAnimator
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.graphics.BitmapFactory
|
||||
import android.graphics.drawable.ClipDrawable
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.graphics.drawable.LayerDrawable
|
||||
import android.media.AudioManager
|
||||
import android.os.Bundle
|
||||
@@ -32,7 +32,7 @@ import com.mogo.och.bus.passenger.ui.layoutmanage.PagerCenterSnapHelper
|
||||
import com.mogo.och.bus.passenger.view.HorizontalDecoration
|
||||
import com.mogo.och.bus.passenger.view.PickerLayoutManager
|
||||
import com.mogo.och.common.module.utils.SoundPoolHelper
|
||||
import com.yangyakun.main.ui.loading.drawable.MineGradientDrawable
|
||||
import com.mogo.och.common.module.wigets.MineGradientDrawable
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
@@ -477,7 +477,7 @@ class M1SoftFragment :
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "打开暖风")
|
||||
heaterAirEnable(false)
|
||||
closeAircondition()//关闭空调
|
||||
var switch = 1;
|
||||
val switch: Int
|
||||
when (rg_setting_windspeed.checkedRadioButtonId) {
|
||||
R.id.rb_wind_speed_low -> {
|
||||
rb_wind_speed_middle.tag = touchTag
|
||||
@@ -616,12 +616,12 @@ class M1SoftFragment :
|
||||
|
||||
// region 声音
|
||||
private var mAudioManager: AudioManager? = null
|
||||
private var mMaxVolume: Int? = 100;
|
||||
private var mMaxVolume: Int? = 100
|
||||
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private fun setVoiceInfo() {
|
||||
val dp2px = AutoSizeUtils.dp2px(context, 26f)//进度条高度
|
||||
R.color.bus_p_m1_47576e
|
||||
val color2CBFFC = ContextCompat.getColor(requireContext(), R.color.bus_p_m1_2cbffc)
|
||||
val color1060FF = ContextCompat.getColor(requireContext(), R.color.bus_p_m1_1060ff)
|
||||
val color96A5C2 = ContextCompat.getColor(requireContext(), R.color.bus_p_m1_96a5c2)
|
||||
@@ -642,7 +642,7 @@ class M1SoftFragment :
|
||||
mMaxVolume?.let {
|
||||
var currnetValue = ((progress.toFloat() / 100) * it).toInt()
|
||||
if (currnetValue <= 0) {
|
||||
currnetValue = 1;
|
||||
currnetValue = 1
|
||||
}
|
||||
mAudioManager?.setStreamVolume(
|
||||
AudioManager.STREAM_MUSIC,
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.yangyakun.main.ui.loading.drawable
|
||||
package com.mogo.och.common.module.wigets
|
||||
|
||||
import android.graphics.*
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.util.Log
|
||||
import androidx.core.graphics.toRectF
|
||||
|
||||
/**
|
||||
@@ -29,7 +28,6 @@ class MineGradientDrawable(colorStart: Int = Color.BLUE,colorEnd:Int = Color.RED
|
||||
this.colorStart = colorStart
|
||||
this.colorEnd = colorEnd
|
||||
this.tartHeight = height
|
||||
Color.TRANSPARENT
|
||||
mPaint.isAntiAlias = true
|
||||
index.forEachIndexed { index, d ->
|
||||
currendDex += (1-d)/2
|
||||
@@ -51,14 +49,13 @@ class MineGradientDrawable(colorStart: Int = Color.BLUE,colorEnd:Int = Color.RED
|
||||
var countstep = 0
|
||||
while (true){
|
||||
val rectF = rect.toRectF()
|
||||
var height = 0f
|
||||
height = if(rect.height()>tartHeight){
|
||||
val height: Float = if(rect.height()>tartHeight){
|
||||
tartHeight.toFloat()
|
||||
}else{
|
||||
rectF.bottom - rectF.top
|
||||
}
|
||||
// 计算前几个和后几个特殊高度递增和递减
|
||||
var dex = 0f;
|
||||
var dex = 0f
|
||||
if(countstep<currendDex.size){
|
||||
dex = (height * currendDex[countstep]).toFloat()
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.mogo.och.taxi.passenger">
|
||||
|
||||
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
|
||||
<uses-permission android:name="android.permission.WRITE_SETTINGS"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
<application>
|
||||
|
||||
</application>
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
package com.mogo.och.taxi.passenger.ui
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.ClipDrawable
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.graphics.drawable.LayerDrawable
|
||||
import android.media.AudioManager
|
||||
import android.provider.Settings
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.SeekBar
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.setting.CallerRequestActivityHandleManager
|
||||
import com.mogo.eagle.core.utilcode.util.BrightnessUtils
|
||||
import com.mogo.och.common.module.wigets.MineGradientDrawable
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import kotlinx.android.synthetic.main.taxi_p_setting_view.view.*
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
class TaxiPSettingView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "TaxiPSettingView"
|
||||
}
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.taxi_p_setting_view, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private var mAudioManager: AudioManager? = null
|
||||
private var mMaxVolume: Int? = 15
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private fun initView() {
|
||||
sb_light_bar.setProgressDrawableTiled(getDrawable())
|
||||
sb_light_bar.max = 100
|
||||
sb_light_bar.min = 5
|
||||
sb_light_bar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
|
||||
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
|
||||
tvSoundPer.text = "$progress%"
|
||||
if (fromUser) {
|
||||
if(!Settings.System.canWrite(context)){
|
||||
CallerRequestActivityHandleManager.requestPermission(TAG,Settings.ACTION_MANAGE_WRITE_SETTINGS)
|
||||
return
|
||||
}
|
||||
if(BrightnessUtils.isAutoBrightnessEnabled()){
|
||||
BrightnessUtils.setBrightness(((progress.toFloat() / 100) * 255).toInt())
|
||||
}else{
|
||||
BrightnessUtils.setAutoBrightnessEnabled(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
override fun onStartTrackingTouch(seekBar: SeekBar?) {}
|
||||
override fun onStopTrackingTouch(seekBar: SeekBar?) {}
|
||||
})
|
||||
sb_light_bar.progress = (BrightnessUtils.getBrightness() * 100) / 255
|
||||
|
||||
sb_voice_bar.setProgressDrawableTiled(getDrawable())
|
||||
sb_voice_bar.max = 100
|
||||
sb_voice_bar.min = 5
|
||||
sb_voice_bar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
|
||||
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
|
||||
tvVoicePer.text = "$progress%"
|
||||
if (fromUser) {
|
||||
mMaxVolume?.let {
|
||||
Log.d("emArrow","progress:$progress, cal :${(progress.toFloat() / 100)}, currentV:${((progress.toFloat() / 100) * it).toInt()} ")
|
||||
var currentValue = ((progress.toFloat() / 100) * it).toInt()
|
||||
if (currentValue <= 0) {
|
||||
currentValue = 1
|
||||
}
|
||||
mAudioManager?.setStreamVolume(
|
||||
AudioManager.STREAM_MUSIC,
|
||||
currentValue,
|
||||
AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStartTrackingTouch(seekBar: SeekBar?) {}
|
||||
override fun onStopTrackingTouch(seekBar: SeekBar?) {}
|
||||
})
|
||||
|
||||
context?.let {
|
||||
mAudioManager = it.getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||
mMaxVolume = mAudioManager?.getStreamMaxVolume(AudioManager.STREAM_MUSIC)
|
||||
Log.d("emArrow","max volume:$mMaxVolume")
|
||||
val mCurrentVolume = mAudioManager?.getStreamVolume(AudioManager.STREAM_MUSIC)
|
||||
Log.d("emArrow","mCurrentVolume:$mCurrentVolume")
|
||||
mMaxVolume?.let { max ->
|
||||
mCurrentVolume?.let { current ->
|
||||
if (current == 1) {
|
||||
sb_voice_bar.progress = 5
|
||||
tvVoicePer.text = "5%"
|
||||
} else {
|
||||
val fl = current.toFloat() / max * 100
|
||||
sb_voice_bar.progress = fl.toInt()
|
||||
tvVoicePer.text = "${fl.toInt()}%"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private fun getDrawable(): Drawable {
|
||||
val dp2px = AutoSizeUtils.dp2px(context, 26f)//进度条高度
|
||||
val color2CBFFC = ContextCompat.getColor(context, R.color.taxi_p_2CBFFC)
|
||||
val color1060FF = ContextCompat.getColor(context, R.color.taxi_p_1060ff)
|
||||
val color96A5C2 = ContextCompat.getColor(context, R.color.taxi_p_96a5c2)
|
||||
val temp03 = MineGradientDrawable(color2CBFFC, color1060FF, dp2px)
|
||||
val clipDrawable3 = ClipDrawable(temp03, Gravity.START, ClipDrawable.HORIZONTAL)
|
||||
val temp01 = MineGradientDrawable(color96A5C2, color96A5C2, dp2px)
|
||||
val arr = arrayOf(temp01, clipDrawable3)
|
||||
val ld = LayerDrawable(arr)
|
||||
ld.setDrawableByLayerId(android.R.id.background, temp01)
|
||||
ld.setDrawableByLayerId(android.R.id.progress, clipDrawable3)
|
||||
return ld
|
||||
}
|
||||
|
||||
override fun onWindowVisibilityChanged(visibility: Int) {
|
||||
super.onWindowVisibilityChanged(visibility)
|
||||
if(visibility == View.VISIBLE){
|
||||
sb_light_bar.progress = (BrightnessUtils.getBrightness() * 100) / 255
|
||||
}
|
||||
}
|
||||
|
||||
override fun onWindowFocusChanged(hasWindowFocus: Boolean) {
|
||||
super.onWindowFocusChanged(hasWindowFocus)
|
||||
if(hasWindowFocus){
|
||||
sb_light_bar.progress = (BrightnessUtils.getBrightness() * 100) / 255
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,6 +22,7 @@ import com.mogo.och.taxi.passenger.ui.arrived.ArrivedView
|
||||
import com.mogo.och.taxi.passenger.ui.check.TaxiPassengerCheckView
|
||||
import com.mogo.och.taxi.passenger.ui.startautopilot.StartAutopilotView
|
||||
import kotlinx.android.synthetic.main.taxi_p_base_fragment.*
|
||||
import kotlinx.android.synthetic.main.taxi_p_base_fragment.*
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
/**
|
||||
@@ -69,7 +70,13 @@ class TaxiPassengerBaseFragment() :
|
||||
overMapView.onCreateView(savedInstanceState)
|
||||
}
|
||||
|
||||
private var settingClick = false
|
||||
|
||||
private fun initListener() {
|
||||
ck_setting.setOnClickListener {
|
||||
clSettingView.visibility = if(!settingClick) View.VISIBLE else View.GONE
|
||||
settingClick = !settingClick
|
||||
}
|
||||
bottom.setOverMapApplyClick(object : BottomBar.ApplyClickLintener{
|
||||
override fun onApplyClick(selectItem: BottomBar.SelectView) {
|
||||
when (selectItem) {
|
||||
@@ -78,6 +85,7 @@ class TaxiPassengerBaseFragment() :
|
||||
mapBizView.visibility = View.VISIBLE
|
||||
presenter?.setItineraryVisibility()
|
||||
ck_setting.visibility = View.VISIBLE
|
||||
clSettingView.visibility = View.VISIBLE
|
||||
if (DeviceUtils.isLenovoModel() || DeviceUtils.isEB5Model()) {
|
||||
romaPView.visibility = View.VISIBLE
|
||||
} else {
|
||||
@@ -93,6 +101,7 @@ class TaxiPassengerBaseFragment() :
|
||||
mapBizView.visibility = View.GONE
|
||||
presenter?.setItineraryVisibility()
|
||||
ck_setting.visibility = View.VISIBLE
|
||||
clSettingView.visibility = View.VISIBLE
|
||||
romaPView.visibility = View.GONE
|
||||
rv_location_center.visibility = View.VISIBLE
|
||||
pcnActionView.visibility = View.VISIBLE
|
||||
@@ -104,6 +113,7 @@ class TaxiPassengerBaseFragment() :
|
||||
mapBizView.visibility = View.GONE
|
||||
presenter?.setItineraryVisibility()
|
||||
ck_setting.visibility = View.GONE
|
||||
clSettingView.visibility = View.GONE
|
||||
romaPView.visibility = View.GONE
|
||||
rv_location_center.visibility = View.GONE
|
||||
pcnActionView.visibility = View.GONE
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item
|
||||
android:drawable="@drawable/taxi_p_function_voice_humb" android:gravity="center"
|
||||
android:top="@dimen/dp_4"
|
||||
android:width="@dimen/dp_46"
|
||||
android:height="@dimen/dp_46"/>
|
||||
</layer-list >
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 216 KiB |
@@ -39,14 +39,23 @@
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/ck_setting"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
android:layout_marginStart="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_100"
|
||||
android:background="@drawable/taxi_p_setting_selector"
|
||||
android:button="@null"
|
||||
android:layout_marginTop="@dimen/dp_100"
|
||||
android:layout_marginStart="@dimen/dp_40"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_height="@dimen/dp_120"/>
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.och.taxi.passenger.ui.TaxiPSettingView
|
||||
android:id="@+id/clSettingView"
|
||||
android:layout_width="@dimen/dp_824"
|
||||
android:layout_height="@dimen/dp_517"
|
||||
android:layout_marginTop="@dimen/dp_205"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- 漫游按钮 -->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaPassengerView
|
||||
@@ -56,20 +65,20 @@
|
||||
android:layout_marginStart="@dimen/dp_220"
|
||||
android:layout_marginTop="100dp"
|
||||
android:background="@drawable/roma_taxi_p_bg_selector"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:roma_close="@drawable/roma_taxi_p_bg_selector"
|
||||
app:roma_open="@drawable/taxi_p_roma_checked" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rv_location_center"
|
||||
android:background="@drawable/taxi_p_location_center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginEnd="@dimen/dp_40"
|
||||
android:layout_width="@dimen/dp_96"
|
||||
android:layout_height="@dimen/dp_96"/>
|
||||
android:layout_height="@dimen/dp_96"
|
||||
android:layout_marginEnd="@dimen/dp_40"
|
||||
android:background="@drawable/taxi_p_location_center"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- 红绿灯 -->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
|
||||
@@ -86,25 +95,25 @@
|
||||
android:layout_width="@dimen/dp_400"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
android:longClickable="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- 路程信息 -->
|
||||
<com.mogo.och.taxi.passenger.ui.orderinfo.ItineraryView
|
||||
android:id="@+id/itinerary"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/bottom"
|
||||
android:layout_width="@dimen/dp_842"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@+id/bottom"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!-- 底部导航栏 -->
|
||||
<com.mogo.och.taxi.passenger.ui.bottom.BottomBar
|
||||
android:id="@+id/bottom"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_160"/>
|
||||
android:layout_height="@dimen/dp_160"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_xiaozhi_normal"
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
<?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="match_parent"
|
||||
android:background="@drawable/taxi_p_setting_view_bg">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSettingLight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_95"
|
||||
android:layout_marginTop="@dimen/dp_98"
|
||||
android:text="@string/taxi_p_setting_light"
|
||||
android:textColor="@color/taxi_p_374968"
|
||||
android:textSize="@dimen/dp_36"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_95"
|
||||
android:layout_marginTop="@dimen/dp_35"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvSettingLight" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/sb_light_bar"
|
||||
android:layout_width="@dimen/dp_376"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_141"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:splitTrack="false"
|
||||
android:thumb="@drawable/taxi_p_function_voice_right_process_humb"
|
||||
android:thumbOffset="@dimen/dp_2"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvSettingLight"
|
||||
app:layout_constraintVertical_bias="0.404"
|
||||
app:layout_constraintWidth_percent="0.253" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_535"
|
||||
android:layout_marginTop="@dimen/dp_35"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvSettingLight" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSoundPer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_154"
|
||||
android:layout_marginRight="@dimen/dp_113"
|
||||
android:gravity="right"
|
||||
android:textColor="@color/taxi_p_303C52"
|
||||
android:textSize="@dimen/dp_60"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSettingSound"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_95"
|
||||
android:layout_marginTop="@dimen/dp_129"
|
||||
android:text="@string/taxi_p_setting_sound"
|
||||
android:textColor="@color/taxi_p_374968"
|
||||
android:textSize="@dimen/dp_36"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvSettingLight" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_95"
|
||||
android:layout_marginTop="@dimen/dp_35"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvSettingSound" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/sb_voice_bar"
|
||||
android:layout_width="@dimen/dp_376"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_141"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:splitTrack="false"
|
||||
android:thumb="@drawable/taxi_p_function_voice_right_process_humb"
|
||||
android:thumbOffset="@dimen/dp_2"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvSettingSound"
|
||||
app:layout_constraintVertical_bias="0.404"
|
||||
app:layout_constraintWidth_percent="0.253" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_535"
|
||||
android:layout_marginTop="@dimen/dp_35"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvSettingSound" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvVoicePer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_333"
|
||||
android:layout_marginRight="@dimen/dp_113"
|
||||
android:gravity="right"
|
||||
android:textColor="@color/taxi_p_303C52"
|
||||
android:textSize="@dimen/dp_60"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -77,6 +77,11 @@
|
||||
<color name="taxi_p_282F62">#282F62</color>
|
||||
<color name="taxi_p_121842">#121842</color>
|
||||
<color name="taxi_p_242C65">#242C65</color>
|
||||
<color name="taxi_p_374968">#374968</color>
|
||||
<color name="taxi_p_303C52">#303C52</color>
|
||||
<color name="taxi_p_2CBFFC">#2CBFFC</color>
|
||||
<color name="taxi_p_1060ff">#1060ff</color>
|
||||
<color name="taxi_p_96a5c2">#96a5c2</color>
|
||||
<color name="taxi_p_76D7FF">#76D7FF</color>
|
||||
<color name="taxi_p_255BAA">#255BAA</color>
|
||||
<color name="taxi_p_80F8FF">#80F8FF</color>
|
||||
|
||||
@@ -42,4 +42,8 @@
|
||||
<string name="taxi_p_surplustime">剩余(分)</string>
|
||||
|
||||
|
||||
<string name="taxi_p_setting_light">亮度</string>
|
||||
<string name="taxi_p_setting_sound">音量</string>
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -5,6 +5,7 @@ buildscript {
|
||||
apply from: rootProject.file('gradle/ext.gradle')
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven { url 'https://nexus.zhidaoauto.com/repository/maven-snapshot/' }
|
||||
maven { url 'https://nexus.zhidaoauto.com/repository/maven-releases/' }
|
||||
maven { url 'https://nexus.zhidaoauto.com/repository/maven-public/' }
|
||||
maven { url 'https://storage.zego.im/maven' }
|
||||
|
||||
@@ -1,33 +1,37 @@
|
||||
package com.mogo.eagle.core.function.main
|
||||
|
||||
import android.Manifest
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.*
|
||||
import android.widget.FrameLayout
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.kwai.koom.base.MonitorManager.addMonitorConfig
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakListener
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakMonitor.start
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakMonitorConfig
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakRecord
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils
|
||||
import com.mogo.commons.context.ContextHolderUtil
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.mvp.MvpActivity
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoRequestActivityHandler
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiFloatViewManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
|
||||
import com.mogo.eagle.core.function.call.setting.CallerRequestActivityHandleManager
|
||||
import com.mogo.eagle.core.function.call.startup.CallerStartUpManager.initStageTwo
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
|
||||
@@ -47,6 +51,7 @@ import com.mogo.map.uicontroller.EnumMapUI
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import kotlinx.android.synthetic.main.module_main_activity_main.*
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-23
|
||||
@@ -55,7 +60,7 @@ import kotlinx.android.synthetic.main.module_main_activity_main.*
|
||||
* 描述:加载各个模块
|
||||
*/
|
||||
open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
IMoGoAutopilotStatusListener {
|
||||
IMoGoAutopilotStatusListener, IMoGoRequestActivityHandler {
|
||||
|
||||
companion object {
|
||||
protected const val TAG = "MainActivity"
|
||||
@@ -92,13 +97,14 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
private fun injectStatusBar() {
|
||||
val decorView = this.window.decorView as? FrameLayout ?: return
|
||||
val contentView =
|
||||
(decorView.findViewById<View>(android.R.id.content) as? ViewGroup)?.getChildAt(0) ?: return
|
||||
(decorView.findViewById<View>(android.R.id.content) as? ViewGroup)?.getChildAt(0)
|
||||
?: return
|
||||
contentView.fitsSystemWindows = false
|
||||
decorView.clipToPadding = false
|
||||
var statusBarView = decorView.findViewWithTag<View>("status_bar")
|
||||
if (statusBarView == null) {
|
||||
val statusBar = CallerHmiFloatViewManager.getView(this)
|
||||
statusBarView = statusBar?:StatusBarView(this)
|
||||
statusBarView = statusBar ?: StatusBarView(this)
|
||||
statusBarView.setTag("status_bar")
|
||||
}
|
||||
val statusBarLP = FrameLayout.LayoutParams(
|
||||
@@ -115,7 +121,8 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
private fun injectFloatView() {
|
||||
val decorView = this.window.decorView as? FrameLayout ?: return
|
||||
val contentView =
|
||||
(decorView.findViewById<View>(android.R.id.content) as? ViewGroup)?.getChildAt(0) ?: return
|
||||
(decorView.findViewById<View>(android.R.id.content) as? ViewGroup)?.getChildAt(0)
|
||||
?: return
|
||||
contentView.fitsSystemWindows = false
|
||||
decorView.clipToPadding = false
|
||||
var floatContainer = decorView.findViewWithTag<View>("float_container")
|
||||
@@ -137,6 +144,7 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
ContextHolderUtil.holdContext(this)
|
||||
// 监听工控机连接信息
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerRequestActivityHandleManager.addListener(TAG, this)
|
||||
initStageTwo()
|
||||
// 加载模块
|
||||
mPresenter!!.postLoadModuleMsg()
|
||||
@@ -197,7 +205,7 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
override fun onMapLoaded() {
|
||||
// 延时加载其他模块
|
||||
window.decorView.post {
|
||||
MogoStatusManager.getInstance().setScreenCoverMode(TAG,true)
|
||||
MogoStatusManager.getInstance().setScreenCoverMode(TAG, true)
|
||||
HdMapBuildConfig.isMapLoaded = true
|
||||
mPresenter!!.delayOperations()
|
||||
loadFunctionFragment()
|
||||
@@ -324,6 +332,7 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
CallerRequestActivityHandleManager.removeListener(TAG)
|
||||
mogoMapListenerHandler.unregisterHostMapListener(TAG)
|
||||
val mapUIController = getMapUIController()
|
||||
mapUIController?.destroy()
|
||||
@@ -335,6 +344,19 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
ProcessUtils.killAllBackgroundProcesses()
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_INIT_STATUS,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_INIT,
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_REQUEST_PERMISSION,
|
||||
paramIndexes = [0, 1]
|
||||
)
|
||||
override fun handleRequestPermission(tag: String, permission: String) {
|
||||
super.handleRequestPermission(tag, permission)
|
||||
val intent = Intent(permission, Uri.parse("package:$packageName"))
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
override fun onRequestPermissionsResult(
|
||||
requestCode: Int,
|
||||
permissions: Array<String>,
|
||||
|
||||
@@ -72,6 +72,7 @@ class ChainConstant {
|
||||
const val CHAIN_CODE_RECORD_ANR = "CHAIN_CODE_RECORD_ANR"
|
||||
const val CHAIN_CODE_RECORD_WEAK_NETWORK = "CHAIN_ALIAS_CODE_RECORD_WEAK_NETWORK"
|
||||
|
||||
const val CHAIN_CODE_REQUEST_PERMISSION = "CHAIN_CODE_REQUEST_PERMISSION"
|
||||
const val CHAIN_CODE_APP_INFO_CONFIG_UPDATE = "CHAIN_CODE_APP_INFO_CONFIG_UPDATE"
|
||||
const val CHAIN_CODE_FUNC_CONFIG_CHANGED = "CHAIN_CODE_FUNC_CONFIG_CHANGED"
|
||||
const val CHAIN_CODE_START_UP = "CHAIN_CODE_START_UP"
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.mogo.eagle.core.function.api.setting
|
||||
|
||||
interface IMoGoRequestActivityHandler {
|
||||
|
||||
/**
|
||||
* 向activity申请权限
|
||||
*/
|
||||
fun handleRequestPermission(tag: String, permission: String) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求修改亮度
|
||||
*/
|
||||
fun handleRequestLight(percent:Float){
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.mogo.eagle.core.function.call.setting
|
||||
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoRequestActivityHandler
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
/**
|
||||
* 仅为了view在操作时无权限时申请,比activity启动早的请求 需要统一调度在activity中request
|
||||
*/
|
||||
object CallerRequestActivityHandleManager : CallerBase<IMoGoRequestActivityHandler>() {
|
||||
|
||||
fun requestPermission(tag: String, permission: String) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.handleRequestPermission(tag, permission)
|
||||
}
|
||||
}
|
||||
|
||||
fun requestLight(percent:Float){
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.handleRequestLight(percent)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -62,15 +62,10 @@ public final class BrightnessUtils {
|
||||
* @return 屏幕亮度 0-255
|
||||
*/
|
||||
public static int getBrightness() {
|
||||
try {
|
||||
return Settings.System.getInt(
|
||||
Utils.getApp().getContentResolver(),
|
||||
Settings.System.SCREEN_BRIGHTNESS
|
||||
);
|
||||
} catch (Settings.SettingNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
return 0;
|
||||
}
|
||||
return Settings.System.getInt(
|
||||
Utils.getApp().getContentResolver(),
|
||||
Settings.System.SCREEN_BRIGHTNESS,125
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user