From a43535018c71451096d39c7532df6f7b7a02c3eb Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 22 Aug 2019 14:48:59 +0200 Subject: [PATCH] Added button disabled ref hint, srcCompat everywhere --- .../eu/faircode/email/FragmentCompose.java | 24 +++++-- app/src/main/res/layout/fragment_answer.xml | 4 +- app/src/main/res/layout/fragment_compose.xml | 66 ++++++++++++------- app/src/main/res/layout/fragment_identity.xml | 4 +- app/src/main/res/layout/fragment_messages.xml | 40 +++++------ .../res/layout/fragment_options_behavior.xml | 4 +- app/src/main/res/layout/fragment_setup.xml | 28 ++++---- .../res/layout/include_message_addresses.xml | 16 ++--- .../res/layout/include_message_compact.xml | 48 +++++++------- .../res/layout/include_message_navigation.xml | 12 ++-- .../res/layout/include_message_normal.xml | 48 +++++++------- app/src/main/res/layout/item_account.xml | 16 ++--- app/src/main/res/layout/item_identity.xml | 12 ++-- app/src/main/res/layout/item_image.xml | 4 +- app/src/main/res/layout/item_nav.xml | 8 +-- app/src/main/res/layout/item_operation.xml | 4 +- app/src/main/res/layout/item_order.xml | 4 +- app/src/main/res/layout/item_rule.xml | 4 +- 18 files changed, 190 insertions(+), 156 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 3fd8dbf854..2376a9e573 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -168,6 +168,7 @@ public class FragmentCompose extends FragmentBase { private TextView tvNoInternet; private TextView tvSignature; private TextView tvReference; + private ImageButton ibCloseRefHint; private ImageButton ibReferenceEdit; private ImageButton ibReferenceImages; private BottomNavigationView edit_bar; @@ -179,7 +180,7 @@ public class FragmentCompose extends FragmentBase { private Group grpAttachments; private Group grpBody; private Group grpSignature; - private Group grpReference; + private Group grpReferenceHint; private ContentResolver resolver; private AdapterAttachment adapter; @@ -260,6 +261,7 @@ public class FragmentCompose extends FragmentBase { tvNoInternet = view.findViewById(R.id.tvNoInternet); tvSignature = view.findViewById(R.id.tvSignature); tvReference = view.findViewById(R.id.tvReference); + ibCloseRefHint = view.findViewById(R.id.ibCloseRefHint); ibReferenceEdit = view.findViewById(R.id.ibReferenceEdit); ibReferenceImages = view.findViewById(R.id.ibReferenceImages); edit_bar = view.findViewById(R.id.edit_bar); @@ -272,7 +274,7 @@ public class FragmentCompose extends FragmentBase { grpAttachments = view.findViewById(R.id.grpAttachments); grpBody = view.findViewById(R.id.grpBody); grpSignature = view.findViewById(R.id.grpSignature); - grpReference = view.findViewById(R.id.grpReference); + grpReferenceHint = view.findViewById(R.id.grpReferenceHint); resolver = getContext().getContentResolver(); @@ -339,6 +341,15 @@ public class FragmentCompose extends FragmentBase { } }); + ibCloseRefHint.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); + prefs.edit().putBoolean("compose_reference", false).apply(); + grpReferenceHint.setVisibility(View.GONE); + } + }); + ibReferenceEdit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -425,9 +436,10 @@ public class FragmentCompose extends FragmentBase { tvNoInternet.setVisibility(View.GONE); grpBody.setVisibility(View.GONE); grpSignature.setVisibility(View.GONE); - grpReference.setVisibility(View.GONE); + grpReferenceHint.setVisibility(View.GONE); ibReferenceEdit.setVisibility(View.GONE); ibReferenceImages.setVisibility(View.GONE); + tvReference.setVisibility(View.GONE); edit_bar.setVisibility(View.GONE); bottom_navigation.setVisibility(View.GONE); pbWait.setVisibility(View.VISIBLE); @@ -2957,8 +2969,12 @@ public class FragmentCompose extends FragmentBase { boolean ref_has_images = args.getBoolean("ref_has_images"); + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); + boolean ref_hint = prefs.getBoolean("compose_reference", true); + tvReference.setText(text[1]); - grpReference.setVisibility(text[1] == null ? View.GONE : View.VISIBLE); + tvReference.setVisibility(text[1] == null ? View.GONE : View.VISIBLE); + grpReferenceHint.setVisibility(text[1] == null || !ref_hint ? View.GONE : View.VISIBLE); ibReferenceEdit.setVisibility(text[1] == null ? View.GONE : View.VISIBLE); ibReferenceImages.setVisibility(ref_has_images && !show_images ? View.VISIBLE : View.GONE); diff --git a/app/src/main/res/layout/fragment_answer.xml b/app/src/main/res/layout/fragment_answer.xml index 58fd745996..dafcdef6ac 100644 --- a/app/src/main/res/layout/fragment_answer.xml +++ b/app/src/main/res/layout/fragment_answer.xml @@ -64,9 +64,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/title_setup_help" - android:src="@drawable/baseline_info_24" app:layout_constraintBottom_toBottomOf="@id/etText" - app:layout_constraintEnd_toEndOf="@id/etText" /> + app:layout_constraintEnd_toEndOf="@id/etText" + app:srcCompat="@drawable/baseline_info_24" /> + + + + + + + + - - - - + app:layout_constraintTop_toBottomOf="@id/barrier_reference" /> + app:constraint_referenced_ids="ibCloseRefHint,tvReferenceHint" /> diff --git a/app/src/main/res/layout/fragment_identity.xml b/app/src/main/res/layout/fragment_identity.xml index 0e4f1f427a..3cfdb707cc 100644 --- a/app/src/main/res/layout/fragment_identity.xml +++ b/app/src/main/res/layout/fragment_identity.xml @@ -147,10 +147,10 @@ android:layout_marginStart="12dp" android:background="@null" android:contentDescription="@string/title_legend_default_color" - android:src="@drawable/baseline_delete_24" app:layout_constraintBottom_toBottomOf="@id/btnColor" app:layout_constraintStart_toEndOf="@id/vwColor" - app:layout_constraintTop_toTopOf="@id/btnColor" /> + app:layout_constraintTop_toTopOf="@id/btnColor" + app:srcCompat="@drawable/baseline_delete_24" /> + app:layout_constraintTop_toTopOf="@id/tvHintSupport" + app:srcCompat="@drawable/baseline_close_24" /> + app:layout_constraintTop_toTopOf="@id/tvHintSwipe" + app:srcCompat="@drawable/baseline_close_24" /> + app:layout_constraintTop_toTopOf="@id/tvHintSelect" + app:srcCompat="@drawable/baseline_close_24" /> + app:layout_constraintEnd_toEndOf="parent" + app:srcCompat="@drawable/baseline_reply_24" /> + app:layout_constraintStart_toStartOf="parent" + app:srcCompat="@drawable/baseline_vertical_align_bottom_24" /> + app:layout_constraintStart_toEndOf="@+id/ibDown" + app:srcCompat="@drawable/baseline_vertical_align_top_24" /> + app:backgroundTint="?attr/colorAccent" + app:srcCompat="@drawable/baseline_more_vert_24" /> + app:backgroundTint="?attr/colorAccent" + app:srcCompat="@drawable/baseline_youtube_searched_for_24" /> + app:backgroundTint="?attr/colorAccent" + app:srcCompat="@drawable/baseline_edit_24" /> + app:backgroundTint="@color/colorError" + app:srcCompat="@drawable/baseline_warning_24" /> diff --git a/app/src/main/res/layout/fragment_options_behavior.xml b/app/src/main/res/layout/fragment_options_behavior.xml index 29a236ff8d..84463566f8 100644 --- a/app/src/main/res/layout/fragment_options_behavior.xml +++ b/app/src/main/res/layout/fragment_options_behavior.xml @@ -195,11 +195,11 @@ android:layout_width="21dp" android:layout_height="21dp" android:contentDescription="@string/title_legend_auth" - android:src="@drawable/baseline_flag_24" android:tint="@color/colorError" app:layout_constraintBottom_toBottomOf="@+id/swAuthentication" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="@+id/swAuthentication" /> + app:layout_constraintTop_toTopOf="@+id/swAuthentication" + app:srcCompat="@drawable/baseline_flag_24" /> + app:layout_constraintTop_toTopOf="@id/tvWelcome" + app:srcCompat="@drawable/baseline_close_24" /> + app:layout_constraintTop_toBottomOf="@id/vSeparatorWelcome" + app:srcCompat="@drawable/baseline_fast_forward_24" /> + app:layout_constraintTop_toBottomOf="@id/vSeparatorAccount" + app:srcCompat="@drawable/baseline_looks_one_24" /> + app:layout_constraintTop_toBottomOf="@id/vSeparatorIdentity" + app:srcCompat="@drawable/baseline_looks_two_24" /> + app:layout_constraintTop_toBottomOf="@id/vSeparatorPermissions" + app:srcCompat="@drawable/baseline_looks_3_24" /> + app:layout_constraintTop_toBottomOf="@id/vSeparatorDoze" + app:srcCompat="@drawable/baseline_looks_4_24" /> + app:layout_constraintTop_toBottomOf="@id/vSeparatorInbox" + app:srcCompat="@drawable/baseline_looks_5_24" /> + app:layout_constraintTop_toBottomOf="@id/vSeparatorAddress" + app:srcCompat="@drawable/expander" /> + app:layout_constraintTop_toBottomOf="@id/ivExpanderAddress" + app:srcCompat="@drawable/baseline_search_24" /> + app:layout_constraintTop_toBottomOf="@id/ivExpanderAddress" + app:srcCompat="@drawable/baseline_notifications_24" /> + app:layout_constraintTop_toBottomOf="@id/ivExpanderAddress" + app:srcCompat="@drawable/baseline_import_contacts_24" /> + app:layout_constraintTop_toTopOf="@id/paddingTop" + app:srcCompat="@drawable/expander" /> + app:layout_constraintTop_toBottomOf="@id/paddingTop" + app:srcCompat="@drawable/baseline_person_24" /> + app:layout_constraintTop_toTopOf="@+id/tvSubject" + app:srcCompat="@drawable/baseline_edit_24" /> + app:layout_constraintTop_toTopOf="@+id/tvSubject" + app:srcCompat="@drawable/baseline_flag_24" /> + app:layout_constraintTop_toTopOf="@+id/tvSubject" + app:srcCompat="@drawable/baseline_timelapse_24" /> + app:layout_constraintTop_toTopOf="@+id/tvSubject" + app:srcCompat="@drawable/baseline_playlist_add_24" /> + app:layout_constraintTop_toTopOf="@+id/tvSubject" + app:srcCompat="@drawable/baseline_reply_24" /> + app:layout_constraintTop_toTopOf="@+id/tvSubject" + app:srcCompat="@drawable/baseline_notes_24" /> + app:layout_constraintTop_toTopOf="@+id/tvSubject" + app:srcCompat="@drawable/baseline_playlist_add_check_24" /> + app:layout_constraintTop_toTopOf="@+id/tvSubject" + app:srcCompat="@drawable/baseline_attachment_24" /> + app:layout_constraintTop_toTopOf="@+id/tvSubject" + app:srcCompat="@drawable/baseline_message_24" /> + app:layout_constraintTop_toBottomOf="@id/paddingTop" + app:srcCompat="@drawable/baseline_star_24" /> + app:layout_constraintTop_toBottomOf="@id/bnvActions" + app:srcCompat="@drawable/baseline_no_encryption_24" /> + app:layout_constraintTop_toBottomOf="@id/bnvActions" + app:srcCompat="@drawable/baseline_image_24" /> + app:layout_constraintTop_toBottomOf="@id/bnvActions" + app:srcCompat="@drawable/baseline_fullscreen_24" /> \ No newline at end of file diff --git a/app/src/main/res/layout/include_message_normal.xml b/app/src/main/res/layout/include_message_normal.xml index 1b646db9d0..f4a7debb51 100644 --- a/app/src/main/res/layout/include_message_normal.xml +++ b/app/src/main/res/layout/include_message_normal.xml @@ -28,11 +28,11 @@ android:layout_marginStart="6dp" android:background="?android:attr/selectableItemBackgroundBorderless" android:contentDescription="@string/title_legend_expander" - android:src="@drawable/expander" android:visibility="visible" app:layout_constraintBottom_toBottomOf="@+id/paddingBottom" app:layout_constraintStart_toEndOf="@id/vwColor" - app:layout_constraintTop_toTopOf="@id/paddingTop" /> + app:layout_constraintTop_toTopOf="@id/paddingTop" + app:srcCompat="@drawable/expander" /> + app:layout_constraintTop_toBottomOf="@id/paddingTop" + app:srcCompat="@drawable/baseline_person_24" /> + app:layout_constraintTop_toBottomOf="@id/paddingTop" + app:srcCompat="@drawable/baseline_star_24" /> + app:layout_constraintTop_toTopOf="@+id/tvFolder" + app:srcCompat="@drawable/baseline_edit_24" /> + app:layout_constraintTop_toTopOf="@+id/tvFolder" + app:srcCompat="@drawable/baseline_flag_24" /> + app:layout_constraintTop_toTopOf="@+id/tvFolder" + app:srcCompat="@drawable/baseline_timelapse_24" /> + app:layout_constraintTop_toTopOf="@+id/tvFolder" + app:srcCompat="@drawable/baseline_playlist_add_24" /> + app:layout_constraintTop_toTopOf="@+id/tvFolder" + app:srcCompat="@drawable/baseline_reply_24" /> + app:layout_constraintTop_toTopOf="@+id/tvFolder" + app:srcCompat="@drawable/baseline_notes_24" /> + app:layout_constraintTop_toTopOf="@+id/tvFolder" + app:srcCompat="@drawable/baseline_playlist_add_check_24" /> + app:layout_constraintTop_toTopOf="@+id/tvFolder" + app:srcCompat="@drawable/baseline_attachment_24" /> + app:layout_constraintTop_toTopOf="@+id/tvFolder" + app:srcCompat="@drawable/baseline_message_24" /> + app:layout_constraintTop_toTopOf="@+id/tvName" + app:srcCompat="@drawable/baseline_cloud_off_24" /> + app:layout_constraintTop_toTopOf="@+id/tvName" + app:srcCompat="@drawable/baseline_star_24" /> + app:layout_constraintTop_toTopOf="@+id/tvName" + app:srcCompat="@drawable/baseline_notifications_24" /> + app:layout_constraintTop_toTopOf="@+id/tvName" + app:srcCompat="@drawable/baseline_sync_24" /> + app:layout_constraintTop_toTopOf="@+id/tvName" + app:srcCompat="@drawable/baseline_cloud_off_24" /> + app:layout_constraintTop_toTopOf="@+id/tvName" + app:srcCompat="@drawable/baseline_star_24" /> + app:layout_constraintTop_toTopOf="@+id/tvName" + app:srcCompat="@drawable/baseline_sync_24" /> + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@mipmap/ic_launcher" /> + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@drawable/baseline_open_in_new_24" /> + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@drawable/baseline_warning_24" /> diff --git a/app/src/main/res/layout/item_operation.xml b/app/src/main/res/layout/item_operation.xml index 4ca4180b40..20afbc24ab 100644 --- a/app/src/main/res/layout/item_operation.xml +++ b/app/src/main/res/layout/item_operation.xml @@ -19,9 +19,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/title_legend_synchronizing" - android:src="@drawable/baseline_compare_arrows_24" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@drawable/baseline_compare_arrows_24" /> + app:layout_constraintTop_toTopOf="@+id/tvTitle" + app:srcCompat="@drawable/baseline_drag_handle_24" /> + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@drawable/baseline_stop_24" />