mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Clicking "More" on tabLayout caused it to be displayed on toolbar (in any other language than English) (#4666)
* Changed hardcoded "More" to getStrings(R.string.more) for Unlogged user - MainActivity toolbar showed "More" when clicked on More options in other language than English * Changed hardcoded "More" to getStrings(R.string.more) for Logged user - MainActivity toolbar showed "More" when clicked on More options in other language than English * Added test for: MainActivity.setUpPager
This commit is contained in:
parent
6978d00926
commit
6649da88a5
2 changed files with 12 additions and 2 deletions
|
|
@ -138,7 +138,7 @@ public class MainActivity extends BaseActivity
|
|||
|
||||
private void setUpPager() {
|
||||
tabLayout.setOnNavigationItemSelectedListener(item -> {
|
||||
if (!item.getTitle().equals("More")) {
|
||||
if (!item.getTitle().equals(getString(R.string.more))) {
|
||||
// do not change title for more fragment
|
||||
setTitle(item.getTitle());
|
||||
}
|
||||
|
|
@ -150,7 +150,7 @@ public class MainActivity extends BaseActivity
|
|||
private void setUpLoggedOutPager() {
|
||||
loadFragment(ExploreFragment.newInstance(),false);
|
||||
tabLayout.setOnNavigationItemSelectedListener(item -> {
|
||||
if (!item.getTitle().equals("More")) {
|
||||
if (!item.getTitle().equals(getString(R.string.more))) {
|
||||
// do not change title for more fragment
|
||||
setTitle(item.getTitle());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,6 +210,16 @@ class MainActivityUnitTests {
|
|||
activity.toggleLimitedConnectionMode()
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testSetUpPager() {
|
||||
val method: Method = MainActivity::class.java.getDeclaredMethod(
|
||||
"setUpPager"
|
||||
)
|
||||
method.isAccessible = true
|
||||
method.invoke(activity)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testSetUpLoggedOutPager() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue