1
0
mirror of https://github.com/MGislv/NekoX.git synced 2024-07-02 10:33:36 +00:00

Fix crash

This commit is contained in:
世界 2021-01-28 14:29:01 +08:00
parent ff23a25ccf
commit fba981b99f
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
5 changed files with 22 additions and 18 deletions

View File

@ -40,7 +40,7 @@ configurations {
def okHttpVersion = '4.9.0'
def fcmVersion = '21.0.1'
def crashlyticsVersion = '17.3.0'
def playCoreVersion = '1.9.0'
def playCoreVersion = '1.9.1'
repositories {
@ -104,7 +104,7 @@ dependencies {
testImplementation 'junit:junit:4.13.1'
testImplementation 'androidx.test:core:1.3.0'
testImplementation "org.robolectric:robolectric:4.4"
testImplementation 'org.robolectric:robolectric:4.5'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.1'

View File

@ -5226,7 +5226,8 @@ public class MessagesController extends BaseController implements NotificationCe
} else if (response instanceof TLRPC.TL_help_promoData) {
final TLRPC.TL_help_promoData res = (TLRPC.TL_help_promoData) response;
if (res.proxy && (NekoConfig.hideProxySponsorChannel || (SharedConfig.currentProxy != null || SharedConfig.currentProxy.subId == 1L))) {
SharedConfig.ProxyInfo proxy = SharedConfig.currentProxy;
if (res.proxy && (NekoConfig.hideProxySponsorChannel || (proxy != null && proxy.subId == 1L))) {
nextPromoInfoCheckTime = getConnectionsManager().getCurrentTime() + 60 * 60;
noDialog = true;
} else {

View File

@ -11442,7 +11442,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
} else {
ActionBarMenuItem replyItem = actionBar.createActionMode().getItem(reply);
if (replyItem != null) {
replyItem.setVisibility(ChatObject.canSendMessages(currentChat) &&
replyItem.setVisibility(chatMode != MODE_PINNED && ChatObject.canSendMessages(currentChat) &&
selectedMessagesIds[0].size() + selectedMessagesIds[1].size() == 1 ? View.VISIBLE : View.GONE);
}
ActionBarMenuItem copyItem = actionBar.createActionMode().getItem(copy);
@ -11489,7 +11489,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);
actionModeOtherItem.setSubItemVisibility(star, getMediaDataController().canAddStickerToFavorites() && (selectedMessagesCanStarIds[0].size() + selectedMessagesCanStarIds[1].size()) == selectedCount);
if (selectItem != null) {
@ -11520,22 +11519,26 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
selectItem.setVisibility(selectable ? View.VISIBLE : View.GONE);
}
int newCopyVisible = copyItem.getVisibility();
int newStarVisible = starItem.getVisibility();
actionBar.createActionMode().getItem(delete).setVisibility(cantDeleteMessagesCount == 0 ? View.VISIBLE : View.GONE);
hasUnfavedSelected = false;
for (int a = 0; a < 2; a++) {
for (int b = 0; b < selectedMessagesCanStarIds[a].size(); b++) {
MessageObject msg = selectedMessagesCanStarIds[a].valueAt(b);
if (!getMediaDataController().isStickerInFavorites(msg.getDocument())) {
hasUnfavedSelected = true;
boolean starChanged = false;
if (starItem != null) {
int starVisible = starItem.getVisibility();
actionModeOtherItem.setSubItemVisibility(star, selectedMessagesCanStarIds[0].size() + selectedMessagesCanStarIds[1].size() != 0);
starChanged = starVisible != starItem.getVisibility();
for (int a = 0; a < 2; a++) {
for (int b = 0; b < selectedMessagesCanStarIds[a].size(); b++) {
MessageObject msg = selectedMessagesCanStarIds[a].valueAt(b);
if (!getMediaDataController().isStickerInFavorites(msg.getDocument())) {
hasUnfavedSelected = true;
break;
}
}
if (hasUnfavedSelected) {
break;
}
}
if (hasUnfavedSelected) {
break;
}
}
starItem.setIcon(hasUnfavedSelected ? R.drawable.baseline_star_24 : R.drawable.baseline_star_24);
final int newEditVisibility = canEditMessagesCount == 1 && selectedCount == 1 ? View.VISIBLE : View.GONE;
if (replyButton != null) {
boolean allowChatActions = true;
@ -11619,7 +11622,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
if (editItem != null) {
if (copyVisible != newCopyVisible || starVisible != newStarVisible) {
if (copyVisible != newCopyVisible || starChanged) {
if (newEditVisibility == View.VISIBLE) {
editItem.setAlpha(1.0f);
editItem.setScaleX(1.0f);

View File

@ -7,7 +7,7 @@ buildscript {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath 'com.android.tools.build:gradle:4.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21-2"
classpath 'com.google.gms:google-services:4.3.4'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'

View File

@ -1,6 +1,6 @@
#Fri Nov 20 09:53:27 UTC 2020
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME