Skip to content

Commit

Permalink
feat: hide dialogs floating button
Browse files Browse the repository at this point in the history
Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com>
  • Loading branch information
NextAlone committed Apr 11, 2024
1 parent 48c7662 commit 5733bda
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7110,6 +7110,9 @@ public int getTopOffset(int tag) {
updateVisibleRows(0, false);
updateProxyButton(false, true);
updateStoriesVisibility(false);
if (Config.hideDialogsFloatingButton) {
hideFloatingButton(true);
}
checkSuggestClearDatabase();
}

Expand Down Expand Up @@ -11189,6 +11192,9 @@ public void onAnimationEnd(Animator animation) {
}

private void hideFloatingButton(boolean hide) {
if (Config.hideDialogsFloatingButton) {
hide = true;
}
if (rightSlidingDialogContainer.hasFragment()) {
hide = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public class GeneralSettingActivity extends BaseActivity {
private int largeAvatarAsBackgroundRow;
private int hidePhoneRow;
private int drawerListRow;
private int hideDialogsFloatingButtonRow;
private int drawer2Row;

private int translatorRow;
Expand Down Expand Up @@ -392,6 +393,11 @@ else if (position == showBotAPIRow) {
if (view instanceof TextCheckCell) {
((TextCheckCell) view).setChecked(Config.hideFilterMuteAll);
}
} else if (position == hideDialogsFloatingButtonRow) {
Config.toggleHideDialogsFloatingButton();
if (view instanceof TextCheckCell) {
((TextCheckCell) view).setChecked(Config.hideDialogsFloatingButton);
}
}

}
Expand Down Expand Up @@ -422,6 +428,7 @@ protected void updateRows() {
}
hidePhoneRow = addRow("hidePhone");
drawerListRow = addRow("drawerList");
hideDialogsFloatingButtonRow = addRow("hideDialogsFloatingButton");
drawer2Row = addRow();

translatorRow = addRow();
Expand Down Expand Up @@ -661,6 +668,8 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position, boole
textCell.setTextAndCheck(LocaleController.getString("ignoreFolderUnreadCount", R.string.ignoreFolderUnreadCount), Config.ignoreFolderUnreadCount, true);
} else if (position == hideFilterMuteAllRow) {
textCell.setTextAndCheck(LocaleController.getString("hideFilterMuteAll", R.string.hideFilterMuteAll), Config.hideFilterMuteAll, true);
} else if (position == hideDialogsFloatingButtonRow) {
textCell.setTextAndCheck(LocaleController.getString("hideDialogsFloatingButton", R.string.hideDialogsFloatingButton), Config.hideDialogsFloatingButton, true);
}
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ object Defines {
@BooleanConfig const val hideKeyboardWhenScrolling = "hideKeyboardWhenScrolling"
@BooleanConfig const val searchInPlace = "searchInPlace"
@IntConfig(100) const val gifSize = "gifSize"
@BooleanConfig const val hideDialogsFloatingButton = "hideDialogsFloatingButton"

// Drawer List
@BooleanConfig(true) const val showNewGroup = "showNewGroup"
Expand Down
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-zh/strings_nullgram.xml
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@
<string name="searchInPlace">从当前位置中开始搜索</string>
<string name="gifSize">GIF 大小</string>
<string name="block">屏蔽</string>
<string name="hideDialogsFloatingButton">禁用主页浮动按钮</string>

<string name="Quote">引用</string>
<string name="QuoteTo">引用到...</string>
Expand Down
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values/strings_nullgram.xml
Original file line number Diff line number Diff line change
Expand Up @@ -375,4 +375,5 @@
<string name="searchInPlace">Search in place</string>
<string name="gifSize">GIF size</string>
<string name="block">Block</string>
<string name="hideDialogsFloatingButton">Hide dialogs floating button</string>
</resources>

0 comments on commit 5733bda

Please sign in to comment.