Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

1package com.genymobile.scrcpy.util;
2
3public interface Codec {
4
5 enum Type {
6 VIDEO,
7 AUDIO,
8 }
9
10 Type getType();
11
12 int getId();
13
14 String getName();
15
16 String getMimeType();
17}
18

After

1package com.genymobile.scrcpy.util;
2
3import android.media.MediaCodec;
4
5public interface Codec {
6
7 enum Type {
8 VIDEO,
9 AUDIO,
…lines 10–13 unchanged (4 lines)
14 int getId();
15
16 String getName();
17
18 String getMimeType();
19
20 static String getMimeType(MediaCodec codec) {
21 String[] types = codec.getCodecInfo().getSupportedTypes();
22 return types.length > 0 ? types[0] : null;
23 }
24}
25

Before

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "genymobile"
. "."
identifier "scrcpy"
. "."
identifier "util"
; ";"
interface_declaration
modifiers
public "public"
interface "interface"
identifier "Codec"
interface_body
{ "{"
enum_declaration
enum "enum"
identifier "Type"
enum_body
{ "{"
enum_constant
identifier "VIDEO"
, ","
enum_constant
identifier "AUDIO"
, ","
} "}"
method_declaration
type_identifier "Type"
identifier "getType"
formal_parameters
( "("
) ")"
; ";"
method_declaration
integral_type
int "int"
identifier "getId"
formal_parameters
( "("
) ")"
; ";"
method_declaration
type_identifier "String"
identifier "getName"
formal_parameters
( "("
) ")"
; ";"
method_declaration
type_identifier "String"
identifier "getMimeType"
formal_parameters
( "("
) ")"
; ";"
} "}"

After

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "genymobile"
. "."
identifier "scrcpy"
. "."
identifier "util"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "media"
. "."
identifier "MediaCodec"
; ";"
interface_declaration
modifiers
public "public"
interface "interface"
identifier "Codec"
interface_body
{ "{"
enum_declaration
enum "enum"
identifier "Type"
enum_body
{ "{"
enum_constant
identifier "VIDEO"
, ","
enum_constant
identifier "AUDIO"
, ","
} "}"
method_declaration
type_identifier "Type"
identifier "getType"
formal_parameters
( "("
) ")"
; ";"
method_declaration
integral_type
int "int"
identifier "getId"
formal_parameters
( "("
) ")"
; ";"
method_declaration
type_identifier "String"
identifier "getName"
formal_parameters
( "("
) ")"
; ";"
method_declaration
type_identifier "String"
identifier "getMimeType"
formal_parameters
( "("
) ")"
; ";"
method_declaration
modifiers
static "static"
type_identifier "String"
identifier "getMimeType"
formal_parameters
( "("
formal_parameter
type_identifier "MediaCodec"
identifier "codec"
) ")"
block
{ "{"
local_variable_declaration
array_type
type_identifier "String"
dimensions
[ "["
] "]"
variable_declarator
identifier "types"
= "="
method_invocation
method_invocation
identifier "codec"
. "."
identifier "getCodecInfo"
argument_list
( "("
) ")"
. "."
identifier "getSupportedTypes"
argument_list
( "("
) ")"
; ";"
return_statement
return "return"
ternary_expression
binary_expression
field_access
identifier "types"
. "."
identifier "length"
> ">"
decimal_integer_literal "0"
? "?"
array_access
identifier "types"
[ "["
decimal_integer_literal "0"
] "]"
: ":"
null_literal "null"
; ";"
} "}"
} "}"