mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Address book requires contacts permissions
This commit is contained in:
parent
52be6a33ae
commit
94421c1e9a
2 changed files with 7 additions and 5 deletions
|
@ -104,6 +104,7 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
|
|||
private ViewType viewType;
|
||||
private IProperties properties;
|
||||
|
||||
private boolean contacts;
|
||||
private boolean avatars;
|
||||
private boolean debug;
|
||||
|
||||
|
@ -349,6 +350,7 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
|
|||
tvTime.setTextColor(colorUnseen);
|
||||
|
||||
grpExpanded.setVisibility(viewType == ViewType.THREAD && show_expanded ? View.VISIBLE : View.GONE);
|
||||
ivAddContact.setVisibility(viewType == ViewType.THREAD && show_expanded && contacts ? View.VISIBLE : View.GONE);
|
||||
pbHeaders.setVisibility(View.GONE);
|
||||
grpHeaders.setVisibility(show_headers && show_expanded ? View.VISIBLE : View.GONE);
|
||||
bnvActions.setVisibility(View.GONE);
|
||||
|
@ -373,7 +375,6 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
|
|||
tvTimeEx.setText(df.format(new Date(message.received)));
|
||||
}
|
||||
|
||||
ivAddContact.setVisibility(viewType == ViewType.THREAD ? View.VISIBLE : View.GONE);
|
||||
tvTo.setText(MessageHelper.getFormattedAddresses(message.to, true));
|
||||
tvReplyTo.setText(MessageHelper.getFormattedAddresses(message.reply, true));
|
||||
tvCc.setText(MessageHelper.getFormattedAddresses(message.cc, true));
|
||||
|
@ -1328,9 +1329,10 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
|
|||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
|
||||
this.avatars = (prefs.getBoolean("avatars", true) &&
|
||||
ContextCompat.checkSelfPermission(context, Manifest.permission.READ_CONTACTS)
|
||||
== PackageManager.PERMISSION_GRANTED);
|
||||
|
||||
this.contacts = (ContextCompat.checkSelfPermission(context, Manifest.permission.READ_CONTACTS)
|
||||
== PackageManager.PERMISSION_GRANTED);
|
||||
this.avatars = (prefs.getBoolean("avatars", true) && this.contacts);
|
||||
this.debug = prefs.getBoolean("debug", false);
|
||||
}
|
||||
|
||||
|
|
|
@ -494,6 +494,6 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="visible"
|
||||
app:constraint_referenced_ids="ivAddContact,vSeparatorAddress,tvFromExTitle,tvFromEx,tvToTitle,tvTo,tvReplyToTitle,tvReplyTo,tvCcTitle,tvCc,tvBccTitle,tvBcc,tvTimeEx,tvSubjectEx,tvBody" />
|
||||
app:constraint_referenced_ids="vSeparatorAddress,tvFromExTitle,tvFromEx,tvToTitle,tvTo,tvReplyToTitle,tvReplyTo,tvCcTitle,tvCc,tvBccTitle,tvBcc,tvTimeEx,tvSubjectEx,tvBody" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</FrameLayout>
|
Loading…
Reference in a new issue