File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
floatlabelededittext/src/com/wrapp/floatlabelededittext Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -25,25 +25,29 @@ public class FloatLabeledEditText extends LinearLayout {
2525 private EditText editText ;
2626
2727 public FloatLabeledEditText (Context context ) {
28- this (context , null );
28+ super (context );
2929 initialize ();
3030 }
3131
3232 public FloatLabeledEditText (Context context , AttributeSet attrs ) {
33- this (context , attrs , 0 );
33+ super (context , attrs );
34+ setAttributes (attrs );
35+ initialize ();
3436 }
3537
3638 public FloatLabeledEditText (Context context , AttributeSet attrs , int defStyle ) {
3739 super (context , attrs , defStyle );
38-
40+ setAttributes (attrs );
41+ initialize ();
42+ }
43+
44+ private void setAttributes (AttributeSet attrs ) {
3945 TypedArray a = getContext ().obtainStyledAttributes (attrs , R .styleable .FloatLabeledEditText );
4046 try {
4147 hint = a .getString (R .styleable .FloatLabeledEditText_floatingHint );
4248 } finally {
4349 a .recycle ();
4450 }
45-
46- initialize ();
4751 }
4852
4953 private void initialize () {
You can’t perform that action at this time.
0 commit comments