medyo / Fancybuttons

Icons, Borders, Radius ... for Android buttons
1.77k stars 397 forks source link

Public method : getText is missing #27

Closed makuchaku closed 9 years ago

makuchaku commented 9 years ago

A missing getText method makes this unusable in onClick events. One has to resort to knowing the internals of FancyButton layout to extract text.

The following complex query is used currently to find text of the button which was clicked

            public void onClick(View view) {
                TextView tv = (TextView)((LinearLayout) view).getChildAt(0);
                Log.d("onClick", tv.getText().toString());
            }

Needed public String getText();

medyo commented 9 years ago

Here you go, i just added some basic getters https://github.com/medyo/fancybuttons/commit/0dcabb3a0ef21dd926e2604cfae4fb4dd4bf46c5