From a6652350e6077e7762b75d9aa01bbadac05658e3 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 23 Jan 2021 16:23:20 +0100 Subject: [PATCH] Revised setup --- .../faircode/email/FragmentOptionsMisc.java | 2 +- .../java/eu/faircode/email/FragmentSetup.java | 42 -- app/src/main/res/layout/dialog_setup.xml | 32 +- app/src/main/res/layout/fragment_setup.xml | 542 +++++++----------- app/src/main/res/values/strings.xml | 24 +- 5 files changed, 223 insertions(+), 419 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index 4ccf209307..f7d02fbe26 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -137,7 +137,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc }; private final static String[] RESET_QUESTIONS = new String[]{ - "welcome", "first", "app_support", "notify_archive", "message_swipe", "message_select", "folder_actions", "folder_sync", + "first", "app_support", "notify_archive", "message_swipe", "message_select", "folder_actions", "folder_sync", "crash_reports_asked", "review_asked", "review_later", "why", "reply_hint", "html_always_images", "open_full_confirmed", "print_html_confirmed", "reformatted_hint", "selected_folders", "move_1_confirmed", "move_n_confirmed", diff --git a/app/src/main/java/eu/faircode/email/FragmentSetup.java b/app/src/main/java/eu/faircode/email/FragmentSetup.java index 86beb289c6..a6fea0da2c 100644 --- a/app/src/main/java/eu/faircode/email/FragmentSetup.java +++ b/app/src/main/java/eu/faircode/email/FragmentSetup.java @@ -57,18 +57,12 @@ import java.util.List; public class FragmentSetup extends FragmentBase { private ViewGroup view; - private TextView tvWelcome; - private ImageButton ibWelcome; - private ImageButton ibHelp; private Button btnQuick; private TextView tvQuickNew; - private TextView tvQuickRemark; - private TextView tvAccountDone; private Button btnAccount; - private TextView tvIdentityDone; private Button btnIdentity; private TextView tvIdentityWhat; private TextView tvNoComposable; @@ -85,7 +79,6 @@ public class FragmentSetup extends FragmentBase { private Button btnInbox; - private Group grpWelcome; private Group grpDataSaver; private int textColorPrimary; @@ -104,18 +97,13 @@ public class FragmentSetup extends FragmentBase { view = (ViewGroup) inflater.inflate(R.layout.fragment_setup, container, false); // Get controls - tvWelcome = view.findViewById(R.id.tvWelcome); - ibWelcome = view.findViewById(R.id.ibWelcome); ibHelp = view.findViewById(R.id.ibHelp); btnQuick = view.findViewById(R.id.btnQuick); tvQuickNew = view.findViewById(R.id.tvQuickNew); - tvQuickRemark = view.findViewById(R.id.tvQuickRemark); - tvAccountDone = view.findViewById(R.id.tvAccountDone); btnAccount = view.findViewById(R.id.btnAccount); - tvIdentityDone = view.findViewById(R.id.tvIdentityDone); btnIdentity = view.findViewById(R.id.btnIdentity); tvIdentityWhat = view.findViewById(R.id.tvIdentityWhat); tvNoComposable = view.findViewById(R.id.tvNoComposable); @@ -132,7 +120,6 @@ public class FragmentSetup extends FragmentBase { btnInbox = view.findViewById(R.id.btnInbox); - grpWelcome = view.findViewById(R.id.grpWelcome); grpDataSaver = view.findViewById(R.id.grpDataSaver); PackageManager pm = getContext().getPackageManager(); @@ -140,17 +127,6 @@ public class FragmentSetup extends FragmentBase { // Wire controls - tvWelcome.setText(getString(R.string.title_setup_welcome) - .replaceAll("^\\s+", "").replaceAll("\\s+", " ")); - - ibWelcome.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - prefs.edit().putBoolean("welcome", false).apply(); - grpWelcome.setVisibility(View.GONE); - } - }); - ibHelp.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -309,13 +285,6 @@ public class FragmentSetup extends FragmentBase { }); // Initialize - tvQuickRemark.setVisibility(View.GONE); - - tvAccountDone.setText(null); - tvAccountDone.setCompoundDrawables(null, null, null, null); - - tvIdentityDone.setText(null); - tvIdentityDone.setCompoundDrawables(null, null, null, null); btnIdentity.setEnabled(false); tvNoComposable.setVisibility(View.GONE); @@ -328,8 +297,6 @@ public class FragmentSetup extends FragmentBase { btnInbox.setEnabled(false); - boolean welcome = prefs.getBoolean("welcome", true); - grpWelcome.setVisibility(welcome ? View.VISIBLE : View.GONE); grpDataSaver.setVisibility(View.GONE); setContactsPermission(hasPermission(Manifest.permission.READ_CONTACTS)); @@ -379,12 +346,6 @@ public class FragmentSetup extends FragmentBase { public void onChanged(@Nullable List accounts) { done = (accounts != null && accounts.size() > 0); - tvQuickRemark.setVisibility(done ? View.VISIBLE : View.GONE); - - tvAccountDone.setText(done ? R.string.title_setup_done : R.string.title_setup_to_do); - tvAccountDone.setTextColor(done ? textColorPrimary : colorWarning); - tvAccountDone.setCompoundDrawablesWithIntrinsicBounds(done ? check : null, null, null, null); - btnIdentity.setEnabled(done); btnInbox.setEnabled(done); @@ -396,9 +357,6 @@ public class FragmentSetup extends FragmentBase { @Override public void onChanged(@Nullable List identities) { boolean done = (identities != null && identities.size() > 0); - tvIdentityDone.setText(done ? R.string.title_setup_done : R.string.title_setup_to_do); - tvIdentityDone.setTextColor(done ? textColorPrimary : colorWarning); - tvIdentityDone.setCompoundDrawablesWithIntrinsicBounds(done ? check : null, null, null, null); tvNoComposable.setVisibility(done ? View.GONE : View.VISIBLE); } }); diff --git a/app/src/main/res/layout/dialog_setup.xml b/app/src/main/res/layout/dialog_setup.xml index 0143dab94e..14f3efcf89 100644 --- a/app/src/main/res/layout/dialog_setup.xml +++ b/app/src/main/res/layout/dialog_setup.xml @@ -20,17 +20,17 @@ app:layout_constraintTop_toTopOf="parent" /> + app:srcCompat="@drawable/twotone_looks_two_24" /> + app:layout_constraintStart_toEndOf="@id/two" /> + app:layout_constraintTop_toBottomOf="@id/two" + app:srcCompat="@drawable/twotone_looks_3_24" /> + app:layout_constraintStart_toEndOf="@id/three" /> + app:layout_constraintTop_toBottomOf="@id/three" /> + app:constraint_referenced_ids="two,title2" /> + app:constraint_referenced_ids="three,title3" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_setup.xml b/app/src/main/res/layout/fragment_setup.xml index e323bcb20e..b2bac36401 100644 --- a/app/src/main/res/layout/fragment_setup.xml +++ b/app/src/main/res/layout/fragment_setup.xml @@ -17,59 +17,15 @@ android:layout_height="wrap_content" android:paddingBottom="24dp"> - - - - - - - - + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@drawable/twotone_looks_one_24" /> - - + android:textStyle="bold" + app:layout_constraintBottom_toBottomOf="@id/one" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/one" /> + app:layout_constraintTop_toBottomOf="@id/one" /> +