Profile

Cover photo
Michael Wolfson
Works at Epocrates
Lives in Phoenix, AZ
1,638 followers|254,190 views
AboutPostsPhotosYouTube

Stream

 
Great
 
After struggling with trying to figure out how various pieces fit together, I've done some research and put together the complete Android Activity/Fragment lifecycle chart. This has two parallel lifecycles (activities and fragments) which are organized vertically by time. Lifecycle stages will occur in the vertical order in which they're displayed, across activities and fragments. In this way, you can see how your fragments interact with your activities.

In addition to the attached image, I've also got an SVG: http://staticfree.info/~steve/complete_android_fragment_lifecycle.svg which is suitable for printing.

If this is missing lifecycle steps or is inaccurate in any way, let me know so I can update it!

#Android #androiddev  
1
Add a comment...

Michael Wolfson

Shared publicly  - 
 
 
 #OSCON registration is open and schedule is posted + first 500 to register can get new Converse shoes

http://oreil.ly/1mxUMpc
1
Add a comment...

Michael Wolfson

Shared publicly  - 
 
Build new habits 1 hour a day.   Great ideas to make your time count.
Who is your most valuable client? It's not the one who brings you the most money. Nor is it the one who is most famous. You are your most important client, and that means you need to spend a little time refining your own process each week. Here are five ways to do just that.
2
1
Stefan Hoth's profile photo
Add a comment...
 
More great UI magic.
 
Android App Polishing: Show UI State Through Icons

With the release of Capitaine Train for Android[0], several people recently asked me how we implemented some of the tips & tricks available in the application (some of these tricks are barely visible but remember, I love details :p). In order to showcase some of the most interesting application bits of code, I thought it could be helpful to Android developers to start a small series of posts. Feel free to comment this article if you want me to describe something you found nice in the Capitaine Train application.

As some of you may have noticed, we put a lot of attention to the search form in the Capitaine Train Android app. As I explained in my previous article[1], I'm not a huge fan of long texts. While often offering a great explanation, text requires a lot of parsing time. Icons are often a great alternative to text because they allow user to understand what's going on more rapidly.

When creating the search form, we thought about leveraging icons to help user better understand the current "form state". As a consequence, the form heavily relies on icons:

  • The "To" icon changes whether the search is round trip or not
  • Mandatory fields (i.e "From", "To" and "Passengers") icons turn red when missing
  • A red icon turns grey in edit mode while animating back to red if the field is not set when exiting the edit mode
  • The "Passengers" icon changes depending on the current number of selected passengers (see screencast)

As you can see in the screencast, the change is done as smoothly as possible simply fading between the different states. This can be done fairly easily thanks to a LevelListDrawable[2]. Here is the XML we use in Capitaine Train Android for the "Passengers" icon.

<?xml version="1.0" encoding="utf-8"?>
<level-list xmlns:android="http://schemas.android.com/apk/res/android">

    <!-- The error icon -->
    <item
        android:drawable="@drawable/ic_search_passengers_0"
        android:maxLevel="0"
        />

    <item
        android:drawable="@drawable/ic_search_passengers_1"
        android:maxLevel="1"
        />

    <item
        android:drawable="@drawable/ic_search_passengers_2"
        android:maxLevel="2"
        />

    <item
        android:drawable="@drawable/ic_search_passengers_several"
        android:maxLevel="10000"
        />

</level-list>

Starting API 11, you can animate changes in a LevelListDrawable or more globally in any DrawableContainer. Unfortunately, the framework only exposes the XML attributes in <selector /> (I really don't know why it has not being exposed to all DrawableContainer :s). Fortunately for us, you can tweak the fading duration values in your Java code with the set[Enter|Exit]FadeDuration(int) methods (yep I also don't know why the duration is an 'int' rather than a 'long').

In our code, we simply update the icon whenever there is an impacting change (an error occurred, the number of selected passenger changed, etc.). Here are some notes about the following snippet of code:

  • mFieldErrorState is a bit mask gathering all of the fields that are currently in error
  • mEditMode contains the current "edit mode" ("Passengers", "From", "To", etc.).
  • LEVEL_ERROR is 0 & LEVEL_NORMAL is 1

private void updateIcons(boolean animated) {
    final int animationDuration = (int) ANIMATION_DURATION;

    // Update the "From" icon...

    // Update the "To" icon...

    final Drawable passengersIcon = mPassengersView.getCompoundDrawables()[TextViewAdditions.INDEX_LEFT];
    if (passengersIcon != null) {
        if (passengersIcon instanceof LevelListDrawable) {
            ((LevelListDrawable) passengersIcon).setEnterFadeDuration(animationDuration);
            ((LevelListDrawable) passengersIcon).setExitFadeDuration(animationDuration);
        }
        int level = LEVEL_ERROR;
        if ((mFieldErrorState & ERROR_PASSENGERS) == 0 || mEditMode == EDIT_MODE_PASSENGERS) {
            level = Math.max(LEVEL_NORMAL, mPassengerIds.size());
        }
        passengersIcon.setLevel(level);
        if (!animated) {
            passengersIcon.jumpToCurrentState();
        }
    }
}

[0]: https://play.google.com/store/apps/details?id=com.capitainetrain.android
[1]: https://plus.google.com/118417777153109946393/posts/FABaJhRMCuy
[2]: http://developer.android.com/reference/android/graphics/drawable/LevelListDrawable.html
1
Add a comment...
Have him in circles
1,638 people
Jason Doucette's profile photo
michalis athanasiadis's profile photo
Vikash Agrawal's profile photo
Jeff Hickey's profile photo
Steve Deutsch's profile photo
Kyle Clayton's profile photo

Michael Wolfson

Shared publicly  - 
 
PSA: IO registration opens at 4:00PM PST (but no hurry, you have 3 days to sign up).

#io2104   #io14
 
Everyone waiting for Google I/O registration  to open ... Relax :)

Not open until 4PM PDT

#io2104   #io14   #registration  
1
Add a comment...
 
"See you at Google I/O 2014"

Super excited to be registered for IO already!  Been to a lot of IOs in the past (many on my own dime, and off the clock).  Feel like that has paid off this year.

Good luck to all - hope to see you in June!

+Joshua Woodward +John Coryat +Sheldon McGee #io2014 #ion +Brandy Camacho +Lawrence Wong 
11
John Coryat's profile photoJason Howell's profile photoMike DiGiovanni's profile photoMichael Wolfson's profile photo
5 comments
 
+Mike DiGiovanni the qualifications are attended at least 5 previous IOs, including the most recent one, and you must have paid your own way to each. Contact support they will check for you (I did last year, and they were able to tell me - someone looked it up and responded to me email promptly)
Add a comment...

Michael Wolfson

Shared publicly  - 
 
Short and sweet.  Better than spending the same 45 minutes on the stairmaster.
2
Add a comment...

Michael Wolfson

Shared publicly  - 
 
PSA, it looks like Google IO registration was postponed one week.  Instead of starting today, looks like it will be Apr 15 - 18th.
3
1
GDG Phoenix's profile photoChris Turvey's profile photojake stuck's profile photo
3 comments
 
I'm going to register 
Add a comment...
 
WWDC was announced today.  It is also an open registration (now until Apr 7).  Then random selection to get in (like Google IO).

Great move (and a great trend to follow).  So happy to see the mad rush to register first is over  This is a more equitable way to register for conferences.

#apple #io #wwdc2014  
1
jake stuck's profile photo
 
Sounds like they are copying google
Add a comment...
People
Have him in circles
1,638 people
Jason Doucette's profile photo
michalis athanasiadis's profile photo
Vikash Agrawal's profile photo
Jeff Hickey's profile photo
Steve Deutsch's profile photo
Kyle Clayton's profile photo
Work
Occupation
Android developer
Skills
Android Java Technical Leadership
Employment
  • Epocrates
    Lead Mobile Developer, 2013 - present
  • Able Android LLC
    Android Developer, 2012 - 2013
  • Airstrip Technologies
    Senior Software Engineer, 2012 - 2013
  • Choice Hotels International
    Android\Java Developer, 2008 - 2012
  • Lockheed Martin
    Sr. Software Engineer, 2001 - 2008
  • Software AG
    Software Engineer, 1997 - 2001
  • Adtranz
    Electronics Technician, 1995 - 1997
Basic Information
Gender
Male
Other names
Booger
Story
Tagline
Android Developer; 1st Gen Glass Explorer; O'Reilly Author; GDGPhoenix Organizer; Lifelong learner;
Introduction
I am a professional Android developer and technology enthusiast living in Phoenix AZ.  I have an appetite for life, and satiate it with travel, learning, and experiencing new things.  I organize the local chapter of the Google Developer Group.  I am the developer of the popular app "Droid Of The Day", and authored the book titled "Android Developer Tools Essentials" for O'Reilly.  I have spoken at a variety of national conferences including Oscon, and AnDevCon.
Bragging rights
Spent a week rafting in the Grand Canyon; Married in Ravello Italy; Snowboarded down Drunken Frenchman (at Mary Jane) top to bottom wihtout falling\stopping; I collect PEZ dispensers; World Traveller (been to Europe, SE Asia, Australia, Mexico, Middle East, China, and all over US)
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Phoenix, AZ
Previously
Denver, CO - Fort Collins, CO - Toronto, Ontario - Alington, VA