Simplification

https://issuetracker.google.com/issues/159730587
This commit is contained in:
M66B
2020-07-17 15:46:02 +02:00
parent f35fca5a1a
commit aae2808f5c
5 changed files with 13 additions and 60 deletions

View File

@@ -23,11 +23,9 @@ import android.app.Dialog;
import android.app.TimePickerDialog;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.provider.ContactsContract;
@@ -277,13 +275,7 @@ public class FragmentRule extends FragmentBase {
@Override
public void onClick(View v) {
Intent pick = new Intent(Intent.ACTION_PICK, ContactsContract.CommonDataKinds.Email.CONTENT_URI);
PackageManager pm = getContext().getPackageManager();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R && // should be system whitelisted
pick.resolveActivity(pm) == null)
Snackbar.make(view, R.string.title_no_contacts, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
startActivityForResult(Helper.getChooser(getContext(), pick), REQUEST_SENDER);
startActivityForResult(Helper.getChooser(getContext(), pick), REQUEST_SENDER);
}
});
@@ -300,13 +292,7 @@ public class FragmentRule extends FragmentBase {
@Override
public void onClick(View v) {
Intent pick = new Intent(Intent.ACTION_PICK, ContactsContract.CommonDataKinds.Email.CONTENT_URI);
PackageManager pm = getContext().getPackageManager();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R && // should be system whitelisted
pick.resolveActivity(pm) == null)
Snackbar.make(view, R.string.title_no_contacts, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
startActivityForResult(Helper.getChooser(getContext(), pick), REQUEST_RECIPIENT);
startActivityForResult(Helper.getChooser(getContext(), pick), REQUEST_RECIPIENT);
}
});