Infeasible
Status Update
Comments
ro...@gmail.com <ro...@gmail.com> #2
Our automated tests pass and I just wrote an application using SDK 1.5r1 and the Eclipse plugin and it works as
well.
well.
m....@gmail.com <m....@gmail.com> #3
That's all good and fine, but then there must be other side effects which break it,
because it has never, ever worked for me. Please re-open the issue and let's
investigate this problem further instead of hastily ignoring it.
because it has never, ever worked for me. Please re-open the issue and let's
investigate this problem further instead of hastily ignoring it.
m....@gmail.com <m....@gmail.com> #4
In fact I have just written a trivial test app, too, and it exposes the flaws as
described in my report. Do you want me to send it to you?
described in my report. Do you want me to send it to you?
m....@gmail.com <m....@gmail.com> #5
here is the layout XML (apart from that, it is simply the default app as generated by
the wizard):
// included.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android "
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#F00"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>
// main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android "
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<include layout="@layout/included" android:layout_height="fill_parent" />
</LinearLayout>
the included layout does not fill the parent.
the wizard):
// included.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#F00"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>
// main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<include layout="@layout/included" android:layout_height="fill_parent" />
</LinearLayout>
the included layout does not fill the parent.
m....@gmail.com <m....@gmail.com> #6
is this still being investigated?
sy...@altran.com <sy...@altran.com> #7
I have the same issue and I don't understand because the code is very simple !
Did you manage to solve it ?
Did you manage to solve it ?
m....@gmail.com <m....@gmail.com> #8
No, sorry. I have come to accept that Android layouts often work in weird and
unpredictable ways, especially RelativeLayout and anything that goes into a ListView.
unpredictable ways, especially RelativeLayout and anything that goes into a ListView.
bu...@gmail.com <bu...@gmail.com> #9
I have several reusable snippets of XML layout in res/layout. I then have two parent
layouts, one in res/layout-land, another in res/layout-port. These parents use
<include> to pull in those snippets from res/layout.
With this organization, none of the android:* attributes on the <include> tag are
ever applied. So I'm unable to override (or even specify) things like layout_width or
layout_height using <include>.
layouts, one in res/layout-land, another in res/layout-port. These parents use
<include> to pull in those snippets from res/layout.
With this organization, none of the android:* attributes on the <include> tag are
ever applied. So I'm unable to override (or even specify) things like layout_width or
layout_height using <include>.
bu...@gmail.com <bu...@gmail.com> #10
The problem is the <include> tag must specify BOTH layout_width and layout_height if
you want to override any layout_* attributes. If you miss one of those, the
LayoutInflater class silently catches a RuntimeException and proceeds to ignore your
overridden attributes.
you want to override any layout_* attributes. If you miss one of those, the
LayoutInflater class silently catches a RuntimeException and proceeds to ignore your
overridden attributes.
mi...@gmail.com <mi...@gmail.com> #11
m....@gmail.com <m....@gmail.com> #12
I think it's clearly a bug their test suite didn't catch. Why would I always have to supply both if I only want to change one? Doesn't make sense.
Posting bug reports here for me always turned out to be either running into walls or having to wait a year to see it being addressed. That's why I don't bother anymore.
Posting bug reports here for me always turned out to be either running into walls or having to wait a year to see it being addressed. That's why I don't bother anymore.
he...@gmail.com <he...@gmail.com> #13
I just ran into this problem myself. I'm not able to change the issue status, maybe we have to create a new issue?
ar...@gmail.com <ar...@gmail.com> #14
+1 - this isn't the first time this whole "specify all before it works properly" issue comes up, and it makes no sense, especially considering how undocumented it is.
ru...@gmail.com <ru...@gmail.com> #15
Google, please reopen this bug, there is no good reason this should be marked as Declined.
va...@gmail.com <va...@gmail.com> #16
FIX: make sure you overwrite BOTH layout_width and layout_height when including, otherwise everything will be ignored.
[Deleted User] <[Deleted User]> #17
ps...@gmail.com <ps...@gmail.com> #18
Why is it whenever I come across an Android bug report I feel like loling but not in a good way.
be...@gmail.com <be...@gmail.com> #19
yes - I'd love to see this info added to the article at http://developer.android.com/resources/articles/layout-tricks-reuse.html
I've spent the last few days banging my head against the wall trying to figure this out. I googled around pretty hard and NOT ONCE did I find this *Declined* Bug Report - only after posting as a question on StackOverflow did someone point me to here.
seriously Google, if you're going to decline to address this as a bug report PLEASE UPDATE YOUR DOCUMENTATION TO REFLECT THIS INFORMATION!!!
I've spent the last few days banging my head against the wall trying to figure this out. I googled around pretty hard and NOT ONCE did I find this *Declined* Bug Report - only after posting as a question on StackOverflow did someone point me to here.
seriously Google, if you're going to decline to address this as a bug report PLEASE UPDATE YOUR DOCUMENTATION TO REFLECT THIS INFORMATION!!!
gv...@gmail.com <gv...@gmail.com> #20
I wanted to INCLUDE a TextView while letting the INCLUDE specify the android:layout_column.
I can assure you all that the problem is still going strong. I have to specify the layout_column in the MERGE section, which is what I wanted to avoid.
I can assure you all that the problem is still going strong. I have to specify the layout_column in the MERGE section, which is what I wanted to avoid.
sc...@gmail.com <sc...@gmail.com> #21
I'm trying to set a custom attribute on an include tag for a layout whose root is a custom view:
<include
android:id="@+id/calculatorrowmenu_result_running"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
archxs:isRunningResult="true"
layout="@layout/single_line_result" />
to include:
<com.archxs.bincalc.SmallIntegerResultView
xmlns:android="http://schemas.android.com/apk/res/android "
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:clickable="true">
...
</com.archxs.bincalc.SmallIntegerResultView>
But the custom attribute is not set:
public SmallIntegerResultView(Context context, AttributeSet attrs) {
super(context,attrs);
final TypedArray styled = context.obtainStyledAttributes(attrs, R.styleable.ResultView);
try {
m_isRunningResult = styled.getBoolean(R.styleable.ResultView_isRunningResult, false);
} finally {
styled.recycle();
}
}
Seems to me this is a pretty serious bug in the include tag. Why is this declined?
<include
android:id="@+id/calculatorrowmenu_result_running"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
archxs:isRunningResult="true"
layout="@layout/single_line_result" />
to include:
<com.archxs.bincalc.SmallIntegerResultView
xmlns:android="
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:clickable="true">
...
</com.archxs.bincalc.SmallIntegerResultView>
But the custom attribute is not set:
public SmallIntegerResultView(Context context, AttributeSet attrs) {
super(context,attrs);
final TypedArray styled = context.obtainStyledAttributes(attrs, R.styleable.ResultView);
try {
m_isRunningResult = styled.getBoolean(R.styleable.ResultView_isRunningResult, false);
} finally {
styled.recycle();
}
}
Seems to me this is a pretty serious bug in the include tag. Why is this declined?
ta...@gmail.com <ta...@gmail.com> #22
I reproduce the issue by 20 scottd.n...@gmail.com
ri...@gmail.com <ri...@gmail.com> #23
Still broken in SDK21...
Thanks for posting the bug guys - at least a web search made this action "documented" in a semi-useful way. At leastgoogle.com works to find the solution...
Thanks for posting the bug guys - at least a web search made this action "documented" in a semi-useful way. At least
fa...@gmail.com <fa...@gmail.com> #24
Please consider adding an appropriate lint message.
ey...@gmail.com <ey...@gmail.com> #25
This should either be fixed, or documented more clearly.
jo...@gmail.com <jo...@gmail.com> #26
I just ran into the same issue posted here... The only solution I have found on stackoverflow to this bug is to wrap the include tag in a container, like a LinearLayout, but it's kind of annoying since the idea of include and merge tags is to eliminate redundancy and allow for reuse of complex views in an atomic way...
Anyone know if there's another solution to this issue? I tried specifying both layout_width and layout_height in the include tag attribute list, but this didnt work...
Anyone know if there's another solution to this issue? I tried specifying both layout_width and layout_height in the include tag attribute list, but this didnt work...
[Deleted User] <[Deleted User]> #28
Could you guys be more specific in the answers ? I tried the solution above, without success.
wh...@gmail.com <wh...@gmail.com> #29
looks like https://developer.android.com/training/articles/layout-tricks-reuse is inaccessable now (http error 404).
what i've discovered is that <merge> elements are blindly included using <include> elements.
So if merge elements have them selfs positioned using layout_below, then after inclusion they'll be possitioned as well.
And in some way it seems logical, because <merge> may have multiple elements, and if you set up layout_* to <include> it won't know to which element to apply the layout_* as <merge> will contain many of them.
On the other hand, if inclusing NOT a <merge> element, probably previous experience applies: width and height has to be set up and then layout_* should work.
My suggestion would be for <include> to own an extra attribute that would allow to set up/overwrite layout_* to the first (or the N'th) element of the merge.
what i've discovered is that <merge> elements are blindly included using <include> elements.
So if merge elements have them selfs positioned using layout_below, then after inclusion they'll be possitioned as well.
And in some way it seems logical, because <merge> may have multiple elements, and if you set up layout_* to <include> it won't know to which element to apply the layout_* as <merge> will contain many of them.
On the other hand, if inclusing NOT a <merge> element, probably previous experience applies: width and height has to be set up and then layout_* should work.
My suggestion would be for <include> to own an extra attribute that would allow to set up/overwrite layout_* to the first (or the N'th) element of the merge.
Description
1.5 R1
Steps to reproduce the problem:
1) create a layout file containing a linear layout, set layout width to
fill_parent
2) include that layout in another layout using:
<include layout="@layout/custom_layout" android:layout_width="wrap_content" />
3) see how the included linear layout still fills its parent
I tested this with various layouts and various layout parameters, all are
ignored by the include tag (i.e. overriding layout params has no effect).