【问题标题】:RippleView effect on view appears late androidRippleView 对 view 的影响出现较晚 android
【发布时间】:2015-09-21 05:37:24
【问题描述】:

我正在使用来自这里的a linkcom.andexert.library.RippleViewlibrary

它的工作,但不像预期的那样。涟漪效应出现较晚,即;当我点击 TextView 时,Activity 会启动,然后在之前的活动的 TextView 上会出现涟漪效果。

还显示错误“无法解析方法 setOnRippleCompleteListener()”

xml文件

<com.andexert.library.RippleView
        android:id="@+id/ripple_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        rv_centered="true"
        android:padding="0dp"
        android:layout_alignParentBottom="true">

    <com.techmorphosis.Utils.TextViewCustomFont
        android:id="@+id/txt_lets_go"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textColor="@color/white_text"
        android:background="@drawable/purple_button_bg"
        android:gravity="center"
        android:padding="10dp"
        android:text="@string/lets_go"
        android:textSize="@dimen/textsize_medium" />

    </com.andexert.library.RippleView>

java 文件

rippleView.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {

           // @Override
            public void onComplete(RippleView rippleView) {
                Log.d("Sample", "Ripple completed");
            }

        });

【问题讨论】:

  • 告诉我们你如何初始化rippleView变量
  • rippleView = (RippleView) findViewById(R.id.ripple_view);
  • 我在等你的回复:(
  • 我没有看到任何问题。确保你已经导入了正确的包。
  • 编译 'com.github.traex.rippleeffect:library:1.2.3' 这是我正在处理的包

标签: android button ripple


【解决方案1】:

我通过将视图 ID 的点击事件放在 rippleView.setOnRippleCompleteListener 中解决了这个问题

例如:

rippleviewNavigation.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {
                    @Override
                    public void onComplete(RippleView rippleView) {

if(id==R.id.txt_open){
// do stuffs here
}
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-08-14
    • 1970-01-01
    • 2014-03-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-30
    • 1970-01-01
    相关资源
    最近更新 更多