fix : alignment bottomsheet header#6696
Conversation
| binding!!.bottomSheetDetails.title.text = selectedPlace!!.name | ||
| binding!!.bottomSheetDetails.category.text = selectedPlace!!.distance | ||
| // Remove label since it is double information | ||
| if (selectedPlace!!.distance != null) { |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
btw hi @neeldoshii forgot to greet while remembering the context of the issue )
|
@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) { |
There was a problem hiding this comment.
Instead of java style can you use let operator here?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
selectedPlace?.distance?.let {
binding?.bottomSheetDetails?.category?.visibility = View.VISIBLE
binding?.bottomSheetDetails?.category?.text = it
}
There was a problem hiding this comment.
Will update it 👍
There was a problem hiding this comment.
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
|
✅ Generated APK variants! |
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 :

after :