[1.0.0]
[样式修改]
This commit is contained in:
yangyakun
2023-02-13 21:33:15 +08:00
parent 1e83fd5566
commit 38a882b3e5
13 changed files with 135 additions and 42 deletions

View File

@@ -4,7 +4,6 @@ import android.content.Context
import android.graphics.Color
import android.graphics.drawable.ClipDrawable
import android.graphics.drawable.LayerDrawable
import android.graphics.drawable.ScaleDrawable
import android.media.AudioManager
import android.os.Bundle
import android.view.Gravity
@@ -14,7 +13,6 @@ import android.widget.SeekBar.OnSeekBarChangeListener
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearSnapHelper
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.SnapHelper
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -30,7 +28,6 @@ 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.zhidao.support.adas.high.AdasManager
import kotlinx.android.synthetic.m1.bus_p_function_setting_soft_fragment.*
import me.jessyan.autosize.utils.AutoSizeUtils
@@ -322,6 +319,16 @@ class BusPassengerFunctionSoftFragment :
if (layoutManager is PickerLayoutManager) {
layoutManager.setHorizontallyScroll(enable)
}
val adapter = rv_aircondition_temperature.adapter as TemperatureAdapter
if(enable){
adapter.setEnable(true)
iv_temperature_select.visibility = View.VISIBLE
rb_wind_speed_low.setTextColor(ContextCompat.getColor(requireContext(),R.color.bus_p_m1_6647576e))
}else{
adapter.setEnable(false)
iv_temperature_select.visibility = View.GONE
rb_wind_speed_low.setTextColor(ContextCompat.getColor(requireContext(),R.color.bus_p_function_airconditon_pattern_text_color_selector))
}
}
/**
@@ -330,28 +337,30 @@ class BusPassengerFunctionSoftFragment :
private fun openHeater() {
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "打开暖风")
heaterAirEnable(false)
if (!tv_aircondition_switch.isChecked) {
return
}
closeAircondition()//关闭空调
var switch = 1;
when (rg_setting_windspeed.checkedRadioButtonId) {
R.id.rb_wind_speed_low -> {
rb_wind_speed_middle.tag = touchTag
rb_wind_speed_middle.toggle()
mPresenter?.openAndSetHeader(1)
switch = 1
}
R.id.rb_wind_speed_middle -> {
mPresenter?.openAndSetHeader(1)
switch = 1
}
R.id.rb_wind_speed_high -> {
mPresenter?.openAndSetHeader(2)
switch = 2
}
else -> {
rb_wind_speed_middle.tag = touchTag
rb_wind_speed_middle.toggle()
mPresenter?.openAndSetHeader(1)
switch = 1
}
}
if (!tv_aircondition_switch.isChecked) {
return
}
mPresenter?.openAndSetHeader(switch)
}
@@ -445,7 +454,7 @@ class BusPassengerFunctionSoftFragment :
private fun setVoiceInfo() {
val dp2px = AutoSizeUtils.dp2px(context, 26f)//进度条高度
R.color.bus_p_m1_47576E
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)

View File

@@ -1,11 +1,13 @@
package com.mogo.och.bus.passenger.ui
import android.os.Bundle
import android.view.View
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.Fragment
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.map.CallerSmpManager.hidePanel
import com.mogo.eagle.core.function.hmi.ui.msgbox.MMsgBoxButtonView
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -52,29 +54,48 @@ class BusPassengerRouteFragment :
true
}
omvOverMap.hideResetView()
viewDriverMsgBoxButton.setClickListener(object : MMsgBoxButtonView.ClickListener {
override fun showMsgBoxList(show: Boolean) {
if (show) {
viewDriverMsgBoxList.visibility = View.VISIBLE
viewDriverMsgBoxBubble.visibility = View.GONE
viewDriverMsgBoxBubble.isShowData(false)
} else {
viewDriverMsgBoxList.visibility = View.GONE
viewDriverMsgBoxBubble.visibility = View.VISIBLE
viewDriverMsgBoxBubble.isShowData(true)
}
}
})
}
private fun openSettingPage(tab:String) {
private fun openSettingPage(tab: String) {
CallerHmiManager.hideToolsView()
val fragmentByTag: Fragment? = childFragmentManager.findFragmentByTag(BusPassengerFunctionFragment.TAG)
val fragmentByTag: Fragment? =
childFragmentManager.findFragmentByTag(BusPassengerFunctionFragment.TAG)
if (fragmentByTag is DialogFragment) {
if (fragmentByTag.dialog != null && fragmentByTag.dialog!!.isShowing) {
return
}
if (fragmentByTag.dialog != null && fragmentByTag.isAdded) {
if (AppStateManager.currentActivity() == null) { // 没有在当前应用内 在启动页面关闭应用
CallerLogger.d(SceneConstant.M_TAXI + LoginServiceImpl.TAG, "showLoginDialogFragment 权限验证")
CallerLogger.d(
SceneConstant.M_TAXI + LoginServiceImpl.TAG,
"showLoginDialogFragment 权限验证"
)
return
}
}
}
if (bpFunctionGroupDialogFragment?.get() == null) {
bpFunctionGroupDialogFragment = WeakReference(BusPassengerFunctionFragment.newInstance())
bpFunctionGroupDialogFragment =
WeakReference(BusPassengerFunctionFragment.newInstance())
}
val bpFunctionGroup = bpFunctionGroupDialogFragment?.get()
bpFunctionGroup?.arguments?.putString(BusPassengerFunctionFragment.SELECTTAB,tab)
bpFunctionGroup?.arguments?.putString(BusPassengerFunctionFragment.SELECTTAB, tab)
if (bpFunctionGroup != null) {
if (bpFunctionGroup.dialog != null && bpFunctionGroup.dialog!!.isShowing) {
return
@@ -85,18 +106,30 @@ class BusPassengerRouteFragment :
}
if (ClickUtils.isFastClick()) {
bpFunctionGroup.show(parentFragmentManager, LoginServiceImpl.TAG)
CallerLogger.d(SceneConstant.M_TAXI + LoginServiceImpl.TAG, "showLoginDialogFragment 展示登录界面")
}else{
CallerLogger.d(SceneConstant.M_TAXI + LoginServiceImpl.TAG, "showLoginDialogFragment 展示登录界面 1s内执行一次")
CallerLogger.d(
SceneConstant.M_TAXI + LoginServiceImpl.TAG,
"showLoginDialogFragment 展示登录界面"
)
} else {
CallerLogger.d(
SceneConstant.M_TAXI + LoginServiceImpl.TAG,
"showLoginDialogFragment 展示登录界面 1s内执行一次"
)
}
}
}
fun setSpeed(speed:String){
fun setSpeed(speed: String) {
tv_speed.text = speed
}
fun setDistanceAndTime(distance: String,distanceUnit: String,sumTime:String,arrivedTime:String){
fun setDistanceAndTime(
distance: String,
distanceUnit: String,
sumTime: String,
arrivedTime: String
) {
tv_distance.text = distance
tv_distance_unit.text = "距离(${distanceUnit})"
tv_distance_surplus_time.text = sumTime

View File

@@ -6,6 +6,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.och.bus.passenger.R;
@@ -23,6 +24,7 @@ public class TemperatureAdapter extends RecyclerView.Adapter<TemperatureAdapter.
private Context context;
private List<Temperature> dataList;
private RecyclerView recyclerView;
private Boolean enable = true;
public TemperatureAdapter(Context context, List<Temperature> dataList, RecyclerView recyclerView) {
this.context = context;
@@ -42,6 +44,12 @@ public class TemperatureAdapter extends RecyclerView.Adapter<TemperatureAdapter.
public void onBindViewHolder(TextVH holder, int position) {
Temperature temperature = dataList.get(holder.getBindingAdapterPosition());
holder.pickerTxt.setText(temperature.getShowTitle());
if(enable){
holder.pickerTxt.setTextColor(ContextCompat.getColor(context,R.color.bus_p_m1_47576e));
}else {
holder.pickerTxt.setTextColor(ContextCompat.getColor(context,R.color.bus_p_m1_6647576e));
}
holder.pickerTxt.setTag(temperature);
holder.pickerTxt.setOnClickListener(v -> {
if (recyclerView != null) {
@@ -64,6 +72,11 @@ public class TemperatureAdapter extends RecyclerView.Adapter<TemperatureAdapter.
return dataList;
}
public void setEnable(boolean enable) {
this.enable = enable;
notifyDataSetChanged();
}
class TextVH extends RecyclerView.ViewHolder {
TextView pickerTxt;

View File

@@ -36,7 +36,7 @@ public class HorizontalDecoration extends RecyclerView.ItemDecoration {
* 由于此时View并未完成测量无法基于测量获取其宽度;思路是在view绘制完成后再进行测量并设置第一个的左边距
*/
if(distance <= 0){
view.post(new Runnable() {
view.postDelayed(new Runnable() {
@Override
public void run() {
distance = dtDistance(parent,view);
@@ -48,7 +48,7 @@ public class HorizontalDecoration extends RecyclerView.ItemDecoration {
//打开后默认显示第一个(居中显示)
parent.scrollToPosition(0);
}
});
},500);
}
/**
* 通过设置Item左右边距实现第一个左侧和最后一个右侧设置边距,确保显示的视图位于屏幕中间

View File

@@ -10,7 +10,6 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.LinearSmoothScroller;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.eagle.core.utilcode.util.ClickUtils;
import com.mogo.och.bus.passenger.R;
public class PickerLayoutManager extends LinearLayoutManager {
@@ -107,7 +106,7 @@ public class PickerLayoutManager extends LinearLayoutManager {
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (child instanceof TextView) {
((TextView) child).setTextColor(ContextCompat.getColor(child.getContext(), R.color.bus_p_m1_47576E));
((TextView) child).setTextColor(ContextCompat.getColor(child.getContext(), R.color.bus_p_m1_47576e));
}
}
}

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/bus_p_m1_47576e" android:state_enabled="true"/>
<item android:color="@color/bus_p_m1_6647576e" android:state_enabled="false"/>
</selector>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@android:color/white" android:state_checked="true"/>
<item android:color="@color/bus_p_m1_47576e" android:state_checked="false"/>
<item android:color="@color/bus_p_m1_6647576e" android:state_enabled="false"/>
<item android:color="@color/bus_p_m1_47576e" android:state_enabled="true"/>
<item android:color="@color/bus_p_m1_47576e" />
</selector>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@android:color/white" android:state_checked="true"/>
<item android:color="@color/bus_p_m1_47576E" android:state_checked="false"/>
<item android:color="@color/bus_p_m1_47576E" />
</selector>

View File

@@ -163,6 +163,37 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<!--消息盒子选择入口-->
<com.mogo.eagle.core.function.hmi.ui.msgbox.MMsgBoxButtonView
android:id="@+id/viewDriverMsgBoxButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_50"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<!--消息盒子打开视图-->
<com.mogo.eagle.core.function.hmi.ui.msgbox.MMsgBoxListView
android:id="@+id/viewDriverMsgBoxList"
android:layout_width="450dp"
android:layout_height="520dp"
android:visibility="gone"
android:layout_marginEnd="@dimen/dp_34"
app:layout_constraintEnd_toEndOf="@+id/viewDriverMsgBoxButton"
app:layout_constraintTop_toBottomOf="@+id/viewDriverMsgBoxButton" />
<!--消息盒子气泡视图-->
<com.mogo.eagle.core.function.hmi.ui.msgbox.MMsgBoxBubbleView
android:id="@+id/viewDriverMsgBoxBubble"
android:layout_width="450dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_34"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="@+id/viewDriverMsgBoxButton"
app:layout_constraintTop_toBottomOf="@+id/viewDriverMsgBoxButton"/>
<ImageView
android:id="@+id/cb_bp_video_player"
android:src="@drawable/bus_p_function_bottom_information_bg_selector"

View File

@@ -109,7 +109,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/bus_p_m1_temperature"
android:textColor="@color/bus_p_m1_47576E"
android:textColor="@color/bus_p_aircondition_enable"
android:textSize="@dimen/dp_24"
app:layout_constraintBottom_toBottomOf="@+id/rv_aircondition_temperature"
app:layout_constraintStart_toStartOf="@+id/tv_aircondition_switch"
@@ -150,7 +150,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="设置"
android:textColor="@color/bus_p_m1_47576E"
android:textColor="@color/bus_p_m1_47576e"
android:textSize="@dimen/dp_24"
app:layout_constraintBottom_toBottomOf="@+id/rg_setting_pattern"
app:layout_constraintStart_toStartOf="@+id/tv_aircondition_switch"
@@ -178,7 +178,7 @@
android:checked="true"
android:gravity="center"
android:text="@string/bus_p_m1_automatic"
android:textColor="@drawable/bus_p_function_airconditon_pattern_text_color_selector"
android:textColor="@drawable/bus_p_function_airconditon_text_color_selector"
android:textSize="@dimen/dp_24" />
<RadioButton
@@ -223,7 +223,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/bus_p_m1_wind_speed"
android:textColor="@color/bus_p_m1_47576E"
android:textColor="@color/bus_p_m1_47576e"
android:textSize="@dimen/dp_24"
app:layout_constraintBottom_toBottomOf="@+id/rg_setting_windspeed"
app:layout_constraintStart_toStartOf="@+id/tv_aircondition_switch"
@@ -251,7 +251,7 @@
android:checked="true"
android:gravity="center"
android:text="@string/bus_p_m1_wind_speed_low"
android:textColor="@drawable/bus_p_function_airconditon_pattern_text_color_selector"
android:textColor="@color/bus_p_function_airconditon_pattern_text_color_selector"
android:textSize="@dimen/dp_24" />
<RadioButton

View File

@@ -6,5 +6,5 @@
android:layout_height="match_parent"
android:gravity="center"
android:text="22°"
android:textColor="@color/bus_p_m1_47576E"
android:textColor="@color/bus_p_m1_47576e"
android:textSize="@dimen/dp_30" />

View File

@@ -3,7 +3,8 @@
<color name="module_main_window_background_color">#212831</color>
<color name="bus_p_m1_203555">#203555</color>
<color name="bus_p_m1_47576E">#47576E</color>
<color name="bus_p_m1_47576e">#47576E</color>
<color name="bus_p_m1_6647576e">#6647576E</color>
<color name="bus_p_m1_374968">#374968</color>
<color name="bus_p_m1_2cbffc">#2CBFFC</color>
<color name="bus_p_m1_1060ff">#1060FF</color>

View File

@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="79dp"
android:layout_height="79dp"
android:layout_width="@dimen/dp_148"
android:layout_height="@dimen/dp_148"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<!--消息盒子M1选择入口-->
<CheckBox
android:id="@+id/cbMsgBoxM1"
android:layout_width="79dp"
android:layout_height="79dp"
android:layout_width="@dimen/dp_148"
android:layout_height="@dimen/dp_148"
android:background="@drawable/selector_msg_box_m"
android:button="@null"
app:layout_constraintBottom_toBottomOf="parent"