[6.2.6]
[taxi_p] [距离进度条修改]
This commit is contained in:
@@ -55,7 +55,7 @@ class ItineraryView : ConstraintLayout, OrderInfoViewModel.ItineraryViewCallback
|
||||
gradientDrawable.cornerRadii =
|
||||
floatArrayOf(0f, 0f, 0f, 0f, corner, corner, corner, corner)
|
||||
}
|
||||
val firstColor = ContextCompat.getColor(context, R.color.taxi_p_OF5FFF)
|
||||
val firstColor = ContextCompat.getColor(context, R.color.taxi_p_0F5FFF)
|
||||
val setondColor = ContextCompat.getColor(context, R.color.taxi_p_44C8FF)
|
||||
val thirdColor = ContextCompat.getColor(context, R.color.taxi_p_8AE4ED)
|
||||
val fourceColor = ContextCompat.getColor(context, R.color.taxi_p_C8F3F4)
|
||||
@@ -95,6 +95,7 @@ class ItineraryView : ConstraintLayout, OrderInfoViewModel.ItineraryViewCallback
|
||||
|
||||
var prePercentage = 0f
|
||||
val needChangeStyleNumber = 0.99
|
||||
val needChangeStyleNumberMin = 0.03f
|
||||
|
||||
override fun setDistanceInfo(surplusdistance:String,distanceUnit:String,
|
||||
surplusTime:String,surplusTimeUnit:String,
|
||||
@@ -113,18 +114,22 @@ class ItineraryView : ConstraintLayout, OrderInfoViewModel.ItineraryViewCallback
|
||||
}
|
||||
|
||||
val currentPercentage = alreadyGone.toFloat() / stationDistance
|
||||
if((prePercentage>needChangeStyleNumber) xor (currentPercentage>needChangeStyleNumber)){
|
||||
if(currentPercentage>needChangeStyleNumber){
|
||||
setDrawable(false)
|
||||
}else{
|
||||
setDrawable(true)
|
||||
}
|
||||
progress_distance.progress = alreadyGone
|
||||
}else{
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
progress_distance.setProgress(alreadyGone,true)
|
||||
}else{
|
||||
if(currentPercentage>0&¤tPercentage<needChangeStyleNumberMin){
|
||||
progress_distance.progress = (stationDistance*needChangeStyleNumberMin).toInt()
|
||||
}else {
|
||||
if ((prePercentage > needChangeStyleNumber) xor (currentPercentage > needChangeStyleNumber)) {
|
||||
if (currentPercentage > needChangeStyleNumber) {
|
||||
setDrawable(false)
|
||||
} else {
|
||||
setDrawable(true)
|
||||
}
|
||||
progress_distance.progress = alreadyGone
|
||||
} else {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
progress_distance.setProgress(alreadyGone, true)
|
||||
} else {
|
||||
progress_distance.progress = alreadyGone
|
||||
}
|
||||
}
|
||||
}
|
||||
prePercentage = currentPercentage
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:gravity="center"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_80"
|
||||
android:layout_marginBottom="@dimen/dp_66"
|
||||
android:layout_marginStart="@dimen/dp_58"
|
||||
android:textSize="@dimen/dp_61"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<color name="taxi_p_66476FBE">#66476FBE</color>
|
||||
|
||||
<color name="taxi_p_41444D">#41444D</color>
|
||||
<color name="taxi_p_OF5FFF">#0F5FFF</color>
|
||||
<color name="taxi_p_0F5FFF">#0F5FFF</color>
|
||||
<color name="taxi_p_44C8FF">#44C8FF</color>
|
||||
<color name="taxi_p_8AE4ED">#8AE4ED</color>
|
||||
<color name="taxi_p_C8F3F4">#C8F3F4</color>
|
||||
|
||||
@@ -59,7 +59,7 @@ class ItineraryView : ConstraintLayout, OrderInfoViewModel.ItineraryViewCallback
|
||||
gradientDrawable.cornerRadii =
|
||||
floatArrayOf(0f, 0f, 0f, 0f, corner, corner, corner, corner)
|
||||
}
|
||||
val firstColor = ContextCompat.getColor(context, R.color.taxi_p_OF5FFF)
|
||||
val firstColor = ContextCompat.getColor(context, R.color.taxi_p_0F5FFF)
|
||||
val setondColor = ContextCompat.getColor(context, R.color.taxi_p_44C8FF)
|
||||
val thirdColor = ContextCompat.getColor(context, R.color.taxi_p_8AE4ED)
|
||||
val fourceColor = ContextCompat.getColor(context, R.color.taxi_p_C8F3F4)
|
||||
@@ -99,6 +99,7 @@ class ItineraryView : ConstraintLayout, OrderInfoViewModel.ItineraryViewCallback
|
||||
|
||||
var prePercentage = 0f
|
||||
val needChangeStyleNumber = 0.99
|
||||
val needChangeStyleNumberMin = 0.03f
|
||||
|
||||
override fun setDistanceInfo(surplusdistance:String,distanceUnit:String,
|
||||
surplusTime:String,surplusTimeUnit:String,
|
||||
@@ -117,18 +118,22 @@ class ItineraryView : ConstraintLayout, OrderInfoViewModel.ItineraryViewCallback
|
||||
}
|
||||
|
||||
val currentPercentage = alreadyGone.toFloat() / stationDistance
|
||||
if((prePercentage>needChangeStyleNumber) xor (currentPercentage>needChangeStyleNumber)){
|
||||
if(currentPercentage>needChangeStyleNumber){
|
||||
setDrawable(false)
|
||||
}else{
|
||||
setDrawable(true)
|
||||
}
|
||||
progress_distance.progress = alreadyGone
|
||||
}else{
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
progress_distance.setProgress(alreadyGone,true)
|
||||
}else{
|
||||
if(currentPercentage>0&¤tPercentage<needChangeStyleNumberMin){
|
||||
progress_distance.progress = (stationDistance*needChangeStyleNumberMin).toInt()
|
||||
}else {
|
||||
if ((prePercentage > needChangeStyleNumber) xor (currentPercentage > needChangeStyleNumber)) {
|
||||
if (currentPercentage > needChangeStyleNumber) {
|
||||
setDrawable(false)
|
||||
} else {
|
||||
setDrawable(true)
|
||||
}
|
||||
progress_distance.progress = alreadyGone
|
||||
} else {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
progress_distance.setProgress(alreadyGone, true)
|
||||
} else {
|
||||
progress_distance.progress = alreadyGone
|
||||
}
|
||||
}
|
||||
}
|
||||
prePercentage = currentPercentage
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:gravity="center"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_80"
|
||||
android:layout_marginBottom="@dimen/dp_66"
|
||||
android:layout_marginStart="@dimen/dp_58"
|
||||
android:textSize="@dimen/dp_61"
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<color name="taxi_p_56efa0">#56efa0</color>
|
||||
<color name="taxi_p_A7BDF3">#A7BDF3</color>
|
||||
<color name="taxi_p_41444D">#41444D</color>
|
||||
<color name="taxi_p_OF5FFF">#0F5FFF</color>
|
||||
<color name="taxi_p_0F5FFF">#0F5FFF</color>
|
||||
<color name="taxi_p_44C8FF">#44C8FF</color>
|
||||
<color name="taxi_p_8AE4ED">#8AE4ED</color>
|
||||
<color name="taxi_p_C8F3F4">#C8F3F4</color>
|
||||
|
||||
Reference in New Issue
Block a user