Skip to content
This repository has been archived by the owner on Feb 20, 2021. It is now read-only.

Fixes layer not closing fully on keyboard close. #57

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion Library/src/com/slidinglayer/SlidingLayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,20 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
// Make sure scroll position is set correctly.
if (w != oldw) {
boolean fix;
switch (mScreenSide) {
case STICK_TO_LEFT:
case STICK_TO_RIGHT:
fix = w != oldw;
break;
case STICK_TO_TOP:
case STICK_TO_BOTTOM:
fix = h != oldh;
break;
default:
fix = (w != oldw) || (h != oldh);
}
if (fix) {
completeScroll();
int[] pos = getDestScrollPos();
scrollTo(pos[0], pos[1]);
Expand Down