Skip to content

Commit

Permalink
Bug fixed: focusable, focusableInTouchMode, clickable can't be set in…
Browse files Browse the repository at this point in the history
… the XML.
  • Loading branch information
rengwuxian committed Jan 11, 2015
1 parent f9a5636 commit 3a3e0a8
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class MaterialAutoCompleteTextView extends AutoCompleteTextView {
/**
* the spacing between the main text and the bottom components (bottom ellipsis, helper/error text, characters counter).
*/
private final int bottomSpacing;
private int bottomSpacing;

/**
* whether the floating label should be shown. default is false.
Expand Down Expand Up @@ -158,7 +158,7 @@ public class MaterialAutoCompleteTextView extends AutoCompleteTextView {
/**
* bottom ellipsis's height
*/
private final int bottomEllipsisSize;
private int bottomEllipsisSize;

/**
* min bottom lines count.
Expand Down Expand Up @@ -245,10 +245,10 @@ public class MaterialAutoCompleteTextView extends AutoCompleteTextView {
*/
private Bitmap[] iconRightBitmaps;

private final int iconSize;
private final int iconOuterWidth;
private final int iconOuterHeight;
private final int iconPadding;
private int iconSize;
private int iconOuterWidth;
private int iconOuterHeight;
private int iconPadding;
private ArgbEvaluator focusEvaluator = new ArgbEvaluator();
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
TextPaint textPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
Expand All @@ -261,21 +261,22 @@ public class MaterialAutoCompleteTextView extends AutoCompleteTextView {
private ArrayList<METValidator> validators = new ArrayList<>();

public MaterialAutoCompleteTextView(Context context) {
this(context, null);
super(context);
init(context, null);
}

public MaterialAutoCompleteTextView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
super(context, attrs);
init(context, attrs);
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public MaterialAutoCompleteTextView(Context context, AttributeSet attrs, int style) {
super(context, attrs, style);
init(context, attrs);
}

setFocusable(true);
setFocusableInTouchMode(true);
setClickable(true);

private void init(Context context, AttributeSet attrs) {
iconSize = getPixel(32);
iconOuterWidth = getPixel(48);
iconOuterHeight = getPixel(32);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class MaterialEditText extends EditText {
/**
* the spacing between the main text and the bottom components (bottom ellipsis, helper/error text, characters counter).
*/
private final int bottomSpacing;
private int bottomSpacing;

/**
* whether the floating label should be shown. default is false.
Expand Down Expand Up @@ -158,7 +158,7 @@ public class MaterialEditText extends EditText {
/**
* bottom ellipsis's height
*/
private final int bottomEllipsisSize;
private int bottomEllipsisSize;

/**
* min bottom lines count.
Expand Down Expand Up @@ -245,10 +245,10 @@ public class MaterialEditText extends EditText {
*/
private Bitmap[] iconRightBitmaps;

private final int iconSize;
private final int iconOuterWidth;
private final int iconOuterHeight;
private final int iconPadding;
private int iconSize;
private int iconOuterWidth;
private int iconOuterHeight;
private int iconPadding;
private ArgbEvaluator focusEvaluator = new ArgbEvaluator();
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
TextPaint textPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
Expand All @@ -261,21 +261,22 @@ public class MaterialEditText extends EditText {
private ArrayList<METValidator> validators = new ArrayList<>();

public MaterialEditText(Context context) {
this(context, null);
super(context);
init(context, null);
}

public MaterialEditText(Context context, AttributeSet attrs) {
this(context, attrs, 0);
super(context, attrs);
init(context, attrs);
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public MaterialEditText(Context context, AttributeSet attrs, int style) {
super(context, attrs, style);
init(context, attrs);
}

setFocusable(true);
setFocusableInTouchMode(true);
setClickable(true);

private void init(Context context, AttributeSet attrs) {
iconSize = getPixel(32);
iconOuterWidth = getPixel(48);
iconOuterHeight = getPixel(32);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class MaterialMultiAutoCompleteTextView extends MultiAutoCompleteTextView
/**
* the spacing between the main text and the bottom components (bottom ellipsis, helper/error text, characters counter).
*/
private final int bottomSpacing;
private int bottomSpacing;

/**
* whether the floating label should be shown. default is false.
Expand Down Expand Up @@ -155,7 +155,7 @@ public class MaterialMultiAutoCompleteTextView extends MultiAutoCompleteTextView
/**
* bottom ellipsis's height
*/
private final int bottomEllipsisSize;
private int bottomEllipsisSize;

/**
* min bottom lines count.
Expand Down Expand Up @@ -242,10 +242,10 @@ public class MaterialMultiAutoCompleteTextView extends MultiAutoCompleteTextView
*/
private Bitmap[] iconRightBitmaps;

private final int iconSize;
private final int iconOuterWidth;
private final int iconOuterHeight;
private final int iconPadding;
private int iconSize;
private int iconOuterWidth;
private int iconOuterHeight;
private int iconPadding;
private ArgbEvaluator focusEvaluator = new ArgbEvaluator();
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
TextPaint textPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
Expand All @@ -258,21 +258,22 @@ public class MaterialMultiAutoCompleteTextView extends MultiAutoCompleteTextView
private ArrayList<METValidator> validators = new ArrayList<>();

public MaterialMultiAutoCompleteTextView(Context context) {
this(context, null);
super(context);
init(context, null);
}

public MaterialMultiAutoCompleteTextView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
super(context, attrs);
init(context, attrs);
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public MaterialMultiAutoCompleteTextView(Context context, AttributeSet attrs, int style) {
super(context, attrs, style);
init(context, attrs);
}

setFocusable(true);
setFocusableInTouchMode(true);
setClickable(true);

private void init(Context context, AttributeSet attrs) {
iconSize = getPixel(32);
iconOuterWidth = getPixel(48);
iconOuterHeight = getPixel(32);
Expand Down

0 comments on commit 3a3e0a8

Please sign in to comment.