@@ -87,6 +87,8 @@ public class MarkdownVisitor extends AbstractVisitor {
87
87
private TableRow tableRow ;
88
88
private boolean inHeader = false ;
89
89
90
+ private int copyButtonCounter = 0 ;
91
+
90
92
MarkdownVisitor (@ NonNull NativeMarkdownView container , @ Nullable MarkdownViewDelegate delegate ) {
91
93
this .container = container ;
92
94
this .delegate = delegate ;
@@ -211,17 +213,18 @@ public void visit(FencedCodeBlock fencedCodeBlock) {
211
213
btnCopy .setTextColor (editorTheme .getFgColor ());
212
214
btnCopy .setIconTint (ColorStateList .valueOf (editorTheme .getFgColor ()));
213
215
divider .setVisibility (View .VISIBLE );
214
- divider .setBackgroundDrawable (new ColorDrawable (editorTheme .getGutterStyle ().getFoldColor ()));
216
+ divider .setBackground (new ColorDrawable (editorTheme .getGutterStyle ().getFoldColor ()));
215
217
216
- btnCopy .setOnClickListener (new View .OnClickListener () {
217
- @ Override
218
- public void onClick (View v ) {
219
- if (delegate != null ) {
220
- delegate .onCopyCodeButtonClicked (v , code );
221
- }
218
+ btnCopy .setOnClickListener (v -> {
219
+ if (delegate != null ) {
220
+ delegate .onCopyCodeButtonClicked (v , code );
222
221
}
223
222
});
224
223
224
+ // for testing
225
+ btnCopy .setTag ("Copy button " + copyButtonCounter );
226
+ copyButtonCounter ++;
227
+
225
228
} else {
226
229
btnCopy .setVisibility (View .GONE );
227
230
divider .setVisibility (View .GONE );
0 commit comments