Fix layout attire compatability

This commit is contained in:
Moez Bhatti
2015-11-16 06:37:56 -05:00
parent 0896e559f6
commit 302eea9a52
2 changed files with 11 additions and 7 deletions
@@ -2,6 +2,7 @@ package com.moez.QKSMS.ui.view;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.TypedArray;
import android.os.Build;
import android.preference.PreferenceManager;
import android.text.Layout;
@@ -9,6 +10,7 @@ import android.text.SpannableStringBuilder;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.widget.TextView;
import com.moez.QKSMS.R;
import com.moez.QKSMS.common.FontManager;
import com.moez.QKSMS.common.LiveViewManager;
import com.moez.QKSMS.common.TypefaceManager;
@@ -51,13 +53,11 @@ public class QKTextView extends TextView implements LiveView {
private void init(Context context, AttributeSet attrs) {
mContext = context;
if (attrs != null) {
for (int i = 0; i < attrs.getAttributeCount(); i++) {
if (attrs.getAttributeName(i).equals("type")) {
mType = Integer.decode(attrs.getAttributeValue(i));
break;
}
}
final TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.QKTextView);
mType = array.getInt(R.styleable.QKTextView_type, FontManager.TEXT_TYPE_PRIMARY);
array.recycle();
}
refresh();
+5 -1
View File
@@ -19,7 +19,11 @@
</attr>
<declare-styleable name="RobotoTextView">
<attr name="typeface"/>
<attr name="typeface" />
</declare-styleable>
<declare-styleable name="QKTextView">
<attr name="type" />
</declare-styleable>
<attr name="typeface">