diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d67d9e..346648d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log --- +### Version 1.4.6 (2016-04-26) + +- 新增 支持`Translucent Status`主题,具体适配可以直接看Demo,适配接口依然非常简单。 Closes #27 。 +- 新增 开放配置 `是否需要让面板高度保持和键盘高度一致` 的接口: `setIgnoreRecommendHeight(boolean)`; 以及对应布局属性配置项 `cn.dreamtobe.kpswitch.R.styleable#KPSwitchPanelLayout_ignore_recommend_height`。Closes #25 。 + ### Version 1.4.5 (2016-04-21) - 修复页面是继承自`Activity`或`FragmentActivity`的情况下,由于计算键盘是否显示出现错误,导致存在闪动的bug。Closes #24 。 diff --git a/FULLSCREEN_TUTORIAL.md b/FULLSCREEN_TUTORIAL.md index ada7f6c..458dc03 100644 --- a/FULLSCREEN_TUTORIAL.md +++ b/FULLSCREEN_TUTORIAL.md @@ -1,6 +1,8 @@ -# 全屏主题情况下使用引导 +# 全屏主题 或者 透明状态栏主题并且在`fitsSystemWindows=false` 情况下使用引导 -> 所谓全屏主题,就是 `(activity.getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0` +> 这个引导覆盖以下两个Case: +> 1. 全屏主题 (`(activity.getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0`) +> 2. 透明状态栏主题(`(activity.getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS) != 0`) 并且 根布局的 `fitsSystemWindows=false`。 ![][fullscreen_resolved_gif] @@ -12,8 +14,6 @@ ## II. 需要处理页面的layout xml -> 可直接参照: [activity_chatting_fullscreen_resolved.xml][activity_chatting_fullscreen_resolved_xml_link] - > 这边只需要用到一个 **面板布局** ([KPSwitchFSPanelFrameLayout][KPSwitchFSPanelFrameLayout_link]/[KPSwitchFSPanelLinearLayout][KPSwitchFSPanelLinearLayout_link]/[KPSwitchFSPanelRelativeLayout][KPSwitchFSPanelRelativeLayout_link]) ``` @@ -36,7 +36,7 @@ ## III. 需要处理页面的Activity: -> 可直接参照: [ChattingResolvedFullScreenActivity.java][ChattingResolvedFullScreenActivity_link] +> 可直接参照: [ChattingResolvedHandleByPlaceholderActivity.java][ChattingResolvedHandleByPlaceholderActivity_link] 1. 主要是处理一些事件([KPSwitchConflictUtil][KPSwitchConflictUtil_link]) 2. 键盘状态(高度与显示与否)监听([KeyboardUtil#attach()][KeyboardUtil_attach_link]) @@ -112,12 +112,11 @@ public boolean dispatchKeyEvent(KeyEvent event){ [fullscreen_resolved_gif]: https://raw.githubusercontent.com/Jacksgong/JKeybordPanelSwitch/master/art/fullscreen_resolved.gif -[AndroidManifest_xml_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/app/src/main/AndroidManifest.xml -[activity_chatting_fullscreen_resolved_xml_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/app/src/main/res/layout/activity_chatting_fullscreen_resolved.xml +[AndroidManifest_xml_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/app/src/main/AndroidManifest.xml#L25 [KPSwitchFSPanelFrameLayout_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/widget/KPSwitchFSPanelFrameLayout.java [KPSwitchFSPanelLinearLayout_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/widget/KPSwitchFSPanelLinearLayout.java [KPSwitchFSPanelRelativeLayout_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/widget/KPSwitchFSPanelRelativeLayout.java -[ChattingResolvedFullScreenActivity_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/app/src/main/java/cn/dreamtobe/kpswitch/demo/activity/ChattingResolvedFullScreenActivity.java +[ChattingResolvedHandleByPlaceholderActivity_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/app/src/main/java/cn/dreamtobe/kpswitch/demo/activity/ChattingResolvedHandleByPlaceholderActivity.java [KPSwitchConflictUtil_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/util/KPSwitchConflictUtil.java -[KeyboardUtil_attach_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/util/KeyboardUtil.java#L146 -[IFSPanelConflictLayout_recordKeyboardStatus_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/IFSPanelConflictLayout.java#L22 +[KeyboardUtil_attach_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/util/KeyboardUtil.java#L134 +[IFSPanelConflictLayout_recordKeyboardStatus_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/IFSPanelConflictLayout.java#L37 diff --git a/NON-FULLSCREEN_TUTORIAL.md b/NON-FULLSCREEN_TUTORIAL.md index caa5ace..d429ab1 100644 --- a/NON-FULLSCREEN_TUTORIAL.md +++ b/NON-FULLSCREEN_TUTORIAL.md @@ -1,6 +1,8 @@ -# 非全屏主题情况下使用引导 +# 非全屏主题 或者 透明状态栏主题并且在`fitsSystemWindows=true` 情况下使用引导 -> 所谓非全屏主题,就是 `(activity.getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) == 0` +> 这个引导覆盖以下两个Case: +> 1. 非全屏主题 (`(activity.getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) == 0`) 。 +> 2. 透明状态栏主题(`(activity.getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS) != 0`) 并且 根布局的 `fitsSystemWindows=true`。 ![][non-fullscreen_resolved_gif] @@ -138,4 +140,4 @@ public boolean dispatchKeyEvent(KeyEvent event){ [KPSwitchRootLinearLayout_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/widget/KPSwitchRootLinearLayout.java [ChattingResolvedActivity_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/app/src/main/java/cn/dreamtobe/kpswitch/demo/activity/ChattingResolvedActivity.java [KPSwitchConflictUtil_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/util/KPSwitchConflictUtil.java -[KeyboardUtil_attach_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/util/KeyboardUtil.java#L146 +[KeyboardUtil_attach_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/util/KeyboardUtil.java#L134 diff --git a/README.md b/README.md index e2e43be..d410d35 100644 --- a/README.md +++ b/README.md @@ -31,14 +31,17 @@ 在`build.gradle`中引入: ``` -compile 'cn.dreamtobe.kpswitch:library:1.4.5' +compile 'cn.dreamtobe.kpswitch:library:1.4.6' ``` - ## 使用引导 -- [非全屏主题情况下使用引导](https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/NON-FULLSCREEN_TUTORIAL.md) -- [全屏主题情况下使用引导](https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/FULLSCREEN_TUTORIAL.md) +> 可以考虑`clone`下来跑下项目中的`demo`,已经用尽量简洁的代码尽量覆盖所有Case了。 + +![](https://raw.githubusercontent.com/Jacksgong/JKeybordPanelSwitch/master/art/demo_snapshot.jpg) + +- [非全屏主题 或者 透明状态栏主题并且在`fitsSystemWindows=true` 情况下使用引导](https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/NON-FULLSCREEN_TUTORIAL.md) +- [全屏主题 或者 透明状态栏主题并且在 `fitsSystemWindows=false` 情况下使用引导](https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/FULLSCREEN_TUTORIAL.md) ## 基本原理 @@ -71,8 +74,8 @@ limitations under the License. [adjust_unresolved_gif]: https://raw.githubusercontent.com/Jacksgong/JKeybordPanelSwitch/master/art/adjust_unresolved.gif [build_status_svg]: https://travis-ci.org/Jacksgong/JKeyboardPanelSwitch.svg?branch=master [build_status_link]: https://travis-ci.org/Jacksgong/JKeyboardPanelSwitch -[KeyboardUtil_calculateKeyboardHeight_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/util/KeyboardUtil.java#L196 -[KeyboardUtil_calculateKeyboardShowing_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/util/KeyboardUtil.java#L247 +[KeyboardUtil_calculateKeyboardHeight_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/util/KeyboardUtil.java#L214 +[KeyboardUtil_calculateKeyboardShowing_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/util/KeyboardUtil.java#L266 [KPSwitchRootLayoutHandler_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/handler/KPSwitchRootLayoutHandler.java [KPSwitchPanelLayoutHandler_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/handler/KPSwitchPanelLayoutHandler.java [KPSwitchFSPanelLayoutHandler_link]: https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/master/library/src/main/java/cn/dreamtobe/kpswitch/handler/KPSwitchFSPanelLayoutHandler.java diff --git a/gradle.properties b/gradle.properties index 24478e1..8b0d61f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -VERSION_NAME=1.4.5 -VERSION_CODE=12 +VERSION_NAME=1.4.6 +VERSION_CODE=13 BUILD_TOOLS_VERSION=23.0.1 COMPILE_SDK_VERSION=23