From 212aac91716f059a1fc081d0e3b2e5b23d61d254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Fri, 9 Oct 2020 17:35:17 +0000 Subject: [PATCH] Minor fixes --- TMessagesProj/build.gradle | 2 +- TMessagesProj/src/main/assets/indigo.attheme | 442 ++++++++++++++++++ .../java/org/telegram/ui/ActionBar/Theme.java | 6 +- .../ui/Cells/DrawerActionCheckCell.java | 1 + .../java/org/telegram/ui/ChatActivity.java | 22 +- .../java/org/telegram/ui/DialogsActivity.java | 4 +- .../java/org/telegram/ui/LaunchActivity.java | 5 +- .../tw/nekomimi/nekogram/MessageHelper.java | 14 +- .../settings/NekoGeneralSettingsActivity.java | 4 +- bin/update_libs.sh | 97 ++-- build.gradle | 2 +- 11 files changed, 519 insertions(+), 80 deletions(-) create mode 100644 TMessagesProj/src/main/assets/indigo.attheme diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 1e28ba6b7..1c685c258 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -71,7 +71,7 @@ repositories { dependencies { - implementation 'androidx.core:core-ktx:1.5.0-alpha03' + implementation 'androidx.core:core-ktx:1.5.0-alpha04' implementation 'androidx.palette:palette-ktx:1.0.0' implementation 'androidx.viewpager:viewpager:1.0.0' implementation 'androidx.exifinterface:exifinterface:1.3.0' diff --git a/TMessagesProj/src/main/assets/indigo.attheme b/TMessagesProj/src/main/assets/indigo.attheme new file mode 100644 index 000000000..ed102f724 --- /dev/null +++ b/TMessagesProj/src/main/assets/indigo.attheme @@ -0,0 +1,442 @@ +chat_unreadMessagesStartText=-12627531 +chat_inFileBackgroundSelected=-12627531 +chat_editDoneIcon=-12627531 +radioBackgroundChecked=-12627531 +dialogTextBlue=-12627531 +chat_inSentClockSelected=-2143333963 +avatar_backgroundActionBarGreen=-12627531 +chat_goDownButtonCounterBackground=-1 +chat_mediaLoaderPhotoSelected=-2147483648 +actionBarActionModeDefaultTop=0 +actionBarActionModeDefault=-1 +dialogCheckboxSquareBackground=-12627531 +chats_menuPhone=-2130706433 +sessions_devicesImage=-8550769 +chat_outViews=-2130706433 +avatar_actionBarSelectorCyan=-2130706433 +chat_secretTimerBackground=-12627531 +chat_botKeyboardButtonText=-1 +chat_outViaBotNameText=-2130706433 +profile_actionPressedBackground=1073741824 +key_chat_messagePanelVoiceLock=-8550769 +chat_secretChatStatusText=-8550769 +switchTrack=-2137088354 +chat_inPreviewInstantSelectedText=-2143333963 +location_sendLocationBackground=-12627531 +avatar_nameInMessageViolet=-12627531 +emptyListPlaceholder=-8550769 +chat_inAudioSelectedProgress=-1 +chats_nameMessage=-12627531 +contacts_inviteBackground=-12627531 +avatar_subtitleInProfileViolet=-2130706433 +chat_messagePanelCancelInlineBot=-2137088354 +checkbox=-12627531 +chat_outAudioSeekbarFill=-1 +actionBarWhiteSelector=1073741824 +chat_botKeyboardButtonBackgroundPressed=-2143333963 +player_time=-12627531 +chat_outTimeSelectedText=-2130706433 +chat_outFileProgressSelected=-12627531 +chat_emojiSearchBackground=-1118482 +chat_inFileProgressSelected=-1 +changephoneinfo_image=-12627531 +avatar_backgroundPink=-12627531 +chat_inAudioPerfomerText=-1069592139 +player_button=-8550769 +login_progressOuter=-12627531 +avatar_backgroundInProfileOrange=-12627531 +chat_inContactNameText=-12627531 +chats_menuPhoneCats=-2130706433 +chat_outPreviewLine=-1 +dialogScrollGlow=-12627531 +chat_messagePanelHint=-8550769 +location_sendLiveLocationBackground=-769226 +windowBackgroundGray=-1118482 +chat_inViaBotNameText=-2143333963 +chat_outVoiceSeekbar=1627389951 +dialogGrayLine=167772160 +player_actionBarTitle=-12627531 +chat_outFileIcon=-12627531 +calls_ratingStar=-8550769 +chat_adminText=-2143333963 +chat_inFileProgress=-1 +dialogIcon=-8550769 +chat_emojiPanelEmptyText=-8550769 +chat_replyPanelClose=-8550769 +chat_emojiPanelBackspace=1621008030 +featuredStickers_addButtonPressed=-2143333963 +chat_outAudioTitleText=-1 +chat_emojiPanelStickerSetNameIcon=-8550769 +chat_emojiPanelBackground=-328966 +chats_unreadCounter=-12627531 +groupcreate_hintText=-8550769 +chat_inReplyMediaMessageSelectedText=-1069592139 +dialogCheckboxSquareUnchecked=-8550769 +avatar_actionBarSelectorOrange=-2130706433 +avatar_backgroundInProfileRed=-12627531 +chat_emojiPanelNewTrending=-12627531 +chat_emojiPanelStickerPackSelector=-12627531 +chat_unreadMessagesStartArrowIcon=-12627531 +avatar_backgroundActionBarOrange=-12627531 +windowBackgroundWhiteBlackText=-12434878 +avatar_backgroundActionBarBlue=-12627531 +dialogTextLink=-12627531 +chat_recordTime=-8550769 +windowBackgroundWhiteBlueHeader=-12627531 +files_folderIconBackground=-12627531 +chat_messagePanelVoiceBackground=-12627531 +groupcreate_onlineText=-12627531 +divider=83886080 +chat_topPanelLine=-12627531 +avatar_backgroundViolet=-12627531 +dialogTopBackground=-12627531 +chat_inReplyMessageText=-12434878 +dialogInputField=-8550769 +windowBackgroundWhiteInputFieldActivated=-12627531 +chat_outInstantSelected=-2130706433 +chat_outSentCheck=-2130706433 +player_placeholder=-2137088354 +chat_outFileSelectedIcon=-12627531 +picker_disabledButton=-2137088354 +groupcreate_spanBackground=-8812853 +dialogButton=-12627531 +contextProgressInner1=-1118482 +contextProgressInner3=-12434878 +chat_inLoaderPhotoIconSelected=-12627531 +actionBarDefaultSubtitle=-2130706433 +contextProgressInner2=-2130706433 +chat_inContactPhoneText=-1069592139 +chat_inlineResultIcon=-12627531 +dialogLineProgress=-12627531 +chats_draft=-12627531 +chat_outPreviewInstantText=-1 +chat_inMenuSelected=-2143333963 +avatar_backgroundOrange=-12627531 +avatar_actionBarSelectorGreen=-2130706433 +chat_outLocationIcon=-12627531 +chat_inLoaderSelected=-12627531 +location_liveLocationProgress=-12627531 +dialogTextRed=-769226 +chat_inBubbleShadow=-16777216 +dialogProgressCircle=-12627531 +chat_outAudioProgress=-12627531 +stickers_menu=-8550769 +avatar_subtitleInProfilePink=-2130706433 +player_progress=-12627531 +chat_inReplyLine=-12627531 +dialogBackground=-328966 +dialogLineProgressBackground=-2137088354 +chat_inReplyNameText=-12627531 +chat_gifSaveHintBackground=-12627531 +actionBarActionModeDefaultIcon=-10065299 +windowBackgroundWhiteRedText4=-769226 +windowBackgroundWhiteRedText3=-769226 +windowBackgroundWhiteRedText6=-769226 +chat_goDownButtonIcon=-1 +windowBackgroundWhiteRedText5=-769226 +featuredStickers_delButtonPressed=-2131475658 +chat_outAudioSelectedProgress=-12627531 +chat_messageTextOut=-1 +chat_inInstant=-12627531 +groupcreate_cursor=-12627531 +avatar_backgroundSaved=-12627531 +returnToCallBackground=-1 +checkboxSquareUnchecked=-8550769 +dialogCheckboxSquareDisabled=-2143333963 +chat_fieldOverlayText=-12627531 +chat_messagePanelSend=-12627531 +switchThumb=-657931 +windowBackgroundWhiteRedText2=-769226 +chats_nameIcon=-12434878 +avatar_backgroundBlue=-12627531 +chat_inSentClock=-2143333963 +avatar_nameInMessageRed=-12627531 +chat_outLoaderPhoto=-12627531 +chat_botSwitchToInlineText=-12627531 +avatar_backgroundInProfilePink=-12627531 +avatar_nameInMessageOrange=-12627531 +featuredStickers_unread=-12627531 +chats_pinnedIcon=-8550769 +chat_replyPanelLine=167772160 +avatar_subtitleInProfileOrange=-2130706433 +chat_outSentCheckSelected=-2130706433 +chat_inVenueInfoSelectedText=-2143333963 +dialogTextBlue2=-12627531 +dialogTextBlue3=-12627531 +avatar_backgroundGroupCreateSpanBlue=-12627531 +dialogTextBlue4=-12627531 +windowBackgroundWhiteGreenText=-12627531 +chat_topPanelMessage=-8550769 +chat_emojiPanelIcon=1358954496 +chat_emojiPanelTrendingDescription=-8550769 +calls_callReceivedGreenIcon=-12627531 +chats_pinnedOverlay=-657931 +windowBackgroundWhiteInputField=-8550769 +avatar_backgroundRed=-12627531 +chat_emojiPanelIconSelector=-12627531 +chat_inForwardedNameText=-2143333963 +chats_sentError=-769226 +groupcreate_checkbox=-12627531 +chats_actionBackground=-12627531 +avatar_nameInMessageGreen=-12627531 +chat_outContactNameText=-1 +chat_inSiteNameText=-12627531 +chat_linkSelectBackground=-2143333963 +dialogLinkSelection=-2143333963 +windowBackgroundWhiteBlueText=-12627531 +avatar_nameInMessageCyan=-12627531 +chat_mediaLoaderPhotoIconSelected=-1 +chat_inLocationBackground=-12627531 +radioBackground=-2137088354 +contextProgressOuter1=-12627531 +dialogTextGray3=-8550769 +chat_inFileIcon=-1 +avatar_backgroundActionBarPink=-12627531 +dialogTextGray2=-8550769 +dialogTextGray4=-8550769 +chat_searchPanelIcons=-12627531 +windowBackgroundWhiteLinkText=-12627531 +chat_inAudioSeekbarSelected=1077891509 +chat_outVenueInfoText=-1056964609 +chat_outContactPhoneText=-1056964609 +chat_inAudioTitleText=-12627531 +chat_messageLinkIn=-12627531 +chats_menuBackground=-328966 +chat_serviceBackground=1610612736 +windowBackgroundWhiteGrayLine=-8550769 +chats_secretIcon=-12627531 +chat_inFileBackground=-12627531 +chat_inBubbleSelected=-1056964609 +chat_outInstant=-1 +chat_outViewsSelected=-2130706433 +chat_emojiPanelShadowLine=-1118482 +actionBarDefaultSearchPlaceholder=-2130706433 +actionBarActionModeDefaultSelector=-16777216 +chat_outForwardedNameText=-2130706433 +dialogRoundCheckBox=-12627531 +chat_emojiPanelTrendingTitle=-12434878 +featuredStickers_delButton=-769226 +returnToCallText=-12627531 +switchThumbChecked=-12627531 +windowBackgroundWhite=-328966 +chat_outSiteNameText=-1 +groupcreate_offlineText=-8550769 +chat_inVoiceSeekbarSelected=1077891509 +avatar_backgroundCyan=-12627531 +dialogTextGray=-8550769 +chat_messageLinkOut=-1056964609 +chat_emojiPanelStickerSetName=-8550769 +dialogRadioBackgroundChecked=-12627531 +picker_badge=-12627531 +chat_inVenueNameText=-12627531 +chat_outFileInfoSelectedText=-1056964609 +chats_tabletSelectedOverlay=-1118482 +chat_outAudioDurationSelectedText=-2130706433 +avatar_actionBarSelectorPink=-2130706433 +dialogTextHint=-8550769 +chat_topPanelTitle=-12627531 +chat_inAudioCacheSeekbar=-2143333963 +chat_outContactIcon=-12627531 +avatar_subtitleInProfileBlue=-2130706433 +featuredStickers_addButton=-12627531 +chat_inFileInfoText=-1069592139 +chat_inPreviewLine=-12627531 +avatar_backgroundGreen=-12627531 +profile_creatorIcon=-12627531 +avatar_subtitleInProfileGreen=-2130706433 +chats_sentCheck=-12627531 +chat_outVoiceSeekbarFill=-1 +chat_outReplyLine=-1 +chat_inAudioSeekbarFill=-12627531 +chat_messagePanelIcons=-8550769 +inappPlayerTitle=-12434878 +chat_inReplyMediaMessageText=-1069592139 +progressCircle=-12627531 +chat_botKeyboardButtonBackground=-12627531 +chat_emojiPanelIconSelected=-12627531 +chat_inContactBackground=-12627531 +chats_menuItemIcon=-8550769 +chat_outVenueInfoSelectedText=-1056964609 +wallpaperFileOffset=-1 +chat_outVenueNameText=-1 +chat_outBubbleShadow=-15064194 +checkboxSquareBackground=-12627531 +files_folderIcon=-328966 +chats_menuCloudBackgroundCats=-2147483648 +chat_topPanelClose=-8550769 +profile_adminIcon=-2143333963 +chats_verifiedBackground=0 +chat_inTimeSelectedText=-2143333963 +chat_outFileBackgroundSelected=-1 +chat_outVoiceSeekbarSelected=1627389951 +windowBackgroundWhiteGrayIcon=-8550769 +avatar_backgroundActionBarViolet=-12627531 +profile_verifiedCheck=-1 +chat_mediaTimeBackground=-2147483648 +listSelectorSDK21=251658240 +chat_outFileNameText=-1 +picker_enabledButton=-12627531 +avatar_backgroundInProfileViolet=-12627531 +avatar_nameInMessagePink=-12627531 +windowBackgroundWhiteGrayText=-8550769 +musicPicker_buttonBackground=-12627531 +avatar_actionBarSelectorViolet=-2130706433 +avatar_nameInMessageBlue=-12627531 +dialogTextBlack=-12434878 +actionBarDefault=-12627531 +location_placeLocationBackground=-12627531 +profile_actionIcon=-12627531 +actionBarDefaultSelector=-2130706433 +chats_menuTopShadow=-2147483648 +chat_outAudioPerfomerText=-1056964609 +sharedMedia_startStopLoadIcon=-12627531 +chat_serviceBackgroundSelected=-2147483648 +inappPlayerPlayPause=-12627531 +chat_inVenueInfoText=-2143333963 +chat_replyPanelIcons=-12627531 +checkboxSquareDisabled=-2143333963 +fastScrollInactive=-8550769 +chat_outSentClockSelected=-2130706433 +featuredStickers_addedIcon=-12627531 +chat_recordedVoicePlayPausePressed=-2130706433 +chat_goDownButtonCounter=-12627531 +musicPicker_checkbox=-12627531 +chat_outFileBackground=-1 +chats_name=-12434878 +dialogBadgeBackground=-12627531 +chat_outBubbleSelected=-1069592139 +avatar_backgroundInProfileBlue=-12627531 +chat_inFileNameText=-12627531 +inappPlayerPerformer=-12434878 +chat_inInstantSelected=-2143333963 +chat_inLocationIcon=-1 +chat_outFileInfoText=-1056964609 +groupcreate_checkboxCheck=-328966 +chat_unreadMessagesStartBackground=-328966 +chat_inLoaderPhoto=-1 +chat_inFileInfoSelectedText=-1069592139 +chat_wallpaper=-657931 +chat_outMenuSelected=-2130706433 +fastScrollActive=-12627531 +chat_outLoaderPhotoSelected=-12627531 +chat_muteIcon=-2130706433 +chat_selectedBackground=1077891509 +chat_recordedVoiceBackground=-12627531 +chat_inAudioDurationText=-2143333963 +chat_secretTimeText=-1 +groupcreate_sectionText=-8550769 +actionBarDefaultSubmenuItem=-12434878 +dialogInputFieldActivated=-12627531 +login_progressInner=-1118482 +chats_actionMessage=-12627531 +chat_inLoaderPhotoIcon=-12627531 +location_markerX=-2147483648 +avatar_actionBarSelectorBlue=-2130706433 +chat_addContact=-12627531 +player_placeholderBackground=-657931 +switchTrackChecked=-2143333963 +windowBackgroundWhiteHintText=-8550769 +chat_inLoader=-12627531 +chat_adminSelectedText=-2143333963 +groupcreate_spanText=-1 +chat_outPreviewInstantSelectedText=-2130706433 +player_actionBarSelector=-2143333963 +key_player_progressCachedBackground=-2143333963 +chat_outTimeText=-2130706433 +chat_outBubble=-12627531 +avatar_backgroundActionBarCyan=-12627531 +chats_verifiedCheck=-12627531 +chat_emojiPanelMasksIconSelected=-12627531 +chats_menuItemText=-12434878 +chats_message=-9079435 +chat_outReplyNameText=-1 +chat_outReplyMediaMessageText=-1056964609 +chat_textSelectBackground=-8812853 +chat_messagePanelVoiceDelete=-8550769 +chats_date=-8550769 +chat_messagePanelText=-12434878 +player_buttonActive=-12627531 +chat_outLoaderPhotoIcon=-1 +chat_outContactBackground=-1 +sharedMedia_linkPlaceholder=-12627531 +windowBackgroundWhiteBlueText7=-12627531 +windowBackgroundWhiteBlueText6=-12627531 +calls_callReceivedRedIcon=-769226 +chat_outLocationBackground=-1 +windowBackgroundWhiteBlueText3=-12627531 +windowBackgroundWhiteBlueText2=-12627531 +windowBackgroundWhiteBlueText5=-12627531 +windowBackgroundWhiteBlueText4=-12627531 +chat_replyPanelMessage=-12434878 +stickers_menuSelector=-2147483648 +chat_inViewsSelected=-2143333963 +windowBackgroundWhiteLinkSelection=1077891509 +player_background=-328966 +inappPlayerClose=-2137088354 +player_actionBarSubtitle=-2143333963 +chat_outAudioCacheSeekbar=-2143333963 +chats_sentClock=-12627531 +chat_inAudioSeekbar=1077891509 +avatar_subtitleInProfileRed=-2130706433 +avatar_backgroundActionBarRed=-12627531 +chat_inPreviewInstantText=-12627531 +chat_messagePanelVoiceShadow=-12627531 +chat_inViews=-2143333963 +chat_outLoaderSelected=-1 +dialogButtonSelector=251658240 +chats_menuItemCheck=-12627531 +player_actionBarItems=-12627531 +chat_sentError=-769226 +avatar_actionBarSelectorRed=-2130706433 +player_progressBackground=1084137118 +chat_inAudioDurationSelectedText=-2143333963 +windowBackgroundWhiteGrayText2=-8550769 +chat_outAudioSeekbarSelected=1627389951 +chat_outLoaderPhotoIconSelected=-1 +player_actionBarTop=855638016 +windowBackgroundWhiteGrayText7=-8550769 +windowBackgroundWhiteGrayText8=-8550769 +windowBackgroundWhiteGrayText5=-8550769 +windowBackgroundWhiteGrayText6=-8550769 +windowBackgroundWhiteGrayText3=-8550769 +windowBackgroundWhiteGrayText4=-8550769 +chat_inTimeText=-2143333963 +dialogRadioBackground=-8550769 +windowBackgroundWhiteRedText=-769226 +chat_outReplyMessageText=-2130706433 +chat_recordedVoiceDot=-12627531 +chat_recordedVoiceProgress=-2130706433 +chat_inLoaderPhotoSelected=-1 +chat_inVoiceSeekbarFill=-12627531 +graySection=-328966 +chat_outAudioSeekbar=1627389951 +chats_muteIcon=-8550769 +chat_inVoiceSeekbar=1077891509 +profile_verifiedBackground=0 +chat_outFileProgress=-12627531 +chat_outLoader=-1 +chats_actionPressedBackground=1073741824 +windowBackgroundWhiteGreenText2=-12627531 +chat_replyPanelName=-12627531 +windowBackgroundWhiteValueText=-12627531 +chat_outAudioDurationText=-2130706433 +chat_outMenu=-2130706433 +avatar_backgroundInProfileGreen=-12627531 +chat_goDownButton=-12627531 +chats_secretName=-12627531 +chat_inMenu=-2143333963 +chat_recordVoiceCancel=-12627531 +chat_inFileSelectedIcon=-1 +chat_outReplyMediaMessageSelectedText=-1056964609 +chat_mediaLoaderPhoto=-2147483648 +avatar_backgroundInProfileCyan=-12627531 +calls_ratingStarSelected=-12627531 +chat_reportSpam=-769226 +chat_messageTextIn=-12434878 +avatar_subtitleInProfileCyan=-2130706433 +chat_emojiPanelMasksIcon=-8550769 +chats_attachMessage=-12627531 +chat_topPanelBackground=-328966 +chat_searchPanelText=-12434878 +chat_outSentClock=-2130706433 +dialogBackgroundGray=-657931 diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java index 9efbedf8d..2e9252823 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java @@ -57,6 +57,8 @@ import android.util.SparseArray; import android.util.StateSet; import android.view.View; +import androidx.annotation.UiThread; + import org.json.JSONArray; import org.json.JSONObject; import org.telegram.messenger.AndroidUtilities; @@ -105,8 +107,6 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Locale; -import androidx.annotation.UiThread; - import tw.nekomimi.nekogram.NekoConfig; public class Theme { @@ -3850,7 +3850,7 @@ public class Theme { ThemeInfo themeInfo = new ThemeInfo(); themeInfo.name = "Blue"; - themeInfo.assetName = NekoConfig.useDefaultTheme ? "bluebubbles.attheme" : "nekox-indigo.attheme"; + themeInfo.assetName = NekoConfig.useDefaultTheme ? "bluebubbles.attheme" : "indigo.attheme"; themeInfo.previewBackgroundColor = -657931; themeInfo.previewInColor = NekoConfig.useDefaultTheme ? 0xffffffff : Color.parseColor("#c0ffffff"); themeInfo.previewOutColor = NekoConfig.useDefaultTheme ? 0xffd0e6ff: Color.parseColor("#3f51b5"); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCheckCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCheckCell.java index 0b30fab1c..d75d28200 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCheckCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCheckCell.java @@ -227,6 +227,7 @@ public class DrawerActionCheckCell extends FrameLayout { protected void onAttachedToWindow() { super.onAttachedToWindow(); textView.setTextColor(Theme.getColor(Theme.key_chats_menuItemText)); + checkBox.setColors(Theme.key_switchTrack, Theme.key_switchTrackChecked, Theme.key_windowBackgroundWhite, Theme.key_windowBackgroundWhite); } @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index 2b8e1be12..daa86aa6b 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -2218,7 +2218,8 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not actionMode.getItem(edit).setVisibility(canEditMessagesCount == 1 && selectedMessagesIds[0].size() + selectedMessagesIds[1].size() == 1 ? View.VISIBLE : View.GONE); actionMode.getItem(copy).setVisibility(selectedMessagesCanCopyIds[0].size() + selectedMessagesCanCopyIds[1].size() != 0 ? View.VISIBLE : View.GONE); actionMode.getItem(star).setVisibility(View.GONE); - actionMode.getItem(delete).setVisibility(cantDeleteMessagesCount > 0 && selectedMessagesIds[0].size() + selectedMessagesIds[1].size() > 1 ? View.VISIBLE : View.GONE); + actionMode.getItem(delete).setVisibility(cantDeleteMessagesCount == 0 ? View.VISIBLE : View.GONE); + actionMode.getItem(translate).setVisibility(selectedMessagesCanCopyIds[0].size() + selectedMessagesCanCopyIds[1].size() > 1 ? View.VISIBLE : View.GONE); checkActionBarMenu(); @@ -6340,21 +6341,17 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not bottomOverlayProgress.setAlpha(1.0f); bottomOverlayChat.addView(bottomOverlayProgress, LayoutHelper.createFrame(30, 30, Gravity.CENTER)); - Theme.ThemeInfo currentTheme = Theme.getCurrentTheme(); - - boolean isMaterial = currentTheme.assetName != null && currentTheme.assetName.startsWith("nekox-indigo"); - replyButton = new TextView(context); replyButton.setText(LocaleController.getString("Reply", R.string.Reply)); replyButton.setGravity(Gravity.CENTER_VERTICAL); replyButton.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15); replyButton.setPadding(AndroidUtilities.dp(14), 0, AndroidUtilities.dp(21), 0); replyButton.setBackgroundDrawable(Theme.createSelectorDrawable(Theme.getColor(Theme.key_actionBarActionModeDefaultSelector), 3)); - replyButton.setTextColor(Theme.getColor(isMaterial ? Theme.key_actionBarActionModeDefault : Theme.key_actionBarActionModeDefaultIcon)); + replyButton.setTextColor(Theme.getColor(Theme.key_actionBarActionModeDefaultIcon)); replyButton.setCompoundDrawablePadding(AndroidUtilities.dp(7)); replyButton.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); Drawable image = context.getResources().getDrawable(R.drawable.input_reply).mutate(); - image.setColorFilter(new PorterDuffColorFilter(Theme.getColor(isMaterial ? Theme.key_actionBarActionModeDefault : Theme.key_actionBarActionModeDefaultIcon), PorterDuff.Mode.SRC_IN)); + image.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_actionBarActionModeDefaultIcon), PorterDuff.Mode.SRC_IN)); replyButton.setCompoundDrawablesWithIntrinsicBounds(image, null, null, null); replyButton.setOnClickListener(v -> { MessageObject messageObject = null; @@ -6382,10 +6379,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not forwardButton.setPadding(AndroidUtilities.dp(21), 0, AndroidUtilities.dp(21), 0); forwardButton.setCompoundDrawablePadding(AndroidUtilities.dp(6)); forwardButton.setBackgroundDrawable(Theme.createSelectorDrawable(Theme.getColor(Theme.key_actionBarActionModeDefaultSelector), 3)); - forwardButton.setTextColor(Theme.getColor(isMaterial ? Theme.key_actionBarActionModeDefault : Theme.key_actionBarActionModeDefaultIcon)); + forwardButton.setTextColor(Theme.getColor(Theme.key_actionBarActionModeDefaultIcon)); forwardButton.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); image = context.getResources().getDrawable(R.drawable.input_forward).mutate(); - image.setColorFilter(new PorterDuffColorFilter(Theme.getColor(isMaterial ? Theme.key_actionBarActionModeDefault : Theme.key_actionBarActionModeDefaultIcon), PorterDuff.Mode.SRC_IN)); + image.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_actionBarActionModeDefaultIcon), PorterDuff.Mode.SRC_IN)); forwardButton.setCompoundDrawablesWithIntrinsicBounds(image, null, null, null); forwardButton.setOnClickListener(v -> { noForwardQuote = false; @@ -10251,6 +10248,8 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ActionBarMenuItem editItem = actionBar.createActionMode().getItem(edit); ActionBarMenuItem forwardItem = actionBar.createActionMode().getItem(forward); + ActionBarMenuItem translateItem = actionBar.createActionMode().getItem(translate); + if (prevCantForwardCount == 0 && cantForwardMessagesCount != 0 || prevCantForwardCount != 0 && cantForwardMessagesCount == 0) { forwardButtonAnimation = new AnimatorSet(); ArrayList animators = new ArrayList<>(); @@ -10285,7 +10284,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not int copyVisible = copyItem.getVisibility(); int starVisible = starItem.getVisibility(); copyItem.setVisibility(selectedMessagesCanCopyIds[0].size() + selectedMessagesCanCopyIds[1].size() != 0 ? View.VISIBLE : View.GONE); - starItem.setVisibility(getMediaDataController().canAddStickerToFavorites() && (selectedMessagesCanStarIds[0].size() + selectedMessagesCanStarIds[1].size()) == selectedCount ? View.VISIBLE : View.GONE); int newCopyVisible = copyItem.getVisibility(); int newStarVisible = starItem.getVisibility(); actionBar.createActionMode().getItem(delete).setVisibility(cantDeleteMessagesCount == 0 ? View.VISIBLE : View.GONE); @@ -10435,6 +10433,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not editButtonAnimation.start(); } } + + if (translateItem != null) { + translateItem.setVisibility(selectedMessagesCanCopyIds[0].size() + selectedMessagesCanCopyIds[1].size() > 1 ? View.VISIBLE : View.GONE); + } } } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java index b8c50d788..21d690b9c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java @@ -116,6 +116,7 @@ import org.telegram.ui.Cells.DialogCell; import org.telegram.ui.Cells.DialogsEmptyCell; import org.telegram.ui.Cells.DividerCell; import org.telegram.ui.Cells.DrawerActionCell; +import org.telegram.ui.Cells.DrawerActionCheckCell; import org.telegram.ui.Cells.DrawerAddCell; import org.telegram.ui.Cells.DrawerProfileCell; import org.telegram.ui.Cells.DrawerUserCell; @@ -6296,12 +6297,13 @@ private int lastMeasuredTopPadding; arrayList.add(new ThemeDescription(sideMenu, 0, new Class[]{DrawerProfileCell.class}, null, null, null, Theme.key_chat_serviceBackground)); arrayList.add(new ThemeDescription(sideMenu, 0, new Class[]{DrawerProfileCell.class}, null, null, null, Theme.key_chats_menuTopShadow)); arrayList.add(new ThemeDescription(sideMenu, 0, new Class[]{DrawerProfileCell.class}, null, null, null, Theme.key_chats_menuTopShadowCats)); - arrayList.add(new ThemeDescription(sideMenu, ThemeDescription.FLAG_IMAGECOLOR, new Class[]{DrawerProfileCell.class}, new String[]{"darkThemeView"}, null, null, null, Theme.key_chats_menuName)); arrayList.add(new ThemeDescription(sideMenu, ThemeDescription.FLAG_CELLBACKGROUNDCOLOR | ThemeDescription.FLAG_CHECKTAG, new Class[]{DrawerProfileCell.class}, null, null, cellDelegate, Theme.key_chats_menuTopBackgroundCats)); arrayList.add(new ThemeDescription(sideMenu, ThemeDescription.FLAG_CELLBACKGROUNDCOLOR | ThemeDescription.FLAG_CHECKTAG, new Class[]{DrawerProfileCell.class}, null, null, cellDelegate, Theme.key_chats_menuTopBackground)); arrayList.add(new ThemeDescription(sideMenu, ThemeDescription.FLAG_IMAGECOLOR, new Class[]{DrawerActionCell.class}, new String[]{"textView"}, null, null, null, Theme.key_chats_menuItemIcon)); arrayList.add(new ThemeDescription(sideMenu, 0, new Class[]{DrawerActionCell.class}, new String[]{"textView"}, null, null, null, Theme.key_chats_menuItemText)); + arrayList.add(new ThemeDescription(sideMenu, ThemeDescription.FLAG_IMAGECOLOR, new Class[]{DrawerActionCheckCell.class}, new String[]{"textView"}, null, null, null, Theme.key_chats_menuItemIcon)); + arrayList.add(new ThemeDescription(sideMenu, 0, new Class[]{DrawerActionCheckCell.class}, new String[]{"textView"}, null, null, null, Theme.key_chats_menuItemText)); arrayList.add(new ThemeDescription(sideMenu, 0, new Class[]{DrawerUserCell.class}, new String[]{"textView"}, null, null, null, Theme.key_chats_menuItemText)); arrayList.add(new ThemeDescription(sideMenu, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{DrawerUserCell.class}, new String[]{"checkBox"}, null, null, null, Theme.key_chats_unreadCounterText)); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java index 86c48cba0..5dace1b1a 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java @@ -53,7 +53,9 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.core.content.pm.ShortcutInfoCompat; import androidx.core.content.pm.ShortcutManagerCompat; +import androidx.recyclerview.widget.ItemTouchHelper; import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import com.v2ray.ang.V2RayConfig; @@ -555,7 +557,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa drawerLayoutContainer.closeDrawer(false); } else if (id == 14) { NekoXConfig.toggleKeepOnlineStatus(); - ; + drawerLayoutAdapter.notifyDataSetChanged(); } } else { @@ -3953,6 +3955,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa if (!toDark) { darkThemeView.setVisibility(View.VISIBLE); } + drawerLayoutAdapter.notifyDataSetChanged(); } }); anim.start(); diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/MessageHelper.java b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/MessageHelper.java index 03f0e7994..8238bf28f 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/MessageHelper.java +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/MessageHelper.java @@ -84,9 +84,9 @@ public class MessageHelper extends BaseController { } if (messageObject.messageOwner.media != null && !(messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaEmpty) && !(messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaWebPage) && !(messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGame) && !(messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaInvoice)) { HashMap params = null; - if ((int) did == 0 && messageObject.messageOwner.to_id != null && (messageObject.messageOwner.media.photo instanceof TLRPC.TL_photo || messageObject.messageOwner.media.document instanceof TLRPC.TL_document)) { + if ((int) did == 0 && messageObject.messageOwner.peer_id != null && (messageObject.messageOwner.media.photo instanceof TLRPC.TL_photo || messageObject.messageOwner.media.document instanceof TLRPC.TL_document)) { params = new HashMap<>(); - params.put("parentObject", "sent_" + messageObject.messageOwner.to_id.channel_id + "_" + messageObject.getId()); + params.put("parentObject", "sent_" + messageObject.messageOwner.peer_id.channel_id + "_" + messageObject.getId()); } long oldGroupId = messageObject.messageOwner.grouped_id; if (oldGroupId != 0) { @@ -111,18 +111,18 @@ public class MessageHelper extends BaseController { } } if (messageObject.messageOwner.media.photo instanceof TLRPC.TL_photo) { - getSendMessagesHelper().sendMessage((TLRPC.TL_photo) messageObject.messageOwner.media.photo, null, did, null, messageObject.messageOwner.message, entities, null, params, notify, scheduleDate, messageObject.messageOwner.media.ttl_seconds, messageObject); + getSendMessagesHelper().sendMessage((TLRPC.TL_photo) messageObject.messageOwner.media.photo, null, did, null, null, messageObject.messageOwner.message, entities, null, params, notify, scheduleDate, messageObject.messageOwner.media.ttl_seconds, messageObject); } else if (messageObject.messageOwner.media.document instanceof TLRPC.TL_document) { - getSendMessagesHelper().sendMessage((TLRPC.TL_document) messageObject.messageOwner.media.document, null, messageObject.messageOwner.attachPath, did, null, messageObject.messageOwner.message, entities, null, params, notify, scheduleDate, messageObject.messageOwner.media.ttl_seconds, messageObject); + getSendMessagesHelper().sendMessage((TLRPC.TL_document) messageObject.messageOwner.media.document, null, messageObject.messageOwner.attachPath, did, null, null, messageObject.messageOwner.message, entities, null, params, notify, scheduleDate, messageObject.messageOwner.media.ttl_seconds, messageObject); } else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaVenue || messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGeo) { - getSendMessagesHelper().sendMessage(messageObject.messageOwner.media, did, null, null, null, notify, scheduleDate); + getSendMessagesHelper().sendMessage(messageObject.messageOwner.media, did, null, null, null, null, notify, scheduleDate); } else if (messageObject.messageOwner.media.phone_number != null) { TLRPC.User user = new TLRPC.TL_userContact_old2(); user.phone = messageObject.messageOwner.media.phone_number; user.first_name = messageObject.messageOwner.media.first_name; user.last_name = messageObject.messageOwner.media.last_name; user.id = messageObject.messageOwner.media.user_id; - getSendMessagesHelper().sendMessage(user, did, null, null, null, notify, scheduleDate); + getSendMessagesHelper().sendMessage(user, did, null, null, null, null, notify, scheduleDate); } else if ((int) did != 0) { ArrayList arrayList = new ArrayList<>(); arrayList.add(messageObject); @@ -133,7 +133,7 @@ public class MessageHelper extends BaseController { if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaWebPage) { webPage = messageObject.messageOwner.media.webpage; } - getSendMessagesHelper().sendMessage(messageObject.messageOwner.message, did, null, webPage, webPage != null, entities, null, null, notify, scheduleDate); + getSendMessagesHelper().sendMessage(messageObject.messageOwner.message, did, null, null, webPage, webPage != null, entities, null, null, notify, scheduleDate); } else if ((int) did != 0) { ArrayList arrayList = new ArrayList<>(); arrayList.add(messageObject); diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoGeneralSettingsActivity.java b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoGeneralSettingsActivity.java index be347644c..19100978e 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoGeneralSettingsActivity.java +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoGeneralSettingsActivity.java @@ -22,6 +22,7 @@ import androidx.recyclerview.widget.RecyclerView; import org.openintents.openpgp.OpenPgpError; import org.openintents.openpgp.util.OpenPgpApi; import org.telegram.messenger.AndroidUtilities; +import org.telegram.messenger.BuildConfig; import org.telegram.messenger.ContactsController; import org.telegram.messenger.ImageLoader; import org.telegram.messenger.LocaleController; @@ -57,7 +58,6 @@ import java.util.concurrent.atomic.AtomicReference; import cn.hutool.core.util.StrUtil; import kotlin.Unit; import tw.nekomimi.nekogram.BottomBuilder; -import tw.nekomimi.nekogram.EmojiProvider; import tw.nekomimi.nekogram.NekoConfig; import tw.nekomimi.nekogram.PopupBuilder; import tw.nekomimi.nekogram.transtale.Translator; @@ -726,7 +726,7 @@ public class NekoGeneralSettingsActivity extends BaseFragment { appearanceRow = rowCount++; typefaceRow = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? rowCount++ : -1; useDefaultThemeRow = rowCount++; - useSystemEmojiRow = EmojiProvider.containsEmoji ? rowCount++ : -1; + useSystemEmojiRow = !BuildConfig.FLAVOR.contains("No") ? rowCount++ : -1; transparentStatusBarRow = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? rowCount++ : -1; forceTabletRow = rowCount++; avatarAsDrawerBackgroundRow = rowCount++; diff --git a/bin/update_libs.sh b/bin/update_libs.sh index def1981d2..58e7cb41f 100755 --- a/bin/update_libs.sh +++ b/bin/update_libs.sh @@ -1,19 +1,19 @@ #!/bin/bash -V2RAY_CORE_VERSION="4.30.0" +V2RAY_CORE_VERSION="4.31.0" if [ ! -x "$(command -v go)" ]; then -# if [ ! -x "$(command -v gvm)" ]; then -# -# apt install -y bison -# bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer) -# source "$HOME/.bashrc" -# -# fi -# -# gvm install go1.15 -B -# gvm use go1.15 --default + # if [ ! -x "$(command -v gvm)" ]; then + # + # apt install -y bison + # bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer) + # source "$HOME/.bashrc" + # + # fi + # + # gvm install go1.15 -B + # gvm use go1.15 --default echo "install golang please!" @@ -23,9 +23,9 @@ fi if [ ! -x "$(command -v rustc)" ]; then -# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -# echo "source \$HOME/.cargo/env" >> $HOME/.bashrc && source $HOME/.cargo/env -# rustup target install armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android + # curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + # echo "source \$HOME/.cargo/env" >> $HOME/.bashrc && source $HOME/.cargo/env + # rustup target install armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android echo "install rust please!" @@ -45,45 +45,34 @@ if [ ! -f "$ANDROID_HOME/ndk-bundle/source.properties" ]; then fi - rm -rf TMessagesProj/libs/*.aar ./gradlew ss-rust:assembleRelease --stacktrace && -cp ss-rust/build/outputs/aar/* TMessagesProj/libs && -./gradlew ssr-libev:assembleRelease && -cp ssr-libev/build/outputs/aar/* TMessagesProj/libs && -cd TMessagesProj/libs && - -go get -v golang.org/x/mobile/cmd/... && - -v2rayCore="$(go env GOPATH)/src/v2ray.com/core" && -rm -rf "$v2rayCore" && -mkdir -p "$v2rayCore" && -git clone https://github.com/v2fly/v2ray-core.git "$v2rayCore" -b "v$V2RAY_CORE_VERSION" && -go get -d github.com/2dust/AndroidLibV2rayLite && - -gomobile init && -gomobile bind -v -ldflags='-s -w' github.com/2dust/AndroidLibV2rayLite && -rm *-sources.jar && - -cd ../.. && - -./gradlew TMessagesProj:stripFullFossDebugSymbols && - -OUT=TMessagesProj/build/intermediates/stripped_native_libs/fullFoss/out/lib && -DIR=TMessagesProj/src/main/libs && - -rm -rf $DIR/armeabi-v7a && -mkdir -p $DIR/armeabi-v7a && -cp $OUT/armeabi-v7a/libtmessages*.so $DIR/armeabi-v7a && - -rm -rf $DIR/arm64-v8a && -mkdir -p $DIR/arm64-v8a && -cp $OUT/arm64-v8a/libtmessages*.so $DIR/arm64-v8a && - -rm -rf $DIR/x86 && -mkdir -p $DIR/x86 && -cp $OUT/x86/libtmessages*.so $DIR/x86 && - -rm -rf $DIR/x86_64 && -mkdir -p $DIR/x86_64 && -cp $OUT/x86_64/libtmessages*.so $DIR/x86_64 + cp ss-rust/build/outputs/aar/* TMessagesProj/libs && + ./gradlew ssr-libev:assembleRelease && + cp ssr-libev/build/outputs/aar/* TMessagesProj/libs && + cd TMessagesProj/libs && + go get -v golang.org/x/mobile/cmd/... && + v2rayCore="$(go env GOPATH)/src/v2ray.com/core" && + rm -rf "$v2rayCore" && + mkdir -p "$v2rayCore" && + git clone https://github.com/v2fly/v2ray-core.git "$v2rayCore" -b "v$V2RAY_CORE_VERSION" && + go get -d github.com/2dust/AndroidLibV2rayLite && + gomobile init && + gomobile bind -v -ldflags='-s -w' github.com/2dust/AndroidLibV2rayLite && + rm *-sources.jar && + cd ../.. && + ./gradlew TMessagesProj:stripFullFossDebugSymbols && + OUT=TMessagesProj/build/intermediates/stripped_native_libs/fullFoss/out/lib && + DIR=TMessagesProj/src/main/libs && + rm -rf $DIR/armeabi-v7a && + mkdir -p $DIR/armeabi-v7a && + cp $OUT/armeabi-v7a/libtmessages*.so $DIR/armeabi-v7a && + rm -rf $DIR/arm64-v8a && + mkdir -p $DIR/arm64-v8a && + cp $OUT/arm64-v8a/libtmessages*.so $DIR/arm64-v8a && + rm -rf $DIR/x86 && + mkdir -p $DIR/x86 && + cp $OUT/x86/libtmessages*.so $DIR/x86 && + rm -rf $DIR/x86_64 && + mkdir -p $DIR/x86_64 && + cp $OUT/x86_64/libtmessages*.so $DIR/x86_64 diff --git a/build.gradle b/build.gradle index d11dff4dc..3b95bb706 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { maven { url "https://plugins.gradle.org/m2/" } } dependencies { - classpath 'com.android.tools.build:gradle:4.0.1' + classpath 'com.android.tools.build:gradle:4.0.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10" classpath 'com.google.gms:google-services:4.3.4' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'