From 033ebbc0af0c366c450f2eb3f10a592b960ded89 Mon Sep 17 00:00:00 2001 From: gitnick Date: Sat, 16 Sep 2023 16:32:07 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E5=A4=8DBaseNodeAdapter=20?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=9F=90=E4=B8=AA=E8=8A=82=E7=82=B9=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E8=B0=83=E7=94=A8expandAndCollapseOther=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E6=8A=A5IndexOutOfBoundsException=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/build.gradle.kts | 30 +++++++++---------- .../library/adapter/base/BaseNodeAdapter.kt | 3 +- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/library/build.gradle.kts b/library/build.gradle.kts index 9a1316494..0b448f578 100644 --- a/library/build.gradle.kts +++ b/library/build.gradle.kts @@ -72,22 +72,22 @@ var ossrhPassword = "" //sonatype密码 val localProperties: File = project.rootProject.file("local.properties") -if (localProperties.exists()) { - println("Found secret props file, loading props") - val properties = Properties() - - InputStreamReader(FileInputStream(localProperties), Charsets.UTF_8).use { reader -> - properties.load(reader) - } - signingKeyId = properties.getProperty("signing.keyId") - signingPassword = properties.getProperty("signing.password") - secretKeyRingFile = properties.getProperty("signing.secretKeyRingFile") - ossrhUsername = properties.getProperty("ossrhUsername") - ossrhPassword = properties.getProperty("ossrhPassword") - -} else { +//if (localProperties.exists()) { +// println("Found secret props file, loading props") +// val properties = Properties() +// +// InputStreamReader(FileInputStream(localProperties), Charsets.UTF_8).use { reader -> +// properties.load(reader) +// } +// signingKeyId = properties.getProperty("signing.keyId") +// signingPassword = properties.getProperty("signing.password") +// secretKeyRingFile = properties.getProperty("signing.secretKeyRingFile") +// ossrhUsername = properties.getProperty("ossrhUsername") +// ossrhPassword = properties.getProperty("ossrhPassword") + +//} else { println("No props file, loading env vars") -} +//} afterEvaluate { diff --git a/library/src/main/java/com/chad/library/adapter/base/BaseNodeAdapter.kt b/library/src/main/java/com/chad/library/adapter/base/BaseNodeAdapter.kt index ecbe23e16..1961b6c1c 100644 --- a/library/src/main/java/com/chad/library/adapter/base/BaseNodeAdapter.kt +++ b/library/src/main/java/com/chad/library/adapter/base/BaseNodeAdapter.kt @@ -605,7 +605,8 @@ abstract class BaseNodeAdapter(nodeList: MutableList? = null) data.size - 1 // 如果没有父节点,则为最外层 } else { val dataSize = data[parentPosition].childNode?.size ?: 0 - parentPosition + dataSize + expandCount // 如果有父节点,则为子节点,父节点 + 子节点数量 + 展开的数量 + parentPosition + dataSize + expandCount -1 + // 如果有父节点,则为子节点,父节点 + 子节点数量 + 展开的数量 } //如果此 position 之后有 node