Skip to content

Commit e1c3fff

Browse files
committed
Fix incorrect vertical position of scroll to bottom button
1 parent 2eae616 commit e1c3fff

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

app/src/main/java/org/thunderdog/challegram/component/chat/ChatBottomBarView.java

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,12 +253,25 @@ protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec) {
253253
public void setCollapseFactor (float collapseFactor) {
254254
if (this.collapseFactor != collapseFactor) {
255255
this.collapseFactor = collapseFactor;
256-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
257-
invalidateOutline();
258-
}
259-
drawable.invalidateSelf();
260-
invalidate();
256+
update();
257+
}
258+
}
259+
260+
@Override
261+
public void setPadding (int left, int top, int right, int bottom) {
262+
boolean bottomUpdated = bottom != getPaddingBottom();
263+
super.setPadding(left, top, right, bottom);
264+
if (bottomUpdated) {
265+
update();
266+
}
267+
}
268+
269+
public void update () {
270+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
271+
invalidateOutline();
261272
}
273+
drawable.invalidateSelf();
274+
invalidate();
262275
}
263276

264277
@Override

app/src/main/java/org/thunderdog/challegram/ui/MessagesController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ protected void onBottomInsetChanged (int extraBottomInset, int extraBottomInsetW
605605
);
606606
Views.setLayoutHeight(bottomBar, Screen.dp(48f) + extraBottomInsetWithoutIme);
607607
Views.setPaddingBottom(bottomBar, extraBottomInsetWithoutIme);
608-
updateBottomBarStyle();
608+
checkScrollButtonOffsets();
609609
updateMessagesViewInset();
610610
onMessagesFrameChanged();
611611
}
@@ -1413,7 +1413,7 @@ protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec) {
14131413
bottomBar.setOnClickListener(this);
14141414
bottomBar.setLayoutParams(params);
14151415
addThemeInvalidateListener(bottomBar);
1416-
updateBottomBarStyle();
1416+
checkScrollButtonOffsets();
14171417
updateMessagesViewInset();
14181418

14191419
if (previewMode == PREVIEW_MODE_WALLPAPER_OBJECT) {

0 commit comments

Comments
 (0)