mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-25 15:32:52 +00:00
Refactoring
This commit is contained in:
parent
f8dd9018cd
commit
cb1e31f965
2 changed files with 27 additions and 23 deletions
|
@ -29,7 +29,6 @@ import android.app.NotificationChannel;
|
|||
import android.app.NotificationManager;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
|
@ -104,8 +103,6 @@ import androidx.annotation.NonNull;
|
|||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.browser.customtabs.CustomTabsClient;
|
||||
import androidx.browser.customtabs.CustomTabsServiceConnection;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.core.content.FileProvider;
|
||||
|
@ -4966,26 +4963,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
final Uri uri = getArguments().getParcelable("uri");
|
||||
final String title = getArguments().getString("title");
|
||||
|
||||
try {
|
||||
CustomTabsClient.bindCustomTabsService(getContext(), "com.android.chrome", new CustomTabsServiceConnection() {
|
||||
@Override
|
||||
public void onCustomTabsServiceConnected(@NonNull ComponentName name, @NonNull CustomTabsClient client) {
|
||||
Log.i("Warning up custom tabs");
|
||||
try {
|
||||
client.warmup(0);
|
||||
} catch (Throwable ex) {
|
||||
Log.w(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDisconnected(ComponentName name) {
|
||||
// Do nothing
|
||||
}
|
||||
});
|
||||
} catch (Throwable ex) {
|
||||
Log.w(ex);
|
||||
}
|
||||
Helper.customTabsWarmup(getContext());
|
||||
|
||||
final Uri sanitized;
|
||||
if (uri.isOpaque())
|
||||
|
|
|
@ -23,6 +23,7 @@ import android.Manifest;
|
|||
import android.app.Activity;
|
||||
import android.app.KeyguardManager;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
|
@ -75,7 +76,9 @@ import androidx.annotation.Nullable;
|
|||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.biometric.BiometricManager;
|
||||
import androidx.biometric.BiometricPrompt;
|
||||
import androidx.browser.customtabs.CustomTabsClient;
|
||||
import androidx.browser.customtabs.CustomTabsIntent;
|
||||
import androidx.browser.customtabs.CustomTabsServiceConnection;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.FileProvider;
|
||||
|
@ -451,6 +454,29 @@ public class Helper {
|
|||
}
|
||||
}
|
||||
|
||||
static void customTabsWarmup(Context context) {
|
||||
try {
|
||||
CustomTabsClient.bindCustomTabsService(context, "com.android.chrome", new CustomTabsServiceConnection() {
|
||||
@Override
|
||||
public void onCustomTabsServiceConnected(@NonNull ComponentName name, @NonNull CustomTabsClient client) {
|
||||
Log.i("Warning up custom tabs");
|
||||
try {
|
||||
client.warmup(0);
|
||||
} catch (Throwable ex) {
|
||||
Log.w(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDisconnected(ComponentName name) {
|
||||
// Do nothing
|
||||
}
|
||||
});
|
||||
} catch (Throwable ex) {
|
||||
Log.w(ex);
|
||||
}
|
||||
}
|
||||
|
||||
static void viewFAQ(Context context, int question) {
|
||||
if (question == 0)
|
||||
view(context, Uri.parse(FAQ_URI), false);
|
||||
|
|
Loading…
Reference in a new issue