Convert explore package to kotlin (#6389)

* Convert WikidataItemDetailsActivity to kotlin

* Convert RecentSearchesDao to kotlin

* Convert RecentSearchesFragment to kotlin

* Convert ExploreListRootFragment to kotlin

* Convert the ParentViewPager to kotlin

* Convert ExploreMapRootFragment to kotlin

* Convert SearchActivity to kotlin

* Convert ExploreFragment to kotlin

* Convert ExploreMapCalls and ExploreMapContract to kotlin

* Convert ExploreMapController to kotlin

* Convert the map presenter to kotlin

* Convert the ExploreMapFragment to kotlin

* Fix import issue
This commit is contained in:
Paul Hawke 2025-08-03 21:44:00 -05:00 committed by GitHub
parent 516039c91d
commit 6f36cae767
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 3218 additions and 3499 deletions

View file

@ -88,14 +88,14 @@ class ExploreFragmentUnitTest {
@Throws(Exception::class)
fun testSetScrollCaseTrue() {
fragment.setScroll(true)
Assert.assertEquals(viewPager.isCanScroll, true)
Assert.assertEquals(viewPager.canScroll, true)
}
@Test
@Throws(Exception::class)
fun testSetScrollCaseFalse() {
fragment.setScroll(false)
Assert.assertEquals(viewPager.isCanScroll, false)
Assert.assertEquals(viewPager.canScroll, false)
}
@Test

View file

@ -20,15 +20,15 @@ import fr.free.nrw.commons.TestCommonsApplication
import fr.free.nrw.commons.explore.models.RecentSearch
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesContentProvider.Companion.BASE_URI
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesContentProvider.Companion.uriForId
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesDao.Table.ALL_FIELDS
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesDao.Table.COLUMN_ID
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesDao.Table.COLUMN_LAST_USED
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesDao.Table.COLUMN_NAME
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesDao.Table.CREATE_TABLE_STATEMENT
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesDao.Table.DROP_TABLE_STATEMENT
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesDao.Table.onCreate
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesDao.Table.onDelete
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesDao.Table.onUpdate
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesTable.ALL_FIELDS
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesTable.COLUMN_ID
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesTable.COLUMN_LAST_USED
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesTable.COLUMN_NAME
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesTable.CREATE_TABLE_STATEMENT
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesTable.DROP_TABLE_STATEMENT
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesTable.onCreate
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesTable.onDelete
import fr.free.nrw.commons.explore.recentsearches.RecentSearchesTable.onUpdate
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull

View file

@ -123,18 +123,4 @@ class RecentSearchesFragmentUnitTest {
method.isAccessible = true
method.invoke(fragment, context, 0)
}
@Test
@Throws(Exception::class)
fun testSetDeletePositiveButton() {
val method: Method =
RecentSearchesFragment::class.java.getDeclaredMethod(
"setDeletePositiveButton",
Context::class.java,
DialogInterface::class.java,
Int::class.java,
)
method.isAccessible = true
method.invoke(fragment, context, dialog, 0)
}
}