Permalink
Browse files

add font change function

Change-Id: I9a969b6bb1e565dcae47fd2248c22d01b441df5e
  • Loading branch information...
1 parent a6a6baf commit c39bb1673fbd58e17b2ab547b354ba6af2fb63f6 @yu88my yu88my committed Nov 30, 2012
Showing with 9 additions and 13 deletions.
  1. +1 −1 ThemeManager/res/values/bools.xml.part
  2. +8 −12 framework.jar.out/smali/android/widget/TextView.smali
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <bool name="support_font_replacement">false</bool>
+ <bool name="support_font_replacement">true</bool>
</resources>
@@ -16447,41 +16447,35 @@
.parameter "styleIndex"
.prologue
- .line 1234
const/4 v0, 0x0
- .line 1235
.local v0, tf:Landroid/graphics/Typeface;
packed-switch p1, :pswitch_data_0
- .line 1249
:goto_0
+ invoke-static {v0, p1, p2}, Landroid/graphics/MiuiTypeface;->getChangedTypeface(Landroid/graphics/Typeface;II)Landroid/graphics/Typeface;
+
+ move-result-object v0
+
invoke-virtual {p0, v0, p2}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;I)V
- .line 1250
return-void
- .line 1237
:pswitch_0
sget-object v0, Landroid/graphics/Typeface;->SANS_SERIF:Landroid/graphics/Typeface;
- .line 1238
goto :goto_0
- .line 1241
:pswitch_1
sget-object v0, Landroid/graphics/Typeface;->SERIF:Landroid/graphics/Typeface;
- .line 1242
goto :goto_0
- .line 1245
:pswitch_2
sget-object v0, Landroid/graphics/Typeface;->MONOSPACE:Landroid/graphics/Typeface;
goto :goto_0
- .line 1235
nop
:pswitch_data_0
@@ -39939,12 +39933,14 @@
invoke-virtual {v4, v2}, Landroid/text/TextPaint;->setFakeBoldText(Z)V
- .line 1338
iget-object v2, p0, Landroid/widget/TextView;->mTextPaint:Landroid/text/TextPaint;
invoke-virtual {v2, v3}, Landroid/text/TextPaint;->setTextSkewX(F)V
- .line 1339
+ invoke-static {p1}, Landroid/graphics/MiuiTypeface;->getDefaultTypeface(Landroid/graphics/Typeface;)Landroid/graphics/Typeface;
+
+ move-result-object p1
+
invoke-virtual {p0, p1}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;)V
goto :goto_3

0 comments on commit c39bb16

Please sign in to comment.