title: How to disable swipe in switch compat?
body: <p>I need to disable swipe in switch compat.I am using OnclickListener for toggling the switch.I have implemented some functionality for onClickListener.But when the user swipes the toggle he is not getting the implemented functionality.I need to disable swipe for switch compat.</p>
  
  <p>Note: I am not using onCheckedlistener since I was getting some issues withonCheckedListener.</p>
  
  <blockquote>
  <pre><code>&lt;android.support.v7.widget.SwitchCompat
      android:id="@+id/switchButton"
      android:layout_width="wrap_content"
      android:layout_centerInParent="true"
      android:checked="false"
      android:scrollbarAlwaysDrawVerticalTrack="true"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceMedium"
      android:text="Switch example"
      /&gt;
  </code></pre>
  </blockquote>
  
  <hr>
  
  <blockquote>
  <pre><code>SwitchCompat switchCompat;
  switchCompat=(SwitchCompat)findViewById(R.id.switchButton);
       switchCompat.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              Toast.makeText(getApplicationContext(), "toggled", Toast.LENGTH_SHORT).show(); //added
          }
      });
  </code></pre>
  </blockquote>