mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-02 07:06:18 +02:00
Made search for sender public
This commit is contained in:
@@ -26,7 +26,6 @@ import android.app.Dialog;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
@@ -144,7 +143,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
|
||||
private boolean hasWebView;
|
||||
private boolean contacts;
|
||||
private boolean search;
|
||||
private float textSize;
|
||||
|
||||
private boolean date;
|
||||
@@ -759,9 +757,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
grpExpanded.setVisibility(View.VISIBLE);
|
||||
|
||||
boolean hasFrom = (message.from != null && message.from.length > 0);
|
||||
boolean hasTo = (message.to != null && message.to.length > 0);
|
||||
boolean hasChannel = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O);
|
||||
|
||||
ibSearchContact.setVisibility(show_addresses && search && BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
|
||||
ibSearchContact.setVisibility(show_addresses && (hasFrom || hasTo) ? View.VISIBLE : View.GONE);
|
||||
ibNotifyContact.setVisibility(show_addresses && hasChannel && hasFrom ? View.VISIBLE : View.GONE);
|
||||
ibAddContact.setVisibility(show_addresses && contacts && hasFrom ? View.VISIBLE : View.GONE);
|
||||
|
||||
@@ -1205,11 +1204,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
|
||||
@Override
|
||||
protected void onExecuted(Bundle args, Address[] addresses) {
|
||||
if (addresses != null && addresses.length > 0) {
|
||||
Intent search = new Intent(context, ActivityView.class);
|
||||
search.putExtra(Intent.EXTRA_PROCESS_TEXT, ((InternetAddress) addresses[0]).getAddress());
|
||||
context.startActivity(search);
|
||||
}
|
||||
String query = ((InternetAddress) addresses[0]).getAddress();
|
||||
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
|
||||
lbm.sendBroadcast(
|
||||
new Intent(ActivityView.ACTION_SEARCH)
|
||||
.putExtra("folder", -1L)
|
||||
.putExtra("query", query));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -3012,9 +3012,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
|
||||
this.hasWebView = Helper.hasWebView(context);
|
||||
this.contacts = Helper.hasPermission(context, Manifest.permission.READ_CONTACTS);
|
||||
this.search = (context.getPackageManager().getComponentEnabledSetting(
|
||||
new ComponentName(context, ActivitySearch.class)) ==
|
||||
PackageManager.COMPONENT_ENABLED_STATE_ENABLED);
|
||||
this.textSize = Helper.getTextSize(context, zoom);
|
||||
|
||||
this.date = prefs.getBoolean("date", true);
|
||||
|
||||
Reference in New Issue
Block a user