Mark M. | has entered the room |
Mark M. | turned on guest access |
Jul 13 | 4:15 PM |
EGHDK | has entered the room |
Mark M. |
hello, EGHDK!@
|
Mark M. |
how can I help you today?
|
EGHDK |
Hey Mark, two questions. 1. I have a sharedprefhelper class. My teammate is developing on the same project via github. Any easy way to make sure he uses my sharedprefhelper class instead of straight sharedprefs? 2. I was watching a video today. The presenter was saying he downloads data from a server then he stores it into a flat file. What do you think he meant by flat file?
|
EGHDK |
For 1. I was thinking custom lint rule or something?
|
Mark M. |
well, then you will be back here with "any easy way to make sure he uses my custom Lint rule?"
|
Mark M. |
and it's turtles all the way down
|
EGHDK |
Gotcha. Just making sure there wasn't something super easy I can do besides code review
|
Mark M. |
you might be able to cobble together something with GitHub commit hooks, but it's probably simpler just to slap the teammate with a trout
|
Mark M. |
with regards to #2: https://en.wikipedia.org/wiki/Flat_file_database
|
Mark M. |
log files, CSV files, and the like are all examples of flat files
|
Jul 13 | 4:20 PM |
EGHDK |
Okay. I've done csv file before. Flat file threw me off. Never heard of something described as a flat file. Thanks.
|
Mark M. |
it's an old term
|
EGHDK |
Would you use it to store key Value pairs? Like json or something? Or parsed json into like a csv?
|
Mark M. |
well, nowadays, you would not use it for much
|
Mark M. |
the big advantage over a flat file as opposed to something like XML or JSON is that you can just append new stuff to the end of the file
|
Mark M. |
with XML, to "append" you have to delete the closing tag, add in a new XML element, and add back in the closing tag
|
Mark M. |
that being said, my guess is that you are reading far too much into this presenter's use of the term
|
Jul 13 | 4:25 PM |
EGHDK |
I basically want to convert read this file and make an object out of it. I don't want to serialize it though. Just want to be able to create an object of the type, and then possibly have another application be able to edit the file, then I'll reload my application and it should be able to read the new updated file as the object.
|
Mark M. |
well, "flat file" isn't going to help you there
|
Mark M. |
you would need far more details on the structure of the entries in the file
|
EGHDK |
I guess if a flat file is logs or csv, it can kinda hold whatever?
|
Mark M. |
yes
|
Mark M. |
usually, any given flat file holds onto one type of thing
|
EGHDK |
Alright. Maybe looking to far into it. Thanks Mark.
|
Mark M. |
so, in the case of CSV, usually all the rows have the same number of comma-delimited entries
|
EGHDK |
Gotcha. That's all I need for today . Thanks
|
Mark M. |
OK
|
EGHDK |
Off to work! Till next time Mark!
|
Mark M. |
tell work I said "hi"!
|
EGHDK |
I will!
|
Jul 13 | 4:40 PM |
EGHDK | has left the room |
Jul 13 | 4:50 PM |
ramsey | has entered the room |
Mark M. |
hello, ramsey!
|
ramsey |
Hi Mark!
|
Mark M. |
there is not a lot of time left in the chat, but if you have a question, go right ahead!
|
ramsey |
I'm trying to position two views on top of each other
|
ramsey |
A diagram might help: http://postimg.org/image/hhik5rv83/
|
ramsey |
The blue one is in the center of the middle Relative layout
|
ramsey |
And I have to do it programmatically because of some animations I'm doing
|
ramsey |
But I'm struggling with setY/setTranslationY
|
ramsey |
And figuring out how to calculate the correct value for Y
|
Mark M. |
why Y?
|
Jul 13 | 4:55 PM |
ramsey |
do I have to always add an onGlobalLayouListener
|
Mark M. |
isn't your problem on the Z axis?
|
ramsey |
Or at least the vertical value
|
ramsey |
Oh hold on why?
|
Mark M. |
I guess I do not understand your problem
|
ramsey |
Ah no it's the the vertical positioning that I'm struggling with
|
ramsey |
The z axis is fine
|
Mark M. |
isn't it a matter of doing the RelativeLayout.LayoutParams equivalent of android:alignBottom="@id/blue" on the red widget?
|
ramsey |
I think so but does that work if you've changed the positioning of the view with animations?
|
ramsey |
Perhaps my question is: do any of the layout params I specify in xml ever get wiped?
|
Mark M. |
if you are using setY/setTranslationY, no
|
Mark M. |
basically, those rules apply first, then the setY/setTranslationY is applied to the results from the layout rules
|
ramsey |
Right so can I add alignBottom as a rule afterwards?
|
ramsey |
Because it shouldn't always be bottom algined to blue
|
ramsey |
And if I do would I have to subsequently call requestLayout?
|
Mark M. |
well, what *is* the rule then? I was just going by the diagram
|
ramsey |
It should be bottom aligned after an animation has completed
|
ramsey |
So it's the end Y value really
|
ramsey |
Red goes from right of screen, at 90 degrees to the centre
|
Mark M. |
off the cuff, I'd set the bottom alignment rule at the outset, then decrease the Y translation to get to 0 through the animation
|
ramsey |
Ah OK
|
ramsey |
So have the base as the end result
|
Jul 13 | 5:00 PM |
Mark M. |
right
|
Jul 13 | 5:00 PM |
ramsey |
Then work backwards
|
ramsey |
OK Thanks mark
|
ramsey |
I know time's up
|
ramsey |
So thanks for your time
|
Mark M. |
you are very welcome
|
Mark M. |
the chat transcript will be posted to https://commonsware.com/office-hours/ shortly
|
Mark M. |
the next chat is tomorrow at 9am US Eastern
|
Mark M. |
have a pleasant day!
|
ramsey | has left the room |
Mark M. | turned off guest access |