From 6d60485184667edc9d18df8ba8239bf2fc77cfa2 Mon Sep 17 00:00:00 2001 From: dic1911 Date: Wed, 9 Oct 2024 14:06:50 +0800 Subject: [PATCH] fix: download button displayed in wrong condition --- .../src/main/java/org/telegram/ui/DialogsActivity.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java index f1a7b7e44..0746ad609 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java @@ -3387,7 +3387,6 @@ public boolean canToggleSearch() { actionBar.setSupportsHolidayImage(true); } } - Log.d("030-tabs", String.format("createView - hide: %s, type: %d", forceHideTabs, initialDialogsType)); if (!forceHideTabs && (!onlySelect || initialDialogsType == DIALOGS_TYPE_FORWARD || (folderId == 0 && NekoConfig.showTabsOnForward.Bool()))) { actionBar.setAddToContainer(false); actionBar.setCastShadows(false); @@ -5429,6 +5428,7 @@ public void openAnimationFinished(boolean backward) { } updateDrawerSwipeEnabled(); updateFilterTabs(false, true); + if (!hasFragment()) updateProxyButton(false, true); } @Override @@ -10109,7 +10109,7 @@ private void updateProxyButton(boolean animated, boolean force) { if (proxyDrawable == null || doneItem != null && doneItem.getVisibility() == View.VISIBLE) { return; } - boolean showDownloads = downloadsItemVisible = NekoConfig.alwaysShowDownloads.Bool(); + boolean showDownloads = downloadsItemVisible = NekoConfig.alwaysShowDownloads.Bool() && !slidingTopicListOpened(); for (int i = 0; i < getDownloadController().downloadingFiles.size() && !showDownloads; i++) { if (getFileLoader().isLoadingFile(getDownloadController().downloadingFiles.get(i).getFileName())) { showDownloads = true; @@ -10202,7 +10202,7 @@ public void onAnimationEnd(Animator animation) { if (passcodeItem != null && passcodeItemVisible) { passcodeItem.setVisibility(View.INVISIBLE); } - if (downloadsItem != null && downloadsItemVisible && !NekoConfig.alwaysShowDownloads.Bool()) { + if (downloadsItem != null && downloadsItemVisible) { downloadsItem.setVisibility(View.INVISIBLE); } } else { @@ -13133,4 +13133,8 @@ public void onLongClickRelease() { searchViewPager.setFilteredSearchViewDelegate((showMediaFilters, users, dates, archive) -> DialogsActivity.this.updateFiltersView(showMediaFilters, users, dates, archive, true)); searchViewPager.setVisibility(View.GONE); } + + private boolean slidingTopicListOpened() { + return rightSlidingDialogContainer != null && rightSlidingDialogContainer.hasFragment() && rightSlidingDialogContainer.isOpenned; + } } \ No newline at end of file