Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6741663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:45:09+00:00 2026-05-26T11:45:09+00:00

I have a set of similar applications. I extracted common resources and code to

  • 0

I have a set of similar applications. I extracted common resources and code to the library project and applications just override what they need to. In my library there is the following style defined:

<style name="ListItemText">
    <item name="android:layout_toRightOf">@id/preview_image</item>
    <item name="android:textStyle">bold</item>
    <item name="android:textSize">@dimen/previewTextSize</item>
</style>

As you can see it contains android:layout_toRightOf attribute as this style would be applied to the text in the ListView row which should be displayed to the right of the image in that row.
However in one of my applications I’d like to display the text below the image. How the ListItemText style in that application should be defined to override android:layout_toRightOf attribute value and replace it with android:layout_below?

If I define it as:

<style name="ListItemText">
    <item name="android:layout_below">@id/preview_image</item>
</style>

it displays text to the right and below the image, effectively summing up attributes from both library and application styles XMLs.

p.s.: One possible solution of my issue would be to get rid of android:layout_toRightOf in the styles and move it to the layout xml instead. Then in the target application this layout can be redefined/overridden. But I’m looking for style-based solution, since it could provide more simple and straightforward way of attribute overriding.
(I can also use the inherited style with the parent attribute, but this would again require layout overriding in the application, which I try to avoid).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:45:09+00:00Added an answer on May 26, 2026 at 11:45 am

    To disable android:layout_toRightOf, you can set it to @null. If your app defines the ListItemText style as follows, it should work as you want:

    <style name="ListItemText">
        <item name="android:layout_toRightOf">@null</item>
        <item name="android:layout_below">@id/preview_image</item>
    </style>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a set up similar to this questions: Parent Child Setup Everything
I have a query that returns a result set similar to the one below:
If I have a function overload set similar to template<typename T> void f(T&& t,
my issue lokks similar to this one: (link) but i have one-to-many association: <set
hi to set my applications hotkeys i need to convert a character into its
I have some code (that is working), but I just want to make sure
I have database schema for an integration project in which I need to be
I am developing software that is similar to fantasy football applications. I have user
Our applications use a lot of shared components. Some of them have no need
I have set the eclipse java formatter to wrap lines that exceed 120 characters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.