johannilsson / android-actionbar

DEPRECATED Android Action Bar Implementation
1.31k stars 564 forks source link

Clear home action #17

Closed obra closed 13 years ago

obra commented 13 years ago

As the commit message says, I'm not really that thrilled with the internals of what I'm doing, but find I do need the method as I reinitialize my actionbar.

johannilsson commented 13 years ago

I agree, don't like how it's constructed internally either, but will merge this now.

I think it would make sense to refactor the internals of setHomeAction and setHomeLogo and have it work just as the other actions would. That would also make it possible to add actions to the left instead of just to the right as it is today.

That could be done by changing addAction or add a new method and add some constants for alignment like;

public static final int ALIGNMENT_LEFT = 0;
public static final int ALIGNMENT_RIGHT = 0;
public void addAction(Action action, int index, int alignment)

Then have addAction default to right alignment and have setHomeAction call addAction with left alignment internally.

obra commented 13 years ago

That's not...wrong, but it doesn't really fit with the UI patterns I see implemented with ActionBar. I wouldn't object, though.

johannilsson commented 13 years ago

True, but I think it would be nice to not only support the standard action bar layout, but also allow the users to build a action bar similar to the one in this article, http://blog.radioactiveyak.com/2010/10/android-app-surgery-cycle-hire-widget.html.

obra commented 13 years ago

Sure. That's a perfectly reasonable argument