Last active
August 29, 2015 14:24
-
-
Save pfn/9e8dcf3ac81056a91783 to your computer and use it in GitHub Desktop.
extension class that returns 'this'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
textfield.asScala.onEditorAction((_,id,event) => true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicit class ExtensionOfTextView(val base: android.widget.TextView) extends AnyVal { | |
def onEditorAction0(fn: => Boolean) = | |
base.setOnEditorActionListener(`fn0 to android.widget.TextView$OnEditorActionListener`(() => fn)) | |
def onEditorAction(fn: (android.widget.TextView, Int, android.view.KeyEvent) => Boolean) = | |
base.setOnEditorActionListener(`fn3 to android.widget.TextView$OnEditorActionListener`(fn)) | |
def asScala = this | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126: getstatic #202 // Field com/hanhuy/android/extensions/package$ExtensionOfTextView$.MODULE$:Lcom/hanhuy/android/extensions/package$ExtensionOfTextView$; | |
129: getstatic #202 // Field com/hanhuy/android/extensions/package$ExtensionOfTextView$.MODULE$:Lcom/hanhuy/android/extensions/package$ExtensionOfTextView$; | |
132: getstatic #207 // Field com/hanhuy/android/extensions/package$.MODULE$:Lcom/hanhuy/android/extensions/package$; | |
135: aload_0 | |
136: invokevirtual #131 // Method textfield:()Lcom/rengwuxian/materialedittext/MaterialEditText; | |
139: invokevirtual #211 // Method com/hanhuy/android/extensions/package$.ExtensionOfTextView:(Landroid/widget/TextView;)Landroid/widget/TextView; | |
142: invokevirtual #214 // Method com/hanhuy/android/extensions/package$ExtensionOfTextView$.asScala$extension:(Landroid/widget/TextView;)Landroid/widget/TextView; | |
145: new #216 // class com/hanhuy/android/keepshare/StandardEditView$$anonfun$13 | |
148: dup | |
149: aload_0 | |
150: invokespecial #219 // Method com/hanhuy/android/keepshare/StandardEditView$$anonfun$13."<init>":(Lcom/hanhuy/android/keepshare/StandardEditView;)V | |
153: invokevirtual #223 // Method com/hanhuy/android/extensions/package$ExtensionOfTextView$.onEditorAction$extension:(Landroid/widget/TextView;Lscala/Function3;)V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126: getstatic #202 // Field com/hanhuy/android/extensions/package$ExtensionOfTextView$.MODULE$:Lcom/hanhuy/android/extensions/package$ExtensionOfTextView$; | |
129: getstatic #207 // Field com/hanhuy/android/extensions/package$.MODULE$:Lcom/hanhuy/android/extensions/package$; | |
132: aload_0 | |
133: invokevirtual #131 // Method textfield:()Lcom/rengwuxian/materialedittext/MaterialEditText; | |
136: invokevirtual #211 // Method com/hanhuy/android/extensions/package$.ExtensionOfTextView:(Landroid/widget/TextView;)Landroid/widget/TextView; | |
139: new #213 // class com/hanhuy/android/keepshare/StandardEditView$$anonfun$2 | |
142: dup | |
143: aload_0 | |
144: invokespecial #216 // Method com/hanhuy/android/keepshare/StandardEditView$$anonfun$2."<init>":(Lcom/hanhuy/android/keepshare/StandardEditView;)V | |
147: invokevirtual #220 // Method com/hanhuy/android/extensions/package$ExtensionOfTextView$.onEditorAction0$extension:(Landroid/widget/TextView;Lscala/Function0;)V |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment