public class Die
Abstract class that defines common Dice behaviour for different dice types
Constructor and Description |
---|
Die(BaseActivity context,
android.view.View view,
Theme theme,
java.lang.String storedValueKey,
int limit,
int minimum,
int initialValue,
int wiggleAnimationResource)
Abstract class that defines common Dice behaviour for different dice types
|
Modifier and Type | Method and Description |
---|---|
void |
draw()
Draws the Current Information as the View
|
BaseActivity |
getContext()
:
|
int |
getCurrentValue()
The current value of the die
|
int |
getLimit()
:
|
int |
getMinimum()
:
|
java.security.SecureRandom |
getRandom()
An object that can generate random numbers
|
java.lang.String |
getStoredValueKey()
:
|
Theme |
getTheme()
:
|
int |
getValue() |
android.view.View |
getView()
:
|
int |
getWiggleAnimationResource()
:
|
boolean |
isAnimating() |
void |
next(java.lang.Integer specificNumber)
Displays the next value in the view
|
int |
nextRandomNumber()
Generates a new random number within the limits
|
void |
roll()
Rolls the Die according to the settings provided by the theme
|
void |
setCurrentValue(int p)
The current value of the die
|
void |
setLimit(int p)
:
|
void |
setMinimum(int p)
:
|
void |
setTheme(Theme p)
:
|
void |
updateTheme(Theme theme)
Updates the theme of the Die
|
public Die(BaseActivity context, android.view.View view, Theme theme, java.lang.String storedValueKey, int limit, int minimum, int initialValue, int wiggleAnimationResource)
Abstract class that defines common Dice behaviour for different dice types
context
- : The Activity using the Dieview
- : The View displaying the dietheme
- : The theme that defines the look of the ViewstoredValueKey
- : The key string used to store the current value in the shared preferenceslimit
- : The maximum value of the Dieminimum
- : The minimum value of the DieinitialValue
- : The initial value of the DiewiggleAnimationResource
- : Overrides the default wiggle animation if setcontext
- : The Activity using the Dieview
- : The View displaying the dietheme
- : The theme that defines the look of the ViewstoredValueKey
- : The key string used to store the current value in the shared preferenceslimit
- : The maximum value of the Dieminimum
- : The minimum value of the DieinitialValue
- : The initial value of the DiewiggleAnimationResource
- : Overrides the default wiggle animation if setpublic void draw()
Draws the Current Information as the View
public int getCurrentValue()
The current value of the die
public void setCurrentValue(int p)
The current value of the die
public java.security.SecureRandom getRandom()
An object that can generate random numbers
public void next(java.lang.Integer specificNumber)
Displays the next value in the view
specificNumber
- : Instead of a random number, display a specific numberpublic void updateTheme(Theme theme)
Updates the theme of the Die
theme
- : The theme to change topublic void roll()
Rolls the Die according to the settings provided by the theme
public int getValue()
public boolean isAnimating()
public int nextRandomNumber()
Generates a new random number within the limits
public BaseActivity getContext()
:
The Activity using the Die
public android.view.View getView()
:
The View displaying the die
public Theme getTheme()
:
The theme that defines the look of the View
public void setTheme(Theme p)
:
The theme that defines the look of the View
p
- : The theme that defines the look of the Viewpublic java.lang.String getStoredValueKey()
:
The key string used to store the current value in the shared preferences
public int getLimit()
:
The maximum value of the Die
public void setLimit(int p)
:
The maximum value of the Die
p
- : The maximum value of the Diepublic int getMinimum()
:
The minimum value of the Die
public void setMinimum(int p)
:
The minimum value of the Die
p
- : The minimum value of the Diepublic int getWiggleAnimationResource()
:
Overrides the default wiggle animation if set