Skip to content

Commit

Permalink
refa: Show Bottom Actions When Selecting
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Jan 12, 2025
1 parent 0e8e62d commit 24600f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
4 changes: 4 additions & 0 deletions TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def keystorePwd = null
def alias = null
def pwd = null
def sentry_token = System.getenv("SENTRY_AUTH_TOKEN")
def nagram_build_args = System.getenv("NAGRAM_BUILD_ARGS")
def sentry_upload = project.rootProject.file("sentry.properties").exists()
def disableCMakeRelWithDebInfo = System.getenv("COMPILE_NATIVE") == null

Expand All @@ -66,6 +67,7 @@ if (properties != null) {
alias = properties.getProperty("ALIAS_NAME")
pwd = properties.getProperty("ALIAS_PASS")
sentry_token = properties.getProperty("SENTRY_AUTH_TOKEN", sentry_token)
nagram_build_args = properties.getProperty("NAGRAM_BUILD_ARGS", nagram_build_args)
}

keystorePwd = keystorePwd ?: System.getenv("KEYSTORE_PASS")
Expand Down Expand Up @@ -371,6 +373,8 @@ android {
task.enabled = false
} else if (task.name.endsWith("GoogleServices") && task.name.contains("NoGcm")) {
task.enabled = false
} else if (task.name.contains("buildCMakeDebug") && nagram_build_args.contains("skip_buildCMakeDebug")) {
task.enabled = false
}
}

Expand Down
25 changes: 8 additions & 17 deletions TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -18708,9 +18708,7 @@ private void addToSelectedMessages(MessageObject messageObject, boolean outside,
saveMessageItem.setVisibility(canForward);
}

if (NekoConfig.showBottomActionsWhenSelecting.Bool())
createBottomMessagesActionButtons();

createBottomMessagesActionButtons();
if (prevCantForwardCount == 0 && cantForwardMessagesCount != 0 || prevCantForwardCount != 0 && cantForwardMessagesCount == 0) {
forwardButtonAnimation = new AnimatorSet();
ArrayList<Animator> animators = new ArrayList<>();
Expand Down Expand Up @@ -31793,7 +31791,10 @@ public void dismiss(boolean animated) {
actionModeOtherItem.showSubItem(nkbtn_forward_noquote);
actionMode.setItemVisibility(delete, View.VISIBLE);
createBottomMessagesActionButtons();
bottomMessagesActionContainer.setVisibility(View.VISIBLE);
if (NekoConfig.showBottomActionsWhenSelecting.Bool())
bottomMessagesActionContainer.setVisibility(View.VISIBLE);
else
bottomMessagesActionContainer.setVisibility(View.GONE);

int translationY = chatActivityEnterView.getMeasuredHeight() - AndroidUtilities.dp(51);
createActionMode();
Expand All @@ -31806,27 +31807,17 @@ public void dismiss(boolean animated) {
if (suggestEmojiPanel != null && suggestEmojiPanel.getVisibility() == View.VISIBLE) {
views.add(suggestEmojiPanel);
}
if (NekoConfig.showBottomActionsWhenSelecting.Bool())
actionBar.showActionMode(true, bottomMessagesActionContainer, null, views.toArray(new View[0]), new boolean[]{false, true, true}, chatListView, translationY);
else
actionBar.showActionMode(true, null, null, null, new boolean[]{false, true, true}, chatListView, translationY);

actionBar.showActionMode(true, bottomMessagesActionContainer, null, views.toArray(new View[0]), new boolean[]{false, true, true}, chatListView, translationY);
if (getParentActivity() instanceof LaunchActivity) {
((LaunchActivity) getParentActivity()).hideVisibleActionMode();
}
if (chatActivityEnterView != null && chatActivityEnterView.getEditField() != null) {
chatActivityEnterView.getEditField().setAllowDrawCursor(false);
}
} else if (bottomOverlayChat.getVisibility() == View.VISIBLE) {
if (NekoConfig.showBottomActionsWhenSelecting.Bool())
actionBar.showActionMode(true, bottomMessagesActionContainer, null, new View[]{bottomOverlayChat}, new boolean[]{true}, chatListView, translationY);
else
actionBar.showActionMode(true, null, null, null, new boolean[]{true}, chatListView, translationY);
actionBar.showActionMode(true, bottomMessagesActionContainer, null, new View[]{bottomOverlayChat}, new boolean[]{true}, chatListView, translationY);
} else {
if (NekoConfig.showBottomActionsWhenSelecting.Bool())
actionBar.showActionMode(true, bottomMessagesActionContainer, null, null, null, chatListView, translationY);
else
actionBar.showActionMode(true, null, null, null, null, chatListView, translationY);
actionBar.showActionMode(true, bottomMessagesActionContainer, null, null, null, chatListView, translationY);
}
closeMenu();
chatLayoutManager.setCanScrollVertically(true);
Expand Down

0 comments on commit 24600f3

Please sign in to comment.