Added option to store email address of attendees

master
M66B 3 months ago
parent a881e89d47
commit 3fa74d95df

@ -323,6 +323,9 @@ public class CalendarHelper {
eventId = existId; eventId = existId;
} }
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean ical_email = prefs.getBoolean("ical_email", false);
for (Attendee a : event.getAttendees()) for (Attendee a : event.getAttendees())
try { try {
String email = a.getEmail(); String email = a.getEmail();
@ -334,8 +337,9 @@ public class CalendarHelper {
ContentValues avalues = new ContentValues(); ContentValues avalues = new ContentValues();
//if (!TextUtils.isEmpty(email)) if (!TextUtils.isEmpty(email) && ical_email)
// avalues.put(CalendarContract.Attendees.ATTENDEE_EMAIL, email); avalues.put(CalendarContract.Attendees.ATTENDEE_EMAIL, email);
if (TextUtils.isEmpty(name)) if (TextUtils.isEmpty(name))
name = email; name = email;
if (!TextUtils.isEmpty(name)) if (!TextUtils.isEmpty(name))

@ -114,7 +114,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SwitchCompat swExternalAnswer; private SwitchCompat swExternalAnswer;
private SwitchCompat swShortcuts; private SwitchCompat swShortcuts;
private SwitchCompat swICalTentative; private SwitchCompat swICalTentative;
private ImageButton ibICalTentative; private SwitchCompat swICalEmail;
private ImageButton ibICal;
private SwitchCompat swFts; private SwitchCompat swFts;
private ImageButton ibFts; private ImageButton ibFts;
private TextView tvFtsIndexed; private TextView tvFtsIndexed;
@ -287,7 +288,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private static final long MIN_FILE_SIZE = 1024 * 1024L; private static final long MIN_FILE_SIZE = 1024 * 1024L;
final static List<String> RESET_OPTIONS = Collections.unmodifiableList(Arrays.asList( final static List<String> RESET_OPTIONS = Collections.unmodifiableList(Arrays.asList(
"sort_answers", "shortcuts", "ical_tentative", "fts", "sort_answers", "shortcuts", "ical_tentative", "ical_email", "fts",
"classification", "class_min_probability", "class_min_difference", "classification", "class_min_probability", "class_min_difference",
"show_filtered", "haptic_feedback", "haptic_feedback_swipe", "show_filtered", "haptic_feedback", "haptic_feedback_swipe",
"language", "language",
@ -383,7 +384,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swExternalAnswer = view.findViewById(R.id.swExternalAnswer); swExternalAnswer = view.findViewById(R.id.swExternalAnswer);
swShortcuts = view.findViewById(R.id.swShortcuts); swShortcuts = view.findViewById(R.id.swShortcuts);
swICalTentative = view.findViewById(R.id.swICalTentative); swICalTentative = view.findViewById(R.id.swICalTentative);
ibICalTentative = view.findViewById(R.id.ibICalTentative); swICalEmail = view.findViewById(R.id.swICalEmail);
ibICal = view.findViewById(R.id.ibICal);
swFts = view.findViewById(R.id.swFts); swFts = view.findViewById(R.id.swFts);
ibFts = view.findViewById(R.id.ibFts); ibFts = view.findViewById(R.id.ibFts);
tvFtsIndexed = view.findViewById(R.id.tvFtsIndexed); tvFtsIndexed = view.findViewById(R.id.tvFtsIndexed);
@ -614,7 +616,15 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
} }
}); });
ibICalTentative.setOnClickListener(new View.OnClickListener() { swICalEmail.setVisibility(BuildConfig.PLAY_STORE_RELEASE ? View.GONE : View.VISIBLE);
swICalEmail.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("ical_email", checked).apply();
}
});
ibICal.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Helper.viewFAQ(v.getContext(), 186); Helper.viewFAQ(v.getContext(), 186);
@ -2473,6 +2483,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swShortcuts.setChecked(prefs.getBoolean("shortcuts", true)); swShortcuts.setChecked(prefs.getBoolean("shortcuts", true));
swICalTentative.setChecked(prefs.getBoolean("ical_tentative", true)); swICalTentative.setChecked(prefs.getBoolean("ical_tentative", true));
swFts.setChecked(prefs.getBoolean("fts", false)); swFts.setChecked(prefs.getBoolean("fts", false));
swICalEmail.setChecked(prefs.getBoolean("ical_email", false));
swClassification.setChecked(prefs.getBoolean("classification", false)); swClassification.setChecked(prefs.getBoolean("classification", false));

@ -168,8 +168,20 @@
app:layout_constraintTop_toBottomOf="@id/tvShortcutsHint" app:layout_constraintTop_toBottomOf="@id/tvShortcutsHint"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swICalEmail"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_ical_email"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swICalTentative"
app:switchPadding="12dp" />
<ImageButton <ImageButton
android:id="@+id/ibICalTentative" android:id="@+id/ibICal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
@ -177,7 +189,7 @@
android:contentDescription="@string/title_info" android:contentDescription="@string/title_info"
android:tooltipText="@string/title_info" android:tooltipText="@string/title_info"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swICalTentative" app:layout_constraintTop_toBottomOf="@id/swICalEmail"
app:srcCompat="@drawable/twotone_info_24" /> app:srcCompat="@drawable/twotone_info_24" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
@ -188,7 +200,7 @@
android:text="@string/title_advanced_fts" android:text="@string/title_advanced_fts"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ibICalTentative" app:layout_constraintTop_toBottomOf="@id/ibICal"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<TextView <TextView

@ -900,6 +900,7 @@
<string name="title_advanced_external_answer" translatable="false">Provide reply templates to other apps</string> <string name="title_advanced_external_answer" translatable="false">Provide reply templates to other apps</string>
<string name="title_advanced_shortcuts">Show frequently used contacts in Android share menu</string> <string name="title_advanced_shortcuts">Show frequently used contacts in Android share menu</string>
<string name="title_advanced_ical_tentative">Store received invitations as tentative</string> <string name="title_advanced_ical_tentative">Store received invitations as tentative</string>
<string name="title_advanced_ical_email">Store email address of attendees</string>
<string name="title_advanced_fts">Build search index</string> <string name="title_advanced_fts">Build search index</string>
<string name="title_advanced_fts_indexed">%1$d / %2$d messages indexed (%3$s)</string> <string name="title_advanced_fts_indexed">%1$d / %2$d messages indexed (%3$s)</string>
<string name="title_advanced_classification">Classify messages</string> <string name="title_advanced_classification">Classify messages</string>

Loading…
Cancel
Save