Browse Source

[공통][Bug] API 19버전 typeFace 미작동 버그 해결 -> Util로 메서드 분리함

Hasemi 6 years ago
parent
commit
481581333e

+ 21 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/util/TextUtil.java

@@ -26,6 +26,16 @@ public class TextUtil {
     textView.setTypeface(textView.getTypeface(), Typeface.BOLD);
   }
 
+  /**
+   * 기존 텍스트  typeface 유지하면서 font-weight Bold 처리
+   *
+   * @param typeface
+   * @param textView
+   */
+  public static void toBold(Typeface typeface, TextView textView) {
+    textView.setTypeface(typeface, Typeface.BOLD);
+  }
+
   /**
    * 현재 속성 유지하면서 font-weight Normal 처리
    *
@@ -35,6 +45,17 @@ public class TextUtil {
     textView.setTypeface(Typeface.create(textView.getTypeface(), Typeface.NORMAL));
   }
 
+
+  /**
+   * 기존 xprtmxm typeface 유지하면서 font-weight Normal 처리
+   *
+   * @param typeface
+   * @param textView
+   */
+  public static void toNormal(Typeface typeface, TextView textView) {
+    textView.setTypeface(typeface, Typeface.NORMAL);
+  }
+
   /**
    * 은/는/이/가 등 조사를 단어의 받침에따라 결정해준다.
    * - `ㄹ`로 끝나는 단어에는 `으로` 가 아니라 `로`를 붙인다. 예: 화장실로, 집으로

+ 1 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/inquiry/InquiryExpandableViewHolder.java

@@ -75,7 +75,7 @@ public class InquiryExpandableViewHolder extends RecyclerView.ViewHolder {
     }
     else {
       layoutAnswer.setVisibility(View.GONE);
-      // TextUtil.toNormal(textViewQuestion);
+      TextUtil.toNormal(typeface, textViewQuestion);
       textViewQuestion.setTypeface(typeface, Typeface.NORMAL);
     }
     buttonArrow.setImageResource(isExpanded ? R.drawable.icon_closearrow : R.drawable.icon_open_arrow);

+ 1 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/inquiry/MyInquiryExpandableViewHolder.java

@@ -99,7 +99,7 @@ public class MyInquiryExpandableViewHolder extends RecyclerView.ViewHolder {
     else {
       // 문의 글 ... 처리
       // maxLines , ellipsize
-      textViewQuestion.setTypeface(typeFace, Typeface.NORMAL);
+      TextUtil.toNormal(typeFace, textViewQuestion);
       textViewQuestion.setMaxLines(2);
       textViewQuestion.setEllipsize(TextUtils.TruncateAt.END);
 

+ 1 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/notification/NotiExpandableViewHolder.java

@@ -94,7 +94,7 @@ public class NotiExpandableViewHolder extends NotiViewHolder {
       //TextUtil.toNormal(textViewAlarmTitle);
       relativeLayoutDetailContents.setVisibility(View.GONE);
       imageViewOpenArrow.setRotation(0);
-      textViewAlarmTitle.setTypeface(typeface, Typeface.NORMAL);
+      TextUtil.toNormal(typeface, textViewAlarmTitle);
     }
   }
 }