Created
December 11, 2014 18:24
-
-
Save fpopic/dd118cb193dade2cbe34 to your computer and use it in GitHub Desktop.
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 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