From 2d6743db9764528b0485d21d3fd8bd7ffbf2565a Mon Sep 17 00:00:00 2001 From: Tobi Date: Sat, 23 Nov 2024 23:49:00 +0100 Subject: [PATCH 1/4] fix AppCompatCustomView lint error --- .../interaction/FractionInputInteractionView.kt | 14 +++++++------- .../interaction/MathExpressionInteractionsView.kt | 15 ++++++++------- .../interaction/NumericInputInteractionView.kt | 14 +++++++------- .../interaction/RatioInputInteractionView.kt | 14 +++++++------- .../interaction/TextInputInteractionView.kt | 14 +++++++------- 5 files changed, 36 insertions(+), 35 deletions(-) diff --git a/app/src/main/java/org/oppia/android/app/customview/interaction/FractionInputInteractionView.kt b/app/src/main/java/org/oppia/android/app/customview/interaction/FractionInputInteractionView.kt index eec5f745241..547b38feaf2 100644 --- a/app/src/main/java/org/oppia/android/app/customview/interaction/FractionInputInteractionView.kt +++ b/app/src/main/java/org/oppia/android/app/customview/interaction/FractionInputInteractionView.kt @@ -8,7 +8,7 @@ import android.view.KeyEvent.ACTION_UP import android.view.KeyEvent.KEYCODE_BACK import android.view.View import android.view.inputmethod.EditorInfo -import android.widget.EditText +import androidx.appcompat.widget.AppCompatEditText import org.oppia.android.app.player.state.listener.StateKeyboardButtonListener import org.oppia.android.app.utility.KeyboardHelper.Companion.hideSoftKeyboard import org.oppia.android.app.utility.KeyboardHelper.Companion.showSoftKeyboard @@ -20,19 +20,19 @@ import org.oppia.android.app.utility.KeyboardHelper.Companion.showSoftKeyboard // background="@drawable/edit_text_background" // maxLength="200". -/** The custom EditText class for fraction input interaction view. */ +/** The custom AppCompatEditText class for fraction input interaction view. */ class FractionInputInteractionView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyle: Int = android.R.attr.editTextStyle -) : EditText(context, attrs, defStyle), View.OnFocusChangeListener { +) : AppCompatEditText(context, attrs, defStyle), View.OnFocusChangeListener { private var hintText: CharSequence = "" private val stateKeyboardButtonListener: StateKeyboardButtonListener init { onFocusChangeListener = this // Assume multi-line for the purpose of properly showing long hints. - setSingleLine(hint != null) + isSingleLine = hint != null stateKeyboardButtonListener = context as StateKeyboardButtonListener } @@ -64,12 +64,12 @@ class FractionInputInteractionView @JvmOverloads constructor( private fun hideHint() { hint = "" typeface = Typeface.DEFAULT - setSingleLine(true) + isSingleLine = true } private fun restoreHint() { hint = hintText - if (text.isEmpty()) setTypeface(typeface, Typeface.ITALIC) - setSingleLine(false) + if (text?.isEmpty() == true) setTypeface(typeface, Typeface.ITALIC) + isSingleLine = false } } diff --git a/app/src/main/java/org/oppia/android/app/customview/interaction/MathExpressionInteractionsView.kt b/app/src/main/java/org/oppia/android/app/customview/interaction/MathExpressionInteractionsView.kt index 00de2602d42..63416dd5196 100644 --- a/app/src/main/java/org/oppia/android/app/customview/interaction/MathExpressionInteractionsView.kt +++ b/app/src/main/java/org/oppia/android/app/customview/interaction/MathExpressionInteractionsView.kt @@ -6,7 +6,7 @@ import android.util.AttributeSet import android.view.KeyEvent import android.view.View import android.view.inputmethod.EditorInfo -import android.widget.EditText +import androidx.appcompat.widget.AppCompatEditText import org.oppia.android.app.player.state.listener.StateKeyboardButtonListener import org.oppia.android.app.utility.KeyboardHelper.Companion.hideSoftKeyboard import org.oppia.android.app.utility.KeyboardHelper.Companion.showSoftKeyboard @@ -19,7 +19,7 @@ import org.oppia.android.app.utility.KeyboardHelper.Companion.showSoftKeyboard // maxLength="200". /** - * The custom [EditText] class for math expression interactions interaction view. + * The custom [AppCompatEditText] class for math expression interactions interaction view. * * Note that the hint should be set via [setPlaceholder] to ensure that it's properly initialized if * using databinding, otherwise setting the hint through android:hint should work fine. @@ -28,14 +28,14 @@ class MathExpressionInteractionsView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyle: Int = android.R.attr.editTextStyle -) : EditText(context, attrs, defStyle), View.OnFocusChangeListener { +) : AppCompatEditText(context, attrs, defStyle), View.OnFocusChangeListener { private var hintText: CharSequence = "" private val stateKeyboardButtonListener: StateKeyboardButtonListener init { onFocusChangeListener = this // Assume multi-line for the purpose of properly showing long hints. - setSingleLine(hint != null) + isSingleLine = hint != null stateKeyboardButtonListener = context as StateKeyboardButtonListener } @@ -79,12 +79,13 @@ class MathExpressionInteractionsView @JvmOverloads constructor( private fun hideHint() { hint = "" typeface = Typeface.DEFAULT - setSingleLine(true) + isSingleLine = true } private fun restoreHint() { hint = hintText - if (text.isEmpty()) setTypeface(typeface, Typeface.ITALIC) - setSingleLine(false) + + if (text?.isEmpty() == true) setTypeface(typeface, Typeface.ITALIC) + isSingleLine = false } } diff --git a/app/src/main/java/org/oppia/android/app/customview/interaction/NumericInputInteractionView.kt b/app/src/main/java/org/oppia/android/app/customview/interaction/NumericInputInteractionView.kt index b6745cad7d9..9af64db917a 100644 --- a/app/src/main/java/org/oppia/android/app/customview/interaction/NumericInputInteractionView.kt +++ b/app/src/main/java/org/oppia/android/app/customview/interaction/NumericInputInteractionView.kt @@ -8,7 +8,7 @@ import android.view.KeyEvent.ACTION_UP import android.view.KeyEvent.KEYCODE_BACK import android.view.View import android.view.inputmethod.EditorInfo -import android.widget.EditText +import androidx.appcompat.widget.AppCompatEditText import org.oppia.android.app.player.state.listener.StateKeyboardButtonListener import org.oppia.android.app.utility.KeyboardHelper.Companion.hideSoftKeyboard import org.oppia.android.app.utility.KeyboardHelper.Companion.showSoftKeyboard @@ -20,19 +20,19 @@ import org.oppia.android.app.utility.KeyboardHelper.Companion.showSoftKeyboard // background="@drawable/edit_text_background" // maxLength="200". -/** The custom EditText class for numeric input interaction view. */ +/** The custom AppCompatEditText class for numeric input interaction view. */ class NumericInputInteractionView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyle: Int = android.R.attr.editTextStyle -) : EditText(context, attrs, defStyle), View.OnFocusChangeListener { +) : AppCompatEditText(context, attrs, defStyle), View.OnFocusChangeListener { private val stateKeyboardButtonListener: StateKeyboardButtonListener private var hintText: CharSequence = "" init { onFocusChangeListener = this // Assume multi-line for the purpose of properly showing long hints. - setSingleLine(hint != null) + isSingleLine = hint != null stateKeyboardButtonListener = context as StateKeyboardButtonListener } @@ -64,12 +64,12 @@ class NumericInputInteractionView @JvmOverloads constructor( private fun hideHint() { hint = "" typeface = Typeface.DEFAULT - setSingleLine(true) + isSingleLine = true } private fun restoreHint() { hint = hintText - if (text.isEmpty()) setTypeface(typeface, Typeface.ITALIC) - setSingleLine(false) + if (text?.isEmpty() == true) setTypeface(typeface, Typeface.ITALIC) + isSingleLine = false } } diff --git a/app/src/main/java/org/oppia/android/app/customview/interaction/RatioInputInteractionView.kt b/app/src/main/java/org/oppia/android/app/customview/interaction/RatioInputInteractionView.kt index fd29579a1fd..1ad77b316b2 100644 --- a/app/src/main/java/org/oppia/android/app/customview/interaction/RatioInputInteractionView.kt +++ b/app/src/main/java/org/oppia/android/app/customview/interaction/RatioInputInteractionView.kt @@ -6,23 +6,23 @@ import android.util.AttributeSet import android.view.KeyEvent import android.view.View import android.view.inputmethod.EditorInfo -import android.widget.EditText +import androidx.appcompat.widget.AppCompatEditText import org.oppia.android.app.player.state.listener.StateKeyboardButtonListener import org.oppia.android.app.utility.KeyboardHelper -/** The custom EditText class for ratio input interaction view. */ +/** The custom AppCompatEditText class for ratio input interaction view. */ class RatioInputInteractionView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyle: Int = android.R.attr.editTextStyle -) : EditText(context, attrs, defStyle), View.OnFocusChangeListener { +) : AppCompatEditText(context, attrs, defStyle), View.OnFocusChangeListener { private var hintText: CharSequence = "" private val stateKeyboardButtonListener: StateKeyboardButtonListener init { onFocusChangeListener = this // Assume multi-line for the purpose of properly showing long hints. - setSingleLine(hint != null) + isSingleLine = hint != null stateKeyboardButtonListener = context as StateKeyboardButtonListener } @@ -54,12 +54,12 @@ class RatioInputInteractionView @JvmOverloads constructor( private fun hideHint() { hint = "" typeface = Typeface.DEFAULT - setSingleLine(true) + isSingleLine = true } private fun restoreHint() { hint = hintText - if (text.isEmpty()) setTypeface(typeface, Typeface.ITALIC) - setSingleLine(false) + if (text?.isEmpty() == true) setTypeface(typeface, Typeface.ITALIC) + isSingleLine = false } } diff --git a/app/src/main/java/org/oppia/android/app/customview/interaction/TextInputInteractionView.kt b/app/src/main/java/org/oppia/android/app/customview/interaction/TextInputInteractionView.kt index 10001acd258..56217ef9fa4 100644 --- a/app/src/main/java/org/oppia/android/app/customview/interaction/TextInputInteractionView.kt +++ b/app/src/main/java/org/oppia/android/app/customview/interaction/TextInputInteractionView.kt @@ -6,7 +6,7 @@ import android.util.AttributeSet import android.view.KeyEvent import android.view.View import android.view.inputmethod.EditorInfo -import android.widget.EditText +import androidx.appcompat.widget.AppCompatEditText import org.oppia.android.app.player.state.listener.StateKeyboardButtonListener import org.oppia.android.app.utility.KeyboardHelper.Companion.hideSoftKeyboard import org.oppia.android.app.utility.KeyboardHelper.Companion.showSoftKeyboard @@ -17,19 +17,19 @@ import org.oppia.android.app.utility.KeyboardHelper.Companion.showSoftKeyboard // background="@drawable/edit_text_background" // maxLength="200". -/** The custom EditText class for text input interaction view. */ +/** The custom AppCompatEditText class for text input interaction view. */ class TextInputInteractionView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyle: Int = android.R.attr.editTextStyle -) : EditText(context, attrs, defStyle), View.OnFocusChangeListener { +) : AppCompatEditText(context, attrs, defStyle), View.OnFocusChangeListener { private var hintText: CharSequence = "" private val stateKeyboardButtonListener: StateKeyboardButtonListener init { onFocusChangeListener = this // Assume multi-line for the purpose of properly showing long hints. - setSingleLine(hint != null) + isSingleLine = hint != null stateKeyboardButtonListener = context as StateKeyboardButtonListener } @@ -61,12 +61,12 @@ class TextInputInteractionView @JvmOverloads constructor( private fun hideHint() { hint = "" typeface = Typeface.DEFAULT - setSingleLine(true) + isSingleLine = true } private fun restoreHint() { hint = hintText - if (text.isEmpty()) setTypeface(typeface, Typeface.ITALIC) - setSingleLine(false) + if (text?.isEmpty() == true) setTypeface(typeface, Typeface.ITALIC) + isSingleLine = false } } From eb5c10d067468a2437d0ed5140c2b0bcdf1fad4e Mon Sep 17 00:00:00 2001 From: Tobi Date: Sat, 23 Nov 2024 23:51:29 +0100 Subject: [PATCH 2/4] fix FragmentTagUsage lint error --- .../app/classroom/ClassroomListActivity.kt | 5 --- .../ClassroomListActivityPresenter.kt | 5 --- .../app/drawer/NavigationDrawerFragment.kt | 13 ++++++- .../NavigationDrawerFragmentPresenter.kt | 34 +++++++++---------- .../oppia/android/app/home/HomeActivity.kt | 5 --- .../android/app/home/HomeActivityPresenter.kt | 4 --- .../administrator_controls_activity.xml | 2 +- .../main/res/layout-sw600dp/help_activity.xml | 2 +- .../res/layout-sw600dp/option_activity.xml | 2 +- .../administrator_controls_activity.xml | 2 +- .../res/layout/classroom_list_activity.xml | 2 +- .../res/layout/developer_options_activity.xml | 2 +- app/src/main/res/layout/help_activity.xml | 2 +- app/src/main/res/layout/home_activity.xml | 2 +- app/src/main/res/layout/option_activity.xml | 2 +- 15 files changed, 38 insertions(+), 46 deletions(-) diff --git a/app/src/main/java/org/oppia/android/app/classroom/ClassroomListActivity.kt b/app/src/main/java/org/oppia/android/app/classroom/ClassroomListActivity.kt index c8f075f10bf..048ed6f6e83 100644 --- a/app/src/main/java/org/oppia/android/app/classroom/ClassroomListActivity.kt +++ b/app/src/main/java/org/oppia/android/app/classroom/ClassroomListActivity.kt @@ -63,11 +63,6 @@ class ClassroomListActivity : title = resourceHandler.getStringInLocale(R.string.classroom_list_activity_title) } - override fun onRestart() { - super.onRestart() - classroomListActivityPresenter.handleOnRestart() - } - override fun onBackPressed() { val previousFragment = supportFragmentManager.findFragmentByTag(TAG_SWITCH_PROFILE_DIALOG) diff --git a/app/src/main/java/org/oppia/android/app/classroom/ClassroomListActivityPresenter.kt b/app/src/main/java/org/oppia/android/app/classroom/ClassroomListActivityPresenter.kt index ea6a0d8df3f..0b8c1d78f1e 100644 --- a/app/src/main/java/org/oppia/android/app/classroom/ClassroomListActivityPresenter.kt +++ b/app/src/main/java/org/oppia/android/app/classroom/ClassroomListActivityPresenter.kt @@ -31,11 +31,6 @@ class ClassroomListActivityPresenter @Inject constructor(private val activity: A } } - /** Handles the activity restart. Re-initializes the navigation drawer. */ - fun handleOnRestart() { - setUpNavigationDrawer() - } - private fun setUpNavigationDrawer() { val toolbar = activity.findViewById(R.id.classroom_list_activity_toolbar) as Toolbar activity.setSupportActionBar(toolbar) diff --git a/app/src/main/java/org/oppia/android/app/drawer/NavigationDrawerFragment.kt b/app/src/main/java/org/oppia/android/app/drawer/NavigationDrawerFragment.kt index ee307e47738..9408ebe67df 100644 --- a/app/src/main/java/org/oppia/android/app/drawer/NavigationDrawerFragment.kt +++ b/app/src/main/java/org/oppia/android/app/drawer/NavigationDrawerFragment.kt @@ -17,6 +17,10 @@ class NavigationDrawerFragment : RouteToProfileProgressListener, ExitProfileDialogInterface { + private lateinit var drawerLayout: DrawerLayout + private lateinit var toolbar: Toolbar + private var menuItemId: Int = 0 + @Inject lateinit var navigationDrawerFragmentPresenter: NavigationDrawerFragmentPresenter @@ -33,10 +37,17 @@ class NavigationDrawerFragment : return navigationDrawerFragmentPresenter.handleCreateView(inflater, container) } - fun setUpDrawer(drawerLayout: DrawerLayout, toolbar: Toolbar, menuItemId: Int) { + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) navigationDrawerFragmentPresenter.setUpDrawer(drawerLayout, toolbar, menuItemId) } + fun setUpDrawer(drawerLayout: DrawerLayout, toolbar: Toolbar, menuItemId: Int) { + this.drawerLayout = drawerLayout + this.toolbar = toolbar + this.menuItemId = menuItemId + } + override fun routeToProfileProgress(profileId: Int) { navigationDrawerFragmentPresenter.openProfileProgress(profileId) } diff --git a/app/src/main/java/org/oppia/android/app/drawer/NavigationDrawerFragmentPresenter.kt b/app/src/main/java/org/oppia/android/app/drawer/NavigationDrawerFragmentPresenter.kt index f606bafca88..e2a6e44d157 100644 --- a/app/src/main/java/org/oppia/android/app/drawer/NavigationDrawerFragmentPresenter.kt +++ b/app/src/main/java/org/oppia/android/app/drawer/NavigationDrawerFragmentPresenter.kt @@ -109,13 +109,13 @@ class NavigationDrawerFragmentPresenter @Inject constructor( drawerLayout.closeDrawers() footerViewModel.isDeveloperOptionsSelected.set(true) val intent = starter.createIntent(activity, profileId) - fragment.activity!!.startActivity(intent) - if (previousMenuItemId == 0) fragment.activity!!.finish() + fragment.requireActivity().startActivity(intent) + if (previousMenuItemId == 0) fragment.requireActivity().finish() else if (previousMenuItemId != null && NavigationDrawerItem.valueFromNavId(previousMenuItemId!!) != NavigationDrawerItem.HOME ) { - fragment.activity!!.finish() + fragment.requireActivity().finish() } drawerLayout.closeDrawers() } @@ -148,13 +148,13 @@ class NavigationDrawerFragmentPresenter @Inject constructor( activity, profileId ) - fragment.activity!!.startActivity(intent) - if (previousMenuItemId == -1) fragment.activity!!.finish() + fragment.requireActivity().startActivity(intent) + if (previousMenuItemId == -1) fragment.requireActivity().finish() else if (previousMenuItemId != null && NavigationDrawerItem.valueFromNavId(previousMenuItemId!!) != NavigationDrawerItem.HOME ) { - fragment.activity!!.finish() + fragment.requireActivity().finish() } drawerLayout.closeDrawers() } @@ -240,7 +240,7 @@ class NavigationDrawerFragmentPresenter @Inject constructor( ClassroomListActivity.createClassroomListActivity(activity, profileId) else HomeActivity.createHomeActivity(activity, profileId) - fragment.activity!!.startActivity(intent) + fragment.requireActivity().startActivity(intent) drawerLayout.closeDrawers() } NavigationDrawerItem.OPTIONS -> { @@ -248,9 +248,9 @@ class NavigationDrawerFragmentPresenter @Inject constructor( activity, profileId, /* isFromNavigationDrawer= */ true ) - fragment.activity!!.startActivity(intent) + fragment.requireActivity().startActivity(intent) if (checkIfPreviousActivityShouldGetFinished(menuItemId)) { - fragment.activity!!.finish() + fragment.requireActivity().finish() } drawerLayout.closeDrawers() } @@ -259,18 +259,18 @@ class NavigationDrawerFragmentPresenter @Inject constructor( activity, profileId, /* isFromNavigationDrawer= */ true ) - fragment.activity!!.startActivity(intent) + fragment.requireActivity().startActivity(intent) if (checkIfPreviousActivityShouldGetFinished(menuItemId)) { - fragment.activity!!.finish() + fragment.requireActivity().finish() } drawerLayout.closeDrawers() } NavigationDrawerItem.DOWNLOADS -> { val intent = MyDownloadsActivity.createMyDownloadsActivityIntent(activity, internalProfileId) - fragment.activity!!.startActivity(intent) + fragment.requireActivity().startActivity(intent) if (checkIfPreviousActivityShouldGetFinished(menuItemId)) { - fragment.activity!!.finish() + fragment.requireActivity().finish() } drawerLayout.closeDrawers() } @@ -412,7 +412,7 @@ class NavigationDrawerFragmentPresenter @Inject constructor( ) { override fun onDrawerOpened(drawerView: View) { super.onDrawerOpened(drawerView) - fragment.activity!!.invalidateOptionsMenu() + fragment.requireActivity().invalidateOptionsMenu() StatusBarColor.statusBarColorUpdate( R.color.component_color_shared_slide_drawer_open_status_bar_color, activity, @@ -451,7 +451,7 @@ class NavigationDrawerFragmentPresenter @Inject constructor( ) { override fun onDrawerOpened(drawerView: View) { super.onDrawerOpened(drawerView) - fragment.activity!!.invalidateOptionsMenu() + fragment.requireActivity().invalidateOptionsMenu() StatusBarColor.statusBarColorUpdate( R.color.component_color_shared_slide_drawer_open_status_bar_color, activity, @@ -461,7 +461,7 @@ class NavigationDrawerFragmentPresenter @Inject constructor( override fun onDrawerClosed(drawerView: View) { super.onDrawerClosed(drawerView) - fragment.activity!!.invalidateOptionsMenu() + fragment.requireActivity().invalidateOptionsMenu() StatusBarColor.statusBarColorUpdate( R.color.component_color_shared_activity_status_bar_color, activity, @@ -473,7 +473,7 @@ class NavigationDrawerFragmentPresenter @Inject constructor( /* Synchronize the state of the drawer indicator/affordance with the linked [drawerLayout]. */ drawerLayout.post { drawerToggle.syncState() } if (previousMenuItemId != NavigationDrawerItem.HOME.ordinal && previousMenuItemId != -1) { - fragment.activity!!.finish() + fragment.requireActivity().finish() } } } diff --git a/app/src/main/java/org/oppia/android/app/home/HomeActivity.kt b/app/src/main/java/org/oppia/android/app/home/HomeActivity.kt index 34885717a33..32279c54162 100644 --- a/app/src/main/java/org/oppia/android/app/home/HomeActivity.kt +++ b/app/src/main/java/org/oppia/android/app/home/HomeActivity.kt @@ -62,11 +62,6 @@ class HomeActivity : title = resourceHandler.getStringInLocale(R.string.home_activity_title) } - override fun onRestart() { - super.onRestart() - homeActivityPresenter.handleOnRestart() - } - override fun routeToTopic(internalProfileId: Int, classroomId: String, topicId: String) { startActivity( TopicActivity.createTopicActivityIntent(this, internalProfileId, classroomId, topicId) diff --git a/app/src/main/java/org/oppia/android/app/home/HomeActivityPresenter.kt b/app/src/main/java/org/oppia/android/app/home/HomeActivityPresenter.kt index 83e65950b7f..b2d6990a902 100644 --- a/app/src/main/java/org/oppia/android/app/home/HomeActivityPresenter.kt +++ b/app/src/main/java/org/oppia/android/app/home/HomeActivityPresenter.kt @@ -38,10 +38,6 @@ class HomeActivityPresenter @Inject constructor(private val activity: AppCompatA } } - fun handleOnRestart() { - setUpNavigationDrawer() - } - private fun setUpNavigationDrawer() { val toolbar = activity.findViewById(R.id.home_activity_toolbar) as Toolbar activity.setSupportActionBar(toolbar) diff --git a/app/src/main/res/layout-sw600dp/administrator_controls_activity.xml b/app/src/main/res/layout-sw600dp/administrator_controls_activity.xml index 9b778df86f3..e853bff7469 100644 --- a/app/src/main/res/layout-sw600dp/administrator_controls_activity.xml +++ b/app/src/main/res/layout-sw600dp/administrator_controls_activity.xml @@ -98,7 +98,7 @@ app:layout_constraintTop_toBottomOf="@id/administrator_controls_activity_toolbar" /> - - - - - - - - - Date: Sun, 24 Nov 2024 06:24:27 +0100 Subject: [PATCH 3/4] remove onRestart from NavigationDrawerTestActivity --- .../android/app/testing/NavigationDrawerTestActivity.kt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/src/main/java/org/oppia/android/app/testing/NavigationDrawerTestActivity.kt b/app/src/main/java/org/oppia/android/app/testing/NavigationDrawerTestActivity.kt index 6097b74d8b5..6a2bcabb787 100644 --- a/app/src/main/java/org/oppia/android/app/testing/NavigationDrawerTestActivity.kt +++ b/app/src/main/java/org/oppia/android/app/testing/NavigationDrawerTestActivity.kt @@ -56,11 +56,6 @@ class NavigationDrawerTestActivity : title = resourceHandler.getStringInLocale(R.string.home_activity_title) } - override fun onRestart() { - super.onRestart() - homeActivityPresenter.handleOnRestart() - } - override fun routeToTopic(internalProfileId: Int, classroomId: String, topicId: String) { startActivity( TopicActivity.createTopicActivityIntent(this, internalProfileId, classroomId, topicId) From 998bb690babc9b23ffcbf4bf37ab7b92ddc82355 Mon Sep 17 00:00:00 2001 From: Tobi Date: Mon, 25 Nov 2024 02:54:44 +0100 Subject: [PATCH 4/4] Add androidx.fragment dependency to bazel --- app/BUILD.bazel | 1 + testing/BUILD.bazel | 1 + third_party/maven_install.json | 3 ++- third_party/versions.bzl | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/BUILD.bazel b/app/BUILD.bazel index cbeefc86af0..943d3715703 100644 --- a/app/BUILD.bazel +++ b/app/BUILD.bazel @@ -609,6 +609,7 @@ android_library( "//third_party:androidx_databinding_databinding-adapters", "//third_party:androidx_databinding_databinding-common", "//third_party:androidx_databinding_databinding-runtime", + "//third_party:androidx_fragment_fragment", "//third_party:androidx_drawerlayout_drawerlayout", "//third_party:androidx_lifecycle_lifecycle-livedata-core", "//third_party:androidx_recyclerview_recyclerview", diff --git a/testing/BUILD.bazel b/testing/BUILD.bazel index 0df7d21484a..d6911740138 100644 --- a/testing/BUILD.bazel +++ b/testing/BUILD.bazel @@ -42,6 +42,7 @@ kt_android_library( "//testing/src/main/java/org/oppia/android/testing/threading:test_coroutine_dispatchers", "//testing/src/main/java/org/oppia/android/testing/time:fake_oppia_clock", "//third_party:androidx_core_core-ktx", + "//third_party:androidx_fragment_fragment", "//third_party:androidx_lifecycle_lifecycle-livedata-ktx", "//third_party:androidx_test_espresso_espresso-accessibility", "//third_party:androidx_test_espresso_espresso-contrib", diff --git a/third_party/maven_install.json b/third_party/maven_install.json index e05d3b9c565..f85e946c595 100644 --- a/third_party/maven_install.json +++ b/third_party/maven_install.json @@ -1,12 +1,13 @@ { "__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL", - "__INPUT_ARTIFACTS_HASH": 1471454102, + "__INPUT_ARTIFACTS_HASH": 1153593813, "__RESOLVED_ARTIFACTS_HASH": 1994124852, "conflict_resolution": { "androidx.annotation:annotation:1.1.0": "androidx.annotation:annotation:1.2.0", "androidx.constraintlayout:constraintlayout:1.1.3": "androidx.constraintlayout:constraintlayout:2.0.1", "androidx.core:core-ktx:1.0.1": "androidx.core:core-ktx:1.1.0", "androidx.core:core:1.0.1": "androidx.core:core:1.7.0", + "androidx.fragment:fragment:1.1.0": "androidx.fragment:fragment:1.3.6", "androidx.lifecycle:lifecycle-livedata-core:2.2.0": "androidx.lifecycle:lifecycle-livedata-core:2.3.1", "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0": "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1", "androidx.recyclerview:recyclerview:1.0.0": "androidx.recyclerview:recyclerview:1.1.0", diff --git a/third_party/versions.bzl b/third_party/versions.bzl index 2bcb6612f34..3f35f396a54 100644 --- a/third_party/versions.bzl +++ b/third_party/versions.bzl @@ -37,6 +37,7 @@ MAVEN_PRODUCTION_DEPENDENCY_VERSIONS = { "androidx.databinding:databinding-compiler": "3.4.2", "androidx.databinding:databinding-runtime": "3.4.2", "androidx.drawerlayout:drawerlayout": "1.1.0", + "androidx.fragment:fragment": "1.1.0", "androidx.lifecycle:lifecycle-extensions": "2.2.0", "androidx.lifecycle:lifecycle-livedata-core": "2.2.0", "androidx.lifecycle:lifecycle-livedata-ktx": "2.2.0",