Skip to Content

Preserve Image Spacing in Object Header

Hi SAP Android team,

I would like to deactivate the preservation of the detail image space in the object header Fiori component.
Unfortunately it does not work to set app:preserveDetailImageSpacing="false" in the XML-Layout (like in Object cell for example). After some research I saw the following method in the ObjectHeader class:

public void setPreserveDetailImageSpacing(boolean preserveDetailImageSpacing) {
super.setPreserveDetailImageSpacing(true);}

It seems like the preservation can not be disabled. Is this on purpose for some reason?
I don't use a detail image in the object header. Therefore, I would like to use the space for more text.

Do you have an idea how I could workaround this issue?

Regards

Eduard Wagner

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Aug 03, 2020 at 05:40 PM

    Hi Eduard,

    This is a done on purpose following the Fiori design. If your application doesn't have to go through Fiori design review, you could try the following workaround ( not tested ):

    public class MyObjectHeader extends ObjectHeader {

    ...

    public void setPreserveDetailImageSpacing(boolean preserveDetailImageSpacing) {    mPreserveDetailImageSpacing = preserveDetailImageSpacing;
        requestLayout(); 
    } 
    
    

    Again, this is a hack, not officially supported, because it violates the design.

    Thanks,

    Hui Cao

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.