Removed mPingHasConnection from BaseActivity and added setRefreshing(false) when connection is lost on MailboxActivity.

MAILAND-999
This commit is contained in:
Tomasz Giszczak 2020-10-22 09:23:53 +02:00
parent ef1d81919d
commit 93a54f0e2e
4 changed files with 2 additions and 33 deletions

View File

@ -102,9 +102,6 @@ public abstract class BaseActivity extends AppCompatActivity implements INetwork
public static final String EXTRA_IN_APP = "extra_in_app";
public static final int REQUEST_CODE_VALIDATE_PIN = 998;
@Deprecated
protected static boolean mPingHasConnection;
@Inject
protected ProtonMailApplication mApp;
@Inject

View File

@ -1,27 +0,0 @@
/*
* Copyright (c) 2020 Proton Technologies AG
*
* This file is part of ProtonMail.
*
* ProtonMail is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ProtonMail is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ProtonMail. If not, see https://www.gnu.org/licenses/.
*/
package ch.protonmail.android.activities
import androidx.lifecycle.ViewModel
import javax.inject.Inject
class ValidatePinViewModel @Inject constructor() : ViewModel() {
}

View File

@ -1171,6 +1171,7 @@ class MailboxActivity :
if (!isDohOngoing) {
Timber.d("DoH NOT ongoing showing UI")
if (!hasConnection) {
setRefreshing(false)
showNoConnSnackAndScheduleRetry()
} else {
hideNoConnSnack()

View File

@ -895,9 +895,7 @@ public class ContactDetailsActivity extends BaseActivity implements AppBarLayout
} else if (!vCardPhotos.get(0).getUrl().isEmpty()) {
contactAvatar.setName(mDisplayName);
contactAvatar.setAvatarType(TYPE_INITIALS);
if (mPingHasConnection) {
contactDetailsViewModel.getBitmapFromURL(photo.getUrl());
}
contactDetailsViewModel.getBitmapFromURL(photo.getUrl());
}
} else {
contactAvatar.setName(mDisplayName);