Relative Content

Tag Archive for kotlinandroid-studio

in the MainActivity.kt i get error. how to fix them?

@Composable fun MyComposeUI( onBlinkStartStop: (Boolean) -> Unit, onSpeedChange: (Float) -> Unit, isBlinking: Boolean ) { var sliderPosition by remember { mutableStateOf(0.5f) } the error is on the line: var sliderPosition by remember { mutableStateOf(0.5f) } should ?I choose the suggested fix: import operator ‘State.getValue’ ? this is a screenshot showing the error: kotlin android-studio

Android Studio – Setting visibility of ImageView in button callback not working

First off – I’m very new to app-coding, kotlin, xmls, etc. (Started teaching myself last week).
Having said that: I’m trying to write an activity in which an image is shown, and the user needs to press the corresponding button. (Specifically the image is of a g-clef note, and the buttons are just a list of note names, in Hebrew).
After pressing the button, I collect “correct or not” statistics, and show a “v” or “x” image so the user knows if they got it right, and then a new image is generated, until I’ve cycled through all images in the list of images to be learned.
The way I’ve got it set up, is that when a new image is generated, I redefine the button callbacks so that the correct button shows the “v” (and does a +1 to the correct answer stats, and moves on to the next image), and all the rest of the buttons show the “x” (and do a +1 to the incorrect stats, and don’t move on to the next image yet).

Android Studio – Setting visibility of ImageView in button callback not working

First off – I’m very new to app-coding, kotlin, xmls, etc. (Started teaching myself last week).
Having said that: I’m trying to write an activity in which an image is shown, and the user needs to press the corresponding button. (Specifically the image is of a g-clef note, and the buttons are just a list of note names, in Hebrew).
After pressing the button, I collect “correct or not” statistics, and show a “v” or “x” image so the user knows if they got it right, and then a new image is generated, until I’ve cycled through all images in the list of images to be learned.
The way I’ve got it set up, is that when a new image is generated, I redefine the button callbacks so that the correct button shows the “v” (and does a +1 to the correct answer stats, and moves on to the next image), and all the rest of the buttons show the “x” (and do a +1 to the incorrect stats, and don’t move on to the next image yet).