Office Hours — Today, December 11

Yesterday, December 10

Dec 11
3:55 PM
Mark M.
has entered the room
Mark M.
turned on guest access
4:05 PM
Brent
has entered the room
Mark M.
hello, Brent!
Brent
Hey Mark
Mark M.
how can I help you today?
Brent
Hi. I have an SO question I tried to get bumped, but got a message saying I'd already requested a bump within the past week.
Mark M.
yes, there's a one-bump-per-week limit
Brent
but I've never asked for a bump before.
let alone in the past week
Mark M.
that'
what is your Warescription user ID?
er, that's odd
Brent
hgross4 (I think)
maybe a weird browser thing? I put in the url in the box, went to another page on your site, then came back to the bump page and hit the button
Mark M.
it shows that you did an SO bump today, slightly over one hour ago
and I already chimed in on it
perhaps you accidentally submitted it twice
Brent
oh, didn't think to look after i got the message about the limit
maybe i did submit it twice
not realizing (of course :))
4:10 PM
Mark M.
I'm revamping the Warescription site, for a January 1st rollout, and it may help here
Brent
ok. thanks for the answer.
weird that it's so hard to do what I'm trying to do there. it doesn't seem like some sort of far out way to lay things out.
another question?
not on SO
Mark M.
go right ahead
Brent
i want to put grid lines over a camera preview. it seems that the prevailing wisdom online, as far as I can tell, is to override SurfaceView and draw the lines in onDraw.
which seems reasonable. just want to see if you agree, or think there's a better way to do it.
Mark M.
well, ideally, you're using something other than SurfaceView, at least on newer devices (e.g., TextureView)
Brent
well... no, I'm already using SurfaceView.
so TextureView is the updated View to use?
Mark M.
yes, it works for camera previews by 4.1 IIRC
has the benefit of being a real View, not the screwy "punch a hole in the window" thing that SurfaceView winds up doing
so you can animate TextureView and such
with respect to the lines, I have never looked into doing that, so I do not know the best technique to use
Brent
4.1 IIRC? do you mean Android 4.1, i.e., JellyBean?
4:15 PM
Mark M.
yes
Brent
i need to support down to ICS
Mark M.
in my CWAC-Camera library, I use TextureView where I can and fall back to SurfaceView
Brent
Android Camera is driving me nuts, btw. you probbaly dont' remember, but we chatted a few weeks ago about it. i was trying to stuff CWAC camera in a square box.
you had some sympathy for me, but not much more ;)
Mark M.
CWAC-Camera does not like to be stuffed in a box
:-)
Brent
nobody puts CWAC-Camera in a box!
:)
(rip Patrick Swayze :)
Mark M.
to clarify, I use TextureView if the API level is 17+ and I have no sign that we're running on CyanogenMod (due to some old compatibility issue with CM)
Brent
wow. you can check for CyanogenMod?
Mark M.
View paste
private boolean isCyanogenMod() {
return(System.getProperty("os.version").contains("cyanogenmod") || Build.HOST.contains("cyanogenmod"));
}
which is crude, but apparently it worked well enough
Brent
oh, it's in the OS version. i guess that makes sense. and i thought that trying to support different "official" versions of Android was hard enough
Mark M.
yes, writing camera apps is not for the faint of heart
Brent
whatever "official" means, since i guess Cyanogenmod isn't much less official than what the manufacturers do to Android.
4:20 PM
Brent
so back to my camera--if i have to support ICS, can I use TextureView, or am I stuck with SurfaceView? it doesn't seem that in this case doing a vesion check and executing different code would be very easy if we're talking about using different classes.
Mark M.
in your specific case, if you wind up subclassing to do your drawing, it'll be a headache
in my case, since I am not extending either class, I was able to hide all of it behind a strategy pattern
Brent
i see. so you're using both, TextureView when possible.
Mark M.
correct
4:25 PM
Brent
different question: i have a field the user types into and is then shown items in a list showing whatever matches what he's typed. What I've first implemented is an AutoCompleteTextView with an adapter and filter set up the way i want.
It works fine, except that the desired design is for one item in the list to always appear at the top, even when the list is scrolled.
i assume i can't do this with the list built into the ACTV (autocomplete...)
Mark M.
correct, as you don't control it
it would require either a subclass (if you're lucky) or a fork (if you're not)
Brent
so I'm probably going to have a TextView above a ListView, with the item always to be in view in the TextView and everything else in the ListView.
and no more ACTV, just an EditText and a textwatcher that will make the adapter properly filter the list based on what's entered in the TextView
Mark M.
while there are sticky/pinned options for ListView available on the Android Arsenal, I don't see one for ACTV
Brent
oh, so maybe i don't need the separate TextView, just the EditText and the ListView?
Mark M.
depending on the rest of your UI, you might consider a SearchView in the action bar vs. your EditText
4:30 PM
Mark M.
correct
Brent
I don't think SearchView in the action bar is acceptable design, but good to know about SearchView
Mark M.
with regards to the sticky/pinned options, see https://android-arsenal.com/tag/54
in your case, you'll only have one "section"
Brent
not familiar with Android arsenal before now.
Mark M.
#1 catalog of available Android libraries
Brent
so the libraries are from whomever
Mark M.
for various values of "whomever", yes
Brent
yeah, that's what I meant. at first i thought it was one group producing everything under the Android Arsenal name. how do you know which are reliable?
Mark M.
word of mouth
experimentation
issue tracker
references on Stack Overflow
Brent
issue tracker?
4:35 PM
Brent
is there one on the site?
Mark M.
most of the libraries are open source, and most of those are on GitHub
see if the code is being updated, see if issues are piling up, etc.
Brent
ok
ok. well, i don't think i have any more technical questions. i have one about the book.
Mark M.
um, OK
Brent
sometimes page breaks are a bit of a nuisance. is there a format in which the content is more continuous?
Mark M.
anything but PDF
Kindle/MOBI
APK
EPUB
Brent
ok. maybe i'll try the Kindle or epub versions. thanks.
4:40 PM
Brent
i think I'm done. if i think of something else before the hour is over, I assume i can come back into the chat room (i won't get a message saying I've hit my weekly limit ;).
thanks for the assistance.
Mark M.
no, so long as the room is open, you can return to it
you are very welcome
Brent
has left the room
5:00 PM
Mark M.
turned off guest access

Yesterday, December 10

 

Office Hours

People in this transcript

  • Brent
  • Mark Murphy