Select calendar improvements

pull/209/head
M66B 2 years ago
parent 2cc7b01296
commit d06743da43

@ -164,6 +164,7 @@ public class FragmentAccount extends FragmentBase {
private Group grpServer;
private Group grpAuthorize;
private Group grpCalendar;
private Group grpAdvanced;
private Group grpFolders;
private Group grpError;
@ -279,6 +280,7 @@ public class FragmentAccount extends FragmentBase {
grpServer = view.findViewById(R.id.grpServer);
grpAuthorize = view.findViewById(R.id.grpAuthorize);
grpCalendar = view.findViewById(R.id.grpCalendar);
grpAdvanced = view.findViewById(R.id.grpAdvanced);
grpFolders = view.findViewById(R.id.grpFolders);
grpError = view.findViewById(R.id.grpError);
@ -294,6 +296,7 @@ public class FragmentAccount extends FragmentBase {
? View.VISIBLE : View.GONE);
grpServer.setVisibility(position > 0 ? View.VISIBLE : View.GONE);
grpAuthorize.setVisibility(position > 0 ? View.VISIBLE : View.GONE);
grpCalendar.setVisibility(position > 0 && !BuildConfig.PLAY_STORE_RELEASE ? View.VISIBLE : View.GONE);
btnAdvanced.setVisibility(position > 0 ? View.VISIBLE : View.GONE);
if (position == 0)
@ -437,7 +440,6 @@ public class FragmentAccount extends FragmentBase {
}
});
btnCalendar.setVisibility(BuildConfig.PLAY_STORE_RELEASE ? View.GONE : View.VISIBLE);
btnCalendar.setEnabled(Helper.hasPermission(getContext(), Manifest.permission.WRITE_CALENDAR));
btnCalendar.setOnClickListener(new View.OnClickListener() {
@Override
@ -625,6 +627,7 @@ public class FragmentAccount extends FragmentBase {
grpServer.setVisibility(View.GONE);
grpAuthorize.setVisibility(View.GONE);
grpCalendar.setVisibility(View.GONE);
grpAdvanced.setVisibility(View.GONE);
grpFolders.setVisibility(View.GONE);
grpError.setVisibility(View.GONE);

@ -76,7 +76,8 @@ public class FragmentDialogCalendar extends FragmentDialogBase {
}
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(R.string.title_select_calendar);
builder.setIcon(R.drawable.twotone_event_24);
builder.setTitle(R.string.title_calendar);
builder.setSingleChoiceItems(names.toArray(new String[0]), checkedItem, new DialogInterface.OnClickListener() {
@Override

@ -458,15 +458,26 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvColorHint" />
<TextView
android:id="@+id/tvCalendar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_calendar"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvColorPro" />
<Button
android:id="@+id/btnCalendar"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_select_calendar"
android:drawableEnd="@drawable/twotone_event_24"
android:drawablePadding="6dp"
android:text="@string/title_select"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvColorPro" />
app:layout_constraintTop_toBottomOf="@id/tvCalendar" />
<Button
android:id="@+id/btnAdvanced"
@ -1120,9 +1131,15 @@
tvUser,etUser,tvPassword,tilPassword,tvCaseSensitive,tvAppPassword,tvPasswordStorage,
btnCertificate,tvCertificate,
tvRealm,etRealm,
tvName,tvNameRemark,etName,etCategory,
tvName,tvNameRemark,etName,tvCategory,etCategory,
tvColor,btnColor,tvColorHint,tvColorPro" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpCalendar"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvCalendar,btnCalendar" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpAdvanced"
android:layout_width="0dp"

@ -959,7 +959,6 @@
<string name="title_advanced_swipe_sensitivity">Left/right swipe sensitivity</string>
<string name="title_select">Select &#8230;</string>
<string name="title_select_calendar">Select calendar &#8230;</string>
<string name="title_identity_name">Your name</string>
<string name="title_identity_email">Your email address</string>
<string name="title_identity_tenant" translatable="false">Tenant ID</string>
@ -988,6 +987,7 @@
<string name="title_account_noop_hint">This will refresh the connection more actively, but also use more battery power</string>
<string name="title_account_partial_fetch_hint">Disable this only in case of empty messages or corrupt attachments</string>
<string name="title_color">Color</string>
<string name="title_calendar">Calendar</string>
<string name="title_background">Background</string>
<string name="title_transparent">Transparent</string>
<string name="title_account_ondemand">Synchronize manually</string>

Loading…
Cancel
Save