May 17 | 7:25 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Joshua C. | has entered the room |
Mark M. |
hello, Joshua
|
Mark M. |
how can I help you today?
|
Joshua C. |
Hello again, Mark. :)
|
Joshua C. |
Well... again I seem to be having a problem getting attributes from the XML into the code... though you helped me solve this problem the other day THOSE attributes are getting through, but not the ones on my new object, the Curve...
|
Joshua C. |
Here is the way it's defined in attrs.xml:
|
Joshua C. |
View paste
(2 more lines)
|
May 17 | 7:30 PM |
Joshua C. |
And here is the layout XML code calling it... the object is being created, my Log.i calls in the constructor are returning the default values.
|
Joshua C. |
View paste
|
Joshua C. |
Here is my object's constructor:
|
Joshua C. |
View paste
(6 more lines)
|
Joshua C. |
As you can see, the values I'm passing from the layout are different than the default values... and I am getting the default values!
|
Mark M. |
can you show the entire layout file containing your Curve?
|
Joshua C. |
View paste
(61 more lines)
|
Mark M. |
OK, just double-checking the xmlns:app line :-)
|
Joshua C. |
The Curve is located inside the OneHandLayout, along with some Edge objects.
|
Joshua C. |
Yes, of course... and the Edge objects ARE managing to get their values just fine from the XML.
|
Joshua C. |
I was using simple integers, which wasn't working, and now I'm trying to use dimensions (preferable), but neither seem to work.
|
Mark M. |
final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Edge);
|
Mark M. |
if this is a Curve, why are you asking for R.styleable.Edge?
|
Joshua C. |
Danmnit! You've found it!
|
May 17 | 7:35 PM |
Joshua C. |
I knew it had to be something little and simple... I was just missing it.
|
May 17 | 7:35 PM |
Mark M. |
copy/paste bug, I would guess
|
Mark M. |
happens all the time
|
Joshua C. |
Well, isn't that embarrasing... yes, definitely copy/paste bug.. I missed that one.
|
Joshua C. |
Okay, compiled and working now... one more little question...
|
Joshua C. |
it doesn't actually stop the program from working, but when I compile and run it I get this red line a bunch of times in the logcat:
|
Joshua C. |
E/dalvikvm: Could not find class 'android.view.WindowInsets', referenced from method com.codesolutions.onehandkeyboard.Curve.access$super
|
Joshua C. |
View paste
|
Joshua C. |
with various methods that are not in my app... do you know what this is? Does it matter?
|
May 17 | 7:40 PM |
Mark M. |
those messages are due to code (yours/framework's/library's) that refer to things that are in newer versions of Android, and you are testing on an older version of Android
|
Joshua C. |
Yes, testing on my 4.4.4 phone.
|
Joshua C. |
So don't worry about it then?
|
Mark M. |
correct
|
Mark M. |
I wish they were not being flagged as errors
|
Mark M. |
since they are not errors
|
Joshua C. |
Right... well, I can ignore them. Okay... I'm starting to make real progress now, thanks to your help. :)
|
Mark M. |
happy to be useful
|
Joshua C. |
Thanks again, I'll get back to it. Cherio till next time. :)
|
Mark M. |
OK
|
May 17 | 7:50 PM |
Joshua C. |
Okay, back again... :)
|
Mark M. |
hi!
|
Joshua C. |
So... in the OneHandLayout object (which is descended from ViewGroup)...
|
Joshua C. |
here is the onLayout...
|
Joshua C. |
View paste
(44 more lines)
|
Joshua C. |
I include the whole thing for context...
|
Joshua C. |
All those Log calls produce exactly what I would expect...
|
Mark M. |
I do not see any Log calls in that code
|
Mark M. |
are you referring to the ones from the Curve constructor from before?
|
Joshua C. |
I'm trying to get the space in the middle, between all the Edge objects (defined in the XML) and pass that to the Curve.
|
Joshua C. |
Oh, quite right, I didn't get to the end of the function.
|
Joshua C. |
View paste
(57 more lines)
|
May 17 | 7:55 PM |
Mark M. |
ah, OK
|
Joshua C. |
I start out with the complete size of the activity (the whole screen)... and layout each of the Edge's... which is working fine.
|
Joshua C. |
Then there near the end...
|
Joshua C. |
If the child is a Curve
|
Joshua C. |
I pass it those "inner" dimensions...
|
Joshua C. |
for some reason, the Curve.onLayout function is never being called.
|
Joshua C. |
Adding another Log inside the if with the child.layout call to be sure it's running.
|
Joshua C. |
and it is!
|
Mark M. |
well, this gets into stuff that I have not worked with personally
|
Mark M. |
off the cuff, I am uncertain if onLayout() is supposed to be calling layout() of the children
|
Joshua C. |
Oh wait.
|
Joshua C. |
Hold on.. perhaps it is...
|
Joshua C. |
Adding more distinct Logs.
|
May 17 | 8:00 PM |
Joshua C. |
Hmm... appears I was mistaken... onLayout is running... my problem must be somewhere else.
|
May 17 | 8:20 PM |
Joshua C. | has left the room |
May 17 | 8:25 PM |
arun | has entered the room |
Mark M. |
hello, arun
|
Mark M. |
the chat is nearly over -- do you have a quick question?
|
arun |
hi mark
|
arun |
no, but i see theres another one at 9am tmrw right?
|
Mark M. |
correct
|
arun |
ok ill be there and ask you then
|
Mark M. |
I adjusted this week's schedule to avoid conflicts with Google I|O
|
Mark M. |
OK
|
arun |
cool, see you tmrw then
|
arun | has left the room |
May 17 | 8:30 PM |
Mark M. | turned off guest access |