Skip to content

xiaocydx/InputView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a3c2ca7 · Mar 17, 2025
Mar 17, 2025
Jan 10, 2025
Jun 28, 2024
Jul 1, 2024
Jan 10, 2025
Jan 10, 2025
Jun 28, 2024
Jan 10, 2023
Jan 10, 2025
Jul 1, 2024
Jun 28, 2024
Jan 8, 2023
Jun 28, 2024
Jun 28, 2024
Jul 5, 2024
Jun 28, 2024
Jun 28, 2024
Jul 24, 2024

Repository files navigation

InputView是一个通用的输入控件

  • 支持Activity和Dialog。
  • 调整IME高度后运行动画。
  • 可自定义编辑器的切换动画。
  • 可自定义编辑器的View或Fragment。
  • 实现Edge-to-Edge并提供相关的扩展函数。
  • 解决EditText水滴状指示器导致动画卡顿的问题。
  • 修改Android 11及以上IME动画的时长和插值器。

IME的全称是Input Method Editors(输入法编辑器),因此将IME和底部视图统一称为Editor(编辑器)。

InputView - 使用文档

InputView - transform

InputView - 常见问题

  1. 在根目录的settings.gradle添加
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}
  1. 在module的build.gradle添加
dependencies {
    // 修改IME动画的属性、调用FLAG_FULLSCREEN的兼容方案,需要依赖inputview-compat
    def version = "1.3.6"
    implementation "com.github.xiaocydx.InputView:inputview:${version}"
    implementation "com.github.xiaocydx.InputView:inputview-compat:${version}"
    implementation "com.github.xiaocydx.InputView:inputview-transform:${version}"
}

 

切换编辑器和调整IME高度

InputView-Animation.mp4

 

手势导航栏Edge-to-Edge

当前是手势导航栏时,对Emoji编辑器添加paddingBottom和增加高度,滚动时内容绘制在paddingBottom区域,滚动到底部时留出paddingBottom区域,内容不会被手势导航栏遮挡。

InputView-Edge-to-Edge.mp4

 

复杂的切换场景

InputView可用于编辑类页面的复杂切换。

InputView-FigureEdit.mp4