From 3f2844d73044cf21dbc89078c958689dd701f9fd Mon Sep 17 00:00:00 2001 From: Lucas Lima Date: Wed, 16 Sep 2020 08:43:43 -0300 Subject: [PATCH] Fix bugs --- app/src/main/java/dev/lucasnlm/antimine/GameActivity.kt | 9 ++------- app/src/main/res/layout/activity_game.xml | 5 +++-- .../antimine/core/preferences/PreferencesRepository.kt | 4 ++-- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/dev/lucasnlm/antimine/GameActivity.kt b/app/src/main/java/dev/lucasnlm/antimine/GameActivity.kt index cf5964c2..ede905a4 100644 --- a/app/src/main/java/dev/lucasnlm/antimine/GameActivity.kt +++ b/app/src/main/java/dev/lucasnlm/antimine/GameActivity.kt @@ -104,7 +104,7 @@ class GameActivity : ThematicActivity(R.layout.activity_game), DialogInterface.O findViewById(R.id.levelContainer).doOnLayout { if (!isFinishing) { - if (!preferencesRepository.isTutorialCompleted() && hasTranslatedTutorial()) { + if (!preferencesRepository.isTutorialCompleted()) { loadGameTutorial() } else { loadGameFragment() @@ -338,7 +338,7 @@ class GameActivity : ThematicActivity(R.layout.activity_game), DialogInterface.O ) if (preferencesRepository.isFirstUse() && - (preferencesRepository.isTutorialCompleted() || !hasTranslatedTutorial()) + (preferencesRepository.isTutorialCompleted()) ) { openDrawer(GravityCompat.START) preferencesRepository.completeFirstUse() @@ -795,11 +795,6 @@ class GameActivity : ThematicActivity(R.layout.activity_game), DialogInterface.O } } - private fun hasTranslatedTutorial(): Boolean { - // Check if we have a translated Tutorial to the current language on a naive way. :/ - return arrayOf("en", "es", "pt", "zh").contains(Locale.getDefault().language) - } - companion object { const val GOOGLE_PLAY_REQUEST_CODE = 6 diff --git a/app/src/main/res/layout/activity_game.xml b/app/src/main/res/layout/activity_game.xml index ef3d6716..badd4e97 100644 --- a/app/src/main/res/layout/activity_game.xml +++ b/app/src/main/res/layout/activity_game.xml @@ -83,11 +83,12 @@ android:background="?selectableItemBackgroundBorderless" android:contentDescription="@string/new_game" android:padding="14dp" - android:visibility="gone" + android:alpha="0.0" + android:clickable="false" ads:layout_constraintRight_toRightOf="parent" ads:layout_constraintTop_toTopOf="parent" app:srcCompat="@drawable/retry" - tools:visibility="visible"/> + tools:alpha="1.0"/>