BottomBar icon indicating copy to clipboard operation
BottomBar copied to clipboard

RequestLayout() improperly called

Open A-Lim opened this issue 8 years ago • 30 comments

I've got these warnings whenever the Tab Bar activity is launched.

W/View: requestLayout() improperly called by android.support.v7.widget.AppCompatTextView{2af626cd V.ED.... ......ID 109,111-215,168 #7f0e0075 app:id/bb_bottom_bar_title} during layout: running second layout pass
W/View: requestLayout() improperly called by android.support.v7.widget.AppCompatTextView{1a2f2b82 V.ED.... ......ID 32,120-161,177 #7f0e0075 app:id/bb_bottom_bar_title} during layout: running second layout pass
W/View: requestLayout() improperly called by android.support.v7.widget.AppCompatTextView{2de35293 V.ED.... ......ID 9,120-185,177 #7f0e0075 app:id/bb_bottom_bar_title} during layout: running second layout pass
W/View: requestLayout() improperly called by android.support.v7.widget.AppCompatTextView{3da522d0 V.ED.... ......ID 0,120-194,177 #7f0e0075 app:id/bb_bottom_bar_title} during layout: running second layout pass
W/View: requestLayout() improperly called by android.support.v7.widget.AppCompatTextView{ccb62c9 V.ED.... ......ID 37,120-157,177 #7f0e0075 app:id/bb_bottom_bar_title} during layout: running second layout pass

Any idea on what might be the problem?

A-Lim avatar Jul 21 '16 02:07 A-Lim

I have the same issue, it doesn't seem to be affecting performance in any way but it shows up in the logger. I'm attaching the BottomBar with five items that have Drawables for icons if that helps.

jessexx avatar Jul 21 '16 15:07 jessexx

I am also getting these warnings.

jimmychen623 avatar Aug 01 '16 05:08 jimmychen623

I am also getting these, with 5 icons.

mdeyell avatar Aug 16 '16 05:08 mdeyell

Me too

johncodeos avatar Aug 18 '16 09:08 johncodeos

+1

REWKyleB avatar Aug 22 '16 20:08 REWKyleB

+1 and the textView it's being cut on every click

firetrap avatar Sep 01 '16 11:09 firetrap

+1 and text is not showing on Android L

UmarBhutta avatar Sep 19 '16 08:09 UmarBhutta

trying to figure this out too... any solution yet? bottom bar title doesnt show appear either.

a00909032 avatar Sep 29 '16 03:09 a00909032

Yeah I have the same issue.

Rikkokiri avatar Dec 11 '16 02:12 Rikkokiri

thumb up! Still in Ver. 2.1.1

iRYO400 avatar Jan 24 '17 11:01 iRYO400

i have the same issue with ver. 2.1.1

strajky5 avatar Jan 27 '17 15:01 strajky5

+1 as mentioned by Firetrap the text may be to blame - the text in my project is getting halved after one click.

Zoomagic avatar Feb 01 '17 10:02 Zoomagic

+1 the same here with the same scenario. BottomBar with 5 itens all with icons and labels.

heitorpr avatar Feb 08 '17 11:02 heitorpr

+1 on the version 2.1.1

chaleao avatar Feb 17 '17 19:02 chaleao

I have the same issue.

burhanaksendir avatar Feb 24 '17 18:02 burhanaksendir

Same issue here

kandreadou avatar Mar 27 '17 09:03 kandreadou

is this happening on the latest version? 2.2.0

yombunker avatar Mar 27 '17 15:03 yombunker

Confirmed on the latest dev branch, looking into it.

roughike avatar Mar 29 '17 18:03 roughike

@roughike this is because we trigger a layout phase while on the layout phase, i think what we are missing is that we are not leveraging the measuring phase to calculate the sizes and just lay them out on the payout phase.

yombunker avatar Mar 29 '17 18:03 yombunker

Yep. There was no manual requestLayout method calls that were out of place, so I guess the system calls that for us whenever we update the width / height, paddings, etc. while the onMeasure method hasn't finished.

There's a lot of optimizations to be done through the library. The weird updateTitleBottomPadding() method for example should be absolutely unnecessary. It was introduced when merging some PR like almost a year ago and to this day, I don't know why it needs to be here at all.

roughike avatar Mar 29 '17 18:03 roughike

https://github.com/roughike/BottomBar/blob/master/bottom-bar/src/main/java/com/roughike/bottombar/BottomBarBadge.java#L32

I resolved this using android.support.v7.widget.AppCompatTextView:

class BottomBarBadge extends android.support.v7.widget.AppCompatTextView {

burhanaksendir avatar Mar 30 '17 19:03 burhanaksendir

@burhanaksendir if that's teh fix, then it will be coming in the next days because that's part of the change i'm working on

yombunker avatar Mar 30 '17 23:03 yombunker

Its still bugged, any eta on fix?

nextdimension avatar Apr 26 '17 21:04 nextdimension

when will this bug be fixed? this bug will cause UI stop when app open for long time.

JDDJJ avatar May 03 '17 12:05 JDDJJ

Its been 1 year and no one fixed it, I'd say they don't know how to, or can't. I'll just use a different bottom bar.

nextdimension avatar May 03 '17 22:05 nextdimension

@nextdimension @JDDJJ well this library wasn't maintained for a while, And i just started helping about like 2 months ago, but, this is just like a side thing, i'm like 60% done with a huge refactoring in how the BottomBar works, which would make it better while still being backwards compatible. But, i'm super swamped with work this weeks that i haven't been able to finish it. But, don't worry @nextdimension i know how to do it, is already solved, the missing thing is not that is other things before the next release is ready. But, you are always free to use other libraries, or if you want you can contribute Pull Request to improve it as well, i try to take a look to PR as they arrive.

yombunker avatar May 04 '17 13:05 yombunker

5a621999-9628-488a-af9f-1816cf79b9ee beced8ea-4db3-4b4b-8f32-e6dcd2b6d2f9

JDDJJ avatar May 15 '17 11:05 JDDJJ

I tried the fix recommended @burhanaksendir but the warnings and the 1-2sec lag on rotation remains

massimobio avatar Jun 08 '17 20:06 massimobio

Why do you need this updateTitleBottomPadding ? What if just add to bb_bottom_bar_item_shifting.xml <TextView ..... android:paddingBottom="10dp" ..../>

Albul avatar Oct 29 '17 09:10 Albul

Fixed in pull request https://github.com/roughike/BottomBar/pull/866

Working fine in my project.

Albul avatar Nov 02 '17 10:11 Albul