Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3092,6 +3092,48 @@ class NearbyParentFragment : CommonsDaggerSupportFragment(),
if (gridLayoutManager != null) {
gridLayoutManager!!.spanCount = spanCount
}
val mapIconLayout = binding!!.fabRecenter.parent as android.widget.LinearLayout
Copy link
Copy Markdown
Collaborator

@RitikaPahwa4444 RitikaPahwa4444 Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to understand this a bit: it's not reproducible in the contributions tab but in nearby. Do we have any possibility of writing common code for this?

val iconParams = mapIconLayout.layoutParams as android.widget.RelativeLayout.LayoutParams
Comment thread
Roniscend marked this conversation as resolved.

val emptyView1Params = binding!!.emptyView1.layoutParams
val emptyViewParams = binding!!.emptyView.layoutParams
val emptyView2Params = binding!!.emptyView2.layoutParams

val density = resources.displayMetrics.density
fun dpToPx(dp: Int): Int = (dp * density).toInt()

if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
iconParams.removeRule(android.widget.RelativeLayout.ALIGN_PARENT_END)
Comment thread
Roniscend marked this conversation as resolved.
iconParams.addRule(android.widget.RelativeLayout.ALIGN_PARENT_START, android.widget.RelativeLayout.TRUE)
iconParams.marginStart = dpToPx(16)
iconParams.marginEnd = 0

emptyView1Params.height = 0
emptyViewParams.height = 0
emptyView2Params.height = 0

binding!!.fabCustomGallery.translationX = dpToPx(-70).toFloat()
binding!!.fabGallery.translationX = dpToPx(-140).toFloat()
binding!!.fabCamera.translationX = dpToPx(-210).toFloat()
Comment thread
Roniscend marked this conversation as resolved.

} else {
iconParams.removeRule(android.widget.RelativeLayout.ALIGN_PARENT_START)
iconParams.addRule(android.widget.RelativeLayout.ALIGN_PARENT_END, android.widget.RelativeLayout.TRUE)
iconParams.marginStart = 0
iconParams.marginEnd = dpToPx(16)

emptyView1Params.height = dpToPx(285)
emptyViewParams.height = dpToPx(174)
emptyView2Params.height = dpToPx(46)
Comment thread
Roniscend marked this conversation as resolved.

binding!!.fabCustomGallery.translationX = 0f
binding!!.fabGallery.translationX = 0f
binding!!.fabCamera.translationX = 0f
}
mapIconLayout.layoutParams = iconParams
binding!!.emptyView1.layoutParams = emptyView1Params
binding!!.emptyView.layoutParams = emptyViewParams
binding!!.emptyView2.layoutParams = emptyView2Params
}

fun onLearnMoreClicked() {
Expand Down
Loading