【问题标题】:How to get "slide to unlock" animation for a text view in android?如何在android中为文本视图获取“滑动解锁”动画?
【发布时间】:2018-08-27 21:46:35
【问题描述】:

在android中有什么方法可以实现滑动解锁android中的动画吗? 我有一个文本视图,我想在其中设置动画动画! 这是我的布局:

<LinearLayout
                android:id="@+id/ll_chooseLang"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:layout_marginTop="5dp"
                android:layout_marginBottom="5dp"
                android:orientation="vertical" >

                <TextView
                    android:id="@+id/tv_chooseLanguage"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:lineSpacingMultiplier="1.2"
                     android:textColor="#fff"
                     android:textSize="25sp"
                    android:text="TextView" />

            </LinearLayout>

我已经完成了淡出和淡入动画:

animSet=new AnimationSet(true);
    trans=new TranslateAnimation(400, 0,0, 0);
    trans.setDuration(2000);

    fadeIn=new AlphaAnimation(0.0f, 1.0f);
    fadeIn.setDuration(1800);
    fadeIn.setFillAfter(true);
    fadeout=new AlphaAnimation(1.0f, 0.0f);
    fadeout.setDuration(2000);
    fadeout.setFillAfter(true);

    animSet.addAnimation(trans);
    animSet.addAnimation(fadeIn);

但我想要“滑动解锁”之类的动画。我搜索了很多,无法满足我的要求..

需要帮助提前谢谢..!!

【问题讨论】:

    标签: android animation


    【解决方案1】:

    你是说“微光”效果? https://github.com/RomainPiel/Shimmer-android

    【讨论】:

    • 你能告诉我如何在我的项目中使用它!
    • 完整说明在我提供的链接中。
    【解决方案2】:

    您可以放置​​内容占位符动画,例如 Shimmer 动画

    微光效果代码参考以下链接:https://www.androidhive.info/2018/01/android-content-placeholder-animation-like-facebook-using-shimmer/

    【讨论】:

      猜你喜欢
      • 2010-10-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-12
      • 2012-05-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多