Skip to content

Commit c47ff22

Browse files
committed
feat: insets升至1.2.5,扩展检查逻辑
1 parent d38821a commit c47ff22

File tree

7 files changed

+89
-2
lines changed

7 files changed

+89
-2
lines changed

buildSrc/src/main/kotlin/Dependencies.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ object CommonLibs {
2424
const val `cxrv-animatable` = "com.github.xiaocydx.CXRV:cxrv-animatable:${cxrvVersion}"
2525
const val `cxrv-viewpager2` = "com.github.xiaocydx.CXRV:cxrv-viewpager2:${cxrvVersion}"
2626

27-
private const val inputViewVersion = "1.2.7"
27+
private const val inputViewVersion = "1.3.1"
2828
const val inputview = "com.github.xiaocydx.InputView:inputview:${inputViewVersion}"
2929
const val `inputview-compat` = "com.github.xiaocydx.InputView:inputview-compat:${inputViewVersion}"
30+
const val `inputview-transform` = "com.github.xiaocydx.InputView:inputview-transform:${inputViewVersion}"
3031

31-
private const val insetsVersion = "1.2.4"
32+
private const val insetsVersion = "1.2.5"
3233
const val insets = "com.github.xiaocydx.Insets:insets:${insetsVersion}"
3334
const val `insets-compat` = "com.github.xiaocydx.Insets:insets-compat:${insetsVersion}"
3435
const val `insets-systembar` = "com.github.xiaocydx.Insets:insets-systembar:${insetsVersion}"

inputview-transform/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ android {
2020

2121
dependencies {
2222
compileOnly(project(":inputview"))
23+
compileOnly(CommonLibs.`insets-systembar`)
2324
implementation(PublishLibs.`androidx-fragment-old`)
2425
implementation(PublishLibs.`androidx-transition`)
2526
testImplementation(PublishLibs.`androidx-appcompat`)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright 2023 xiaocydx
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
@file:Suppress("INVISIBLE_REFERENCE", "CANNOT_OVERRIDE_INVISIBLE_MEMBER", "PackageDirectoryMismatch")
18+
19+
package com.xiaocydx.inputview.transform
20+
21+
import android.view.ViewGroup
22+
import androidx.fragment.app.Fragment
23+
import com.xiaocydx.insets.systembar.SystemBar
24+
import com.xiaocydx.insets.systembar.SystemBarExtensions
25+
import com.xiaocydx.insets.systembar.name
26+
27+
/**
28+
* 扩展[SystemBar]的检查逻辑
29+
*
30+
* @author xcc
31+
* @date 2024/8/22
32+
*/
33+
internal class FragmentContentChecker : SystemBarExtensions {
34+
35+
override fun checkUnsupportedOnResume(fragment: Fragment, parent: ViewGroup) = run {
36+
if (parent !is ContentContainer) return@run null
37+
"""使用${SystemBar.name}的Fragment不支持Overlay
38+
| ${fragment.javaClass.canonicalName ?: ""} : ${SystemBar.name}
39+
""".trimMargin()
40+
}
41+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
com.xiaocydx.inputview.transform.FragmentContentChecker

inputview/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ android {
2020

2121
dependencies {
2222
api(CommonLibs.insets)
23+
compileOnly(CommonLibs.`insets-systembar`)
2324
implementation(PublishLibs.`androidx-fragment-old`)
2425
testImplementation(PublishLibs.`androidx-appcompat`)
2526
testImplementation(PublishLibs.`androidx-viewpager2`)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright 2023 xiaocydx
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
@file:Suppress("INVISIBLE_REFERENCE", "CANNOT_OVERRIDE_INVISIBLE_MEMBER")
18+
19+
package com.xiaocydx.inputview
20+
21+
import android.view.ViewGroup
22+
import androidx.fragment.app.Fragment
23+
import com.xiaocydx.insets.systembar.SystemBar
24+
import com.xiaocydx.insets.systembar.SystemBarExtensions
25+
import com.xiaocydx.insets.systembar.name
26+
27+
/**
28+
* 扩展[SystemBar]的检查逻辑
29+
*
30+
* @author xcc
31+
* @date 2024/8/22
32+
*/
33+
internal class FragmentEditorChecker : SystemBarExtensions {
34+
35+
override fun checkUnsupportedOnResume(fragment: Fragment, parent: ViewGroup) = run {
36+
if (parent !is EditorContainer) return@run null
37+
"""使用${SystemBar.name}的Fragment不支持InputView
38+
| ${fragment.javaClass.canonicalName ?: ""} : ${SystemBar.name}
39+
""".trimMargin()
40+
}
41+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
com.xiaocydx.inputview.FragmentEditorChecker

0 commit comments

Comments
 (0)