mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Convert the ExploreMapFragment to kotlin
This commit is contained in:
parent
cd1aaa82e0
commit
4dd1e3ee2e
3 changed files with 1093 additions and 1152 deletions
|
|
@ -123,12 +123,7 @@ class ExploreMapRootFragment : CommonsDaggerSupportFragment, MediaDetailProvider
|
||||||
* index of viewPager.
|
* index of viewPager.
|
||||||
* @return Media Object
|
* @return Media Object
|
||||||
*/
|
*/
|
||||||
override fun getMediaAtPosition(i: Int): Media? =
|
override fun getMediaAtPosition(i: Int): Media? = mapFragment?.mediaList?.get(i)
|
||||||
if (mapFragment != null && mapFragment!!.mediaList != null) {
|
|
||||||
mapFragment!!.mediaList[i]
|
|
||||||
} else {
|
|
||||||
null
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called on from getCount of MediaDetailPagerFragment The viewpager will contain
|
* This method is called on from getCount of MediaDetailPagerFragment The viewpager will contain
|
||||||
|
|
@ -136,12 +131,7 @@ class ExploreMapRootFragment : CommonsDaggerSupportFragment, MediaDetailProvider
|
||||||
*
|
*
|
||||||
* @return Total Media count in the adapter
|
* @return Total Media count in the adapter
|
||||||
*/
|
*/
|
||||||
override fun getTotalMediaCount(): Int =
|
override fun getTotalMediaCount(): Int = mapFragment?.mediaList?.size ?: 0
|
||||||
if (mapFragment != null && mapFragment!!.mediaList != null) {
|
|
||||||
mapFragment!!.mediaList.size
|
|
||||||
} else {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getContributionStateAt(position: Int): Int? = null
|
override fun getContributionStateAt(position: Int): Int? = null
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue