diff --git a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoAutoCompleteTextView.java b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoAutoCompleteTextView.java index ca4912a..bd03019 100644 --- a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoAutoCompleteTextView.java +++ b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoAutoCompleteTextView.java @@ -98,11 +98,13 @@ private void onInitTypeface(Context context, AttributeSet attrs, int defStyle) { return; } - int typefaceValue = 0; + int typefaceValue = RobotoTypefaceManager.ROBOTO_REGULAR; if (attrs != null) { TypedArray values = context.obtainStyledAttributes(attrs, R.styleable.RobotoTextView, defStyle, 0); - typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, 0); - values.recycle(); + if (values != null) { + typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, typefaceValue); + values.recycle(); + } } Typeface robotoTypeface = RobotoTypefaceManager.obtainTypeface(context, typefaceValue); diff --git a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoButton.java b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoButton.java index 560bba1..f287c4c 100644 --- a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoButton.java +++ b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoButton.java @@ -98,11 +98,13 @@ private void onInitTypeface(Context context, AttributeSet attrs, int defStyle) { return; } - int typefaceValue = 0; + int typefaceValue = RobotoTypefaceManager.ROBOTO_REGULAR; if (attrs != null) { TypedArray values = context.obtainStyledAttributes(attrs, R.styleable.RobotoTextView, defStyle, 0); - typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, 0); - values.recycle(); + if (values != null) { + typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, typefaceValue); + values.recycle(); + } } Typeface robotoTypeface = RobotoTypefaceManager.obtainTypeface(context, typefaceValue); diff --git a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoCheckBox.java b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoCheckBox.java index eb545c4..6a31c9e 100644 --- a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoCheckBox.java +++ b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoCheckBox.java @@ -98,11 +98,13 @@ private void onInitTypeface(Context context, AttributeSet attrs, int defStyle) { return; } - int typefaceValue = 0; + int typefaceValue = RobotoTypefaceManager.ROBOTO_REGULAR; if (attrs != null) { TypedArray values = context.obtainStyledAttributes(attrs, R.styleable.RobotoTextView, defStyle, 0); - typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, 0); - values.recycle(); + if (values != null) { + typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, typefaceValue); + values.recycle(); + } } Typeface robotoTypeface = RobotoTypefaceManager.obtainTypeface(context, typefaceValue); diff --git a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoCheckedTextView.java b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoCheckedTextView.java index 333055f..b9b5357 100644 --- a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoCheckedTextView.java +++ b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoCheckedTextView.java @@ -98,11 +98,13 @@ private void onInitTypeface(Context context, AttributeSet attrs, int defStyle) { return; } - int typefaceValue = 0; + int typefaceValue = RobotoTypefaceManager.ROBOTO_REGULAR; if (attrs != null) { TypedArray values = context.obtainStyledAttributes(attrs, R.styleable.RobotoTextView, defStyle, 0); - typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, 0); - values.recycle(); + if (values != null) { + typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, typefaceValue); + values.recycle(); + } } Typeface robotoTypeface = RobotoTypefaceManager.obtainTypeface(context, typefaceValue); diff --git a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoChronometer.java b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoChronometer.java index ace4a14..95830f6 100644 --- a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoChronometer.java +++ b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoChronometer.java @@ -98,11 +98,13 @@ private void onInitTypeface(Context context, AttributeSet attrs, int defStyle) { return; } - int typefaceValue = 0; + int typefaceValue = RobotoTypefaceManager.ROBOTO_REGULAR; if (attrs != null) { TypedArray values = context.obtainStyledAttributes(attrs, R.styleable.RobotoTextView, defStyle, 0); - typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, 0); - values.recycle(); + if (values != null) { + typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, typefaceValue); + values.recycle(); + } } Typeface robotoTypeface = RobotoTypefaceManager.obtainTypeface(context, typefaceValue); diff --git a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoCompoundButton.java b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoCompoundButton.java index 0f1409a..968eeef 100644 --- a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoCompoundButton.java +++ b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoCompoundButton.java @@ -98,11 +98,13 @@ private void onInitTypeface(Context context, AttributeSet attrs, int defStyle) { return; } - int typefaceValue = 0; + int typefaceValue = RobotoTypefaceManager.ROBOTO_REGULAR; if (attrs != null) { TypedArray values = context.obtainStyledAttributes(attrs, R.styleable.RobotoTextView, defStyle, 0); - typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, 0); - values.recycle(); + if (values != null) { + typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, typefaceValue); + values.recycle(); + } } Typeface robotoTypeface = RobotoTypefaceManager.obtainTypeface(context, typefaceValue); diff --git a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoDigitalClock.java b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoDigitalClock.java index 5904fa2..71561b6 100644 --- a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoDigitalClock.java +++ b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoDigitalClock.java @@ -76,11 +76,13 @@ private void onInitTypeface(Context context, AttributeSet attrs) { return; } - int typefaceValue = 0; + int typefaceValue = RobotoTypefaceManager.ROBOTO_REGULAR; if (attrs != null) { TypedArray values = context.obtainStyledAttributes(attrs, R.styleable.RobotoTextView); - typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, 0); - values.recycle(); + if (values != null) { + typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, typefaceValue); + values.recycle(); + } } Typeface robotoTypeface = RobotoTypefaceManager.obtainTypeface(context, typefaceValue); diff --git a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoEditText.java b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoEditText.java index c04e24b..66439b7 100644 --- a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoEditText.java +++ b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoEditText.java @@ -98,11 +98,13 @@ private void onInitTypeface(Context context, AttributeSet attrs, int defStyle) { return; } - int typefaceValue = 0; + int typefaceValue = RobotoTypefaceManager.ROBOTO_REGULAR; if (attrs != null) { TypedArray values = context.obtainStyledAttributes(attrs, R.styleable.RobotoTextView, defStyle, 0); - typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, 0); - values.recycle(); + if (values != null) { + typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, typefaceValue); + values.recycle(); + } } Typeface robotoTypeface = RobotoTypefaceManager.obtainTypeface(context, typefaceValue); diff --git a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoExtractEditText.java b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoExtractEditText.java index 965562c..93c0010 100644 --- a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoExtractEditText.java +++ b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoExtractEditText.java @@ -98,11 +98,13 @@ private void onInitTypeface(Context context, AttributeSet attrs, int defStyle) { return; } - int typefaceValue = 0; + int typefaceValue = RobotoTypefaceManager.ROBOTO_REGULAR; if (attrs != null) { TypedArray values = context.obtainStyledAttributes(attrs, R.styleable.RobotoTextView, defStyle, 0); - typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, 0); - values.recycle(); + if (values != null) { + typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, typefaceValue); + values.recycle(); + } } Typeface robotoTypeface = RobotoTypefaceManager.obtainTypeface(context, typefaceValue); diff --git a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoMultiAutoCompleteTextView.java b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoMultiAutoCompleteTextView.java index f72dbf6..a9b5f05 100644 --- a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoMultiAutoCompleteTextView.java +++ b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoMultiAutoCompleteTextView.java @@ -98,11 +98,13 @@ private void onInitTypeface(Context context, AttributeSet attrs, int defStyle) { return; } - int typefaceValue = 0; + int typefaceValue = RobotoTypefaceManager.ROBOTO_REGULAR; if (attrs != null) { TypedArray values = context.obtainStyledAttributes(attrs, R.styleable.RobotoTextView, defStyle, 0); - typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, 0); - values.recycle(); + if (values != null) { + typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, typefaceValue); + values.recycle(); + } } Typeface robotoTypeface = RobotoTypefaceManager.obtainTypeface(context, typefaceValue); diff --git a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoRadioButton.java b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoRadioButton.java index 5f7f1d4..fcc26a6 100644 --- a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoRadioButton.java +++ b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoRadioButton.java @@ -98,11 +98,13 @@ private void onInitTypeface(Context context, AttributeSet attrs, int defStyle) { return; } - int typefaceValue = 0; + int typefaceValue = RobotoTypefaceManager.ROBOTO_REGULAR; if (attrs != null) { TypedArray values = context.obtainStyledAttributes(attrs, R.styleable.RobotoTextView, defStyle, 0); - typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, 0); - values.recycle(); + if (values != null) { + typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, typefaceValue); + values.recycle(); + } } Typeface robotoTypeface = RobotoTypefaceManager.obtainTypeface(context, typefaceValue); diff --git a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoSwitch.java b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoSwitch.java index aa6d2bb..7e99c81 100644 --- a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoSwitch.java +++ b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoSwitch.java @@ -101,11 +101,13 @@ private void onInitTypeface(Context context, AttributeSet attrs, int defStyle) { return; } - int typefaceValue = 0; + int typefaceValue = RobotoTypefaceManager.ROBOTO_REGULAR; if (attrs != null) { TypedArray values = context.obtainStyledAttributes(attrs, R.styleable.RobotoTextView, defStyle, 0); - typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, 0); - values.recycle(); + if (values != null) { + typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, typefaceValue); + values.recycle(); + } } Typeface robotoTypeface = RobotoTypefaceManager.obtainTypeface(context, typefaceValue); diff --git a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoTextClock.java b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoTextClock.java index 5e82248..b216eb3 100644 --- a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoTextClock.java +++ b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoTextClock.java @@ -98,11 +98,13 @@ private void onInitTypeface(Context context, AttributeSet attrs, int defStyle) { return; } - int typefaceValue = 0; + int typefaceValue = RobotoTypefaceManager.ROBOTO_REGULAR; if (attrs != null) { TypedArray values = context.obtainStyledAttributes(attrs, R.styleable.RobotoTextView, defStyle, 0); - typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, 0); - values.recycle(); + if (values != null) { + typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, typefaceValue); + values.recycle(); + } } Typeface robotoTypeface = RobotoTypefaceManager.obtainTypeface(context, typefaceValue); diff --git a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoTextView.java b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoTextView.java index d03e408..88e6b22 100644 --- a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoTextView.java +++ b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoTextView.java @@ -98,11 +98,13 @@ private void onInitTypeface(Context context, AttributeSet attrs, int defStyle) { return; } - int typefaceValue = 0; + int typefaceValue = RobotoTypefaceManager.ROBOTO_REGULAR; if (attrs != null) { TypedArray values = context.obtainStyledAttributes(attrs, R.styleable.RobotoTextView, defStyle, 0); - typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, 0); - values.recycle(); + if (values != null) { + typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, typefaceValue); + values.recycle(); + } } Typeface robotoTypeface = RobotoTypefaceManager.obtainTypeface(context, typefaceValue); diff --git a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoToggleButton.java b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoToggleButton.java index 9372304..cecb466 100644 --- a/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoToggleButton.java +++ b/robototextview/src/main/java/com/devspark/robototextview/widget/RobotoToggleButton.java @@ -98,11 +98,13 @@ private void onInitTypeface(Context context, AttributeSet attrs, int defStyle) { return; } - int typefaceValue = 0; + int typefaceValue = RobotoTypefaceManager.ROBOTO_REGULAR; if (attrs != null) { TypedArray values = context.obtainStyledAttributes(attrs, R.styleable.RobotoTextView, defStyle, 0); - typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, 0); - values.recycle(); + if (values != null) { + typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, typefaceValue); + values.recycle(); + } } Typeface robotoTypeface = RobotoTypefaceManager.obtainTypeface(context, typefaceValue);