android-actionbar icon indicating copy to clipboard operation
android-actionbar copied to clipboard

Text instead of Drawables

Open robisaks opened this issue 14 years ago • 1 comments

I'd like to have text as a button in the action bar, in addition to normal drawables. I did some initial research into doing this by drawing text onto a canvas then converting it to a drawable. It seems as though the action bar is expecting the integer for the drawable resource.

robisaks avatar Feb 23 '11 05:02 robisaks

Oh that is true. Currently it's not possible to do, sorry for the poorly designed api for Action. Guess public int getDrawable(); should have been public Drawable getDrawable(); instead and internally deal with translating resources to drawables.

Changing this would break the api and all users would need to change their code when implementing other actions than IntentActions, but I think it's a reasonable change. I need to think that through and have the users of the action bar feedback on such a change.

Until that I would suggest you to add the text through resources or fork it yourself to be able to do it for now.

johannilsson avatar Feb 23 '11 08:02 johannilsson