mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-23 06:08:52 +01:00
Fix layout attire compatability
This commit is contained in:
@@ -2,6 +2,7 @@ package com.moez.QKSMS.ui.view;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.text.Layout;
|
import android.text.Layout;
|
||||||
@@ -9,6 +10,7 @@ import android.text.SpannableStringBuilder;
|
|||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import com.moez.QKSMS.R;
|
||||||
import com.moez.QKSMS.common.FontManager;
|
import com.moez.QKSMS.common.FontManager;
|
||||||
import com.moez.QKSMS.common.LiveViewManager;
|
import com.moez.QKSMS.common.LiveViewManager;
|
||||||
import com.moez.QKSMS.common.TypefaceManager;
|
import com.moez.QKSMS.common.TypefaceManager;
|
||||||
@@ -51,13 +53,11 @@ public class QKTextView extends TextView implements LiveView {
|
|||||||
private void init(Context context, AttributeSet attrs) {
|
private void init(Context context, AttributeSet attrs) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
|
|
||||||
|
|
||||||
if (attrs != null) {
|
if (attrs != null) {
|
||||||
for (int i = 0; i < attrs.getAttributeCount(); i++) {
|
final TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.QKTextView);
|
||||||
if (attrs.getAttributeName(i).equals("type")) {
|
mType = array.getInt(R.styleable.QKTextView_type, FontManager.TEXT_TYPE_PRIMARY);
|
||||||
mType = Integer.decode(attrs.getAttributeValue(i));
|
array.recycle();
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh();
|
refresh();
|
||||||
|
|||||||
@@ -19,7 +19,11 @@
|
|||||||
</attr>
|
</attr>
|
||||||
|
|
||||||
<declare-styleable name="RobotoTextView">
|
<declare-styleable name="RobotoTextView">
|
||||||
<attr name="typeface"/>
|
<attr name="typeface" />
|
||||||
|
</declare-styleable>
|
||||||
|
|
||||||
|
<declare-styleable name="QKTextView">
|
||||||
|
<attr name="type" />
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
|
|
||||||
<attr name="typeface">
|
<attr name="typeface">
|
||||||
|
|||||||
Reference in New Issue
Block a user