Skip to content

fix : alignment bottomsheet header#6696

Open
rovertrack wants to merge 1 commit intocommons-app:mainfrom
rovertrack:bottomsheet
Open

fix : alignment bottomsheet header#6696
rovertrack wants to merge 1 commit intocommons-app:mainfrom
rovertrack:bottomsheet

Conversation

@rovertrack
Copy link
Contributor

@rovertrack rovertrack commented Mar 2, 2026

proper alignment of labels and title

Fixes #6695

What changes did you make and why?
added necessary padding and margins , center aligning of title

betadebug

Screenshots (for UI changes only)

before :
Image

after :

Screenshot_2026-03-02-20-53-06-30_062c6066f629c24413cc8efde3bd9f38

binding!!.bottomSheetDetails.title.text = selectedPlace!!.name
binding!!.bottomSheetDetails.category.text = selectedPlace!!.distance
// Remove label since it is double information
if (selectedPlace!!.distance != null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i have implemented the fix , but what is this distance and category needed really for ?
in the xml layout it shows as category and here the distance is being assigned which always return null and not populating the category placeholder in the ui ! @nicolas-raoul what should be shown below the main title in the bottomsheet header is it category of place or distance , if it is redundant can i remove it ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

if it is redundant can i remove it ?

For now, I’d recommend focusing on the current issue. We can create a separate issue for this and address it there.

Copy link
Collaborator

Choose a reason for hiding this comment

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

i have implemented the fix , but what is this distance and category needed really for ?

@RitikaPahwa4444 Need your help here.

binding!!.bottomSheetDetails.title.text = selectedPlace!!.name
binding!!.bottomSheetDetails.category.text = selectedPlace!!.distance
// Remove label since it is double information
if (selectedPlace!!.distance != null) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @rovertrack , thanks for the contribution!

Haven’t checked the code locally yet. Is there any specific reason this change was needed? Since it’s alignment related, could this have been handled in XML file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

then it should be always hidden and not needed itself
the title and that category are stacked on top of each other so hiding the category part aligns the title perfectly
but why is it needed ? in XML file it says category in the code it is being initialized with distance , should it be showing category / distance below title in the header ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

btw hi @neeldoshii forgot to greet while remembering the context of the issue )

@rovertrack rovertrack requested a review from neeldoshii March 6, 2026 17:30
@rovertrack
Copy link
Contributor Author

@neeldoshii what should i do about this ?

binding!!.bottomSheetDetails.title.text = selectedPlace!!.name
binding!!.bottomSheetDetails.category.text = selectedPlace!!.distance
// Remove label since it is double information
if (selectedPlace!!.distance != null) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of java style can you use let operator here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok will do it soon

// Remove label since it is double information
if (selectedPlace!!.distance != null) {
binding!!.bottomSheetDetails.category.visibility = View.VISIBLE
binding!!.bottomSheetDetails.category.text = selectedPlace!!.distance
Copy link
Collaborator

Choose a reason for hiding this comment

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

selectedPlace?.distance?.let {
            binding?.bottomSheetDetails?.category?.visibility = View.VISIBLE
            binding?.bottomSheetDetails?.category?.text = it
        }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will update it 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i have updated the code to use the let operator instead of java (rookie mistake as transitioning from java to kotlin ,my bad ) thank you very much for the code

@github-actions
Copy link

✅ Generated APK variants!

@rovertrack rovertrack requested a review from neeldoshii March 13, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Proper alignment of label required in bottomsheet details header view

2 participants