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

…lines 1–72 unchanged (72 lines)
73 lastFileCount = requiredCount
74 }
75
76 val dimensions = getDimensions(row)
77
78 for (i in row.files.indices) {
79 adjustFile(i, row.files[i], dimensions[i], row)
80 }
81 }
82
83 fun updateRowVisuals() = bind(currentRow)
84
85 private fun getRowLayout(file: OCFile): FrameLayout {
…lines 86–202 unchanged (117 lines)

After

…lines 1–72 unchanged (72 lines)
73 lastFileCount = requiredCount
74 }
75
76 val dimensions = getDimensions(row)
77
78 for (i in row.files.indices) {
79 val dim = dimensions.getOrNull(i) ?: (defaultThumbnailSize.toInt() to defaultThumbnailSize.toInt())
80 adjustFile(i, row.files[i], dim, row)
81 }
82 }
83
84 fun updateRowVisuals() = bind(currentRow)
85
86 private fun getRowLayout(file: OCFile): FrameLayout {
…lines 87–203 unchanged (117 lines)

Before

source_file
block_comment "/*\n * Nextcloud - Android Client\n *\n * SPDX-FileCopyrightTex"...
package_header
package "package"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "ui"
. "."
identifier "adapter"
import
import "import"
qualified_identifier
identifier "android"
. "."
identifier "view"
. "."
identifier "Gravity"
import
import "import"
qualified_identifier
identifier "android"
. "."
identifier "view"
. "."
identifier "View"
import
import "import"
qualified_identifier
identifier "android"
. "."
identifier "widget"
. "."
identifier "FrameLayout"
import
import "import"
qualified_identifier
identifier "android"
. "."
identifier "widget"
. "."
identifier "ImageView"
import
import "import"
qualified_identifier
identifier "androidx"
. "."
identifier "core"
. "."
identifier "content"
. "."
identifier "ContextCompat"
import
import "import"
qualified_identifier
identifier "androidx"
. "."
identifier "core"
. "."
identifier "view"
. "."
identifier "get"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "afollestad"
. "."
identifier "sectionedrecyclerview"
. "."
identifier "SectionedViewHolder"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "elyeproj"
. "."
identifier "loaderviewlibrary"
. "."
identifier "LoaderImageView"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "android"
. "."
identifier "common"
. "."
identifier "ui"
. "."
identifier "theme"
. "."
identifier "utils"
. "."
identifier "ColorRole"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "utils"
. "."
identifier "OCFileUtils"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "utils"
. "."
identifier "extensions"
. "."
identifier "makeRounded"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "utils"
. "."
identifier "extensions"
. "."
identifier "setVisibleIf"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "R"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "databinding"
. "."
identifier "GalleryRowBinding"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "datamodel"
. "."
identifier "FileDataStorageManager"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "datamodel"
. "."
identifier "GalleryRow"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "datamodel"
. "."
identifier "OCFile"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "utils"
. "."
identifier "theme"
. "."
identifier "ViewThemeUtils"
class_declaration
modifiers
annotation
@ "@"
constructor_invocation
user_type
identifier "Suppress"
value_arguments
( "("
value_argument
string_literal
" "\""
string_content "LongParameterList"
" "\""
) ")"
class "class"
identifier "GalleryRowHolder"
primary_constructor (+53 nodes collapsed)
: ":"
delegation_specifiers
delegation_specifier
constructor_invocation
user_type
identifier "SectionedViewHolder"
value_arguments
( "("
value_argument
navigation_expression
identifier "binding"
. "."
identifier "root"
) ")"
class_body
{ "{"
property_declaration
val "val"
variable_declaration
identifier "context"
= "="
navigation_expression
identifier "galleryAdapter"
. "."
identifier "context"
property_declaration
modifiers
visibility_modifier
private "private"
member_modifier
lateinit "lateinit"
var "var"
variable_declaration
identifier "currentRow"
: ":"
user_type
identifier "GalleryRow"
line_comment "// Cached values"
property_declaration (+34 nodes collapsed)
property_declaration (+34 nodes collapsed)
property_declaration (+34 nodes collapsed)
property_declaration (+34 nodes collapsed)
property_declaration (+34 nodes collapsed)
property_declaration (+64 nodes collapsed)
property_declaration (+34 nodes collapsed)
property_declaration
modifiers
visibility_modifier
private "private"
var "var"
variable_declaration
identifier "lastFileCount"
= "="
unary_expression
- "-"
number_literal "1"
line_comment "// endregion"
function_declaration
fun "fun"
identifier "bind"
function_value_parameters
( "("
parameter
identifier "row"
: ":"
user_type
identifier "GalleryRow"
) ")"
function_body
block
{ "{"
assignment
identifier "currentRow"
= "="
identifier "row"
property_declaration
val "val"
variable_declaration
identifier "requiredCount"
= "="
navigation_expression
navigation_expression
identifier "row"
. "."
identifier "files"
. "."
identifier "size"
line_comment "// Only rebuild if file count changed"
if_expression (+61 nodes collapsed)
property_declaration
val "val"
variable_declaration
identifier "dimensions"
= "="
call_expression
identifier "getDimensions"
value_arguments
( "("
value_argument
identifier "row"
) ")"
for_statement
for "for"
( "("
variable_declaration
identifier "i"
in "in"
navigation_expression
navigation_expression
identifier "row"
. "."
identifier "files"
. "."
identifier "indices"
) ")"
block
{ "{"
call_expression
identifier "adjustFile"
value_arguments
( "("
value_argument
identifier "i"
, ","
value_argument
index_expression
navigation_expression
identifier "row"
. "."
identifier "files"
[ "["
identifier "i"
] "]"
, ","
value_argument
index_expression
identifier "dimensions"
[ "["
identifier "i"
] "]"
, ","
value_argument
identifier "row"
) ")"
} "}"
} "}"
function_declaration
fun "fun"
identifier "updateRowVisuals"
function_value_parameters
( "("
) ")"
function_body
= "="
call_expression
identifier "bind"
value_arguments
( "("
value_argument
identifier "currentRow"
) ")"
function_declaration (+313 nodes collapsed)
function_declaration (+352 nodes collapsed)
function_declaration (+270 nodes collapsed)
function_declaration (+90 nodes collapsed)
function_declaration (+124 nodes collapsed)
} "}"

After

source_file
block_comment "/*\n * Nextcloud - Android Client\n *\n * SPDX-FileCopyrightTex"...
package_header
package "package"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "ui"
. "."
identifier "adapter"
import
import "import"
qualified_identifier
identifier "android"
. "."
identifier "view"
. "."
identifier "Gravity"
import
import "import"
qualified_identifier
identifier "android"
. "."
identifier "view"
. "."
identifier "View"
import
import "import"
qualified_identifier
identifier "android"
. "."
identifier "widget"
. "."
identifier "FrameLayout"
import
import "import"
qualified_identifier
identifier "android"
. "."
identifier "widget"
. "."
identifier "ImageView"
import
import "import"
qualified_identifier
identifier "androidx"
. "."
identifier "core"
. "."
identifier "content"
. "."
identifier "ContextCompat"
import
import "import"
qualified_identifier
identifier "androidx"
. "."
identifier "core"
. "."
identifier "view"
. "."
identifier "get"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "afollestad"
. "."
identifier "sectionedrecyclerview"
. "."
identifier "SectionedViewHolder"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "elyeproj"
. "."
identifier "loaderviewlibrary"
. "."
identifier "LoaderImageView"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "android"
. "."
identifier "common"
. "."
identifier "ui"
. "."
identifier "theme"
. "."
identifier "utils"
. "."
identifier "ColorRole"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "utils"
. "."
identifier "OCFileUtils"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "utils"
. "."
identifier "extensions"
. "."
identifier "makeRounded"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "utils"
. "."
identifier "extensions"
. "."
identifier "setVisibleIf"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "R"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "databinding"
. "."
identifier "GalleryRowBinding"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "datamodel"
. "."
identifier "FileDataStorageManager"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "datamodel"
. "."
identifier "GalleryRow"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "datamodel"
. "."
identifier "OCFile"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "utils"
. "."
identifier "theme"
. "."
identifier "ViewThemeUtils"
class_declaration
modifiers
annotation
@ "@"
constructor_invocation
user_type
identifier "Suppress"
value_arguments
( "("
value_argument
string_literal
" "\""
string_content "LongParameterList"
" "\""
) ")"
class "class"
identifier "GalleryRowHolder"
primary_constructor (+53 nodes collapsed)
: ":"
delegation_specifiers
delegation_specifier
constructor_invocation
user_type
identifier "SectionedViewHolder"
value_arguments
( "("
value_argument
navigation_expression
identifier "binding"
. "."
identifier "root"
) ")"
class_body
{ "{"
property_declaration
val "val"
variable_declaration
identifier "context"
= "="
navigation_expression
identifier "galleryAdapter"
. "."
identifier "context"
property_declaration
modifiers
visibility_modifier
private "private"
member_modifier
lateinit "lateinit"
var "var"
variable_declaration
identifier "currentRow"
: ":"
user_type
identifier "GalleryRow"
line_comment "// Cached values"
property_declaration (+34 nodes collapsed)
property_declaration (+34 nodes collapsed)
property_declaration (+34 nodes collapsed)
property_declaration (+34 nodes collapsed)
property_declaration (+34 nodes collapsed)
property_declaration (+64 nodes collapsed)
property_declaration (+34 nodes collapsed)
property_declaration
modifiers
visibility_modifier
private "private"
var "var"
variable_declaration
identifier "lastFileCount"
= "="
unary_expression
- "-"
number_literal "1"
line_comment "// endregion"
function_declaration
fun "fun"
identifier "bind"
function_value_parameters
( "("
parameter
identifier "row"
: ":"
user_type
identifier "GalleryRow"
) ")"
function_body
block
{ "{"
assignment
identifier "currentRow"
= "="
identifier "row"
property_declaration
val "val"
variable_declaration
identifier "requiredCount"
= "="
navigation_expression
navigation_expression
identifier "row"
. "."
identifier "files"
. "."
identifier "size"
line_comment "// Only rebuild if file count changed"
if_expression (+61 nodes collapsed)
property_declaration
val "val"
variable_declaration
identifier "dimensions"
= "="
call_expression
identifier "getDimensions"
value_arguments
( "("
value_argument
identifier "row"
) ")"
for_statement
for "for"
( "("
variable_declaration
identifier "i"
in "in"
navigation_expression
navigation_expression
identifier "row"
. "."
identifier "files"
. "."
identifier "indices"
) ")"
block
{ "{"
property_declaration
val "val"
variable_declaration
identifier "dim"
= "="
binary_expression
call_expression
navigation_expression
identifier "dimensions"
. "."
identifier "getOrNull"
value_arguments
( "("
value_argument
identifier "i"
) ")"
?: "?:"
parenthesized_expression
( "("
infix_expression
call_expression
navigation_expression
identifier "defaultThumbnailSize"
. "."
identifier "toInt"
value_arguments
( "("
) ")"
identifier "to"
call_expression
navigation_expression
identifier "defaultThumbnailSize"
. "."
identifier "toInt"
value_arguments
( "("
) ")"
) ")"
call_expression
identifier "adjustFile"
value_arguments
( "("
value_argument
identifier "i"
, ","
value_argument
index_expression
navigation_expression
identifier "row"
. "."
identifier "files"
[ "["
identifier "i"
] "]"
, ","
value_argument
identifier "dim"
, ","
value_argument
identifier "row"
) ")"
} "}"
} "}"
function_declaration
fun "fun"
identifier "updateRowVisuals"
function_value_parameters
( "("
) ")"
function_body
= "="
call_expression
identifier "bind"
value_arguments
( "("
value_argument
identifier "currentRow"
) ")"
function_declaration (+313 nodes collapsed)
function_declaration (+352 nodes collapsed)
function_declaration (+270 nodes collapsed)
function_declaration (+90 nodes collapsed)
function_declaration (+124 nodes collapsed)
} "}"