mirror of https://github.com/M66B/FairEmail.git
Added support for online meeting URLs
This commit is contained in:
parent
6b3c7078e1
commit
50da7f2b77
|
@ -350,6 +350,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
private static final int MAX_RECIPIENTS_COMPACT = 3;
|
||||
private static final int MAX_RECIPIENTS_NORMAL = 7;
|
||||
|
||||
private static final String X_ONLINE_MEETING = "X-MICROSOFT-ONLINEMEETINGEXTERNALLINK";
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder implements
|
||||
View.OnClickListener,
|
||||
View.OnLongClickListener,
|
||||
|
@ -515,6 +517,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
private Flow flow;
|
||||
|
||||
private ImageButton ibCalendar;
|
||||
private ImageButton ibOnline;
|
||||
private TextView tvCalendarSummary;
|
||||
private TextView tvCalendarDescription;
|
||||
private TextView tvCalendarLocation;
|
||||
|
@ -861,6 +864,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
tvNoInternetHeaders = vsBody.findViewById(R.id.tvNoInternetHeaders);
|
||||
|
||||
ibCalendar = vsBody.findViewById(R.id.ibCalendar);
|
||||
ibOnline = vsBody.findViewById(R.id.ibOnline);
|
||||
tvCalendarSummary = vsBody.findViewById(R.id.tvCalendarSummary);
|
||||
tvCalendarDescription = vsBody.findViewById(R.id.tvCalendarDescription);
|
||||
tvCalendarLocation = vsBody.findViewById(R.id.tvCalendarLocation);
|
||||
|
@ -1117,6 +1121,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
tvBody.addOnLayoutChangeListener(this);
|
||||
|
||||
ibCalendar.setOnClickListener(this);
|
||||
ibOnline.setOnClickListener(this);
|
||||
btnCalendarAccept.setOnClickListener(this);
|
||||
btnCalendarDecline.setOnClickListener(this);
|
||||
btnCalendarMaybe.setOnClickListener(this);
|
||||
|
@ -1238,6 +1243,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
btnCalendarDecline.setOnClickListener(null);
|
||||
btnCalendarMaybe.setOnClickListener(null);
|
||||
ibCalendar.setOnClickListener(null);
|
||||
ibOnline.setOnClickListener(null);
|
||||
|
||||
btnCalendarAccept.setOnLongClickListener(null);
|
||||
btnCalendarDecline.setOnLongClickListener(null);
|
||||
|
@ -1891,6 +1897,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
|
||||
private void clearCalendar() {
|
||||
ibCalendar.setVisibility(View.GONE);
|
||||
ibOnline.setVisibility(View.GONE);
|
||||
tvCalendarSummary.setVisibility(View.GONE);
|
||||
tvCalendarDescription.setVisibility(View.GONE);
|
||||
tvCalendarLocation.setVisibility(View.GONE);
|
||||
|
@ -3758,7 +3765,11 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
|
||||
Organizer organizer = event.getOrganizer();
|
||||
|
||||
RawProperty prop = event.getExperimentalProperty(X_ONLINE_MEETING);
|
||||
String uri = (prop == null ? null : prop.getValue());
|
||||
|
||||
ibCalendar.setVisibility(View.VISIBLE);
|
||||
ibOnline.setVisibility(TextUtils.isEmpty(uri) ? View.GONE : View.VISIBLE);
|
||||
|
||||
tvCalendarSummary.setText(summary);
|
||||
tvCalendarSummary.setVisibility(TextUtils.isEmpty(summary) ? View.GONE : View.VISIBLE);
|
||||
|
@ -3955,6 +3966,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
return intent;
|
||||
}
|
||||
|
||||
if (action == R.id.ibOnline) {
|
||||
RawProperty prop = event.getExperimentalProperty(X_ONLINE_MEETING);
|
||||
String uri = (prop == null ? null : prop.getValue());
|
||||
return (uri == null ? null : Uri.parse(uri));
|
||||
}
|
||||
|
||||
Created created = event.getCreated();
|
||||
LastModified modified = event.getLastModified();
|
||||
Transparency transparancy = event.getTransparency();
|
||||
|
@ -4104,7 +4121,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
} catch (Throwable ex) {
|
||||
Helper.reportNoViewer(context, (Intent) result, ex);
|
||||
}
|
||||
}
|
||||
} else if (result instanceof Uri)
|
||||
Helper.view(context, (Uri) result, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -4462,7 +4480,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
} else if (id == R.id.ibImportance) {
|
||||
int importance = (((message.ui_importance == null ? 1 : message.ui_importance) + 1) % 3);
|
||||
onMenuSetImportance(message, importance);
|
||||
} else if (id == R.id.btnCalendarAccept || id == R.id.btnCalendarDecline || id == R.id.btnCalendarMaybe || id == R.id.ibCalendar) {
|
||||
} else if (id == R.id.btnCalendarAccept || id == R.id.btnCalendarDecline || id == R.id.btnCalendarMaybe ||
|
||||
id == R.id.ibCalendar || id == R.id.ibOnline) {
|
||||
onActionCalendar(message, view.getId(), false);
|
||||
} else if (id == R.id.ibStoreMedia) {
|
||||
onStoreMedia(message);
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M18,10.48V6c0,-1.1 -0.9,-2 -2,-2H4C2.9,4 2,4.9 2,6v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2v-4.48l4,3.98v-11L18,10.48zM16,18H4V6h12V18zM10,12c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2s-2,0.9 -2,2S8.9,12 10,12zM14,15.43c0,-0.81 -0.48,-1.53 -1.22,-1.85C11.93,13.21 10.99,13 10,13c-0.99,0 -1.93,0.21 -2.78,0.58C6.48,13.9 6,14.62 6,15.43V16h8V15.43z"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M4,18h12V9.69V6H4V18zM10,8c1.1,0 2,0.9 2,2s-0.9,2 -2,2s-2,-0.9 -2,-2S8.9,8 10,8zM6,15.43c0,-0.81 0.48,-1.53 1.22,-1.85C8.07,13.21 9.01,13 10,13c0.99,0 1.93,0.21 2.78,0.58C13.52,13.9 14,14.62 14,15.43V16H6V15.43z"
|
||||
android:strokeAlpha="0.3"
|
||||
android:fillAlpha="0.3"/>
|
||||
</vector>
|
|
@ -24,11 +24,24 @@
|
|||
android:contentDescription="@string/title_icalendar_calendar"
|
||||
android:padding="6dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:tooltipText="@string/title_icalendar_accept"
|
||||
android:tooltipText="@string/title_icalendar_calendar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/vSeparatorCalendar"
|
||||
app:srcCompat="@drawable/twotone_event_24" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibOnline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/title_icalendar_calendar"
|
||||
android:padding="6dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:tooltipText="@string/title_icalendar_accept"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tvAttendees"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:srcCompat="@drawable/twotone_video_camera_front_24" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCalendarSummary"
|
||||
android:layout_width="0dp"
|
||||
|
|
Loading…
Reference in New Issue