totond / TextPathView

A View with text path animation!
MIT License
1.91k stars 214 forks source link

如何在动画执行完,显示填充的文字 #12

Closed wqbs369 closed 6 years ago

wqbs369 commented 6 years ago
atpv_1 = findViewById(R.id.atpv_1);
    stpv_2017 = findViewById(R.id.stpv_2017);

    //从无到显示
    atpv_1.startAnimation(1, 0);
    //从显示到消失
    stpv_2017.startAnimation(0, 1);
    stpv_2017.showFillColorText();

这样的话,动画会直接执行,执行完文字消失。希望可以在动画view中添加动画执行结束监听

wqbs369 commented 6 years ago
  <yanzhikai.textpath.AsyncTextPathView
        android:id="@+id/atpv_1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        app:autoStart="true"
        app:duration="5000"
        app:paintStrokeColor="@android:color/holo_orange_light"
        app:pathStrokeColor="@android:color/holo_orange_light"
        app:showPainter="true"
        app:text="2018西安特检"
        app:textSize="62sp" />

    <yanzhikai.textpath.AsyncTextPathView
        android:id="@+id/atpv_totond"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        app:autoStart="true"
        app:duration="2500"
        app:paintStrokeColor="@android:color/holo_orange_light"
        app:pathStrokeColor="@android:color/holo_orange_light"
        app:showPainter="true"
        app:text="测试自动换行(abcdefghijk(lmnopqrst)uvwxyz)"
        app:textSize="64sp" />

我这二个layout除了文字长度不一致,其它都一样,但是换行后,动画执行完成,会保留文字,而没有换行的,动画执行完文字消失。 上面view文字消失,下面的会保留

totond commented 6 years ago
wqbs369 commented 6 years ago

OK,谢谢了。

totond commented 5 years ago

新的版本v0.2.1已经可以不通过关闭硬件加速解决这个问题了,可以试一下