isExpanded() would always retun true if called before layout.

After restoreInstanceState, isExpanded() currently always returns true if the initial layout hasn't been completed yet, requiring you to keep track of the state in the activity to e.g. set the visible state of the actionbar upon activity creation.