Added setup hint

pull/157/head
M66B 6 years ago
parent 4a4d003787
commit 20bdcf65b0

@ -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]);

@ -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" />
<TextView
android:id="@+id/tvHintSwipe"
@ -130,7 +130,7 @@
android:layout_height="1dp"
android:background="?attr/colorSeparator"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ibHintSelect" />
app:layout_constraintTop_toBottomOf="@id/tvHintSelect" />
<TextView
android:id="@+id/tvNoEmail"

@ -18,14 +18,47 @@
android:layout_height="wrap_content"
android:padding="12dp">
<TextView
android:id="@+id/tvWelcome"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="33dp"
android:text="@string/title_setup_welcome"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toStartOf="@+id/ibWelcome"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/ibWelcome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/title_legend_close_hint"
android:src="@drawable/baseline_close_24"
app:layout_constraintBottom_toBottomOf="@id/tvWelcome"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvWelcome" />
<View
android:id="@+id/vSeparatorWelcome"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="12dp"
android:background="?attr/colorSeparator"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvWelcome" />
<ImageView
android:id="@+id/fast"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginTop="12dp"
android:contentDescription="@string/title_setup_quick"
android:src="@drawable/baseline_fast_forward_24"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@id/vSeparatorWelcome" />
<TextView
android:layout_width="0dp"
@ -435,6 +468,13 @@
android:text="@string/title_setup_go"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/five" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpWelcome"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="
tvWelcome,ibWelcome,vSeparatorWelcome" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -103,6 +103,12 @@
<string name="title_setup">Settings</string>
<string name="title_setup_help">Help</string>
<string name="title_setup_welcome">
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.
</string>
<string name="title_setup_quick">Quick setup</string>
<string name="title_setup_quick_remark">To quickly setup an account and an identity for most providers</string>
<string name="title_setup_quick_hint">The quick setup will fetch configuration information from autoconfig.thunderbird.net</string>

Loading…
Cancel
Save