Skip to content

Instantly share code, notes, and snippets.

@fpopic
Created December 11, 2014 18:24
Show Gist options
  • Save fpopic/dd118cb193dade2cbe34 to your computer and use it in GitHub Desktop.
Save fpopic/dd118cb193dade2cbe34 to your computer and use it in GitHub Desktop.
package hr.fer.ruazosa.hw3;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.SeekBar;
public class WheelOfFortuneActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_wheel_of_fortune);
final ImageView imageView = (ImageView) this.findViewById(R.id.wof_wheel);
SeekBar seekBar = (SeekBar) this.findViewById(R.id.wof_seekbar);
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (progress == 14 || progress == 90 || progress == 180 || progress == 270 || progress == 360) {
imageView.setRotation(progress);
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
}
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment