CompoundButtonCompatDonut.smali 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. .class Landroid/support/v4/widget/CompoundButtonCompatDonut;
  2. .super Ljava/lang/Object;
  3. .source "CompoundButtonCompatDonut.java"
  4. # static fields
  5. .field private static final TAG:Ljava/lang/String; = "CompoundButtonCompatDonut"
  6. .field private static sButtonDrawableField:Ljava/lang/reflect/Field;
  7. .field private static sButtonDrawableFieldFetched:Z
  8. # direct methods
  9. .method constructor <init>()V
  10. .locals 0
  11. .prologue
  12. .line 27
  13. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  14. return-void
  15. .end method
  16. .method static getButtonDrawable(Landroid/widget/CompoundButton;)Landroid/graphics/drawable/Drawable;
  17. .locals 5
  18. .param p0, "button" # Landroid/widget/CompoundButton;
  19. .prologue
  20. const/4 v2, 0x0
  21. const/4 v4, 0x1
  22. .line 61
  23. sget-boolean v1, Landroid/support/v4/widget/CompoundButtonCompatDonut;->sButtonDrawableFieldFetched:Z
  24. if-nez v1, :cond_0
  25. .line 63
  26. :try_start_0
  27. const-class v1, Landroid/widget/CompoundButton;
  28. const-string v3, "mButtonDrawable"
  29. invoke-virtual {v1, v3}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
  30. move-result-object v1
  31. sput-object v1, Landroid/support/v4/widget/CompoundButtonCompatDonut;->sButtonDrawableField:Ljava/lang/reflect/Field;
  32. .line 64
  33. sget-object v1, Landroid/support/v4/widget/CompoundButtonCompatDonut;->sButtonDrawableField:Ljava/lang/reflect/Field;
  34. const/4 v3, 0x1
  35. invoke-virtual {v1, v3}, Ljava/lang/reflect/Field;->setAccessible(Z)V
  36. :try_end_0
  37. .catch Ljava/lang/NoSuchFieldException; {:try_start_0 .. :try_end_0} :catch_0
  38. .line 68
  39. :goto_0
  40. sput-boolean v4, Landroid/support/v4/widget/CompoundButtonCompatDonut;->sButtonDrawableFieldFetched:Z
  41. .line 71
  42. :cond_0
  43. sget-object v1, Landroid/support/v4/widget/CompoundButtonCompatDonut;->sButtonDrawableField:Ljava/lang/reflect/Field;
  44. if-eqz v1, :cond_1
  45. .line 73
  46. :try_start_1
  47. sget-object v1, Landroid/support/v4/widget/CompoundButtonCompatDonut;->sButtonDrawableField:Ljava/lang/reflect/Field;
  48. invoke-virtual {v1, p0}, Ljava/lang/reflect/Field;->get(Ljava/lang/Object;)Ljava/lang/Object;
  49. move-result-object v1
  50. check-cast v1, Landroid/graphics/drawable/Drawable;
  51. :try_end_1
  52. .catch Ljava/lang/IllegalAccessException; {:try_start_1 .. :try_end_1} :catch_1
  53. .line 79
  54. :goto_1
  55. return-object v1
  56. .line 65
  57. :catch_0
  58. move-exception v0
  59. .line 66
  60. .local v0, "e":Ljava/lang/NoSuchFieldException;
  61. const-string v1, "CompoundButtonCompatDonut"
  62. const-string v3, "Failed to retrieve mButtonDrawable field"
  63. invoke-static {v1, v3, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
  64. goto :goto_0
  65. .line 74
  66. .end local v0 # "e":Ljava/lang/NoSuchFieldException;
  67. :catch_1
  68. move-exception v0
  69. .line 75
  70. .local v0, "e":Ljava/lang/IllegalAccessException;
  71. const-string v1, "CompoundButtonCompatDonut"
  72. const-string v3, "Failed to get button drawable via reflection"
  73. invoke-static {v1, v3, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
  74. .line 76
  75. sput-object v2, Landroid/support/v4/widget/CompoundButtonCompatDonut;->sButtonDrawableField:Ljava/lang/reflect/Field;
  76. .end local v0 # "e":Ljava/lang/IllegalAccessException;
  77. :cond_1
  78. move-object v1, v2
  79. .line 79
  80. goto :goto_1
  81. .end method
  82. .method static getButtonTintList(Landroid/widget/CompoundButton;)Landroid/content/res/ColorStateList;
  83. .locals 1
  84. .param p0, "button" # Landroid/widget/CompoundButton;
  85. .prologue
  86. .line 41
  87. instance-of v0, p0, Landroid/support/v4/widget/TintableCompoundButton;
  88. if-eqz v0, :cond_0
  89. .line 42
  90. check-cast p0, Landroid/support/v4/widget/TintableCompoundButton;
  91. .end local p0 # "button":Landroid/widget/CompoundButton;
  92. invoke-interface {p0}, Landroid/support/v4/widget/TintableCompoundButton;->getSupportButtonTintList()Landroid/content/res/ColorStateList;
  93. move-result-object v0
  94. .line 44
  95. :goto_0
  96. return-object v0
  97. .restart local p0 # "button":Landroid/widget/CompoundButton;
  98. :cond_0
  99. const/4 v0, 0x0
  100. goto :goto_0
  101. .end method
  102. .method static getButtonTintMode(Landroid/widget/CompoundButton;)Landroid/graphics/PorterDuff$Mode;
  103. .locals 1
  104. .param p0, "button" # Landroid/widget/CompoundButton;
  105. .prologue
  106. .line 54
  107. instance-of v0, p0, Landroid/support/v4/widget/TintableCompoundButton;
  108. if-eqz v0, :cond_0
  109. .line 55
  110. check-cast p0, Landroid/support/v4/widget/TintableCompoundButton;
  111. .end local p0 # "button":Landroid/widget/CompoundButton;
  112. invoke-interface {p0}, Landroid/support/v4/widget/TintableCompoundButton;->getSupportButtonTintMode()Landroid/graphics/PorterDuff$Mode;
  113. move-result-object v0
  114. .line 57
  115. :goto_0
  116. return-object v0
  117. .restart local p0 # "button":Landroid/widget/CompoundButton;
  118. :cond_0
  119. const/4 v0, 0x0
  120. goto :goto_0
  121. .end method
  122. .method static setButtonTintList(Landroid/widget/CompoundButton;Landroid/content/res/ColorStateList;)V
  123. .locals 1
  124. .param p0, "button" # Landroid/widget/CompoundButton;
  125. .param p1, "tint" # Landroid/content/res/ColorStateList;
  126. .prologue
  127. .line 35
  128. instance-of v0, p0, Landroid/support/v4/widget/TintableCompoundButton;
  129. if-eqz v0, :cond_0
  130. .line 36
  131. check-cast p0, Landroid/support/v4/widget/TintableCompoundButton;
  132. .end local p0 # "button":Landroid/widget/CompoundButton;
  133. invoke-interface {p0, p1}, Landroid/support/v4/widget/TintableCompoundButton;->setSupportButtonTintList(Landroid/content/res/ColorStateList;)V
  134. .line 38
  135. :cond_0
  136. return-void
  137. .end method
  138. .method static setButtonTintMode(Landroid/widget/CompoundButton;Landroid/graphics/PorterDuff$Mode;)V
  139. .locals 1
  140. .param p0, "button" # Landroid/widget/CompoundButton;
  141. .param p1, "tintMode" # Landroid/graphics/PorterDuff$Mode;
  142. .prologue
  143. .line 48
  144. instance-of v0, p0, Landroid/support/v4/widget/TintableCompoundButton;
  145. if-eqz v0, :cond_0
  146. .line 49
  147. check-cast p0, Landroid/support/v4/widget/TintableCompoundButton;
  148. .end local p0 # "button":Landroid/widget/CompoundButton;
  149. invoke-interface {p0, p1}, Landroid/support/v4/widget/TintableCompoundButton;->setSupportButtonTintMode(Landroid/graphics/PorterDuff$Mode;)V
  150. .line 51
  151. :cond_0
  152. return-void
  153. .end method