Skip to content

Commit

Permalink
Merge pull request #7166 from manumaticx/TC-5682
Browse files Browse the repository at this point in the history
[TC-5682] Android: switch to AppCompatButton
  • Loading branch information
ashcoding committed Sep 14, 2015
2 parents aa29fb8 + 0df3fdd commit abe4ee9
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.view.Gravity;
import android.widget.Button;
import android.support.v7.widget.AppCompatButton;

public class TiUIButton extends TiUIView
{
Expand All @@ -39,7 +39,7 @@ public TiUIButton(final TiViewProxy proxy)
{
super(proxy);
Log.d(TAG, "Creating a button", Log.DEBUG_MODE);
Button btn = new Button(proxy.getActivity())
AppCompatButton btn = new AppCompatButton(proxy.getActivity())
{
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom)
Expand All @@ -60,7 +60,7 @@ public void processProperties(KrollDict d)

boolean needShadow = false;

Button btn = (Button) getNativeView();
AppCompatButton btn = (AppCompatButton) getNativeView();
if (d.containsKey(TiC.PROPERTY_IMAGE)) {
Object value = d.get(TiC.PROPERTY_IMAGE);
TiDrawableReference drawableRef = null;
Expand Down Expand Up @@ -130,7 +130,7 @@ public void propertyChanged(String key, Object oldValue, Object newValue, KrollP
if (Log.isDebugModeEnabled()) {
Log.d(TAG, "Property: " + key + " old: " + oldValue + " new: " + newValue, Log.DEBUG_MODE);
}
Button btn = (Button) getNativeView();
AppCompatButton btn = (AppCompatButton) getNativeView();
if (key.equals(TiC.PROPERTY_TITLE)) {
btn.setText((String) newValue);
} else if (key.equals(TiC.PROPERTY_COLOR)) {
Expand Down

0 comments on commit abe4ee9

Please sign in to comment.