2017-05-18 3 views
1

カスタムクラスを使用していないため、警告が表示されて混乱します。誰もこの問題を解決する方法のアイデアを持っていますか?カスタムビューFloatingActionButtonにはsetOnTouchListenerが呼び出されていますが、performClickをオーバーライドしません。

"カスタムビューFloatingActionButtonはそれにsetOnTouchListenerを呼びかけているが、performClick上書きされることはありません" FABのため

FloatingActionButton touchFab = (FloatingActionButton) findViewById(R.id.floatingActionButton); 
     touchFab.setOnTouchListener(new View.OnTouchListener() { 
      @Override 
      public boolean onTouch(View v, MotionEvent event) { 
       switch (event.getAction()) { 
        case MotionEvent.ACTION_DOWN: 
         round.setRound(); 
         round.setStartTime(System.currentTimeMillis()); 
         return false; 
        case MotionEvent.ACTION_UP: 
         round.setEndTime(System.currentTimeMillis()); 
//      setRecordedTime(round.getTimeDiff()); 
         round.afterRound(); 
         createFragment(); 
         return false; 
        default: 
         return false; 
       } 
      } 
     }); 

関連するXMLを。いくつかのテストの後

<android.support.design.widget.FloatingActionButton 
      android:id="@+id/floatingActionButton" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_marginEnd="12dp" 
      android:layout_marginLeft="12dp" 
      android:layout_marginRight="12dp" 
      android:layout_marginStart="12dp" 
      android:clickable="true" 
      android:focusable="true" 
      app:backgroundTint="#FFF" 
      app:fabSize="normal" 
      app:layout_constraintBottom_toBottomOf="parent" 
      app:layout_constraintRight_toRightOf="parent" 
      app:rippleColor="@color/colorPrimaryDark"/> 

、私がちょうど戻っStudioとエラーなしの安定したバージョンに行き、問題はただのAndroid Studioの3.0カナリアにある表示されます。なぜ誰かが、新しいバージョンの警告がポップアップしていたのか理解できれば、それは理解できます。

答えて

0

私は同じ問題があります。 私の結果オーバーライドメソッドperformClick():

class FAButton(context: Context?) : FloatingActionButton(context){ 
    override fun performClick(): Boolean { 
     return super.performClick() 
    } 
} 
関連する問題