Skip to content

Instantly share code, notes, and snippets.

@sigmadeltasoftware
Created February 2, 2017 23:11
Show Gist options
  • Save sigmadeltasoftware/767ad6480454392493f3a6963776b63a to your computer and use it in GitHub Desktop.
Save sigmadeltasoftware/767ad6480454392493f3a6963776b63a to your computer and use it in GitHub Desktop.
Activity for DoubleTapSeekBar
package com.sigmadelta.verticaldoubletapseekbar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
DoubleTapSeekBar seekBar = (DoubleTapSeekBar) findViewById(R.id.doubletapseekbar);
seekBar.setMax(25);
seekBar.setDebounceTimeInMs(200); // Unnecessary but for demo purposes
seekBar.setDoubleTapEvent(new DoubleTapSeekBarEvent() {
@Override
public void onDoubleTap(DoubleTapSeekBar seekBar) {
// Define your behaviour here, f.e. see below
seekBar.setProgress(seekBar.getMax()/2);
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment