Skip to content

Commit

Permalink
Fix part of #3602 Added label for HomeActivity (#3850)
Browse files Browse the repository at this point in the history
* Label added for HomeActivity

* HomeActivity removed from label exemptions

* Removed translatable=false

* Test created for HomeActivity

* removed summary value

* Update deploymentTargetDropDown.xml

* Update deploymentTargetDropDown.xml

* Updated testcase

* Updated strings.xml

* Delete deploymentTargetDropDown.xml

* ActivityTestRule removed

* multiple home string removed

* .idea/runConfigurations.xml file reverted back

* Removed unused imports

* reformated code

* Fixed unnecessary changes

* String.xml updated

* removed changes from strings.xml

* strings.xml updated removed unncessary changes
  • Loading branch information
vrajdesai78 committed Nov 17, 2021
1 parent e28e285 commit 4647538
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
android:theme="@style/OppiaThemeWithoutActionBar" />
<activity
android:name=".app.home.HomeActivity"
android:label="@string/home_activity_title"
android:theme="@style/OppiaThemeWithoutActionBar" />
<activity
android:name=".app.home.recentlyplayed.RecentlyPlayedActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class HomeActivity :
(activityComponent as ActivityComponentImpl).inject(this)
internalProfileId = intent?.getIntExtra(NAVIGATION_PROFILE_ID_ARGUMENT_KEY, -1)!!
homeActivityPresenter.handleOnCreate()
title = resourceHandler.getStringInLocale(R.string.menu_home)
title = resourceHandler.getStringInLocale(R.string.home_activity_title)
}

override fun onRestart() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class NavigationDrawerTestActivity :
(activityComponent as ActivityComponentImpl).inject(this)
internalProfileId = intent?.getIntExtra(NAVIGATION_PROFILE_ID_ARGUMENT_KEY, -1)!!
homeActivityPresenter.handleOnCreate()
title = resourceHandler.getStringInLocale(R.string.menu_home)
title = resourceHandler.getStringInLocale(R.string.home_activity_title)
}

override fun onRestart() {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/menu/navigation_drawer_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<item
android:id="@+id/nav_home"
android:icon="@drawable/ic_home_icon_grey_24dp"
android:title="@string/menu_home" />
android:title="@string/home_activity_title" />
<item
android:id="@+id/nav_options"
android:icon="@drawable/ic_options_icon_grey_24dp"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
-->
<resources>
<string name="nav_header_desc">أعلى قائمة التنقل</string>
<string name="menu_home">الصفحة الرئيسية</string>
<string name="home_activity_title">الصفحة الرئيسية</string>
<string name="menu_options">خيارات</string>
<string name="menu_my_downloads">التنزيلات</string>
<string name="menu_help">مساعدة</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->
<resources>
<string name="nav_header_desc">Cabeçalho de navegação</string>
<string name="menu_home">Início</string>
<string name="home_activity_title">Início</string>
<string name="menu_options">Opções</string>
<string name="menu_my_downloads">Meus Downloads</string>
<string name="menu_help">Ajuda</string>
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="nav_header_desc">Navigation header</string>
<string name="menu_home">Home</string>
<string name="menu_options">Options</string>
<string name="menu_my_downloads">My Downloads</string>
<string name="menu_help">Help</string>
Expand Down Expand Up @@ -296,6 +295,8 @@
<string name="home_activity_back_dialog_message">Would you like to exit your profile?</string>
<string name="home_activity_back_dialog_cancel">Cancel</string>
<string name="home_activity_back_dialog_exit">Exit</string>
<!-- HomeActivity -->
<string name="home_activity_title">Home</string>
<!-- ProfileListActivity -->
<string name="profile_list_activity_title">Profiles</string>
<!-- ProfileEditActivity -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,16 @@ class HomeActivityTest {
}
}

@Test
fun testHomeActivity_hasCorrectActivityLabel() {
launch(HomeActivity::class.java).use { scenario ->
scenario.onActivity { activity ->
val title = activity.title
assertThat(title).isEqualTo(context.getString(R.string.home_activity_title))
}
}
}

@Test
fun testHomeActivity_withAdminProfile_configChange_profileNameIsDisplayed() {
launch<HomeActivity>(createHomeActivityIntent(internalProfileId)).use {
Expand Down
1 change: 0 additions & 1 deletion scripts/assets/accessibility_label_exemptions.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ exempted_activity: "app/src/main/java/org/oppia/android/app/devoptions/markstori
exempted_activity: "app/src/main/java/org/oppia/android/app/devoptions/marktopicscompleted/testing/MarkTopicsCompletedTestActivity"
exempted_activity: "app/src/main/java/org/oppia/android/app/devoptions/vieweventlogs/testing/ViewEventLogsTestActivity"
exempted_activity: "app/src/main/java/org/oppia/android/app/devoptions/testing/DeveloperOptionsTestActivity"
exempted_activity: "app/src/main/java/org/oppia/android/app/home/HomeActivity"
exempted_activity: "app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity"
exempted_activity: "app/src/main/java/org/oppia/android/app/mydownloads/MyDownloadsActivity"
exempted_activity: "app/src/main/java/org/oppia/android/app/player/state/testing/StateFragmentTestActivity"
Expand Down

0 comments on commit 4647538

Please sign in to comment.