Skip to content

Commit

Permalink
Add editorconfig and apply format
Browse files Browse the repository at this point in the history
  • Loading branch information
r-ralph committed May 10, 2021
1 parent baf318a commit 08f4cc3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
26 changes: 26 additions & 0 deletions .editorconfig
@@ -0,0 +1,26 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 100
tab_width = 4
trim_trailing_whitespace = true
ij_continuation_indent_size = 8
ij_smart_tabs = false

[{*.kt, *.kts}]
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
continuation_indent_size = 4
ij_continuation_indent_size = 4
ij_kotlin_name_count_to_use_star_import = 2147483647
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
disabled_rules = import-ordering

[{*.yml, *.yaml}]
indent_size = 2
ij_yaml_keep_indents_on_empty_lines = false
ij_yaml_keep_line_breaks = true
Expand Up @@ -291,11 +291,11 @@ class ApngDrawable @VisibleForTesting internal constructor(
require(frameIndex >= 0) { "frameIndex must be positive value" }
require(loopIndex < loopCount) {
"loopIndex must be less than loopCount." +
" loopIndex = $loopIndex, loopCount = $loopCount."
" loopIndex = $loopIndex, loopCount = $loopCount."
}
require(frameIndex < frameCount) {
"frameIndex must be less than frameCount." +
" frameIndex = $frameIndex, frameCount = $frameCount."
" frameIndex = $frameIndex, frameCount = $frameCount."
}
seekTo(loopIndex * durationMillis.toLong() + frameStartTimes[frameIndex])
}
Expand Down Expand Up @@ -383,7 +383,7 @@ class ApngDrawable @VisibleForTesting internal constructor(
return when {
// Continue searching in the upper half
frameStartTimes.size > middleIndex + 1 &&
progressMillisInCurrentLoop >= frameStartTimes[middleIndex + 1] ->
progressMillisInCurrentLoop >= frameStartTimes[middleIndex + 1] ->
calculateCurrentFrameIndex(
middleIndex + 1,
upperBoundIndex,
Expand All @@ -392,7 +392,7 @@ class ApngDrawable @VisibleForTesting internal constructor(

// Continue searching in the lower half
lowerBoundIndex != upperBoundIndex &&
progressMillisInCurrentLoop < frameStartTimes[middleIndex] ->
progressMillisInCurrentLoop < frameStartTimes[middleIndex] ->
calculateCurrentFrameIndex(
lowerBoundIndex,
middleIndex,
Expand Down
Expand Up @@ -59,8 +59,8 @@ class MainActivity : AppCompatActivity() {
val loopCount = drawable.loopCount
Log.d("apng", "Animation repeat loopCount: $loopCount, nextLoopIndex: $nextLoopIndex")
binding.textCallback.text = "Animation repeat " +
"loopCount: $loopCount, " +
"nextLoopIndex: $nextLoopIndex"
"loopCount: $loopCount, " +
"nextLoopIndex: $nextLoopIndex"
}

override fun onAnimationEnd(drawable: Drawable?) {
Expand Down

0 comments on commit 08f4cc3

Please sign in to comment.