mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 12:19:54 +01:00
Replace illustration for mailbox success
This commit is contained in:
@@ -22,12 +22,11 @@ import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.widget.ImageViewCompat;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import static android.view.View.FOCUS_DOWN;
|
||||
import static android.view.View.GONE;
|
||||
import static androidx.core.widget.ImageViewCompat.setImageTintList;
|
||||
import static org.briarproject.briar.android.util.UiUtils.hideViewOnSmallScreen;
|
||||
|
||||
/**
|
||||
* A fragment to be used at the end of a user flow
|
||||
@@ -61,7 +60,6 @@ public class FinalFragment extends Fragment {
|
||||
return f;
|
||||
}
|
||||
|
||||
private NestedScrollView scrollView;
|
||||
protected Button buttonView;
|
||||
protected final OnBackPressedCallback onBackPressedCallback =
|
||||
new OnBackPressedCallback(true) {
|
||||
@@ -79,7 +77,6 @@ public class FinalFragment extends Fragment {
|
||||
View v = inflater
|
||||
.inflate(R.layout.fragment_final, container, false);
|
||||
|
||||
scrollView = (NestedScrollView) v;
|
||||
ImageView iconView = v.findViewById(R.id.iconView);
|
||||
TextView titleView = v.findViewById(R.id.titleView);
|
||||
TextView textView = v.findViewById(R.id.textView);
|
||||
@@ -88,9 +85,12 @@ public class FinalFragment extends Fragment {
|
||||
Bundle args = requireArguments();
|
||||
titleView.setText(args.getInt(ARG_TITLE));
|
||||
iconView.setImageResource(args.getInt(ARG_ICON));
|
||||
int color = getResources().getColor(args.getInt(ARG_ICON_TINT));
|
||||
ColorStateList tint = ColorStateList.valueOf(color);
|
||||
ImageViewCompat.setImageTintList(iconView, tint);
|
||||
int tintRes = args.getInt(ARG_ICON_TINT);
|
||||
if (tintRes != 0) {
|
||||
int color = getResources().getColor(tintRes);
|
||||
ColorStateList tint = ColorStateList.valueOf(color);
|
||||
setImageTintList(iconView, tint);
|
||||
}
|
||||
int textRes = args.getInt(ARG_TEXT);
|
||||
if (textRes == 0) {
|
||||
textView.setVisibility(GONE);
|
||||
@@ -122,8 +122,7 @@ public class FinalFragment extends Fragment {
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
// Scroll down in case the screen is small, so the button is visible
|
||||
scrollView.post(() -> scrollView.fullScroll(FOCUS_DOWN));
|
||||
hideViewOnSmallScreen(requireView().findViewById(R.id.iconView));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -186,8 +186,7 @@ public class MailboxActivity extends BriarActivity {
|
||||
tag = ErrorFragment.TAG;
|
||||
} else if (s instanceof MailboxPairingState.Paired) {
|
||||
f = FinalFragment.newInstance(R.string.mailbox_setup_paired_title,
|
||||
R.drawable.ic_check_circle_outline,
|
||||
R.color.briar_brand_green,
|
||||
R.drawable.ic_check_circle, 0,
|
||||
R.string.mailbox_setup_paired_description);
|
||||
tag = FinalFragment.TAG;
|
||||
} else {
|
||||
|
||||
13
briar-android/src/main/res/drawable/ic_check_circle.xml
Normal file
13
briar-android/src/main/res/drawable/ic_check_circle.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="90dp"
|
||||
android:height="90dp"
|
||||
android:viewportWidth="91"
|
||||
android:viewportHeight="90">
|
||||
<path
|
||||
android:fillColor="@color/il_lime"
|
||||
android:pathData="M62.571,35.163C63.214,34.517 63.211,33.473 62.565,32.83C61.919,32.187 60.874,32.19 60.231,32.836L39.524,53.66L30.571,44.658C29.929,44.012 28.884,44.009 28.238,44.651C27.592,45.294 27.589,46.339 28.232,46.985L39.524,58.34L62.571,35.163Z" />
|
||||
<path
|
||||
android:fillColor="@color/il_lime"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M89.401,45C89.401,69.3 69.702,89 45.401,89C21.101,89 1.401,69.3 1.401,45C1.401,20.699 21.101,1 45.401,1C69.702,1 89.401,20.699 89.401,45ZM86.101,45C86.101,67.478 67.879,85.7 45.401,85.7C22.923,85.7 4.701,67.478 4.701,45C4.701,22.522 22.923,4.3 45.401,4.3C67.879,4.3 86.101,22.522 86.101,45Z" />
|
||||
</vector>
|
||||
@@ -1,70 +1,75 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true">
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iconView"
|
||||
android:layout_width="@dimen/hero_square"
|
||||
android:layout_height="@dimen/hero_square"
|
||||
android:layout_marginHorizontal="@dimen/margin_xlarge"
|
||||
android:layout_marginTop="@dimen/margin_xlarge"
|
||||
app:layout_constraintBottom_toTopOf="@+id/titleView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.25"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:srcCompat="@drawable/alerts_and_states_error"
|
||||
tools:tint="@color/briar_red_500" />
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/titleView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/margin_xlarge"
|
||||
android:layout_marginTop="@dimen/margin_xlarge"
|
||||
android:gravity="center"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline5"
|
||||
app:layout_constraintBottom_toTopOf="@+id/textView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iconView"
|
||||
tools:text="@string/removable_drive_error_send_title" />
|
||||
<ImageView
|
||||
android:id="@+id/iconView"
|
||||
android:layout_width="@dimen/hero_square"
|
||||
android:layout_height="@dimen/hero_square"
|
||||
android:layout_marginHorizontal="@dimen/margin_xlarge"
|
||||
android:layout_marginTop="@dimen/margin_xlarge"
|
||||
app:layout_constraintBottom_toTopOf="@+id/titleView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.25"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:srcCompat="@drawable/alerts_and_states_error"
|
||||
tools:tint="@color/briar_red_500" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/margin_xlarge"
|
||||
android:layout_marginTop="@dimen/margin_xlarge"
|
||||
android:layout_marginBottom="@dimen/margin_large"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
|
||||
app:layout_constraintBottom_toTopOf="@+id/button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/titleView"
|
||||
tools:text="@string/removable_drive_error_send_text" />
|
||||
<TextView
|
||||
android:id="@+id/titleView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/margin_xlarge"
|
||||
android:layout_marginTop="@dimen/margin_xlarge"
|
||||
android:gravity="center"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline5"
|
||||
app:layout_constraintBottom_toTopOf="@+id/textView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iconView"
|
||||
tools:text="@string/removable_drive_error_send_title" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button"
|
||||
style="@style/BriarButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/margin_large"
|
||||
android:text="@string/finish"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/margin_large"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/titleView"
|
||||
tools:text="@string/removable_drive_error_send_text" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</ScrollView>
|
||||
|
||||
<Button
|
||||
android:id="@+id/button"
|
||||
style="@style/BriarButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/margin_large"
|
||||
android:text="@string/finish"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -29,4 +29,5 @@
|
||||
|
||||
<color name="il_border">#64748B</color>
|
||||
<color name="il_background">#334155</color>
|
||||
<color name="il_lime">@color/briar_lime_400_new</color>
|
||||
</resources>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="briar_lime_600">#67a60f</color>
|
||||
<color name="briar_lime_600_new">#65A30D</color>
|
||||
<color name="briar_lime_400">#82c91e</color>
|
||||
<color name="briar_lime_400_new">#A3E635</color>
|
||||
|
||||
<color name="briar_blue_800">#134a81</color>
|
||||
<color name="briar_blue_600">#1b69b6</color>
|
||||
@@ -55,6 +57,7 @@
|
||||
|
||||
<color name="il_border">#9CA3AF</color>
|
||||
<color name="il_background">#E5E7EB</color>
|
||||
<color name="il_lime">@color/briar_lime_600_new</color>
|
||||
|
||||
<!-- text colors -->
|
||||
<color name="briar_text_link">@color/briar_blue_400</color>
|
||||
|
||||
Reference in New Issue
Block a user