Skip to content

Commit

Permalink
feat: Dsiable Archive On Pull
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Jan 15, 2024
1 parent 33226fd commit 615b93a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3775,7 +3775,7 @@ public int scrollVerticallyBy(int dy, RecyclerView.Recycler recycler, RecyclerVi
if (hasStories && !rightSlidingDialogContainer.hasFragment() && !fixScrollYAfterArchiveOpened) {
pTop -= AndroidUtilities.dp(DialogStoriesCell.HEIGHT_IN_DP);
}
boolean hasHidenArchive = !fixScrollYAfterArchiveOpened && viewPage.dialogsType == DIALOGS_TYPE_DEFAULT && !onlySelect && folderId == 0 && getMessagesController().hasHiddenArchive() && viewPage.archivePullViewState == ARCHIVE_ITEM_STATE_HIDDEN;
boolean hasHidenArchive = !fixScrollYAfterArchiveOpened && viewPage.dialogsType == DIALOGS_TYPE_DEFAULT && !onlySelect && folderId == 0 && hasHiddenArchive() && viewPage.archivePullViewState == ARCHIVE_ITEM_STATE_HIDDEN;
if ((hasHidenArchive || (hasStories && !rightSlidingDialogContainer.hasFragment())) && dy < 0) {
viewPage.listView.setOverScrollMode(View.OVER_SCROLL_ALWAYS);
int currentPosition = viewPage.layoutManager.findFirstVisibleItemPosition();
Expand Down Expand Up @@ -8389,6 +8389,13 @@ private void updateStoriesPosting() {
}

private boolean hasHiddenArchive() {
return hasHiddenArchive(false);
}

private boolean hasHiddenArchive(Boolean force) {
if (!force && !NaConfig.INSTANCE.getShowArchiveOnPull().Bool()) {
return false;
}
return !onlySelect && initialDialogsType == DIALOGS_TYPE_DEFAULT && folderId == 0 && getMessagesController().hasHiddenArchive();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public class NekoGeneralSettingsActivity extends BaseNekoXSettingsActivity {

private final AbstractConfigCell headerFolder = cellGroup.appendCell(new ConfigCellHeader(LocaleController.getString("Folder")));
private final AbstractConfigCell hideAllTabRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.hideAllTab, LocaleController.getString("HideAllTabAbout")));
private final AbstractConfigCell showArchiveOnPullRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getShowArchiveOnPull()));
private final AbstractConfigCell openArchiveOnPullRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.openArchiveOnPull));
private final AbstractConfigCell ignoreMutedCountRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.ignoreMutedCount));
private final AbstractConfigCell ignoreFolderCountRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getIgnoreFolderCount()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,12 @@ object NaConfig {
ConfigItem.configTypeBool,
false
)
val showArchiveOnPull =
addConfig(
"ShowArchiveOnPull",
ConfigItem.configTypeBool,
true
)

private fun addConfig(
k: String,
Expand Down
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,5 @@
<string name="HideFilterMuteAll">隐藏文件夹中的\"全部取消静音\"</string>
<string name="UseLocalQuoteColor">本地名称颜色</string>
<string name="ShowSquareAvatar">显示方形头像</string>
<string name="ShowArchiveOnPull">显示下拉打开已归档对话</string>
</resources>
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,5 @@
<string name="HideFilterMuteAll">Hide filter mute all</string>
<string name="UseLocalQuoteColor">Use local quote color</string>
<string name="ShowSquareAvatar">Show square avatar</string>
<string name="ShowArchiveOnPull">Show archive on pull</string>
</resources>

0 comments on commit 615b93a

Please sign in to comment.