Created
February 2, 2017 23:11
-
-
Save sigmadeltasoftware/767ad6480454392493f3a6963776b63a to your computer and use it in GitHub Desktop.
Activity for DoubleTapSeekBar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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