diff --git a/app/src/main/java/eu/faircode/email/FragmentSetup.java b/app/src/main/java/eu/faircode/email/FragmentSetup.java index c0572ed7a5..a6f648f270 100644 --- a/app/src/main/java/eu/faircode/email/FragmentSetup.java +++ b/app/src/main/java/eu/faircode/email/FragmentSetup.java @@ -39,11 +39,13 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; +import android.widget.ImageButton; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; +import androidx.constraintlayout.widget.Group; import androidx.core.content.ContextCompat; import androidx.lifecycle.Observer; import androidx.localbroadcastmanager.content.LocalBroadcastManager; @@ -54,6 +56,8 @@ import java.util.List; public class FragmentSetup extends FragmentBase { private ViewGroup view; + private ImageButton ibWelcome; + private Button btnHelp; private Button btnQuick; @@ -75,6 +79,8 @@ public class FragmentSetup extends FragmentBase { private Button btnInbox; + private Group grpWelcome; + private int textColorPrimary; private int colorWarning; private Drawable check; @@ -95,6 +101,8 @@ public class FragmentSetup extends FragmentBase { view = (ViewGroup) inflater.inflate(R.layout.fragment_setup, container, false); // Get controls + ibWelcome = view.findViewById(R.id.ibWelcome); + btnHelp = view.findViewById(R.id.btnHelp); btnQuick = view.findViewById(R.id.btnQuick); @@ -116,8 +124,20 @@ public class FragmentSetup extends FragmentBase { btnInbox = view.findViewById(R.id.btnInbox); + grpWelcome = view.findViewById(R.id.grpWelcome); + + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); + // Wire controls + ibWelcome.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + prefs.edit().putBoolean("welcome", false).apply(); + grpWelcome.setVisibility(View.GONE); + } + }); + btnHelp.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -208,6 +228,9 @@ public class FragmentSetup extends FragmentBase { btnInbox.setEnabled(false); + boolean welcome = prefs.getBoolean("welcome", true); + grpWelcome.setVisibility(welcome || BuildConfig.DEBUG ? View.VISIBLE : View.GONE); + int[] grantResults = new int[permissions.length]; for (int i = 0; i < permissions.length; i++) grantResults[i] = ContextCompat.checkSelfPermission(getActivity(), permissions[i]); diff --git a/app/src/main/res/layout/fragment_messages.xml b/app/src/main/res/layout/fragment_messages.xml index bcf3cbd538..5ad87eb6d4 100644 --- a/app/src/main/res/layout/fragment_messages.xml +++ b/app/src/main/res/layout/fragment_messages.xml @@ -66,7 +66,7 @@ android:layout_height="1dp" android:background="?attr/colorSeparator" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/ibHintSupport" /> + app:layout_constraintTop_toBottomOf="@id/tvHintSupport" /> + app:layout_constraintTop_toBottomOf="@id/tvHintSelect" /> + + + + + + + app:layout_constraintTop_toBottomOf="@id/vSeparatorWelcome" /> + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index be44d4f0ab..494487e0eb 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -103,6 +103,12 @@ Settings Help + + To receive and send messages you\'ll need to setup an account and identity. + This is not easier or not more difficult than in any other email app, + although some providers make this not very easy. + You can use the help button for instructions. + Quick setup To quickly setup an account and an identity for most providers The quick setup will fetch configuration information from autoconfig.thunderbird.net