[6.7.0]
[fea] [滑动出发动画展示]
This commit is contained in:
@@ -33,6 +33,11 @@ class OchCustomViewProvider : IOchCustomViewProvider {
|
||||
if(temp is FacadeProvider){
|
||||
commonService = temp.commonService
|
||||
}
|
||||
}else{
|
||||
val temp = ARouter.getInstance().build(FacadeConst.PASSENGER_PATH).navigation(context)
|
||||
if(temp is FacadeProvider){
|
||||
commonService = temp.commonService
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.roomRxjava
|
||||
implementation rootProject.ext.dependencies.androidxrecyclerview
|
||||
kapt rootProject.ext.dependencies.recyclerviewadapterhelper
|
||||
implementation rootProject.ext.dependencies.lottie
|
||||
|
||||
implementation rootProject.ext.dependencies.androidxroomruntime
|
||||
kapt rootProject.ext.dependencies.androidxroomcompiler
|
||||
|
||||
1
OCH/shuttle/driver_weaknet/src/main/assets/data.json
Normal file
1
OCH/shuttle/driver_weaknet/src/main/assets/data.json
Normal file
File diff suppressed because one or more lines are too long
BIN
OCH/shuttle/driver_weaknet/src/main/assets/images/img_0.png
Normal file
BIN
OCH/shuttle/driver_weaknet/src/main/assets/images/img_0.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
BIN
OCH/shuttle/driver_weaknet/src/main/assets/images/img_1.png
Normal file
BIN
OCH/shuttle/driver_weaknet/src/main/assets/images/img_1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
BIN
OCH/shuttle/driver_weaknet/src/main/assets/images/img_2.png
Normal file
BIN
OCH/shuttle/driver_weaknet/src/main/assets/images/img_2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
1
OCH/shuttle/driver_weaknet/src/main/assets/slide.json
Normal file
1
OCH/shuttle/driver_weaknet/src/main/assets/slide.json
Normal file
File diff suppressed because one or more lines are too long
@@ -71,10 +71,12 @@ class SwitchLineTaskAdapter(
|
||||
if(checkTask!!.taskId==task.taskId){
|
||||
checkTask = null
|
||||
mTaskItemClickListener?.onItemClick(currentPosition,false)
|
||||
notifyItemChanged(currentPosition)
|
||||
}else {
|
||||
resetOther()
|
||||
checkTask = task
|
||||
mTaskItemClickListener?.onItemClick(currentPosition,true)
|
||||
notifyItemChanged(currentPosition)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +90,7 @@ class SwitchLineTaskAdapter(
|
||||
if(checkTask!=null && result.taskId==checkTask!!.taskId){
|
||||
checkTask = null
|
||||
notifyItemChanged(index)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,11 @@ import androidx.appcompat.widget.AppCompatTextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.constraintlayout.widget.ConstraintSet
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.shuttle.weaknet.R
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_task_leave_station_view.view.actv_draggable
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_task_leave_station_view.view.lottie_bg
|
||||
|
||||
class BizLeaveStationView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
@@ -38,6 +41,7 @@ class BizLeaveStationView @JvmOverloads constructor(
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.shuttle_weak_task_leave_station_view, this, true)
|
||||
draggableButton = findViewById(R.id.actv_draggable)
|
||||
lottie_bg.setImageAssetsFolder("images")
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
@@ -87,7 +91,12 @@ class BizLeaveStationView @JvmOverloads constructor(
|
||||
duration = 100
|
||||
}.start()
|
||||
}else if (draggableButton.translationX>=(width-draggableButton.width)){
|
||||
slideListener?.slideEnd()
|
||||
lottie_bg.setAnimation("data.json")
|
||||
lottie_bg.playAnimation()
|
||||
actv_draggable.setTextColor(ResourcesUtils.getColor(R.color.shuttle_driver_80FFFFFF))
|
||||
RxUtils.createSubscribe(1_000) {
|
||||
slideListener?.slideEnd()
|
||||
}
|
||||
}else{
|
||||
ObjectAnimator.ofFloat(
|
||||
draggableButton, "translationX", draggableButton.translationX,
|
||||
@@ -106,6 +115,9 @@ class BizLeaveStationView @JvmOverloads constructor(
|
||||
override fun onVisibilityAggregated(isVisible: Boolean) {
|
||||
super.onVisibilityAggregated(isVisible)
|
||||
if(isVisible){
|
||||
lottie_bg.setAnimation("slide.json")
|
||||
lottie_bg.playAnimation()
|
||||
actv_draggable.setTextColor(ResourcesUtils.getColor(R.color.white))
|
||||
ObjectAnimator.ofFloat(
|
||||
draggableButton, "translationX", draggableButton.translationX,
|
||||
0f
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_30"/>
|
||||
<solid android:color="@color/bus_color_4dffffff"/>
|
||||
<solid android:color="@color/bus_color_4D000000"/>
|
||||
</shape>
|
||||
@@ -7,14 +7,24 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_task_leave_station_slide_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
<!-- <androidx.appcompat.widget.AppCompatImageView-->
|
||||
<!-- android:id="@+id/aciv_task_leave_station_slide_bg"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- android:src="@drawable/bus_task_leave_station_slide_bg"-->
|
||||
<!-- android:layout_width="@dimen/dp_774"-->
|
||||
<!-- android:layout_height="@dimen/dp_120"/>-->
|
||||
|
||||
<com.airbnb.lottie.LottieAnimationView
|
||||
android:id="@+id/lottie_bg"
|
||||
android:layout_width="774px"
|
||||
android:layout_height="120px"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:src="@drawable/bus_task_leave_station_slide_bg"
|
||||
android:layout_width="@dimen/dp_774"
|
||||
android:layout_height="@dimen/dp_120"/>
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:lottie_fileName="slide.json"
|
||||
app:lottie_loop="true"
|
||||
app:lottie_autoPlay="true"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_draggable"
|
||||
|
||||
@@ -74,4 +74,5 @@
|
||||
<color name="shuttle_driver_bf0e3dbc">#BF0E3DBC</color>
|
||||
<color name="shuttle_driver_bf1e2e89">#BF1E2E89</color>
|
||||
<color name="shuttle_driver_D4D4D4">#D4D4D4</color>
|
||||
<color name="shuttle_driver_80FFFFFF">#80FFFFFF</color>
|
||||
</resources>
|
||||
@@ -20,6 +20,7 @@ ext {
|
||||
localbroadcastmanager : "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0",
|
||||
// flexbox
|
||||
flexbox : 'com.google.android.flexbox:flexbox:3.0.0',
|
||||
lottie :'com.airbnb.android:lottie:5.2.0',
|
||||
guava :'com.google.guava:guava:29.0-android',
|
||||
// 测试
|
||||
junit : "junit:junit:4.12",
|
||||
|
||||
Reference in New Issue
Block a user