First of all, my apologies for the title. I thought about choosing a more descriptive name for a long time, but I could not find it.
I have a screen with a title (variable length - using a sliding action bar), a middle part (scrollview) and a lower part for showing ads (fixed length). I can write a screen using RelativeLayout, but I would really like:
- If the scroll content (middle part) is not enough to fill the screen (including the title), I would like to show an ad at the bottom of the screen.
- If the title of the scroll content + is larger than the screen, I would like to show an ad BELOW the contents of the scroll content, which means that it does not appear if the user does not scroll the bottom of the fragment.
Present the scroll content as short text or image + long text. In the first case, the scroll content will be short, and therefore I would ideally show the ad at the bottom of the screen, since I have enough space, but if it is an image + text, it will be larger than the height of the screen and as such, I would like to show the ad after scrolling user to the bottom.
The reason I want to do this is because the ad does not necessarily take up space if there is useful content on the screen (user interface).
Is there anyway to achieve this goal in android without writing my own layout? If so, what kind of performance would you recommend?
Thank you very much in advance,
source share