-1

My xml form

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.motion.widget.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/container_quick_process"
    app:layoutDescription="@xml/scene_fragment_quick_process">

    <ImageView
        android:id="@+id/image"
        android:layout_width="0dp"
        android:layout_height="0dp"
        />

I want change the picture smoothly in ImageView (filled circle with a half-empty), and bind this animation with MotionLayout's animation

Svetl9chok
  • 153
  • 5

2 Answers2

0

We're going to need a little more info than that. Try this and post a new question with what you tried and didn't get to work Animate ImageView

0

It is unclear exactly what effect you are trying to achieve.

ConstraintLayout/MotionLayout library provides a Component ImageFilterView Which can:

  • Cross fade between 2 images
  • Change Contrasts/Hue/Saturation/Color Temperature
  • pan/zoom/rotate
  • clip round the corners from full circle to rounded rect to rectangle
  • ImageFiterButton has similar API but is a button with Shadow.

These can be access through MotionLayout's CustomAttribute tag

If you want a vector animation you can use LottieAnimationView (see Lottie) LottieAnimationView has a setProgress which can be driven from MotionLayout. See section on Lottie Animation in Introduction to MotionLayout III

hoford
  • 4,918
  • 2
  • 19
  • 19
  • I used ImageFilterView, but the first circle faded out against the background of the second, but I want it to animate into it – Svetl9chok Jul 01 '21 at 07:35
  • to cross fade between the two set: app:overlay="false" But it will not morph between the two. You can design your own morph using. https://shapeshifter.design/ – hoford Jul 01 '21 at 17:04