Hello Patrick! I need help. in 'PlaySudokuActivity' file you have: viewModel = ViewModelProviders.of(arguments). Now I have viewModel = ViewModelProvider.of(arguments), and '.of' is not recognizable because in my case - import androidx.lifecycle.ViewModelProvider instead of yours android.arch.lifecycle.ViewModelProviders. I don't how to fix it.
I had a similar issue that some people below were having. The project wouldn't recognize the import kotlinx... so it wouldn't get the reference to sudokuBoardView.updateSelectedCellUI or registerListener. I had to check the build.gradle(:app) file and under "plugins", I added : id 'kotlin-android-extensions' in order to fix it.
@@onlydecafThank you. The "View binding" works for registerListener. But in the case of updateSelectedCellUI, it doesn't work. The word 'binding' in the private fun updateSelectedCellUI(cell:Pair?) = cell?.let { binding.sudokuBoardView.updateSelectedCellUI(cell.first, cell.second) is red.
Hi Patrick, at 9:37, you were calling sudokuBoardView but I could not find where it was defined and initialized. My compiler won't let me go further. It is a great tutorial!
This is answered in an earlier comment down below: ua-cam.com/video/0_gtvFtZjQ8/v-deo.html&lc=UgzpjqzoROoTih-Epqx4AaABAg.8sMLps7mJni8sR9wNFiGvR&ab_channel=PatrickFeltes.
In 2021 you need to add `apply plugin: 'kotlin-android-extensions'` to your build.gradle, otherwise finding the view from the XML does not work and you will not get past 9:40 in the video.
unfortunately i'm doing something wrong, I cannot reference the three functions from the SudokuBoardView.kt, i even tried using the ones from the github, and still invalid references: SudokuBoardView.updateCells(cells) just will not resolve
Make sure you have this imported: import kotlinx.android.synthetic.main.activity_play_sudoku.* Kotlin adds support for these kotlinx extensions which allow us to grab UI components without having to do findViewById. So it should be sudokuBoardView.updateCells(cells) if "sudokuBoardView" is the id of your SudokuBoardView in the activity_play_sudoku.xml layout file. Let me know if this helps!
@@PatrickFeltes I was totally missing the connection, that I should be looking for the id of the element rather than using the id of the class lol, wow.... thanks this helped
Dude, these tutorials are amazing. I'm working through it in Java so there are always a few bits here and there I have to learn on my own. But you explain so much of this so well, that I barely struggle to figure out what it is I need to do differently in Java.
Hi, I'm also working through it in Java and I'm struggling a bit at 9:40, I don't know how to access "sudokuBoardView". How did you solve it? Thanks :)
@@MishLoumova See reply to an earlier comment thread here: ua-cam.com/video/0_gtvFtZjQ8/v-deo.html&lc=UgzpjqzoROoTih-Epqx4AaABAg.8sMLps7mJni8sR9wNFiGvR
I'm stuck. I keep getting this error: Unresolved reference: updateSelectedCellUI I verified the I'm importing the SudokuBoardView in my MainActivity.kt, and I verified that in SudokuBoardView I put the function updateSelectedCellUI code. I double and triple checked the spelling and everything. In MainActivity, the SudokuBoardView.updateSelectedCellUI is in red, so it's not finding it, but I confirmed it's there. are there any settings I need to check?
In MainActivity, are you calling `sudokuBoardView.updateSelectedCellUI` or `SudokuBoardView.updateSelectedCellUI`? It should be the first one since we are calling the function on our instance of SudokuBoardView, which is called `sudokuBoardView` with the lowercase 's'.
@@PatrickFeltes Hi Patrick, thanks for the response. I think I may have missed where we create the instance of SodukuBoardView. When I use lower case "s", then sudokuBoardView appears in red. So i must have not created the instance correctly. Where are we creating it? I downloaded your version from GitHub, but I couldn't find the sudokuBoardView instantiation. FYI, I liked and subscribed. Great work.
@@dawkins75 So the issue is that we create the sudokuBoardView in the xml file for the MainActivity. I am using the kotlinx extension functions which let us reference views by their ids (instead of using findViewById), so you need to match it with whatever your id is in the xml file. Also, make sure you have this import: `import kotlinx.android.synthetic.main.activity_play_sudoku.*` Thanks for the like and subscribe! Hope this helps! If not, let me know.
Hey, I’m planning to release a new video every Sunday morning from now on. I just released a whole bunch since I was on winter break, but from now on it should be at least once a week on Sunday mornings!
Hello Patrick! I need help. in 'PlaySudokuActivity' file you have: viewModel = ViewModelProviders.of(arguments). Now I have viewModel = ViewModelProvider.of(arguments), and '.of' is not recognizable because in my case - import androidx.lifecycle.ViewModelProvider instead of yours android.arch.lifecycle.ViewModelProviders. I don't how to fix it.
Your explanations are on point.Thank you for the great tutorial!
I had a similar issue that some people below were having. The project wouldn't recognize the import kotlinx... so it wouldn't get the reference to sudokuBoardView.updateSelectedCellUI or registerListener. I had to check the build.gradle(:app) file and under "plugins", I added : id 'kotlin-android-extensions' in order to fix it.
@@onlydecafThank you. The "View binding" works for registerListener. But in the case of updateSelectedCellUI, it doesn't work. The word 'binding' in the
private fun updateSelectedCellUI(cell:Pair?) = cell?.let {
binding.sudokuBoardView.updateSelectedCellUI(cell.first, cell.second)
is red.
@@onlydecaf Thank you very much!
Hi Patrick, at 9:37, you were calling sudokuBoardView but I could not find where it was defined and initialized. My compiler won't let me go further. It is a great tutorial!
This is answered in an earlier comment down below: ua-cam.com/video/0_gtvFtZjQ8/v-deo.html&lc=UgzpjqzoROoTih-Epqx4AaABAg.8sMLps7mJni8sR9wNFiGvR&ab_channel=PatrickFeltes.
In 2021 you need to add `apply plugin: 'kotlin-android-extensions'` to your build.gradle, otherwise finding the view from the XML does not work and you will not get past 9:40 in the video.
in which part of build gradle should be added?
unfortunately i'm doing something wrong, I cannot reference the three functions from the SudokuBoardView.kt, i even tried using the ones from the github, and still invalid references:
SudokuBoardView.updateCells(cells) just will not resolve
Make sure you have this imported: import kotlinx.android.synthetic.main.activity_play_sudoku.*
Kotlin adds support for these kotlinx extensions which allow us to grab UI components without having to do findViewById.
So it should be sudokuBoardView.updateCells(cells) if "sudokuBoardView" is the id of your SudokuBoardView in the activity_play_sudoku.xml layout file.
Let me know if this helps!
@@PatrickFeltes I was totally missing the connection, that I should be looking for the id of the element rather than using the id of the class lol, wow.... thanks this helped
Dude, these tutorials are amazing. I'm working through it in Java so there are always a few bits here and there I have to learn on my own. But you explain so much of this so well, that I barely struggle to figure out what it is I need to do differently in Java.
Hi, I'm also working through it in Java and I'm struggling a bit at 9:40, I don't know how to access "sudokuBoardView". How did you solve it? Thanks :)
@@MishLoumova See reply to an earlier comment thread here: ua-cam.com/video/0_gtvFtZjQ8/v-deo.html&lc=UgzpjqzoROoTih-Epqx4AaABAg.8sMLps7mJni8sR9wNFiGvR
How can i figure out [ Unresolved reference: sudokuBoardView
PlaySudokuActivites.kt
code no: 20 sudokuBoardView.registerListener(this)
code no: 29 sudokuBoardView.updateCells(cells)
code no: 33 sudokuBoardView.updateSelectedCellUI(cell.first, cell.second)
private fun updateSelectedCellUI(cell: Pair?) = cell?.let {
Looks.updateSelectedCellUI(cell.first,cell.second)
update this in ur board view
fun updateSelectedCellUI(row: Int, col:Int){
selectedRow = row
selectedCol = col
invalidate()
}
Whats the program you use for programming kotlin
This is Android Studio, which has support for Kotlin and Android. If you want to program in just Kotlin and not Android, you should use IntelliJ.
I'm stuck. I keep getting this error:
Unresolved reference: updateSelectedCellUI
I verified the I'm importing the SudokuBoardView in my MainActivity.kt, and I verified that in SudokuBoardView I put the function updateSelectedCellUI code. I double and triple checked the spelling and everything. In MainActivity, the SudokuBoardView.updateSelectedCellUI is in red, so it's not finding it, but I confirmed it's there. are there any settings I need to check?
In MainActivity, are you calling `sudokuBoardView.updateSelectedCellUI` or `SudokuBoardView.updateSelectedCellUI`? It should be the first one since we are calling the function on our instance of SudokuBoardView, which is called `sudokuBoardView` with the lowercase 's'.
@@PatrickFeltes Hi Patrick, thanks for the response. I think I may have missed where we create the instance of SodukuBoardView. When I use lower case "s", then sudokuBoardView appears in red. So i must have not created the instance correctly. Where are we creating it? I downloaded your version from GitHub, but I couldn't find the sudokuBoardView instantiation.
FYI, I liked and subscribed. Great work.
@@dawkins75 So the issue is that we create the sudokuBoardView in the xml file for the MainActivity. I am using the kotlinx extension functions which let us reference views by their ids (instead of using findViewById), so you need to match it with whatever your id is in the xml file. Also, make sure you have this import:
`import kotlinx.android.synthetic.main.activity_play_sudoku.*`
Thanks for the like and subscribe! Hope this helps! If not, let me know.
@@PatrickFeltes Thanks Patrick, that did it. Turns out I misspelled it in the XML file. Seems to be ok now.
Keep up the good work.
Thank you for this tutorial. This improved my Kotlin abilities
i guess I'm quite randomly asking but does anybody know a good site to stream new movies online ?
@Brantley Bode Lately I have been using FlixZone. You can find it by googling :)
@Ariel Karsyn yea, I've been using FlixZone for years myself :)
@Ariel Karsyn Thanks, I signed up and it seems like they got a lot of movies there :D I appreciate it !!
@Brantley Bode glad I could help :)
when is the next part?? do you have some sort of schedule or something? if yes then what is it..?
Hey, I’m planning to release a new video every Sunday morning from now on. I just released a whole bunch since I was on winter break, but from now on it should be at least once a week on Sunday mornings!
@@PatrickFeltes k thx
Sorry for the delay, but the next video is now up!