Skip to content

Commit

Permalink
feat(coinjoin): pick privacy level (#1217)
Browse files Browse the repository at this point in the history
* feat: coinjoin menu item

* feat: coinjoin info fragment

* fix: icons

* fix: back button

* feat: coinjoin levels UI

* fix: ui glitch
  • Loading branch information
Syn-McJ authored Oct 10, 2023
1 parent 7f1ca22 commit c97e236
Show file tree
Hide file tree
Showing 27 changed files with 590 additions and 577 deletions.
12 changes: 4 additions & 8 deletions common/src/main/res/drawable/ic_advanced_privacy.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
android:height="23dp"
android:viewportWidth="18"
android:viewportHeight="23">
<path
android:pathData="M8.848,22.094C8.934,22.094 9.037,22.076 9.159,22.04C9.288,22.011 9.421,21.961 9.557,21.89C11.089,21.088 12.371,20.364 13.402,19.72C14.441,19.075 15.268,18.438 15.884,17.808C16.507,17.177 16.954,16.501 17.227,15.777C17.499,15.047 17.635,14.198 17.635,13.231V5.132C17.635,4.58 17.517,4.183 17.28,3.939C17.051,3.696 16.711,3.481 16.26,3.295C16.009,3.188 15.665,3.051 15.229,2.887C14.792,2.722 14.308,2.543 13.778,2.35C13.255,2.156 12.729,1.963 12.199,1.77C11.676,1.576 11.197,1.404 10.76,1.254C10.33,1.096 9.99,0.975 9.739,0.889C9.596,0.846 9.449,0.81 9.299,0.781C9.148,0.753 8.998,0.738 8.848,0.738C8.697,0.738 8.547,0.753 8.396,0.781C8.253,0.81 8.11,0.846 7.967,0.889C7.716,0.975 7.372,1.096 6.936,1.254C6.499,1.404 6.015,1.576 5.485,1.77C4.963,1.956 4.436,2.149 3.906,2.35C3.383,2.543 2.904,2.726 2.467,2.897C2.03,3.062 1.686,3.195 1.436,3.295C0.992,3.474 0.651,3.689 0.415,3.939C0.179,4.183 0.061,4.58 0.061,5.132V13.231C0.061,14.198 0.2,15.04 0.479,15.756C0.766,16.465 1.221,17.127 1.844,17.743C2.474,18.352 3.305,18.982 4.336,19.634C5.374,20.285 6.642,21.037 8.139,21.89C8.275,21.961 8.404,22.011 8.525,22.04C8.654,22.076 8.762,22.094 8.848,22.094Z"
android:fillColor="#CED2D5"/>
<vector android:autoMirrored="true" android:height="22dp"
android:viewportHeight="22" android:viewportWidth="18"
android:width="18dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#008DE4" android:pathData="M9,21.678C9.086,21.678 9.19,21.66 9.312,21.624C9.44,21.595 9.573,21.545 9.709,21.474C11.241,20.671 12.523,19.948 13.555,19.304C14.593,18.659 15.42,18.022 16.036,17.392C16.659,16.761 17.107,16.085 17.379,15.361C17.651,14.631 17.787,13.782 17.787,12.815V4.716C17.787,4.164 17.669,3.767 17.433,3.523C17.204,3.28 16.863,3.065 16.412,2.879C16.162,2.771 15.818,2.635 15.381,2.471C14.944,2.306 14.461,2.127 13.931,1.934C13.408,1.74 12.882,1.547 12.352,1.354C11.829,1.16 11.349,0.988 10.912,0.838C10.482,0.68 10.142,0.559 9.892,0.473C9.748,0.43 9.602,0.394 9.451,0.365C9.301,0.337 9.15,0.322 9,0.322C8.85,0.322 8.699,0.337 8.549,0.365C8.406,0.394 8.262,0.43 8.119,0.473C7.868,0.559 7.525,0.68 7.088,0.838C6.651,0.988 6.168,1.16 5.638,1.354C5.115,1.54 4.589,1.733 4.059,1.934C3.536,2.127 3.056,2.31 2.619,2.481C2.182,2.646 1.839,2.779 1.588,2.879C1.144,3.058 0.804,3.273 0.567,3.523C0.331,3.767 0.213,4.164 0.213,4.716V12.815C0.213,13.782 0.353,14.624 0.632,15.34C0.918,16.049 1.373,16.711 1.996,17.327C2.626,17.936 3.457,18.566 4.488,19.218C5.527,19.869 6.794,20.621 8.291,21.474C8.427,21.545 8.556,21.595 8.678,21.624C8.807,21.66 8.914,21.678 9,21.678ZM4.155,11.354C4.155,11.204 4.216,11.061 4.338,10.925L10.407,3.309C10.565,3.115 10.733,3.022 10.912,3.029C11.098,3.029 11.241,3.104 11.342,3.255C11.449,3.398 11.456,3.588 11.363,3.824L9.354,9.206H13.114C13.257,9.206 13.376,9.253 13.469,9.346C13.569,9.439 13.619,9.557 13.619,9.7C13.619,9.843 13.558,9.987 13.436,10.13L7.367,17.746C7.217,17.94 7.049,18.036 6.862,18.036C6.676,18.029 6.529,17.95 6.422,17.8C6.322,17.649 6.318,17.456 6.411,17.22L8.42,11.838H4.66C4.517,11.838 4.395,11.795 4.295,11.709C4.202,11.616 4.155,11.498 4.155,11.354Z"/>
</vector>
2 changes: 1 addition & 1 deletion common/src/main/res/drawable/ic_clock.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
android:viewportHeight="13">
<path
android:pathData="M2.961,7.402H6.02C6.137,7.402 6.234,7.363 6.313,7.285C6.391,7.207 6.43,7.109 6.43,6.992V3.043C6.43,2.93 6.391,2.834 6.313,2.756C6.234,2.678 6.137,2.639 6.02,2.639C5.906,2.639 5.811,2.678 5.732,2.756C5.654,2.834 5.615,2.93 5.615,3.043V6.588H2.961C2.844,6.588 2.746,6.627 2.668,6.705C2.59,6.783 2.551,6.879 2.551,6.992C2.551,7.109 2.59,7.207 2.668,7.285C2.746,7.363 2.844,7.402 2.961,7.402ZM6.025,12.746C6.842,12.746 7.609,12.59 8.328,12.277C9.051,11.965 9.688,11.533 10.238,10.982C10.789,10.432 11.221,9.797 11.533,9.078C11.846,8.355 12.002,7.586 12.002,6.77C12.002,5.953 11.846,5.186 11.533,4.467C11.221,3.744 10.789,3.107 10.238,2.557C9.688,2.006 9.051,1.574 8.328,1.262C7.605,0.949 6.836,0.793 6.02,0.793C5.203,0.793 4.434,0.949 3.711,1.262C2.992,1.574 2.357,2.006 1.807,2.557C1.26,3.107 0.83,3.744 0.518,4.467C0.205,5.186 0.049,5.953 0.049,6.77C0.049,7.586 0.205,8.355 0.518,9.078C0.83,9.797 1.262,10.432 1.813,10.982C2.363,11.533 2.998,11.965 3.717,12.277C4.439,12.59 5.209,12.746 6.025,12.746ZM6.025,11.75C5.334,11.75 4.688,11.621 4.086,11.363C3.484,11.106 2.955,10.75 2.498,10.297C2.045,9.84 1.689,9.311 1.432,8.709C1.178,8.107 1.051,7.461 1.051,6.77C1.051,6.078 1.178,5.432 1.432,4.83C1.689,4.229 2.045,3.699 2.498,3.242C2.951,2.785 3.479,2.43 4.08,2.176C4.682,1.918 5.328,1.789 6.02,1.789C6.711,1.789 7.357,1.918 7.959,2.176C8.564,2.43 9.094,2.785 9.547,3.242C10.004,3.699 10.361,4.229 10.619,4.83C10.877,5.432 11.006,6.078 11.006,6.77C11.006,7.461 10.877,8.107 10.619,8.709C10.365,9.311 10.01,9.84 9.553,10.297C9.096,10.75 8.566,11.106 7.965,11.363C7.363,11.621 6.717,11.75 6.025,11.75Z"
android:fillColor="#191C1F"/>
android:fillColor="@color/content_primary"/>
</vector>
12 changes: 4 additions & 8 deletions common/src/main/res/drawable/ic_intermediate_privacy.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="19dp"
android:height="23dp"
android:viewportWidth="19"
android:viewportHeight="23">
<path
android:pathData="M0.921,13.371C0.921,14.352 1.064,15.204 1.351,15.928C1.637,16.651 2.099,17.324 2.736,17.947C3.374,18.57 4.215,19.215 5.261,19.881C6.313,20.547 7.603,21.31 9.128,22.169C9.264,22.241 9.396,22.294 9.525,22.33C9.654,22.366 9.762,22.384 9.848,22.384C9.934,22.384 10.041,22.366 10.17,22.33C10.299,22.294 10.431,22.241 10.567,22.169C12.1,21.31 13.389,20.547 14.435,19.881C15.487,19.222 16.332,18.581 16.97,17.958C17.607,17.335 18.065,16.662 18.345,15.939C18.631,15.208 18.774,14.352 18.774,13.371V5.153C18.774,4.588 18.656,4.183 18.42,3.939C18.184,3.696 17.836,3.478 17.378,3.284C17.127,3.177 16.78,3.041 16.336,2.876C15.892,2.704 15.401,2.521 14.864,2.328C14.334,2.128 13.801,1.931 13.264,1.737C12.727,1.544 12.236,1.368 11.792,1.211C11.348,1.053 11.001,0.932 10.75,0.846C10.607,0.803 10.456,0.767 10.299,0.738C10.148,0.702 9.998,0.685 9.848,0.685C9.697,0.685 9.547,0.702 9.396,0.738C9.246,0.774 9.099,0.81 8.956,0.846C8.698,0.917 8.347,1.032 7.903,1.189C7.459,1.34 6.969,1.515 6.432,1.716C5.902,1.909 5.368,2.106 4.831,2.307C4.294,2.507 3.803,2.693 3.359,2.865C2.915,3.037 2.568,3.177 2.317,3.284C1.866,3.47 1.519,3.689 1.275,3.939C1.039,4.183 0.921,4.588 0.921,5.153V13.371ZM10.073,20.396V2.446C10.102,2.453 10.13,2.461 10.159,2.468C10.195,2.475 10.234,2.489 10.277,2.511C10.6,2.64 10.976,2.786 11.405,2.951C11.835,3.109 12.286,3.277 12.759,3.456C13.239,3.628 13.715,3.8 14.188,3.972C14.667,4.144 15.122,4.308 15.552,4.466C15.989,4.616 16.375,4.749 16.712,4.863C16.855,4.913 16.948,4.985 16.991,5.078C17.041,5.171 17.066,5.307 17.066,5.486V12.974C17.066,13.804 16.955,14.51 16.733,15.09C16.519,15.67 16.157,16.204 15.648,16.69C15.147,17.177 14.474,17.693 13.629,18.237C12.791,18.782 11.753,19.43 10.514,20.182C10.435,20.232 10.356,20.275 10.277,20.31C10.206,20.346 10.138,20.375 10.073,20.396Z"
android:fillColor="#CED2D5"/>
<vector android:autoMirrored="true" android:height="22dp"
android:viewportHeight="22" android:viewportWidth="18"
android:width="18dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#008DE4" android:pathData="M0.073,12.837C0.073,13.818 0.216,14.67 0.503,15.394C0.789,16.117 1.251,16.79 1.889,17.413C2.526,18.036 3.368,18.681 4.413,19.347C5.466,20.013 6.755,20.775 8.28,21.635C8.416,21.706 8.549,21.76 8.678,21.796C8.807,21.832 8.914,21.85 9,21.85C9.086,21.85 9.193,21.832 9.322,21.796C9.451,21.76 9.584,21.706 9.72,21.635C11.252,20.775 12.541,20.013 13.587,19.347C14.64,18.688 15.485,18.047 16.122,17.424C16.759,16.801 17.218,16.128 17.497,15.404C17.784,14.674 17.927,13.818 17.927,12.837V4.619C17.927,4.053 17.809,3.649 17.572,3.405C17.336,3.162 16.989,2.943 16.53,2.75C16.28,2.643 15.932,2.507 15.488,2.342C15.044,2.17 14.554,1.987 14.017,1.794C13.487,1.593 12.953,1.396 12.416,1.203C11.879,1.01 11.388,0.834 10.944,0.677C10.5,0.519 10.153,0.397 9.902,0.312C9.759,0.269 9.609,0.233 9.451,0.204C9.301,0.168 9.15,0.15 9,0.15C8.85,0.15 8.699,0.168 8.549,0.204C8.398,0.24 8.252,0.276 8.108,0.312C7.851,0.383 7.5,0.498 7.056,0.655C6.612,0.806 6.121,0.981 5.584,1.182C5.054,1.375 4.521,1.572 3.983,1.772C3.446,1.973 2.956,2.159 2.512,2.331C2.068,2.503 1.72,2.643 1.47,2.75C1.019,2.936 0.671,3.155 0.428,3.405C0.191,3.649 0.073,4.053 0.073,4.619V12.837ZM9.226,19.862V1.912C9.254,1.919 9.283,1.926 9.312,1.934C9.347,1.941 9.387,1.955 9.43,1.977C9.752,2.105 10.128,2.252 10.558,2.417C10.987,2.575 11.439,2.743 11.911,2.922C12.391,3.094 12.867,3.266 13.34,3.438C13.82,3.609 14.274,3.774 14.704,3.932C15.141,4.082 15.528,4.215 15.864,4.329C16.007,4.379 16.101,4.451 16.144,4.544C16.194,4.637 16.219,4.773 16.219,4.952V12.439C16.219,13.27 16.108,13.976 15.886,14.556C15.671,15.136 15.309,15.669 14.801,16.156C14.3,16.643 13.626,17.159 12.781,17.703C11.943,18.247 10.905,18.896 9.666,19.647C9.587,19.698 9.508,19.741 9.43,19.776C9.358,19.812 9.29,19.841 9.226,19.862Z"/>
</vector>
4 changes: 2 additions & 2 deletions common/src/main/res/drawable/light_grey_border_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<shape android:shape="rectangle" >
<corners android:radius="14dp" />
<solid android:color="@color/background_secondary" />
<stroke android:color="@color/light_gray" android:width="1.5dp"/>
<stroke android:color="@color/divider_color" android:width="1.5dp"/>
</shape>
</item>
<item android:state_pressed="true">
Expand All @@ -25,7 +25,7 @@
<shape android:shape="rectangle" >
<corners android:radius="14dp" />
<solid android:color="@color/background_secondary" />
<stroke android:color="@color/light_gray" android:width="1.5dp"/>
<stroke android:color="@color/divider_color" android:width="1.5dp"/>
</shape>
</item>
</selector>
30 changes: 8 additions & 22 deletions common/src/main/res/layout/dialog_simple.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,39 +39,25 @@
tools:text="Cancel transaction?" />

<Button
android:id="@+id/dialog_negative_button"
style="@style/Button.Tertiary.Blue"
android:id="@+id/dialog_positive_button"
style="@style/Button.Primary.Blue"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginEnd="6dp"
app:layout_constraintEnd_toStartOf="@id/dialog_positive_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/dialog_message"
tools:text="No, keep it" />
tools:text="Yes, cancel" />

<Button
android:id="@+id/dialog_negative_button_secondary"
style="@style/Button.Secondary"
android:id="@+id/dialog_negative_button"
style="@style/Button.Tertiary"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginEnd="6dp"
android:visibility="gone"
android:layout_marginTop="5dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/dialog_message"
app:layout_constraintTop_toBottomOf="@id/dialog_positive_button"
tools:text="No, keep it" />

<Button
android:id="@+id/dialog_positive_button"
style="@style/Button.Primary.Blue"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/dialog_negative_button"
app:layout_constraintTop_toBottomOf="@id/dialog_message"
tools:text="Yes, cancel" />
</androidx.constraintlayout.widget.ConstraintLayout>

13 changes: 12 additions & 1 deletion common/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -809,13 +809,20 @@
<item name="rippleColor">@color/button_ripple_color</item>
</style>

<style name="PrimaryButtonTheme.Large.Red">
<style name="PrimaryButtonTheme.Large.LightRed">
<item name="backgroundColor">@color/system_red_0.1</item>
<item name="strokeColor">@android:color/transparent</item>
<item name="titleTextColor">@color/system_red</item>
<item name="rippleColor">@color/button_ripple_color</item>
</style>

<style name="PrimaryButtonTheme.Large.Red">
<item name="backgroundColor">@color/system_red</item>
<item name="strokeColor">@android:color/transparent</item>
<item name="titleTextColor">@color/dash_white</item>
<item name="rippleColor">@color/button_ripple_color</item>
</style>

<style name="PrimaryButtonTheme.Large.TransparentBlue">
<item name="backgroundColor">@color/light_blue</item>
<item name="strokeColor">@android:color/transparent</item>
Expand Down Expand Up @@ -934,6 +941,10 @@
<item name="android:theme">@style/PrimaryButtonTheme.Large.Grey</item>
</style>

<style name="Button.Primary.Large.LightRed">
<item name="android:theme">@style/PrimaryButtonTheme.Large.LightRed</item>
</style>

<style name="Button.Primary.Large.Red">
<item name="android:theme">@style/PrimaryButtonTheme.Large.Red</item>
</style>
Expand Down
3 changes: 1 addition & 2 deletions wallet/res/layout/activity_coinjoin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:navGraph="@navigation/nav_coinjoin" />
app:defaultNavHost="true" />
</FrameLayout>
13 changes: 13 additions & 0 deletions wallet/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,19 @@
app:layout_constraintStart_toEndOf="@id/coinjoin_icon"
app:layout_constraintTop_toBottomOf="@id/coinjoin_title"
app:layout_constraintBottom_toBottomOf="parent" />

<ImageView
android:id="@+id/coinjoin_subtitle_icon"
android:layout_gravity="center_vertical"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginStart="3dp"
android:layout_marginTop="3dp"
android:visibility="gone"
app:srcCompat="@drawable/ic_dash"
app:tint="@color/content_tertiary"
app:layout_constraintTop_toTopOf="@id/coinjoin_subtitle"
app:layout_constraintStart_toEndOf="@id/coinjoin_subtitle" />
</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down
4 changes: 2 additions & 2 deletions wallet/res/layout/fragment_coinjoin_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
android:orientation="vertical"
android:paddingBottom="20dp"
android:clipToPadding="false"
app:layout_constraintBottom_toTopOf="@+id/continue_button"
app:layout_constraintTop_toBottomOf="@id/toolbar">
app:layout_constraintTop_toBottomOf="@id/toolbar"
app:layout_constraintBottom_toTopOf="@+id/continue_button">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
Expand Down
Loading

0 comments on commit c97e236

Please sign in to comment.