mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +01:00
some code style edits
This commit is contained in:
parent
accf45bc83
commit
47d111c642
2 changed files with 8 additions and 20 deletions
|
@ -60,17 +60,11 @@ class MediaAdapter(private val context: Context, private val media: MutableList<
|
|||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun getCount(): Int {
|
||||
return media.size
|
||||
}
|
||||
override fun getCount() = media.size
|
||||
|
||||
override fun getItem(position: Int): Any {
|
||||
return media[position]
|
||||
}
|
||||
override fun getItem(position: Int) = media[position]
|
||||
|
||||
override fun getItemId(position: Int): Long {
|
||||
return 0
|
||||
}
|
||||
override fun getItemId(position: Int) = 0L
|
||||
|
||||
fun updateItems(newPhotos: List<Medium>) {
|
||||
media.clear()
|
||||
|
|
|
@ -19,9 +19,7 @@ class MyPagerAdapter(val activity: ViewPagerActivity, fm: FragmentManager, val m
|
|||
mFragments = SparseArray<ViewPagerFragment>()
|
||||
}
|
||||
|
||||
override fun getCount(): Int {
|
||||
return media.size
|
||||
}
|
||||
override fun getCount() = media.size
|
||||
|
||||
override fun getItem(position: Int): Fragment {
|
||||
val medium = media[position]
|
||||
|
@ -46,17 +44,13 @@ class MyPagerAdapter(val activity: ViewPagerActivity, fm: FragmentManager, val m
|
|||
}
|
||||
|
||||
fun updateUiVisibility(isFullscreen: Boolean, pos: Int) {
|
||||
for (i in -1..1) {
|
||||
val fragment = mFragments[pos + i]
|
||||
fragment?.systemUiVisibilityChanged(isFullscreen)
|
||||
}
|
||||
(-1..1).map { mFragments[pos + it] }
|
||||
.forEach { it?.systemUiVisibilityChanged(isFullscreen) }
|
||||
}
|
||||
|
||||
fun updateItems(pos: Int) {
|
||||
for (i in -1..1) {
|
||||
val fragment = mFragments[pos + i]
|
||||
fragment?.updateItem()
|
||||
}
|
||||
(-1..1).map { mFragments[pos + it] }
|
||||
.forEach { it?.updateItem() }
|
||||
}
|
||||
|
||||
fun updateItems(newPaths: List<Medium>) {
|
||||
|
|
Loading…
Reference in a new issue