1
0
mirror of https://github.com/NekoX-Dev/NekoX.git synced 2024-12-03 15:10:28 +01:00

Fix cannot scroll

This commit is contained in:
Riko Sakurauchi 2020-04-10 22:47:50 +08:00 committed by NekoInverter
parent 8e94ff4b5b
commit 61873b532e
No known key found for this signature in database
GPG Key ID: 280D6CCCF95715F9

View File

@ -519,13 +519,13 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
if (filterTabsView != null && filterTabsView.getVisibility() == VISIBLE) {
h = heightSize - inputFieldHeight + AndroidUtilities.dp(2) - AndroidUtilities.dp(44) - topPadding;
} else {
h = heightSize - inputFieldHeight + AndroidUtilities.dp(2) - (onlySelect ? 0 : actionBar.getMeasuredHeight()) - topPadding;
h = heightSize - inputFieldHeight + AndroidUtilities.dp(2) - ((onlySelect && !(initialDialogsType == 3 && NekoConfig.showTabsOnForward)) ? 0 : actionBar.getMeasuredHeight()) - topPadding;
}
child.measure(contentWidthSpec, View.MeasureSpec.makeMeasureSpec(Math.max(AndroidUtilities.dp(10), h), View.MeasureSpec.EXACTLY));
child.setPivotX(child.getMeasuredWidth() / 2);
} else if (child == searchListView || child == searchEmptyView) {
int contentWidthSpec = View.MeasureSpec.makeMeasureSpec(widthSize, View.MeasureSpec.EXACTLY);
int contentHeightSpec = View.MeasureSpec.makeMeasureSpec(Math.max(AndroidUtilities.dp(10), heightSize - inputFieldHeight + AndroidUtilities.dp(2) - (onlySelect ? 0 : actionBar.getMeasuredHeight()) - topPadding), View.MeasureSpec.EXACTLY);
int contentHeightSpec = View.MeasureSpec.makeMeasureSpec(Math.max(AndroidUtilities.dp(10), heightSize - inputFieldHeight + AndroidUtilities.dp(2) - (onlySelect && !(initialDialogsType == 3 && NekoConfig.showTabsOnForward) ? 0 : actionBar.getMeasuredHeight()) - topPadding), View.MeasureSpec.EXACTLY);
child.measure(contentWidthSpec, contentHeightSpec);
child.setPivotX(child.getMeasuredWidth() / 2);
} else if (commentView != null && commentView.isPopupView(child)) {
@ -1525,16 +1525,16 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
AndroidUtilities.runOnUIThread(() -> Theme.createChatResources(context, false));
ActionBarMenu menu = actionBar.createMenu();
doneItem = new ActionBarMenuItem(context, null, Theme.getColor(Theme.key_actionBarDefaultSelector), Theme.getColor(Theme.key_actionBarDefaultIcon), true);
doneItem.setText(LocaleController.getString("Done", R.string.Done).toUpperCase());
actionBar.addView(doneItem, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.TOP | Gravity.RIGHT, 0, 0, 10, 0));
doneItem.setOnClickListener(v -> {
filterTabsView.setIsEditing(false);
showDoneItem(false);
});
doneItem.setAlpha(0.0f);
doneItem.setVisibility(View.GONE);
if (!onlySelect && searchString == null && folderId == 0) {
doneItem = new ActionBarMenuItem(context, null, Theme.getColor(Theme.key_actionBarDefaultSelector), Theme.getColor(Theme.key_actionBarDefaultIcon), true);
doneItem.setText(LocaleController.getString("Done", R.string.Done).toUpperCase());
actionBar.addView(doneItem, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.TOP | Gravity.RIGHT, 0, 0, 10, 0));
doneItem.setOnClickListener(v -> {
filterTabsView.setIsEditing(false);
showDoneItem(false);
});
doneItem.setAlpha(0.0f);
doneItem.setVisibility(View.GONE);
proxyDrawable = new ProxyDrawable(context);
proxyItem = menu.addItem(2, proxyDrawable);
proxyItem.setContentDescription(LocaleController.getString("ProxySettings", R.string.ProxySettings));