File tree Expand file tree Collapse file tree
codeview/src/main/java/io/github/kbiakov/codeview
example/src/main/java/io/github/kbiakov/codeviewexample Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ class CodeContentAdapter : RecyclerView.Adapter<CodeContentAdapter.ViewHolder> {
178178 holder.mItem = codeLine
179179
180180 holder.itemView.setOnClickListener {
181- codeListener?.onCodeLineClicked(position)
181+ codeListener?.onCodeLineClicked(position + 1 , codeLine )
182182 }
183183
184184 holder.tvLineContent.text = html(codeLine)
Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ class CodeView : RelativeLayout {
264264 val lineHeight = dpToPx(context, 24 )
265265 val topPadding = dpToPx(context, 8 )
266266
267- // double padding (top & bottom) for big view , one is enough for small
267+ // double padding (top & bottom), one is enough for single line view
268268 val padding = (if (linesCount > 1 ) 2 else 1 ) * topPadding
269269
270270 val height = linesCount * lineHeight + padding
@@ -296,7 +296,7 @@ class CodeView : RelativeLayout {
296296 * Provides listener to code line clicks.
297297 */
298298interface OnCodeLineClickListener {
299- fun onCodeLineClicked (n : Int )
299+ fun onCodeLineClicked (n : Int , line : String )
300300}
301301
302302/* *
Original file line number Diff line number Diff line change 22
33import android .os .Bundle ;
44import android .support .annotation .Nullable ;
5- import android .support .v4 .content .ContextCompat ;
65import android .support .v7 .app .AppCompatActivity ;
7- import android .util .Log ;
86
97import io .github .kbiakov .codeview .CodeView ;
108import io .github .kbiakov .codeview .highlight .ColorTheme ;
You can’t perform that action at this time.
0 commit comments