This project was created during Google's Android Apps Withroid Apps with Koltin to represent the "rolling" of a data. Although simple, it uses a lot of Android Development concepts, such as view, viewgroup, layout, activity, etc.
It works by pressing a button called "Roll". When tightening, the code will choose an image at random and show the user.
Logic used to make the choice of image:
private fun rollDice () {
val drawableResource = when ( Random .nextInt( 6 ) + 1 ) {
1 -> R .drawable.dice_1
2 -> R .drawable.dice_2
3 -> R .drawable.dice_3
4 -> R .drawable.dice_4
5 -> R .drawable.dice_5
else -> R .drawable.dice_6
}The app was created and tested on a physical device, Redmi Note 9S, but is available to anyone who wants to contribute.
If you have any idea how to improve the app, make the following steps:
To contribute, just make a fork. (https://github.com/aturbruno17/diceroller/fork)
Create a branch for its modification ( git checkout -b feature/fooBar )
Make Commit ( git commit -am "Add some fooBar" )
Push ( git push origin feature/fooBar )
Create a new pull Request