Office Hours — Today, January 22

Thursday, January 17

Jan 22
9:55 AM
Mark M.
has entered the room
Mark M.
turned on guest access
10:10 AM
Marcin
has entered the room
Mark M.
hello, Marcin!
how can I help you today?
Marcin
Hi Mark
in actionbar, when i press search a textfield appears and an arrow (back) next to my logo. How can I press the logo-back button from code?
10:15 AM
Mark M.
um, generally speaking, you don't press any widgets "from code"
Marcin
should be... search (icon), a textfield ...
Mark M.
if you want to do whatever the "logo-back button" does, just do it
Marcin
thanks
another one
on my actionbar my icons are hidden in overflow menu
i want to have them as in gmail app.. at the bottom, how i achieve that?
Mark M.
add android:uiOptions="splitActionBarWhenNarrow" to your manifest
either to the <application> or <activity> element, depending upon whether you want this for the whole app or just one activity
Marcin
thanks
10:20 AM
Mark M.
that is covered in the chapter on the action bar and is demonstrated in samples like https://github.com/commonsguy/cw-omnibus/tree/m...
Marcin
another
in my action bar i have two tabs
on my phone they look allright
ahh never mind :)
10:30 AM
Marcin
another
i have a main.xml layout which i use in my activity
View paste (20 more lines)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/container"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <LinearLayout
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal" >
    </LinearLayout>

    <LinearLayout
        android:id="@+id/progressBar"
...
View paste (5 more lines)
android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:visibility="invisible"
        android:background="@drawable/progresscontainer" >

        <ProgressBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

        <TextView
            android:layout_gravity="center"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
...
sorry for second paste
forget second paste
Mark M.
it's all there -- you just have to click the View paste link
go ahead with your question
Marcin
just realized
ok. in id.content depending on which tab i am in actionbar im attaching/deattaching different fragment
one of the fragments is SupportMapFragment
all works as expected in 4.2.1
10:35 AM
Marcin
by that I mean.. I see the map.. and when i click an action bar button a request to server happens
this is where i set id.progress_bar to visible
when it finishes i set invisible
on 4.0.4 when i press the button progess bar does not appear
any idea why this might be happening?
Mark M.
I am surprised it works on 4.2.1
I am skeptical about your use of wrap_content for the size of the ProgressBar
that being said, you should run your app in a 4.0 emulator and see what Hierarchy View shows you
Marcin
this is a bit connected with my first question
because.. i actually press search icon.. type in a place name.. and then press search on soft keyboard
this is what invokes a request
in 4.2.1 all works well
10:40 AM
Marcin
in 4.0.4 the progress bar does not appear... BUT as soon when I click the logo-back button.. progress bar appears
Mark M.
I have no good way to help you on this
Marcin
thats fine. what should i look for in hierarchy view?
Mark M.
if you think you ran your code to set visibility to VISIBLE, see if Hierarchy View thinks the widget is visible
(BTW, never mind about my wrap_content comment -- I was thinking about a horizontal ProgressBar, and you are using the circular default one)
Marcin
why are you suprised it works on 4.2.1?
Mark M.
that was based on my wrap_comment comment, which I now realize was incorrect
Marcin
because of your btw?
Mark M.
yes
Marcin
ok
10:45 AM
MarkSemsel
has entered the room
Marcin
how to set zoom level on a v2 map?
Mark M.
(BTW, howdy, Mark -- be with you in a minute)
MarkSemsel
No problem.
Mark M.
Marcin: apply a camera update
Marcin
thanks
Mark M.
Marcin: this is covered in some of the early examples in the Maps V2 chapter of the book
Mark: do you have a question?
MarkSemsel
Yes. Currently building an app with an ActionBar configured as a tab bar. I am using a ViewPager, and one of the fragments contains a list view...
10:50 AM
MarkSemsel
The desired behaviour: The user clicks on an item in the list view, and a detailed view appears. The tab bar should still be visible, of course, and the back button should remove that view. I've got part of this figured out with the use of the FragmentManager, but not all the way.
Mark M.
ick
MarkSemsel
Yeah, I know.
Mark M.
:-)
MarkSemsel
This client's app was first an iOS app, so you can imagine what the client is looking for with a tab bar.
If this is an awkward paradigm for the ActionBar, perhaps I can convince the client of a slightly different UI experience.
Mark M.
well, beyond Web browsers, I do not see much in the way of navigation-within-tabs anywhere in Android
IMHO, iOS tab bar turns into action bar items and separate activities
but, that's just my take
EGHDK
has entered the room
Mark M.
(howdy, EGHDK, be with you in a minute)
Mark: specifically what is your problem?
MarkSemsel
I can dig that. But I think that implies that the user would need to back out of the current activity to get back to the action bar.
10:55 AM
Mark M.
no, the action bar items would be on every activity (except the item for the current activity, of course)
they would just tap another action bar item
use FLAG_ACTIVITY_REORDER_TO_FRONT to recycle the last-created activity for that operation, if one exists
BACK may be a bit odd, but BACK will be even more odd in your current approach
(e.g., if they navigated in Tab A, and switch to Tab B, and press BACK -- what happens?)
MarkSemsel
That flag would maybe mitigate my concerns about piling up activities on a stack.
Mark M.
right
EGHDK: do you have a quick question, as we are almost to the end of the chat?
MarkSemsel
How do we get a transcript of your sacred words?
Mark M.
transcripts are usually posted a few minutes after the chat ends
Marcin
take care guys
EGHDK
View paste
Nope just watching thanks
MarkSemsel
Thanks, Mark
11:00 AM
Mark M.
well, that's a wrap for today's chat
next one is Thursday at 4pm Eastern
have a pleasant day, all!
Marcin
has left the room
MarkSemsel
has left the room
EGHDK
has left the room
Mark M.
turned off guest access

Thursday, January 17

 

Office Hours

People in this transcript

  • EGHDK
  • Marcin
  • Mark Murphy
  • MarkSemsel