Skip to content

Commit

Permalink
[RunAllTests] Fix part of #3974: Cherry-pick MR3 release blocker fixes (
Browse files Browse the repository at this point in the history
#3975)

* Fix #3946: Fix solution automatically revealing after first hint reveal (#3955)

* Fix solution auto showing after hint reveal.

See #3946 & PR for specifics.

* Add translations for new hint/solution.

* Lint fixes.

* Add TODO.

* Fix Gradle-variant tests.

* Fix #3937: Ensure ViewEventLogsViewModel builds for alpha builds (#3957)

* Ensure ViewEventLogsViewModel builds for alpha.

* BUILD file lint fix.

* Fix #3939 & #3938: Fix KitKat crash & SVG rendering issues (#3963)

* Fix KitKat crash when opening Help menu.

* Fix SVG rendering on SDKs 19-23 (incl).

* Add regex check to prohibit Delegates.

* Lint fixes.

* Add exemption for regex script test.

* Update file_content_validation_checks.textproto

Grammar fix in error.

* Update RegexPatternValidationCheckTest.kt

Copy grammar fix to test copy of error.

* Update version.bzl (#3964)

Bump version codes for another RC of release-0.6.

* Embed proguard.map in optimized AAB builds. (#3973)
  • Loading branch information
BenHenning authored Oct 29, 2021
1 parent de345f9 commit 0506c5d
Show file tree
Hide file tree
Showing 19 changed files with 999 additions and 296 deletions.
1 change: 1 addition & 0 deletions app/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ kt_android_library(
"//third_party:androidx_databinding_databinding-runtime",
"//utility",
"//utility/src/main/java/org/oppia/android/util/extensions:context_extensions",
"//utility/src/main/java/org/oppia/android/util/logging/firebase:debug_event_logger",
"//utility/src/main/java/org/oppia/android/util/logging/firebase:debug_module",
# TODO(#59): Remove 'debug_util_module' once we completely migrate to Bazel from Gradle as
# we can then directly exclude debug files from the build and thus won't be requiring this module.
Expand Down
7 changes: 2 additions & 5 deletions app/src/main/java/org/oppia/android/app/help/HelpActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import org.oppia.android.app.help.thirdparty.ThirdPartyDependencyListActivity
import org.oppia.android.app.translation.AppLanguageResourceHandler
import org.oppia.android.util.extensions.getStringFromBundle
import javax.inject.Inject
import kotlin.properties.Delegates

const val HELP_OPTIONS_TITLE_SAVED_KEY = "HelpActivity.help_options_title"
const val SELECTED_FRAGMENT_SAVED_KEY = "HelpActivity.selected_fragment"
Expand Down Expand Up @@ -45,8 +44,6 @@ class HelpActivity :

private lateinit var selectedFragment: String
private lateinit var selectedHelpOptionsTitle: String
private var selectedDependencyIndex by Delegates.notNull<Int>()
private var selectedLicenseIndex by Delegates.notNull<Int>()

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand All @@ -57,9 +54,9 @@ class HelpActivity :
)
selectedFragment =
savedInstanceState?.getStringFromBundle(SELECTED_FRAGMENT_SAVED_KEY) ?: FAQ_LIST_FRAGMENT_TAG
selectedDependencyIndex =
val selectedDependencyIndex =
savedInstanceState?.getInt(THIRD_PARTY_DEPENDENCY_INDEX_SAVED_KEY) ?: 0
selectedLicenseIndex = savedInstanceState?.getInt(LICENSE_INDEX_SAVED_KEY) ?: 0
val selectedLicenseIndex = savedInstanceState?.getInt(LICENSE_INDEX_SAVED_KEY) ?: 0
selectedHelpOptionsTitle = savedInstanceState?.getStringFromBundle(HELP_OPTIONS_TITLE_SAVED_KEY)
?: resourceHandler.getStringInLocale(R.string.faq_activity_title)
helpActivityPresenter.handleOnCreate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import org.oppia.android.app.help.thirdparty.LicenseTextViewerFragment
import org.oppia.android.app.help.thirdparty.ThirdPartyDependencyListFragment
import org.oppia.android.app.translation.AppLanguageResourceHandler
import javax.inject.Inject
import kotlin.properties.Delegates

/** The presenter for [HelpActivity]. */
@ActivityScope
Expand All @@ -31,8 +30,8 @@ class HelpActivityPresenter @Inject constructor(

private lateinit var selectedFragmentTag: String
private lateinit var selectedHelpOptionTitle: String
private var selectedDependencyIndex by Delegates.notNull<Int>()
private var selectedLicenseIndex by Delegates.notNull<Int>()
private var selectedDependencyIndex: Int? = null
private var selectedLicenseIndex: Int? = null

fun handleOnCreate(
helpOptionsTitle: String,
Expand Down Expand Up @@ -60,7 +59,7 @@ class HelpActivityPresenter @Inject constructor(
val titleTextView =
activity.findViewById<TextView>(R.id.options_activity_selected_options_title)
if (titleTextView != null) {
setMultipaneContainerTitle(helpOptionsTitle!!)
setMultipaneContainerTitle(helpOptionsTitle)
}
val isMultipane = activity.findViewById<FrameLayout>(R.id.multipane_options_container) != null
if (isMultipane) {
Expand Down Expand Up @@ -140,8 +139,8 @@ class HelpActivityPresenter @Inject constructor(
outState.putString(HELP_OPTIONS_TITLE_SAVED_KEY, titleTextView.text.toString())
}
outState.putString(SELECTED_FRAGMENT_SAVED_KEY, selectedFragmentTag)
outState.putInt(THIRD_PARTY_DEPENDENCY_INDEX_SAVED_KEY, selectedDependencyIndex)
outState.putInt(LICENSE_INDEX_SAVED_KEY, selectedLicenseIndex)
selectedDependencyIndex?.let { outState.putInt(THIRD_PARTY_DEPENDENCY_INDEX_SAVED_KEY, it) }
selectedLicenseIndex?.let { outState.putInt(LICENSE_INDEX_SAVED_KEY, it) }
}

private fun setUpToolbar() {
Expand All @@ -156,7 +155,13 @@ class HelpActivityPresenter @Inject constructor(
val currentFragment = getMultipaneOptionsFragment()
if (currentFragment != null) {
when (currentFragment) {
is LicenseTextViewerFragment -> handleLoadLicenseListFragment(selectedDependencyIndex)
is LicenseTextViewerFragment -> {
handleLoadLicenseListFragment(
checkNotNull(selectedDependencyIndex) {
"Expected dependency index to be selected & defined"
}
)
}
is LicenseListFragment -> handleLoadThirdPartyDependencyListFragment()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2603,6 +2603,7 @@ class StateFragmentTest {
targetTextViewId: Int
) {
scrollToViewType(SELECTION_INTERACTION)
// First, check that the option matches what's expected by the test.
onView(
atPositionOnView(
recyclerViewId = R.id.selection_interaction_recyclerview,
Expand Down
Loading

0 comments on commit 0506c5d

Please sign in to comment.