mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
implementing
This commit is contained in:
parent
c6040d02ec
commit
8ec08acc32
1 changed files with 5 additions and 2 deletions
|
|
@ -2273,16 +2273,19 @@ class NearbyParentFragment : CommonsDaggerSupportFragment(), NearbyParentFragmen
|
||||||
binding!!.bottomSheetDetails.bottomSheetRecyclerView.adapter = bottomSheetAdapter
|
binding!!.bottomSheetDetails.bottomSheetRecyclerView.adapter = bottomSheetAdapter
|
||||||
updateBookmarkButtonImage(selectedPlace!!)
|
updateBookmarkButtonImage(selectedPlace!!)
|
||||||
|
|
||||||
selectedPlace?.pic?.substringAfterLast("/")?.let { imageName ->
|
selectedPlace?.pic?.substringAfterLast("/")?.takeIf { it.isNotEmpty() }?.let { imageName ->
|
||||||
Glide.with(binding!!.bottomSheetDetails.icon.context)
|
Glide.with(binding!!.bottomSheetDetails.icon.context)
|
||||||
.load("https://commons.wikimedia.org/wiki/Special:Redirect/file/$imageName?width=20")
|
.load("https://commons.wikimedia.org/wiki/Special:Redirect/file/$imageName?width=20")
|
||||||
.placeholder(fr.free.nrw.commons.R.drawable.ic_refresh_24dp_nearby)
|
.placeholder(fr.free.nrw.commons.R.drawable.ic_refresh_24dp_nearby)
|
||||||
.error(selectedPlace!!.label.icon)
|
.error(selectedPlace!!.label.icon)
|
||||||
.into(binding!!.bottomSheetDetails.icon)
|
.into(binding!!.bottomSheetDetails.icon)
|
||||||
|
|
||||||
binding!!.bottomSheetDetails.icon.setOnClickListener {
|
binding!!.bottomSheetDetails.icon.setOnClickListener {
|
||||||
handleMediaClick(imageName)
|
handleMediaClick(imageName)
|
||||||
}
|
}
|
||||||
} ?: binding!!.bottomSheetDetails.icon.setImageResource(selectedPlace!!.label.icon)
|
} ?: run {
|
||||||
|
binding!!.bottomSheetDetails.icon.setImageResource(selectedPlace!!.label.icon)
|
||||||
|
}
|
||||||
|
|
||||||
binding!!.bottomSheetDetails.title.text = selectedPlace!!.name
|
binding!!.bottomSheetDetails.title.text = selectedPlace!!.name
|
||||||
binding!!.bottomSheetDetails.category.text = selectedPlace!!.distance
|
binding!!.bottomSheetDetails.category.text = selectedPlace!!.distance
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue