Git Product home page Git Product logo

andfun-kotlin-guess-it's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

andfun-kotlin-guess-it's Issues

Step 08 Solution

@SudKul
Hello, firstly, thank you for writing the solutions. Following each commit has helped me to write cleaner code and understand the pertinent concepts better e.g. encapsulation.

For solution 08 I was wondering the reasoning behind 1) the onPlayAgainComplete() method and 2) storing the score as a LiveData.

  1. It seems, to me, that once we navigate away from the scoreFragment, the scoreViewModel will be cleared anyway so changing the value of _eventPlayAgain to false is not meaningful i.e. the next viewModel being referenced won't be the same viewModel as before.

  2. The score seems neither transient nor live, it is a value that is being passed from the previous fragment. Hence, why is it a good idea to store this value in the viewModel?

If there is a particular reason for this then I would love to be enlightened. If it's good coding practice then I will take it in good faith. Thanks once again for your help so far.

starter-code branch is totally out of date

The starter-code branch is totally out of date.

The main issue is that it's build.gradle files still has references to the old android.arch.navigation packages instead of the new androidx.navigation ones and thus the app crashes a lot.

I suggest upgrading it with the versions from the master branch.

Crash

so, when:

  • click play button
  • rotate
  • back
  • rotate
  • click play button again, it going to crash.
    java.lang.IllegalStateException: no current navigation node
    is it ack-ed?

Abrupt termination

Hi,
After the optional lesson's (haptic feedback) code is installed, the application terminates abruptly after "Play" is clicked. No logcat details reported. Please help.
Thanks.
Vasan S T

getting error in GameFragmentDirections

Can anybody please tell me why it showing a red error. i have downloaded the zip file from udacity and i didn't change the any code but it's showing error.

Help me!



private fun gameFinished() { val action = GameFragmentDirections.actionGameToScore(score) findNavController(this).navigate(action) }

Application crash when game finished

Hi Team,
the steps are as follows to reproduce the issue,

  1. on finishing all the words, just before pressing GOT IT, change the orientation.
  2. once the orientation is changed, now press GOT IT button .
  3. There is application crash with below logs.
    2020-12-30 09:07:14.599 4328-4328/com.example.android.guesstheword E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.android.guesstheword, PID: 4328
    java.lang.IllegalStateException: no current navigation node
    at androidx.navigation.NavController.navigate(NavController.java:765)
    at androidx.navigation.NavController.navigate(NavController.java:745)
    at androidx.navigation.NavController.navigate(NavController.java:731)
    at androidx.navigation.NavController.navigate(NavController.java:863)
    at com.example.android.guesstheword.screens.game.GameFragment.gameFinished(GameFragment.kt:87)
    at com.example.android.guesstheword.screens.game.GameFragment.access$gameFinished(GameFragment.kt:35)
    at com.example.android.guesstheword.screens.game.GameFragment$onCreateView$3.onChanged(GameFragment.kt:65)
    at com.example.android.guesstheword.screens.game.GameFragment$onCreateView$3.onChanged(GameFragment.kt:35)
    at androidx.lifecycle.LiveData.considerNotify(LiveData.java:131)
    at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:149)
    at androidx.lifecycle.LiveData.setValue(LiveData.java:307)
    at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
    at com.example.android.guesstheword.screens.game.GameViewModel.nextWord(GameViewModel.kt:90)
    at com.example.android.guesstheword.screens.game.GameViewModel.onCorrect(GameViewModel.kt:105)
    at com.example.android.guesstheword.screens.game.GameFragment$onCreateView$4.onClick(GameFragment.kt:71)
    at android.view.View.performClick(View.java:7448)
    at android.view.View.performClickInternal(View.java:7425)
    at android.view.View.access$3600(View.java:810)
    at android.view.View$PerformClick.run(View.java:28305)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:223)
    at android.app.ActivityThread.main(ActivityThread.java:7656)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Unresolved reference : ScoreFragmentBinding

Hello,

it seems that I cant' use GameFragmentBinding, ScoreFragmentBinding, and TitleFragmentBinding.
I can't find the packages com.example.android.guesstheword.databinding in the code that I downloaded, neither on github.

How to get this right?

Thank you

Starter code does not compile

Error message is:

<snip>andfun-kotlin-guess-it-starter-code/app/build/generated/source/kapt/debug/androidx/databinding/library/baseAdapters/BR.java:3: error: package javax.annotation does not exist
import javax.annotation.Generated;
                       ^

I'm using intellij rather than android studio because autocomplete and other functionality works!

IntelliJ IDEA 2021.1.3 (Community Edition)
Build #IC-211.7628.21, built on June 29, 2021
Runtime version: 11.0.11+9-b1341.60 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.13.0-1-default
GC: ParNew, ConcurrentMarkSweep
Memory: 1923M
Cores: 12
Non-Bundled Plugins: Batch Scripts Support (1.0.12), CMD Support (1.0.5), com.intellij.javafx (1.0.3), org.jetbrains.kotlin (211-1.5.10-release-909-IJ7142.45)
Kotlin: 211-1.5.10-release-909-IJ7142.45
Current Desktop: KDE

Starter code built failed

  • Exception is:
    java.lang.NoClassDefFoundError: com/google/common/util/concurrent/SettableFuture
    at com.google.common.cache.LocalCache$LoadingValueReference.(LocalCache.java:3388)
    at com.google.common.cache.LocalCache$LoadingValueReference.(LocalCache.java:3392)

BUG: Crash on Rotation in Game

steps to recreate Bug:

  1. start the game
  2. play and rotate screen
  3. finish to the end
  4. crash happens upon navigating to ScoreFragment


upgrading dependencies to androidx fix it:

// Navigation
// implementation "android.arch.navigation:navigation-fragment-ktx:1.0.0-rc02"
// implementation "android.arch.navigation:navigation-ui-ktx:1.0.0-rc02"
implementation "androidx.navigation:navigation-fragment-ktx:2.3.5"
implementation "androidx.navigation:navigation-ui-ktx:2.3.5"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.