Use cards for main setup

pull/198/head
M66B 4 years ago
parent 1733299393
commit 24373b4be9

@ -51,6 +51,7 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.PopupMenu;
import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.Observer;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
@ -91,7 +92,6 @@ public class FragmentSetup extends FragmentBase {
private Button btnInbox;
private Group grpManual;
private Group grpDoze;
private Group grpBackgroundRestricted;
private Group grpDataSaver;
@ -157,7 +157,6 @@ public class FragmentSetup extends FragmentBase {
btnInbox = view.findViewById(R.id.btnInbox);
grpManual = view.findViewById(R.id.grpManual);
grpDoze = view.findViewById(R.id.grpDoze);
grpBackgroundRestricted = view.findViewById(R.id.grpBackgroundRestricted);
grpDataSaver = view.findViewById(R.id.grpDataSaver);
@ -404,6 +403,9 @@ public class FragmentSetup extends FragmentBase {
});
// Initialize
if (!Helper.isDarkTheme(getContext()))
view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige));
btnIdentity.setEnabled(false);
tvNoComposable.setVisibility(View.GONE);
@ -416,7 +418,6 @@ public class FragmentSetup extends FragmentBase {
btnInbox.setEnabled(false);
grpDoze.setVisibility(Build.VERSION.SDK_INT < Build.VERSION_CODES.M ? View.GONE : View.VISIBLE);
grpBackgroundRestricted.setVisibility(View.GONE);
grpDataSaver.setVisibility(View.GONE);

@ -18,6 +18,23 @@
android:layout_height="wrap_content"
android:paddingBottom="24dp">
<androidx.cardview.widget.CardView
android:id="@+id/cardWelcome"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="3dp"
app:cardBackgroundColor="?attr/colorCardBackground"
app:cardCornerRadius="6dp"
app:cardElevation="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp">
<eu.faircode.email.FixedTextView
android:id="@+id/welcome"
android:layout_width="0dp"
@ -51,25 +68,34 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/intro" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<View
android:id="@+id/vSeparatorWizard"
android:layout_width="0dp"
android:layout_height="1dp"
<androidx.cardview.widget.CardView
android:id="@+id/cardWizard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="3dp"
android:layout_marginTop="12dp"
android:background="?attr/colorSeparator"
app:cardBackgroundColor="?attr/colorCardBackground"
app:cardCornerRadius="6dp"
app:cardElevation="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/simple" />
app:layout_constraintTop_toBottomOf="@+id/cardWelcome">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp">
<ImageView
android:id="@+id/one"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginTop="12dp"
android:contentDescription="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/vSeparatorWizard"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_looks_one_24" />
<eu.faircode.email.FixedTextView
@ -354,26 +380,42 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnInbox" />
<!-- permissions -->
<View
android:id="@+id/vSeparatorPermissions"
<androidx.constraintlayout.widget.Group
android:id="@+id/grpManual"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_height="0dp"
app:constraint_referenced_ids="
btnAccount,tvAccount,tvImap,tvPop,
btnIdentity,tvIdentity,tvSmtp,tvAliases,
tvAccountIdentity,tvExchangeSupport,tvIdentityWhat" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/cardPermissions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="3dp"
android:layout_marginTop="12dp"
android:background="?attr/colorSeparator"
app:cardBackgroundColor="?attr/colorCardBackground"
app:cardCornerRadius="6dp"
app:cardElevation="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvFree" />
app:layout_constraintTop_toBottomOf="@+id/cardWizard">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp">
<ImageView
android:id="@+id/two"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginTop="12dp"
android:contentDescription="2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorPermissions"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_looks_two_24" />
<eu.faircode.email.FixedTextView
@ -419,27 +461,34 @@
android:text="@string/title_setup_grant"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPermissions" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<!-- doze -->
<View
android:id="@+id/vSeparatorDoze"
android:layout_width="0dp"
android:layout_height="1dp"
<androidx.cardview.widget.CardView
android:id="@+id/cardDoze"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="3dp"
android:layout_marginTop="12dp"
android:background="?attr/colorSeparator"
app:cardBackgroundColor="?attr/colorCardBackground"
app:cardCornerRadius="6dp"
app:cardElevation="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnPermissions" />
app:layout_constraintTop_toBottomOf="@+id/cardPermissions">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp">
<ImageView
android:id="@+id/three"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginTop="12dp"
android:contentDescription="3"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorDoze"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_looks_3_24" />
<eu.faircode.email.FixedTextView
@ -566,21 +615,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvBatteryUsage" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpManual"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="
btnAccount,tvAccount,tvImap,tvPop,
btnIdentity,tvIdentity,tvSmtp,tvAliases,
tvAccountIdentity,tvExchangeSupport,tvIdentityWhat" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpDoze"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="three,title3,tvDoze,tvDozeDone,btnDoze,tvDozeHint" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpBackgroundRestricted"
android:layout_width="0dp"
@ -593,4 +627,6 @@
android:layout_height="0dp"
app:constraint_referenced_ids="tvDataSaver,btnDataSaver" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
</eu.faircode.email.ScrollViewEx>

Loading…
Cancel
Save